From 91c919ea81f9cee98668cf232b7f06d716b0bde9 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Mon, 27 Nov 2023 16:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E8=AE=BE=E5=A4=87=E6=98=AF=E5=90=A6=E5=90=AF?= =?UTF-8?q?=E7=94=A8+=E8=AE=BE=E5=A4=87=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseEquipmentController.java | 18 +++++++++++++++--- .../java/com/op/wms/domain/BaseEquipment.java | 14 +++++++++++++- .../op/wms/mapper/BaseEquipmentMapper.java | 5 ++++- .../op/wms/service/IBaseEquipmentService.java | 5 ++++- .../impl/BaseEquipmentServiceImpl.java | 19 +++++++++++++++++-- .../mapper/wms/BaseEquipmentMapper.xml | 17 ++++++++++++++++- 6 files changed, 69 insertions(+), 9 deletions(-) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java index 1421808f..1ee83137 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/BaseEquipmentController.java @@ -7,7 +7,10 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import com.op.common.core.domain.ExcelCol; +import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.poi.ExcelMapUtil; +import com.op.common.security.utils.SecurityUtils; +import com.op.system.api.domain.SysUser; import com.op.wms.domain.EquSpareEquipment; import com.op.wms.domain.WmsSparePartsLedger; import com.op.wms.service.IBaseEquipmentService; @@ -114,7 +117,6 @@ public class BaseEquipmentController extends BaseController { /** * 查询设备类型 */ -// @RequiresPermissions("wms:equipment:getEquipmentTypeList") @GetMapping("/getEquipmentTypeList") public TableDataInfo getEquipmentTypeList(BaseEquipment baseEquipment) { List list = baseEquipmentService.getEquipmentTypeList(baseEquipment); @@ -125,8 +127,8 @@ public class BaseEquipmentController extends BaseController { * 查询设备备件 */ @GetMapping("/getSparePartsList") - public TableDataInfo getSparePartsList(BaseEquipment baseEquipment) { - List list = baseEquipmentService.getSparePartsList(baseEquipment); + public TableDataInfo getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) { + List list = baseEquipmentService.getSparePartsList(wmsSparePartsLedger); return getDataTable(list); } @@ -218,4 +220,14 @@ public class BaseEquipmentController extends BaseController { return baseEquipmentService.importFile(orderList); } + /** + * 状态修改 + */ + @RequiresPermissions("wms:equipment:edit") + @Log(title = "修改设备状态", businessType = BusinessType.UPDATE) + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody BaseEquipment baseEquipment) { + return toAjax(baseEquipmentService.updateBaseEquipmentStatus(baseEquipment)); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java index 840fb317..3aab7b21 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/BaseEquipment.java @@ -61,7 +61,7 @@ public class BaseEquipment extends BaseEntity { private String workshopName; /** 设备状态 */ - @Excel(name = "设备状态") + @Excel(name = "设备是否启用") private String status; /** 预留字段1 */ @@ -207,6 +207,10 @@ public class BaseEquipment extends BaseEntity { @Excel(name = "工厂号") private String factoryCode; + /** 设备状态 */ + @Excel(name = "设备状态") + private String equipmentStatus; + private String imageFileList; private String barCodeFileList; @@ -619,6 +623,14 @@ public class BaseEquipment extends BaseEntity { return factoryCode; } + //设备状态 + public void setEquipmentStatus(String equipmentStatus) { + this.equipmentStatus = equipmentStatus; + } + public String getEquipmentStatus() { + return equipmentStatus; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java index 5b7d0208..a2132e72 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/BaseEquipmentMapper.java @@ -81,7 +81,7 @@ public interface BaseEquipmentMapper { Long getEquipmentId(String equipmentCode); //查询备件 - List getSparePartsList(BaseEquipment baseEquipment); + List getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger); //绑定备品备件 public int bindSpareParts(EquSpareEquipment equSpareEquipment); @@ -107,4 +107,7 @@ public interface BaseEquipmentMapper { //设备 BaseEquipment selectExistByEquipmentCode(String equipmentCode); + + //更新设备状态 + Integer updateBaseEquipmentStatus(BaseEquipment baseEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java index 449a8105..a8562b48 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseEquipmentService.java @@ -69,11 +69,14 @@ public interface IBaseEquipmentService { List getEquipmentTypeList(BaseEquipment baseEquipment); //查询设备备品备件 - List getSparePartsList(BaseEquipment baseEquipment); + List getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger); //查询设备备品备件右侧列表 public List getRightSparePartsList(BaseEquipment baseEquipment); //导入设备基础数据文件 AjaxResult importFile(List equipmentList); + + //更改设备状态 + int updateBaseEquipmentStatus(BaseEquipment baseEquipment); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java index 0dd6c1cf..472f40a9 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseEquipmentServiceImpl.java @@ -372,8 +372,8 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { */ @Override @DS("#header.poolName") - public List getSparePartsList(BaseEquipment baseEquipment) { - return baseEquipmentMapper.getSparePartsList(baseEquipment); + public List getSparePartsList(WmsSparePartsLedger wmsSparePartsLedger) { + return baseEquipmentMapper.getSparePartsList(wmsSparePartsLedger); } /** @@ -481,4 +481,19 @@ public class BaseEquipmentServiceImpl implements IBaseEquipmentService { return failEquipment; } + /** + * 修改设备管理 + * + * @param baseEquipment 设备管理 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateBaseEquipmentStatus(BaseEquipment baseEquipment) { + baseEquipment.setUpdateBy(SecurityUtils.getUsername()); + baseEquipment.setUpdateTime(DateUtils.getNowDate()); + Integer list = baseEquipmentMapper.updateBaseEquipmentStatus(baseEquipment); + return list; + } + } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml index b8a74f66..97f14bfe 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BaseEquipmentMapper.xml @@ -47,6 +47,7 @@ + @@ -159,7 +160,9 @@ asset_head, fixed_asset_code, department, - equipment_head + equipment_head, + factory_code, + equipment_status from base_equipment @@ -201,6 +204,7 @@ and department = #{department} and sap_asset = #{sapAsset} and factory_code = #{factoryCode} + and equipment_status = #{equipmentStatus} and del_flag ='0' @@ -254,6 +258,7 @@ sap_asset, equipment_head, factory_code, + equipment_status, #{equipmentCode}, @@ -296,6 +301,7 @@ #{sapAsset}, #{equipmentHead}, #{factoryCode}, + equipmentStatus, @@ -342,6 +348,7 @@ sap_asset = #{sapAsset}, equipment_head = #{equipmentHead}, factory_code = #{factoryCode}, + equipment_status = #{equipmentStatus}, where equipment_id = #{equipmentId} @@ -514,4 +521,12 @@ and del_flag ='0' + + update base_equipment + + status = #{status}, + + where equipment_id = #{equipmentId} + + \ No newline at end of file