16 changed files with 1033 additions and 0 deletions
@ -0,0 +1,87 @@
|
||||
package com.mh.web.controller.device; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.DeviceInOutManage; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.device.IDeviceInOutManageService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 设备出入库流水表记录 |
||||
* @date 2025-01-09 15:24:24 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/spareInOut") |
||||
public class DeviceInOutManageController extends BaseController { |
||||
@Autowired |
||||
private IDeviceInOutManageService deviceInOutManageService; |
||||
|
||||
/** |
||||
* 获取备品/备件出入库管理流水记录列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spareInOut:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(DeviceInOutManage deviceInOutManage) |
||||
{ |
||||
startPage(); |
||||
List<DeviceInOutManage> list = deviceInOutManageService.selectDeviceInOutManageList(deviceInOutManage); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据备品/备件出入库管理流水记录id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spareInOut:query')") |
||||
@GetMapping(value = "/{spareId}") |
||||
public AjaxResult getInfo(@PathVariable String spareId) |
||||
{ |
||||
return success(deviceInOutManageService.selectDeviceInOutManageById(spareId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增备品/备件出入库管理流水记录 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spareInOut:add')") |
||||
@Log(title = "备品/备件出入库管理流水记录管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody DeviceInOutManage deviceInOutManage) |
||||
{ |
||||
deviceInOutManage.setCreateBy(getUsername()); |
||||
return toAjax(deviceInOutManageService.insertDeviceInOutManage(deviceInOutManage)); |
||||
} |
||||
|
||||
// /**
|
||||
// * 修改备品/备件出入库管理流水记录信息
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:spareInOut:edit')")
|
||||
// @Log(title = "备品/备件出入库管理流水记录管理", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@Validated @RequestBody DeviceInOutManage deviceInOutManage)
|
||||
// {
|
||||
// deviceInOutManage.setUpdateBy(getUsername());
|
||||
// return toAjax(deviceInOutManageService.updateDeviceInOutManage(deviceInOutManage));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除备品/备件出入库管理流水记录管理
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:spareInOut:remove')")
|
||||
// @Log(title = "备品/备件出入库管理流水记录管理", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{spareIds}")
|
||||
// public AjaxResult remove(@PathVariable String[] spareIds)
|
||||
// {
|
||||
// return toAjax(deviceInOutManageService.deleteDeviceInOutManageByIds(spareIds));
|
||||
// }
|
||||
|
||||
} |
@ -0,0 +1,95 @@
|
||||
package com.mh.web.controller.device; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.DeviceQrManage; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.device.IDeviceQrManageService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 设备二维码维护管理 |
||||
* @date 2025-01-09 16:48:30 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/qr") |
||||
public class DeviceQrManageController extends BaseController { |
||||
|
||||
@Autowired |
||||
private IDeviceQrManageService deviceQrManageService; |
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:qr:create')") |
||||
@GetMapping("/create") |
||||
public AjaxResult create(@RequestParam String qrNum) { |
||||
return success(deviceQrManageService.createQrCode(qrNum)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取二维码维护记录列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:qr:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(DeviceQrManage deviceQrManage) |
||||
{ |
||||
startPage(); |
||||
List<DeviceQrManage> list = deviceQrManageService.selectDeviceQrManageList(deviceQrManage); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据二维码维护记录id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:qr:query')") |
||||
@GetMapping(value = "/{qrId}") |
||||
public AjaxResult getInfo(@PathVariable String qrId) |
||||
{ |
||||
return success(deviceQrManageService.selectDeviceQrManageById(qrId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增二维码维护记录 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:qr:add')") |
||||
@Log(title = "二维码维护记录管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody DeviceQrManage deviceQrManage) |
||||
{ |
||||
deviceQrManage.setCreateBy(getUsername()); |
||||
return toAjax(deviceQrManageService.insertDeviceQrManage(deviceQrManage)); |
||||
} |
||||
|
||||
/** |
||||
* 修改二维码维护记录信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:qr:edit')") |
||||
@Log(title = "二维码维护记录管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody DeviceQrManage deviceQrManage) |
||||
{ |
||||
deviceQrManage.setUpdateBy(getUsername()); |
||||
return toAjax(deviceQrManageService.updateDeviceQrManage(deviceQrManage)); |
||||
} |
||||
|
||||
/** |
||||
* 删除二维码维护记录管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:qr:remove')") |
||||
@Log(title = "二维码维护记录管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{qrIds}") |
||||
public AjaxResult remove(@PathVariable String[] qrIds) |
||||
{ |
||||
return toAjax(deviceQrManageService.deleteDeviceQrManageByIds(qrIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,88 @@
|
||||
package com.mh.web.controller.device; |
||||
|
||||
import com.mh.common.annotation.Log; |
||||
import com.mh.common.core.controller.BaseController; |
||||
import com.mh.common.core.domain.AjaxResult; |
||||
import com.mh.common.core.domain.entity.SparePartsManage; |
||||
import com.mh.common.core.page.TableDataInfo; |
||||
import com.mh.common.enums.BusinessType; |
||||
import com.mh.system.service.device.ISparePartsManageService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.security.access.prepost.PreAuthorize; |
||||
import org.springframework.validation.annotation.Validated; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 备品/备件出入库管理 |
||||
* @date 2025-01-09 11:40:25 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping("/device/spare") |
||||
public class SparePartsManageController extends BaseController { |
||||
|
||||
@Autowired |
||||
private ISparePartsManageService sparePartsManageService; |
||||
|
||||
/** |
||||
* 获取备品/备件出入库管理列表内容数据 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spare:list')") |
||||
@GetMapping("/list") |
||||
public TableDataInfo list(SparePartsManage sparePartsManage) |
||||
{ |
||||
startPage(); |
||||
List<SparePartsManage> list = sparePartsManageService.selectSparePartsManageList(sparePartsManage); |
||||
return getDataTable(list); |
||||
} |
||||
|
||||
/** |
||||
* 根据备品/备件出入库管理id获取详细信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spare:query')") |
||||
@GetMapping(value = "/{spareId}") |
||||
public AjaxResult getInfo(@PathVariable String spareId) |
||||
{ |
||||
return success(sparePartsManageService.selectSparePartsManageById(spareId)); |
||||
} |
||||
|
||||
/** |
||||
* 新增备品/备件出入库管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spare:add')") |
||||
@Log(title = "备品/备件出入库管理管理", businessType = BusinessType.INSERT) |
||||
@PostMapping |
||||
public AjaxResult add(@Validated @RequestBody SparePartsManage sparePartsManage) |
||||
{ |
||||
sparePartsManage.setCreateBy(getUsername()); |
||||
return toAjax(sparePartsManageService.insertSparePartsManage(sparePartsManage)); |
||||
} |
||||
|
||||
/** |
||||
* 修改备品/备件出入库管理信息 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spare:edit')") |
||||
@Log(title = "备品/备件出入库管理管理", businessType = BusinessType.UPDATE) |
||||
@PutMapping |
||||
public AjaxResult edit(@Validated @RequestBody SparePartsManage sparePartsManage) |
||||
{ |
||||
sparePartsManage.setUpdateBy(getUsername()); |
||||
return toAjax(sparePartsManageService.updateSparePartsManage(sparePartsManage)); |
||||
} |
||||
|
||||
/** |
||||
* 删除备品/备件出入库管理管理 |
||||
*/ |
||||
@PreAuthorize("@ss.hasPermi('system:spare:remove')") |
||||
@Log(title = "备品/备件出入库管理管理", businessType = BusinessType.DELETE) |
||||
@DeleteMapping("/{spareIds}") |
||||
public AjaxResult remove(@PathVariable String[] spareIds) |
||||
{ |
||||
return toAjax(sparePartsManageService.deleteSparePartsManageByIds(spareIds)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,106 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 配件出入库流水记录表 |
||||
* @date 2025-01-09 15:07:33 |
||||
*/ |
||||
@TableName("device_in_out_manage") |
||||
public class DeviceInOutManage extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 关联到备件的唯一标识符,用于标识具体的备件 |
||||
*/ |
||||
private String sparePartsId; |
||||
|
||||
/** |
||||
* 备件的名称,便于快速识别 |
||||
*/ |
||||
private String sparePartsName; |
||||
|
||||
/** |
||||
* 出入库操作类型,0表示入库,1表示出库 |
||||
*/ |
||||
private Integer operaType; |
||||
|
||||
/** |
||||
* 本次出入库操作的数量,正值表示入库,负值表示出库 |
||||
*/ |
||||
private Integer intOutNum; |
||||
|
||||
/** |
||||
* 当前备件的库存数量,在每次出入库操作后更新 |
||||
*/ |
||||
private Integer inventoryLevels; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getSparePartsId() { |
||||
return sparePartsId; |
||||
} |
||||
|
||||
public void setSparePartsId(String sparePartsId) { |
||||
this.sparePartsId = sparePartsId; |
||||
} |
||||
|
||||
public String getSparePartsName() { |
||||
return sparePartsName; |
||||
} |
||||
|
||||
public void setSparePartsName(String sparePartsName) { |
||||
this.sparePartsName = sparePartsName; |
||||
} |
||||
|
||||
public Integer getOperaType() { |
||||
return operaType; |
||||
} |
||||
|
||||
public void setOperaType(Integer operaType) { |
||||
this.operaType = operaType; |
||||
} |
||||
|
||||
public Integer getIntOutNum() { |
||||
return intOutNum; |
||||
} |
||||
|
||||
public void setIntOutNum(Integer intOutNum) { |
||||
this.intOutNum = intOutNum; |
||||
} |
||||
|
||||
public Integer getInventoryLevels() { |
||||
return inventoryLevels; |
||||
} |
||||
|
||||
public void setInventoryLevels(Integer inventoryLevels) { |
||||
this.inventoryLevels = inventoryLevels; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("sparePartsId", sparePartsId) |
||||
.append("sparePartsName", sparePartsName) |
||||
.append("operaType", operaType) |
||||
.append("intOutNum", intOutNum) |
||||
.append("inventoryLevels", inventoryLevels) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,122 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 设备二维码维护管理 |
||||
* @date 2025-01-09 16:42:51 |
||||
*/ |
||||
@TableName("device_qr_manage") |
||||
public class DeviceQrManage extends BaseEntity { |
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 二维码序列号 |
||||
*/ |
||||
private String serialNum; |
||||
|
||||
/** |
||||
* 二维码内容或者文件路径 |
||||
*/ |
||||
private String picContent; |
||||
|
||||
/** |
||||
* 设备台账id |
||||
*/ |
||||
private String deviceLedgerId; |
||||
|
||||
/** |
||||
* 设备名称 |
||||
*/ |
||||
private String deviceName; |
||||
|
||||
/** |
||||
* 绑定时间 |
||||
*/ |
||||
private Date bindTime; |
||||
|
||||
/** |
||||
* 二维码状态:0:已绑定,1:未绑定 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getSerialNum() { |
||||
return serialNum; |
||||
} |
||||
|
||||
public void setSerialNum(String serialNum) { |
||||
this.serialNum = serialNum; |
||||
} |
||||
|
||||
public String getPicContent() { |
||||
return picContent; |
||||
} |
||||
|
||||
public void setPicContent(String picContent) { |
||||
this.picContent = picContent; |
||||
} |
||||
|
||||
public String getDeviceLedgerId() { |
||||
return deviceLedgerId; |
||||
} |
||||
|
||||
public void setDeviceLedgerId(String deviceLedgerId) { |
||||
this.deviceLedgerId = deviceLedgerId; |
||||
} |
||||
|
||||
public String getDeviceName() { |
||||
return deviceName; |
||||
} |
||||
|
||||
public void setDeviceName(String deviceName) { |
||||
this.deviceName = deviceName; |
||||
} |
||||
|
||||
public Date getBindTime() { |
||||
return bindTime; |
||||
} |
||||
|
||||
public void setBindTime(Date bindTime) { |
||||
this.bindTime = bindTime; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("serialNum", serialNum) |
||||
.append("picContent", picContent) |
||||
.append("deviceLedgerId", deviceLedgerId) |
||||
.append("deviceName", deviceName) |
||||
.append("bindTime", bindTime) |
||||
.append("status", status) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,154 @@
|
||||
package com.mh.common.core.domain.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.mh.common.core.domain.BaseEntity; |
||||
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 备品/备件出入库管理表,用于记录备件的出入库操作及当前库存情况 |
||||
* @date 2025-01-09 11:24:02 |
||||
*/ |
||||
@TableName("spare_parts_manage") |
||||
public class SparePartsManage extends BaseEntity { |
||||
|
||||
/** |
||||
* id |
||||
*/ |
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID) |
||||
private String id; |
||||
|
||||
/** |
||||
* 备件的序列号,用于唯一识别每个备件 |
||||
*/ |
||||
private String serialNum; |
||||
|
||||
/** |
||||
* 备件的名称,便于快速识别 |
||||
*/ |
||||
private String spareName; |
||||
|
||||
/** |
||||
* 备件的规格和型号 |
||||
*/ |
||||
private String modelSpecs; |
||||
|
||||
/** |
||||
* 关联到设备类型的ID,标识备件适用于哪种设备类型 |
||||
*/ |
||||
private String deviceTypeId; |
||||
|
||||
/** |
||||
* 当前备件的库存数量,在每次出入库操作后更新 |
||||
*/ |
||||
private Integer inventoryLevels; |
||||
|
||||
/** |
||||
* 最低库存量阈值,当库存低于此值时需要补货 |
||||
*/ |
||||
private Integer minInventoryLevels; |
||||
|
||||
/** |
||||
* 备件的预计使用年限,单位为年 |
||||
*/ |
||||
private Integer serviceLife; |
||||
|
||||
/** |
||||
* 备件的单价,保留三位小数 |
||||
*/ |
||||
private BigDecimal unitPrice; |
||||
|
||||
public String getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(String id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getSerialNum() { |
||||
return serialNum; |
||||
} |
||||
|
||||
public void setSerialNum(String serialNum) { |
||||
this.serialNum = serialNum; |
||||
} |
||||
|
||||
public String getSpareName() { |
||||
return spareName; |
||||
} |
||||
|
||||
public void setSpareName(String spareName) { |
||||
this.spareName = spareName; |
||||
} |
||||
|
||||
public String getModelSpecs() { |
||||
return modelSpecs; |
||||
} |
||||
|
||||
public void setModelSpecs(String modelSpecs) { |
||||
this.modelSpecs = modelSpecs; |
||||
} |
||||
|
||||
public String getDeviceTypeId() { |
||||
return deviceTypeId; |
||||
} |
||||
|
||||
public void setDeviceTypeId(String deviceTypeId) { |
||||
this.deviceTypeId = deviceTypeId; |
||||
} |
||||
|
||||
public Integer getInventoryLevels() { |
||||
return inventoryLevels; |
||||
} |
||||
|
||||
public void setInventoryLevels(Integer inventoryLevels) { |
||||
this.inventoryLevels = inventoryLevels; |
||||
} |
||||
|
||||
public Integer getMinInventoryLevels() { |
||||
return minInventoryLevels; |
||||
} |
||||
|
||||
public void setMinInventoryLevels(Integer minInventoryLevels) { |
||||
this.minInventoryLevels = minInventoryLevels; |
||||
} |
||||
|
||||
public Integer getServiceLife() { |
||||
return serviceLife; |
||||
} |
||||
|
||||
public void setServiceLife(Integer serviceLife) { |
||||
this.serviceLife = serviceLife; |
||||
} |
||||
|
||||
public BigDecimal getUnitPrice() { |
||||
return unitPrice; |
||||
} |
||||
|
||||
public void setUnitPrice(BigDecimal unitPrice) { |
||||
this.unitPrice = unitPrice; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return new ToStringBuilder(this) |
||||
.append("id", id) |
||||
.append("serialNum", serialNum) |
||||
.append("spareName", spareName) |
||||
.append("modelSpecs", modelSpecs) |
||||
.append("deviceTypeId", deviceTypeId) |
||||
.append("inventoryLevels", inventoryLevels) |
||||
.append("minInventoryLevels", minInventoryLevels) |
||||
.append("serviceLife", serviceLife) |
||||
.append("unitPrice", unitPrice) |
||||
.toString(); |
||||
} |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.mh.system.mapper.device; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.DeviceInOutManage; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 设备出入库流水管理Mapper |
||||
* @date 2025-01-09 15:43:52 |
||||
*/ |
||||
@Mapper |
||||
public interface DeviceInOutManageMapper extends BaseMapper<DeviceInOutManage> { |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.mh.system.mapper.device; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.DeviceQrManage; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 二维码管理mapper类 |
||||
* @date 2025-01-09 17:14:26 |
||||
*/ |
||||
@Mapper |
||||
public interface DeviceQrManageMapper extends BaseMapper<DeviceQrManage> { |
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.mh.system.mapper.device; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.mh.common.core.domain.entity.SparePartsManage; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Update; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 物品配件管理 |
||||
* @date 2025-01-09 14:52:08 |
||||
*/ |
||||
@Mapper |
||||
public interface SparePartsManageMapper extends BaseMapper<SparePartsManage> { |
||||
|
||||
@Update("update spare_parts_manage set inventory_levels = #{inventoryLevels} where id = #{sparePartsId}") |
||||
void updateInventoryLevels(@Param("sparePartsId") String sparePartsId, |
||||
@Param("inventoryLevels") int inventoryLevels); |
||||
|
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.mh.system.service.device; |
||||
|
||||
import com.mh.common.core.domain.entity.DeviceInOutManage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 配件设备出入库流水管理 |
||||
* @date 2025-01-09 15:39:45 |
||||
*/ |
||||
public interface IDeviceInOutManageService { |
||||
|
||||
List<DeviceInOutManage> selectDeviceInOutManageList(DeviceInOutManage deviceInOutManage); |
||||
|
||||
DeviceInOutManage selectDeviceInOutManageById(String spareId); |
||||
|
||||
int insertDeviceInOutManage(DeviceInOutManage deviceInOutManage); |
||||
|
||||
int updateDeviceInOutManage(DeviceInOutManage deviceInOutManage); |
||||
|
||||
int deleteDeviceInOutManageByIds(String[] spareIds); |
||||
|
||||
} |
@ -0,0 +1,27 @@
|
||||
package com.mh.system.service.device; |
||||
|
||||
import com.mh.common.core.domain.entity.DeviceQrManage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 二维码管理 |
||||
* @date 2025-01-09 17:12:56 |
||||
*/ |
||||
public interface IDeviceQrManageService { |
||||
|
||||
List<DeviceQrManage> selectDeviceQrManageList(DeviceQrManage deviceQrManage); |
||||
|
||||
DeviceQrManage selectDeviceQrManageById(String qrId); |
||||
|
||||
int updateDeviceQrManage(DeviceQrManage deviceQrManage); |
||||
|
||||
int insertDeviceQrManage(DeviceQrManage deviceQrManage); |
||||
|
||||
int deleteDeviceQrManageByIds(String[] qrIds); |
||||
|
||||
int createQrCode(String qrNum); |
||||
} |
@ -0,0 +1,24 @@
|
||||
package com.mh.system.service.device; |
||||
|
||||
import com.mh.common.core.domain.entity.SparePartsManage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 备件管理 |
||||
* @date 2025-01-09 11:46:24 |
||||
*/ |
||||
public interface ISparePartsManageService { |
||||
List<SparePartsManage> selectSparePartsManageList(SparePartsManage sparePartsManage); |
||||
|
||||
SparePartsManage selectSparePartsManageById(String spareId); |
||||
|
||||
int insertSparePartsManage(SparePartsManage sparePartsManage); |
||||
|
||||
int updateSparePartsManage(SparePartsManage sparePartsManage); |
||||
|
||||
int deleteSparePartsManageByIds(String[] spareIds); |
||||
} |
@ -0,0 +1,92 @@
|
||||
package com.mh.system.service.device.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.DeviceInOutManage; |
||||
import com.mh.common.core.domain.entity.SparePartsManage; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.device.DeviceInOutManageMapper; |
||||
import com.mh.system.mapper.device.SparePartsManageMapper; |
||||
import com.mh.system.service.device.IDeviceInOutManageService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 配件设备出入库流水管理 |
||||
* @date 2025-01-09 15:39:45 |
||||
*/ |
||||
@Service |
||||
public class DeviceInOutManageServiceImpl implements IDeviceInOutManageService { |
||||
|
||||
@Resource |
||||
private DeviceInOutManageMapper deviceInOutManageMapper; |
||||
|
||||
@Resource |
||||
private SparePartsManageMapper sparePartsManageMapper; |
||||
|
||||
@Override |
||||
public List<DeviceInOutManage> selectDeviceInOutManageList(DeviceInOutManage deviceInOutManage) { |
||||
if (deviceInOutManage == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<DeviceInOutManage> queryWrapper = new QueryWrapper<>(); |
||||
if (!StringUtils.isEmpty(deviceInOutManage.getSparePartsId())) { |
||||
queryWrapper.eq("spare_parts_id", deviceInOutManage.getSparePartsId()); |
||||
} |
||||
if (!StringUtils.isEmpty(deviceInOutManage.getSparePartsName())) { |
||||
queryWrapper.like("spare_parts_name", deviceInOutManage.getSparePartsName()); |
||||
} |
||||
if (deviceInOutManage.getOperaType() != null) { |
||||
queryWrapper.eq("opera_type", deviceInOutManage.getOperaType()); |
||||
} |
||||
// 出入库时间范围
|
||||
if (!deviceInOutManage.getParams().isEmpty()) { |
||||
queryWrapper.between("create_time", deviceInOutManage.getParams().get("beginTime"), deviceInOutManage.getParams().get("endTime")); |
||||
} |
||||
queryWrapper.orderByDesc("create_time"); |
||||
return deviceInOutManageMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public DeviceInOutManage selectDeviceInOutManageById(String spareId) { |
||||
return deviceInOutManageMapper.selectById(spareId); |
||||
} |
||||
|
||||
@Transactional |
||||
@Override |
||||
public int insertDeviceInOutManage(DeviceInOutManage deviceInOutManage) { |
||||
// 获取当前库存量
|
||||
String sparePartsId = deviceInOutManage.getSparePartsId(); |
||||
SparePartsManage sparePartsManage = sparePartsManageMapper.selectById(sparePartsId); |
||||
int inventoryLevels = 0; |
||||
if (sparePartsManage != null) { |
||||
inventoryLevels = sparePartsManage.getInventoryLevels(); |
||||
} |
||||
// 修改配件的库存:operaType=0:入库;operaType=1:出库
|
||||
int intOutNum = deviceInOutManage.getIntOutNum(); |
||||
if (deviceInOutManage.getOperaType() == 0) { |
||||
inventoryLevels = inventoryLevels + intOutNum; |
||||
sparePartsManageMapper.updateInventoryLevels(deviceInOutManage.getSparePartsId(), inventoryLevels); |
||||
} else if (deviceInOutManage.getOperaType() == 1) { |
||||
inventoryLevels = inventoryLevels - intOutNum; |
||||
sparePartsManageMapper.updateInventoryLevels(deviceInOutManage.getSparePartsId(), -intOutNum); |
||||
} |
||||
deviceInOutManage.setInventoryLevels(inventoryLevels); |
||||
return deviceInOutManageMapper.insert(deviceInOutManage); |
||||
} |
||||
|
||||
@Override |
||||
public int updateDeviceInOutManage(DeviceInOutManage deviceInOutManage) { |
||||
return 0; |
||||
} |
||||
|
||||
@Override |
||||
public int deleteDeviceInOutManageByIds(String[] spareIds) { |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,71 @@
|
||||
package com.mh.system.service.device.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.DeviceQrManage; |
||||
import com.mh.system.mapper.device.DeviceQrManageMapper; |
||||
import com.mh.system.service.device.IDeviceQrManageService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 二维码管理 |
||||
* @date 2025-01-09 17:13:21 |
||||
*/ |
||||
@Service |
||||
public class DeviceQrManageServiceImpl implements IDeviceQrManageService { |
||||
|
||||
@Resource |
||||
private DeviceQrManageMapper deviceQrManageMapper; |
||||
|
||||
@Override |
||||
public List<DeviceQrManage> selectDeviceQrManageList(DeviceQrManage deviceQrManage) { |
||||
if (deviceQrManage == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<DeviceQrManage> queryWrapper = new QueryWrapper<>(); |
||||
if (deviceQrManage.getStatus() != null) { |
||||
queryWrapper.eq("status", deviceQrManage.getStatus()); |
||||
} |
||||
queryWrapper.orderByAsc("create_time"); |
||||
return deviceQrManageMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public DeviceQrManage selectDeviceQrManageById(String qrId) { |
||||
return deviceQrManageMapper.selectById(qrId); |
||||
} |
||||
|
||||
@Override |
||||
public int updateDeviceQrManage(DeviceQrManage deviceQrManage) { |
||||
return deviceQrManageMapper.updateById(deviceQrManage); |
||||
} |
||||
|
||||
@Override |
||||
public int insertDeviceQrManage(DeviceQrManage deviceQrManage) { |
||||
return deviceQrManageMapper.insert(deviceQrManage); |
||||
} |
||||
|
||||
@Transactional |
||||
@Override |
||||
public int deleteDeviceQrManageByIds(String[] qrIds) { |
||||
if (qrIds != null) { |
||||
for (String qrId : qrIds) { |
||||
deviceQrManageMapper.deleteById(qrId); |
||||
} |
||||
return qrIds.length; |
||||
} |
||||
return 0; |
||||
} |
||||
|
||||
@Override |
||||
public int createQrCode(String qrNum) { |
||||
|
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,73 @@
|
||||
package com.mh.system.service.device.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.mh.common.core.domain.entity.SparePartsManage; |
||||
import com.mh.common.utils.StringUtils; |
||||
import com.mh.system.mapper.device.SparePartsManageMapper; |
||||
import com.mh.system.service.device.ISparePartsManageService; |
||||
import jakarta.annotation.Resource; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author LJF |
||||
* @version 1.0 |
||||
* @project EEMCS |
||||
* @description 备件管理 |
||||
* @date 2025-01-09 11:47:05 |
||||
*/ |
||||
@Service |
||||
public class SparePartsManageServiceImpl implements ISparePartsManageService { |
||||
|
||||
@Resource |
||||
private SparePartsManageMapper sparePartsManageMapper; |
||||
|
||||
@Override |
||||
public List<SparePartsManage> selectSparePartsManageList(SparePartsManage sparePartsManage) { |
||||
if (sparePartsManage == null) { |
||||
return List.of(); |
||||
} |
||||
QueryWrapper<SparePartsManage> queryWrapper = new QueryWrapper<>(); |
||||
// 序列号
|
||||
if (!StringUtils.isEmpty(sparePartsManage.getSerialNum())) { |
||||
queryWrapper.like("serial_num", sparePartsManage.getSerialNum()); |
||||
} |
||||
// 配件名称
|
||||
if (!StringUtils.isEmpty(sparePartsManage.getSpareName())) { |
||||
queryWrapper.like("spare_name", sparePartsManage.getSpareName()); |
||||
} |
||||
// 入库时间范围
|
||||
if (sparePartsManage.getCreateTime() != null) { |
||||
queryWrapper.between("create_time", sparePartsManage.getParams().get("beginTime"), sparePartsManage.getParams().get("endTime")); |
||||
} |
||||
queryWrapper.orderByDesc("create_time"); |
||||
return sparePartsManageMapper.selectList(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public SparePartsManage selectSparePartsManageById(String spareId) { |
||||
return sparePartsManageMapper.selectById(spareId); |
||||
} |
||||
|
||||
@Override |
||||
public int insertSparePartsManage(SparePartsManage sparePartsManage) { |
||||
return sparePartsManageMapper.insert(sparePartsManage); |
||||
} |
||||
|
||||
@Override |
||||
public int updateSparePartsManage(SparePartsManage sparePartsManage) { |
||||
return sparePartsManageMapper.updateById(sparePartsManage); |
||||
} |
||||
|
||||
@Override |
||||
public int deleteSparePartsManageByIds(String[] spareIds) { |
||||
if (spareIds != null) { |
||||
for (String spareId : spareIds) { |
||||
sparePartsManageMapper.deleteById(spareId); |
||||
} |
||||
return spareIds.length; |
||||
} |
||||
return 0; |
||||
} |
||||
} |
Loading…
Reference in new issue