From 41b78fa0afd3b2e2971e3bb87ddc1980f5c63f70 Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 19 Nov 2024 08:38:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=AE=9E=E4=BE=8B):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=BA=93=E6=88=BF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/wm/domain/WmsInPlanDetailEntity.java | 49 ++++++++++++++++--- .../WmsInPlanDetailEntityServiceImpl.java | 23 +++++---- 2 files changed, 54 insertions(+), 18 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java index c72af0b..df29a0d 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java @@ -18,43 +18,36 @@ public class WmsInPlanDetailEntity extends BaseEntity { * $column.columnComment */ private Long id; - /** * 入库计划ID */ @Excel(name = "入库计划ID") private Long planId; - /** * 入库计划明细ID */ @Excel(name = "入库计划明细ID") private Long planDetailsId; - /** * 来源 */ @Excel(name = "来源") private String source; - /** * 台账ID */ @Excel(name = "台账ID") private Long knifeId; - /** * rfid */ @Excel(name = "rfid") private String rfid; - /** * 消耗寿命 */ @Excel(name = "消耗寿命") private Integer consumeLife; - /** * 入库计划编码 */ @@ -71,7 +64,6 @@ public class WmsInPlanDetailEntity extends BaseEntity { * 入库计划类型 */ private String planType; - /** * 库位编码 */ @@ -85,6 +77,11 @@ public class WmsInPlanDetailEntity extends BaseEntity { */ private String detailBatch; + private String warehouseName; + private String warehouseCode; + private String warehouseTypeName; + private String warehouseTypeCode; + public void setId(Long id) { this.id = id; } @@ -197,6 +194,38 @@ public class WmsInPlanDetailEntity extends BaseEntity { this.detailBatch = detailBatch; } + public String getWarehouseName() { + return warehouseName; + } + + public void setWarehouseName(String warehouseName) { + this.warehouseName = warehouseName; + } + + public String getWarehouseCode() { + return warehouseCode; + } + + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + public String getWarehouseTypeName() { + return warehouseTypeName; + } + + public void setWarehouseTypeName(String warehouseTypeName) { + this.warehouseTypeName = warehouseTypeName; + } + + public String getWarehouseTypeCode() { + return warehouseTypeCode; + } + + public void setWarehouseTypeCode(String warehouseTypeCode) { + this.warehouseTypeCode = warehouseTypeCode; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) @@ -208,6 +237,10 @@ public class WmsInPlanDetailEntity extends BaseEntity { .append("planType", getPlanType()) .append("cellCode", getCellCode()) .append("cellName", getCellName()) + .append("warehouseName", getWarehouseName()) + .append("warehouseCode", getWarehouseCode()) + .append("warehouseTypeName", getWarehouseTypeName()) + .append("warehouseTypeCode", getWarehouseTypeCode()) .append("detailBatch", getDetailBatch()) .append("planDetailsId", getPlanDetailsId()) .append("source", getSource()) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java index 52e0480..71f1331 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java @@ -5,15 +5,10 @@ import java.util.*; import com.ktg.common.utils.DateUtils; import com.ktg.mes.md.domain.WmsBusinessType; import com.ktg.mes.md.mapper.WmsBusinessTypeMapper; -import com.ktg.mes.wm.domain.WmStorageArea; -import com.ktg.mes.wm.domain.WmsInPlan; -import com.ktg.mes.wm.domain.WmsInPlanDetails; -import com.ktg.mes.wm.mapper.WmStorageAreaMapper; -import com.ktg.mes.wm.mapper.WmsInPlanMapper; +import com.ktg.mes.wm.domain.*; +import com.ktg.mes.wm.mapper.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper; -import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService; /** @@ -26,15 +21,16 @@ import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService; public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityService { @Autowired private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper; - @Autowired private WmsInPlanMapper wmsInPlanMapper; - @Autowired private WmsBusinessTypeMapper wmsBusinessTypeMapper; - @Autowired private WmStorageAreaMapper wmStorageAreaMapper; + @Autowired + private WmStorageLocationMapper wmStorageLocationMapper; + @Autowired + private WmWarehouseMapper wmWarehouseMapper; /** * 查询入库计划明细实体 @@ -83,6 +79,13 @@ public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityS // 设置库位信息 entity.setCellCode(wmStorageArea.getAreaCode()); entity.setCellName(wmStorageArea.getAreaName()); + // 查询库区信息 + WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId()); + // 查询库房信息 + WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId()); + entity.setWarehouseCode(wmWarehouse.getWarehouseCode()); + entity.setWarehouseName(wmWarehouse.getWarehouseName()); + entity.setWarehouseTypeCode(wmWarehouse.getAttr2()); } } From 373254447499c6236536d99869259c5cd5bc5602 Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 19 Nov 2024 08:40:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(=E5=8F=B0=E8=B4=A6):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20=E9=AA=8C=E8=AF=81rfid=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ktg/mes/md/controller/BaseKnifeController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index a55e8f9..0d0b94c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java @@ -321,7 +321,7 @@ public class BaseKnifeController extends BaseController { // 齐套性检查 AjaxResult ajaxResult = this.checkForAlignment(processCodeList); - if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200){ + if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) { return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data")); } @@ -988,7 +988,15 @@ public class BaseKnifeController extends BaseController { @PreAuthorize("@ss.hasPermi('md:baseKnife:query')") @GetMapping(value = "/isDuplicateRfid/{rfid}") public AjaxResult isDuplicateRfid(@PathVariable("rfid") String rfid) { - return AjaxResult.success(baseKnifeService.isDuplicateRfid(rfid)); + String[] split = rfid.split(","); + // 验证失败的rfid + ArrayList errorList = new ArrayList<>(); + for (String s : split) { + if (baseKnifeService.isDuplicateRfid(rfid)) { + errorList.add(s); + } + } + return AjaxResult.success(errorList); } /**