diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index b0ae315..37d253b 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -315,6 +315,8 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { wmsOutPlanDetail.setWmStorageAreaName(wmStorageArea.getAreaName()); wmsOutPlanDetail.setDetailState("1"); wmsOutPlanDetail.setRemark("一键清退无寿命物品"); + wmsOutPlanDetail.setCreateBy(username); + wmsOutPlanDetail.setCreateTime(new Date()); wmsOutPlanMapper.insertWmsOutPlanDetail(wmsOutPlanDetail); // 遍历台账对象 @@ -324,6 +326,8 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { wmsOutPlanDetailEntity.setWmsOutPlanDetailId(wmsOutPlanDetail.getWmsOutPlanDetailId()); wmsOutPlanDetailEntity.setBaseKnifeId(baseKnife.getBaseKnifeId()); wmsOutPlanDetailEntity.setRemark("一键清退无寿命物品"); + wmsOutPlanDetailEntity.setCreateBy(username); + wmsOutPlanDetailEntity.setCreateTime(new Date()); wmsOutPlanDetailEntityMapper.insertWmsOutPlanDetailEntity(wmsOutPlanDetailEntity); // 锁定并出库台账明细实体 @@ -354,6 +358,8 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { wmsOutTask.setMdItemUnit(wmsOutPlanDetail.getMdItemUnit()); wmsOutTask.setTaskState("1"); wmsOutTask.setRemark("一键清退无寿命物品"); + wmsOutTask.setCreateBy(username); + wmsOutTask.setCreateTime(new Date()); wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); }); }); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java index c81d5ce..ee6637f 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java @@ -1,6 +1,5 @@ package com.ktg.mes.md.service.impl; -import com.alibaba.fastjson.JSON; import com.ktg.common.utils.DateUtils; import com.ktg.mes.md.domain.*; import com.ktg.mes.md.mapper.*; @@ -37,6 +36,9 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { @Autowired private WmsBusinessTypeMapper wmsBusinessTypeMapper; + @Autowired + private MdItemMapper mdItemMapper; + /** * 查询出库任务 * @@ -50,13 +52,14 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { // 构建出库信息 List> hashMapList = new ArrayList<>(); + // 获得物料 + MdItem mdItem = this.mdItemMapper.selectMdItemById(wmsOutTask.getMdItemId()); + // 获得当前出库计划明细实体列表,并遍历 WmsOutPlanDetailEntity entityQuery = new WmsOutPlanDetailEntity(); entityQuery.setWmsOutPlanDetailId(wmsOutTask.getWmsOutPlanDetailId()); List wmsOutPlanDetailEntityList = wmsOutPlanDetailEntityMapper.selectWmsOutPlanDetailEntityList(entityQuery); - System.out.println(JSON.toJSONString(wmsOutPlanDetailEntityList)); - wmsOutPlanDetailEntityList.forEach(nowWmsOutPlanDetailEntity -> { // 根据出库实例对象获取出库计划明细 WmsOutPlanDetail wmsOutPlanDetail = this.wmsOutPlanMapper.selectWmsOutPlanDetailById(nowWmsOutPlanDetailEntity.getWmsOutPlanDetailId()); @@ -69,6 +72,10 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { // 设定出库信息数据 HashMap hashMap = new HashMap<>(); + /* 来自物料 */ + hashMap.put("mdItemId", mdItem.getItemId()); // 物料ID + hashMap.put("mdItemCode", mdItem.getItemCode()); // 物料编码 + hashMap.put("mdItemName", mdItem.getItemName()); // 物料名称 /* 来自计划 */ hashMap.put("planCode", wmsOutPlan.getPlanCode()); // 计划编号 hashMap.put("planStatus", wmsOutPlan.getPlanState()); // 计划状态 @@ -89,6 +96,7 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { if (nowWmsOutPlanDetailEntity.getCreateTime() != null) outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime()); hashMap.put("outTime", outTime); // 出库时间 + hashMap.put("baseKnifeId", nowWmsOutPlanDetailEntity.getBaseKnifeId()); hashMapList.add(hashMap); // 注入出库信息对象