From eaf2b3ee82319fd1bc7ffd7750d3069fcc9f1f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A4=E9=94=A6=E7=A7=91?= <32996823@qq.com> Date: Fri, 20 Dec 2024 15:13:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E5=87=BA=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A7=A3=E5=BC=80=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/service/impl/BaseKnifeServiceImpl.java | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java index d49fe17..f8e8e52 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java @@ -94,55 +94,55 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService { List> hashMapList = new ArrayList<>(); // 根据台账实例ID获取出库实例列表,并遍历 -// WmsOutPlanDetailEntity wmsOutPlanDetailEntityQuery = new WmsOutPlanDetailEntity(); -// wmsOutPlanDetailEntityQuery.setBaseKnifeId(nowBaseKnife.getBaseKnifeId()); -// List wmsOutPlanDetailEntityList = this.wmsOutPlanDetailEntityMapper.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntityQuery); -// wmsOutPlanDetailEntityList.forEach(nowWmsOutPlanDetailEntity -> { -// // 根据出库实例对象获取出库计划明细 -// WmsOutPlanDetail wmsOutPlanDetail = this.wmsOutPlanMapper.selectWmsOutPlanDetailById(nowWmsOutPlanDetailEntity.getWmsOutPlanDetailId()); -// -// // 根据计划明细获得出库计划 -// WmsOutPlan wmsOutPlan = this.wmsOutPlanMapper.selectWmsOutPlanByWmsOutPlanId(wmsOutPlanDetail.getWmsOutPlanId()); -// -// // 根据出库计划获得出库类型 -// WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); -// -// // 设定出库信息数据 -// HashMap hashMap = new HashMap<>(); -// /* 来自计划 */ -// hashMap.put("planCode", wmsOutPlan.getPlanCode()); // 计划编号 -// hashMap.put("planStatus", wmsOutPlan.getPlanState()); // 计划状态 -// hashMap.put("planType", wmsOutPlan.getPlanType()); // 计划类型 -// hashMap.put("useUsername", wmsOutPlan.getRecipientUsername()); // 领用人 -// /* 来自出入库计划类型 */ -// hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID -// hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码 -// hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称 -// /* 来自计划明细 */ -// hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次 -// hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID -// hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 -// hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 -// hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 -// hashMap.put("isToolSetting", nowWmsOutPlanDetailEntity.getIsToolSetting()); // 是否对刀 -// hashMap.put("toolSettingParam", nowWmsOutPlanDetailEntity.getToolSettingParam()); // 对刀参数 -// -// /* 实体 */ -// String outTime = null; -// if (nowWmsOutPlanDetailEntity.getCreateTime() != null) -// outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime()); -// hashMap.put("outTime", outTime); // 出库时间 -// hashMapList.add(hashMap); -// -// // 注入出库信息对象 -// nowBaseKnife.setOutInfoList(hashMapList); -// }); -// -// // 构建入库信息 -// WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity(); -// wmsInPlanDetailEntityQuery.setKnifeId(nowBaseKnife.getBaseKnifeId()); -// List wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery); -// nowBaseKnife.setInInfoList(wmsInPlanDetailEntityList); + WmsOutPlanDetailEntity wmsOutPlanDetailEntityQuery = new WmsOutPlanDetailEntity(); + wmsOutPlanDetailEntityQuery.setBaseKnifeId(nowBaseKnife.getBaseKnifeId()); + List wmsOutPlanDetailEntityList = this.wmsOutPlanDetailEntityMapper.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntityQuery); + wmsOutPlanDetailEntityList.forEach(nowWmsOutPlanDetailEntity -> { + // 根据出库实例对象获取出库计划明细 + WmsOutPlanDetail wmsOutPlanDetail = this.wmsOutPlanMapper.selectWmsOutPlanDetailById(nowWmsOutPlanDetailEntity.getWmsOutPlanDetailId()); + + // 根据计划明细获得出库计划 + WmsOutPlan wmsOutPlan = this.wmsOutPlanMapper.selectWmsOutPlanByWmsOutPlanId(wmsOutPlanDetail.getWmsOutPlanId()); + + // 根据出库计划获得出库类型 + WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); + + // 设定出库信息数据 + HashMap hashMap = new HashMap<>(); + /* 来自计划 */ + hashMap.put("planCode", wmsOutPlan.getPlanCode()); // 计划编号 + hashMap.put("planStatus", wmsOutPlan.getPlanState()); // 计划状态 + hashMap.put("planType", wmsOutPlan.getPlanType()); // 计划类型 + hashMap.put("useUsername", wmsOutPlan.getRecipientUsername()); // 领用人 + /* 来自出入库计划类型 */ + hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID + hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码 + hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称 + /* 来自计划明细 */ + hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次 + hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID + hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 + hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 + hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 + hashMap.put("isToolSetting", nowWmsOutPlanDetailEntity.getIsToolSetting()); // 是否对刀 + hashMap.put("toolSettingParam", nowWmsOutPlanDetailEntity.getToolSettingParam()); // 对刀参数 + + /* 实体 */ + String outTime = null; + if (nowWmsOutPlanDetailEntity.getCreateTime() != null) + outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime()); + hashMap.put("outTime", outTime); // 出库时间 + hashMapList.add(hashMap); + + // 注入出库信息对象 + nowBaseKnife.setOutInfoList(hashMapList); + }); + + // 构建入库信息 + WmsInPlanDetailEntity wmsInPlanDetailEntityQuery = new WmsInPlanDetailEntity(); + wmsInPlanDetailEntityQuery.setKnifeId(nowBaseKnife.getBaseKnifeId()); + List wmsInPlanDetailEntityList = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntityQuery); + nowBaseKnife.setInInfoList(wmsInPlanDetailEntityList); // 查询基础物料 if ("PRODUCT".equals(nowBaseKnife.getItemOrProduct())) {