diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java index 7abdb73..fc5d6c7 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/InventoryBatchServiceImpl.java @@ -192,14 +192,9 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService { entityQuery.setPlanDetailsId(inTask.getDetailInId()); List wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery); wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> { - // 根据出库实例对象获取出库计划明细 - WmsInPlanDetails wmsInPlanDetails = this.wmsInPlanMapper.selectWmsInPlanDetailById(inPlanDetailEntity.getPlanDetailsId()); - - // 根据计划明细获得出库计划 - WmsInPlan wmsInPlan = this.wmsInPlanMapper.selectWmsInPlanByPlanId(wmsInPlanDetails.getPlanId().toString()); // 根据出库计划获得出库类型 - WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsInPlan.getBusinessTypeId()); + WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(inTask.getPlanTypeId()); // 获得物料 MdItem mdItem = this.mdItemMapper.selectMdItemById(Long.parseLong(inTask.getMaterialId())); @@ -213,25 +208,25 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService { hashMap.put("mdItemUnit", mdItem.getUnitName()); // 物料单位 hashMap.put("mdItemKnifeWarn", mdItem.getAttr2()); // 物料名称 /* 来自出入库计划类型 */ - hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID - hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码 - hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称 + hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 入库类型ID + hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 入库类型编码 + hashMap.put("planTypeName", wmsBusinessType.getName()); // 入库类型名称 /* 来自计划明细 */ - hashMap.put("detailBatchNum", wmsInPlanDetails.getBatch()); // 明细批次 - hashMap.put("wmStorageAreaId", wmsInPlanDetails.getCellId()); // 库位ID + hashMap.put("detailBatchNum", inTask.getBatch()); // 明细批次 + hashMap.put("wmStorageAreaId", inTask.getCellTgt()); // 库位ID hashMap.put("wmStorageAreaName", inTask.getCellName()); // 库位名称 - hashMap.put("detailStatus", wmsInPlanDetails.getPlanInStatus()); // 明细状态 + hashMap.put("detailStatus", inTask.getPlanInStatus()); // 明细状态 // 查询库区信息 - WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(wmsInPlanDetails.getCellId()); + WmStorageArea wmStorageArea = wmStorageAreaMapper.selectWmStorageAreaByAreaId(inTask.getCellTgt()); WmStorageLocation wmStorageLocation = wmStorageLocationMapper.selectWmStorageLocationByLocationId(wmStorageArea.getLocationId()); // 查询库房信息 WmWarehouse wmWarehouse = wmWarehouseMapper.selectWmWarehouseByWarehouseId(wmStorageLocation.getWarehouseId()); hashMap.put("wmWarehouseName", wmWarehouse.getWarehouseName()); // 库位名称 /* 实体 */ String outTime = null; - if (wmsInPlanDetails.getCreateTime() != null) - outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(wmsInPlanDetails.getCreateTime()); + if (inPlanDetailEntity.getCreateTime() != null) + outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inPlanDetailEntity.getCreateTime()); hashMap.put("dateTime", outTime); // 出库时间 hashMap.put("baseKnifeId", inPlanDetailEntity.getKnifeId()); hashMap.put("planCode", inTask.getPlanInCode()); @@ -240,6 +235,7 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService { hashMapList.add(hashMap); }); + inventoryBatchIn.setInfoList(hashMapList); result.add(inventoryBatchIn); }); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java index 8f11956..6a44748 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsZdTaskServiceImpl.java @@ -441,6 +441,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService wmsInTask.setMaterialId(zdTask.getmProductId().toString()); wmsInTask.setPlanTypeId("9"); wmsInTask.setPlanInStatus("1"); + wmsInTask.setDetailInId(wmsInPlan.getWmsInPlanDetailsList().get(0).getDetailsId()); wmsInTask.setCreateBy(getUsername()); wmsInTask.setCreateTime(DateUtils.getNowDate()); wmsInTaskMapper.insertWmsInTask(wmsInTask); diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml index b70c205..663c528 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml @@ -58,6 +58,24 @@ + + + + + + + + + + + + + + + + + + select PLAN_ID, STATE, @@ -362,9 +380,9 @@ WHERE PLAN_CODE = #{value} - SELECT * FROM WMS_IN_PLAN_DETAILS - WHERE DETAILS_ID = #{wmsInPlanDetailId}; + WHERE DETAILS_ID = #{planDetailsId} \ No newline at end of file