diff --git a/ktg-admin/pom.xml b/ktg-admin/pom.xml index 26b1e76..dbebbe6 100644 --- a/ktg-admin/pom.xml +++ b/ktg-admin/pom.xml @@ -65,9 +65,6 @@ - - - io.swagger @@ -75,7 +72,7 @@ 1.6.2 - + mysql mysql-connector-java @@ -106,20 +103,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + com.dm DmJdbcDriver 1.8 - system - ${basedir}/lib/DmJdbcDriver18.jar com.dm.dialect hibernate5 5.4 - system - ${basedir}/lib/DmDialect-for-hibernate5.4.jar + @@ -139,15 +159,15 @@ - - org.apache.maven.plugins - maven-war-plugin - 3.1.0 + + org.apache.maven.plugins + maven-war-plugin + 3.1.0 false ${project.artifactId} - - + + ${project.artifactId} diff --git a/ktg-admin/src/main/resources/application-druid.yml b/ktg-admin/src/main/resources/application-druid.yml index 7bf5910..76beb88 100644 --- a/ktg-admin/src/main/resources/application-druid.yml +++ b/ktg-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:dm://localhost:5236/CS_HF_WMS?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:dm://localhost:5236/WMS_DJ?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: SYSDBA password: SYSDBA # 从库数据源 diff --git a/ktg-admin/src/main/resources/application.yml b/ktg-admin/src/main/resources/application.yml index bb9acb2..eea2fcf 100644 --- a/ktg-admin/src/main/resources/application.yml +++ b/ktg-admin/src/main/resources/application.yml @@ -46,15 +46,15 @@ spring: messages: # 国际化资源文件路径 basename: i18n/messages - profiles: + profiles: active: druid # 文件上传 servlet: - multipart: - # 单个文件大小 - max-file-size: 10MB - # 设置总上传的文件大小 - max-request-size: 20MB + multipart: + # 单个文件大小 + max-file-size: 10MB + # 设置总上传的文件大小 + max-request-size: 20MB # 服务模块 devtools: restart: @@ -63,13 +63,13 @@ spring: # redis 配置 redis: # 地址 - host: jjml.cc + host: localhost # 端口,默认为6379 - port: 7067 + port: 6379 # 数据库索引 - database: 1 + database: 0 # 密码 - password: redis_HtWAZW + password: # 连接超时时间 timeout: 10s lettuce: @@ -85,27 +85,27 @@ spring: # token配置 token: - # 令牌自定义标识 - header: Authorization - # 令牌密钥 - secret: abcdefghijklmnopqrstuvwxyz - # 令牌有效期(默认30分钟) - expireTime: 30 - + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 30 + # MyBatis配置 mybatis: - # 搜索指定包别名 - typeAliasesPackage: com.ktg.**.domain - # 配置mapper的扫描,找到所有的mapper.xml映射文件 - mapperLocations: classpath*:mapper/**/*Mapper.xml - # 加载全局的配置文件 - configLocation: classpath:mybatis/mybatis-config.xml + # 搜索指定包别名 + typeAliasesPackage: com.ktg.**.domain + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapperLocations: classpath*:mapper/**/*Mapper.xml + # 加载全局的配置文件 + configLocation: classpath:mybatis/mybatis-config.xml # PageHelper分页插件 -pagehelper: +pagehelper: helperDialect: oracle supportMethodsArguments: true - params: count=countSql + params: count=countSql # Swagger配置 swagger: @@ -116,7 +116,7 @@ swagger: pathMapping: /dev-api # 防止XSS攻击 -xss: +xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) @@ -126,7 +126,7 @@ xss: #Mino配置 minio: - url: http://192.168.100.106:9000 - accessKey: mi80JZXet0K0v8sSHzOm - secretKey: 2BaCUhfkFStLHdUfkBRwhshLyKFfbOBG366uakzx - bucketName: ktg-mes + url: http://localhost:9000 + accessKey: seBsDKT7Ss8B4aGiNiNn + secretKey: IYvTR63NZE3EemLfIHGTXu72O7svMEiNHG2OoOWI + bucketName: wms-dj 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 b873937..cbb04c5 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 @@ -29,6 +29,8 @@ import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.core.page.TableDataInfo; +import static com.ktg.generator.util.MultiModuleCodeGenerator.generateTaskCode; + /** * 工具台账Controller * @@ -95,8 +97,8 @@ public class BaseKnifeController extends BaseController map.put("mbbMrlClass", item.getKnifeType()); map.put("wmsAreaCode", item.getAreaCode()); map.put("knifeLife", "100"); - map.put("knifeLifeUser", item.getKnifeLife() == null ? null : String.valueOf(100 - Integer.parseInt(item.getKnifeLife()))); - map.put("knifeLifeLeave", item.getKnifeLife() == null ? null : item.getKnifeLife()); + map.put("knifeLifeUser", item.getKnifeLife() == 0 ? null : String.valueOf(100 - item.getKnifeLife())); + map.put("knifeLifeLeave", item.getKnifeLife() == 0 ? null : String.valueOf(item.getKnifeLife())); map.put("isLocked", item.getIsLocked().toString()); map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString()); map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString()); @@ -126,9 +128,11 @@ public class BaseKnifeController extends BaseController @PostMapping("/open/checkForAlignment") @ResponseBody public AjaxResult checkForAlignment(@RequestBody String json) { + // 检查请求json是否正确 List technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class); if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) return AjaxResult.error("未检测到工艺bom项"); + // 记录请求数据 technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom)); // 构建日志 @@ -167,7 +171,7 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setIsLocked(0); List tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); + tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount()); // 如果台账表中不存在,尝试组刀任务查询 @@ -181,7 +185,7 @@ public class BaseKnifeController extends BaseController operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); } - + BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); if (!bomRoute.getMbbProduBomList().isEmpty()) { @@ -191,7 +195,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -229,7 +232,8 @@ public class BaseKnifeController extends BaseController } else { // 将物料填入集合 tempList.forEach(item -> { - if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) { + if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) { + // 更新数量 knifeCount.getAndDecrement(); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); } @@ -238,6 +242,7 @@ public class BaseKnifeController extends BaseController if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){ // 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装 bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); + List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); @@ -245,7 +250,6 @@ public class BaseKnifeController extends BaseController return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); } - BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); if (!bomRoute.getMbbProduBomList().isEmpty()) { @@ -255,7 +259,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -304,11 +307,15 @@ public class BaseKnifeController extends BaseController @PostMapping("/open/productionArrangements") @ResponseBody public AjaxResult productionArrangements(@RequestBody String json) { + // 验证请求数据 List technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class); if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) return AjaxResult.error("未检测到工艺bom项"); technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom)); + // 记录数据修改 + List baseKnifeOriginList = new ArrayList<>(); + // 构建日志 SysOperLog operLog = new SysOperLog(); operLog.setTitle("生产准备"); @@ -322,6 +329,7 @@ public class BaseKnifeController extends BaseController operLog.setOperParam(json); operLog.setStatus(1); operLog.setOperTime(new Date()); + // 接口返回信息 String msg = "生产准备验证成功!"; // 记录所需物料数量的map @@ -338,15 +346,17 @@ public class BaseKnifeController extends BaseController // 台账表中查询工具 :并记录数量 mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); if (mdItemTemp == null){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); } + // 查询复合条件的台账 baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setIsLocked(0); List tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - tempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); + tempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); AtomicInteger knifeCount = new AtomicInteger(techBom.getKnifeCount()); // 如果台账表中不存在,尝试组刀任务查询 @@ -356,12 +366,12 @@ public class BaseKnifeController extends BaseController bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); } - BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); if (!bomRoute.getMbbProduBomList().isEmpty()) { @@ -371,9 +381,9 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); if (sitmTempList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -381,6 +391,7 @@ public class BaseKnifeController extends BaseController if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -391,17 +402,20 @@ public class BaseKnifeController extends BaseController // 判断基础物料是否充足 if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); } } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("暂无记录整刀bom项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); @@ -409,9 +423,17 @@ public class BaseKnifeController extends BaseController } else { // 将物料填入集合 tempList.forEach(item -> { - if (knifeCount.get() > 0 && Integer.parseInt(item.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && tempList.size() > countMap.get(item.getKnifeCode())) { + if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) { + // 更新数量 knifeCount.getAndDecrement(); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); + // 记录源数据然后锁定 + baseKnifeOriginList.add(item); + item.setPlanSheet(techBom.getTechnologyBomId()); + item.setIsLocked(1); + item.setLockedStartTime(techBom.getLockedStartTime()); + item.setLockedEndTime(techBom.getLockedEndTime()); + baseKnifeService.updateBaseKnife(item); } }); if (knifeCount.get() > 0) { @@ -421,6 +443,7 @@ public class BaseKnifeController extends BaseController List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); @@ -435,9 +458,9 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> Integer.parseInt(baseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); if (sitmTempList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -445,6 +468,7 @@ public class BaseKnifeController extends BaseController if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -455,17 +479,20 @@ public class BaseKnifeController extends BaseController // 判断基础物料是否充足 if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); } } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("暂无记录整刀bom项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); @@ -481,15 +508,15 @@ public class BaseKnifeController extends BaseController List bomList; for (BaseTechnologyBom techBom : technologyBomList){ mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); - count = techBom.getKnifeCount(); + count = techBom.getKnifeCount() - countMap.get(techBom.getKnifeCode()); // 先从台账表找 baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId()); baseKnifeWrapper.setIsLocked(0); baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - baseKnifeList.removeIf(wmsBaseKnife -> Integer.parseInt(wmsBaseKnife.getKnifeLife()) < Integer.parseInt(techBom.getExpendLife())); + baseKnifeList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); for (BaseKnife wmsBaseKnife : baseKnifeList){ - if (Integer.parseInt(wmsBaseKnife.getKnifeLife()) >= Integer.parseInt(techBom.getExpendLife()) && count > 0){ + if (wmsBaseKnife.getKnifeLife() >= techBom.getExpendLife() && count > 0){ count--; } } @@ -502,6 +529,7 @@ public class BaseKnifeController extends BaseController List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); @@ -509,14 +537,16 @@ public class BaseKnifeController extends BaseController WmsZdTask wmsZdTask = new WmsZdTask(); wmsZdTask.setmProductId(mdItem.getItemId()); - wmsZdTask.setCode(techBom.getProcessCode() + mdItem.getItemCode()); - wmsZdTask.setName(techBom.getProcessName() + "[" + mdItem.getItemName() + "]"); + wmsZdTask.setAttr4(techBom.getTechnologyBomId()); + wmsZdTask.setCode(techBom.getProcessCode()); + wmsZdTask.setName(techBom.getProcessName()); wmsZdTask.setProductIdQty(count); wmsZdTask.setAttr1(bomRouteList.get(0).getBomRouteId()); wmsZdTask.setCreateTime(DateUtils.getNowDate()); zdTaskService.insertWmsZdTask(wmsZdTask); - msg = "生产准备验证成功!已生成组装任务!"; + msg = "生产准备验证成功!缺少物料已生成组装任务!"; } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("缺少BOM项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("缺少BOM项", techBom.getKnifeCode()); @@ -539,10 +569,13 @@ public class BaseKnifeController extends BaseController @PutMapping("/zdTask") public AjaxResult zdTask(@RequestBody WmsZdTask zdTask) { + String batchNum = "ZZPC001"; + // 判断物料是否充足 BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1()); BaseKnife baseKnifeWrapper = new BaseKnife(); List baseKnifeList = new ArrayList<>(); + // 遍历组装整刀需要的bom物料 for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) { baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); @@ -555,18 +588,35 @@ public class BaseKnifeController extends BaseController List wmsOutPlanDetailList = new ArrayList<>(); List baseKnifeListOutPlan = new ArrayList<>(); - WmsOutPlan outPlan = new WmsOutPlan(); - outPlan.setPlanCode(zdTask.getCode()); - outPlan.setWmsBusinessTypeId(12L); - outPlan.setPlanState("1"); - outPlan.setPlanType("ZDCK"); - outPlan.setCreateBy(getUsername()); - outPlan.setCreateTime(DateUtils.getNowDate()); - wmsOutPlanMapper.insertWmsOutPlan(outPlan); + // 查询工艺bom + BaseTechnologyBom technologyBom = new BaseTechnologyBom(); + Boolean lockedFlag = false; + // attr4 组装任务所属计划单, 如果为空则是手动组装任务不需要锁定 + if (zdTask.getAttr4() != null){ + lockedFlag = true; + technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4()); + } else { + technologyBom.setFigureCode(zdTask.getCode()); + } + + // 出库基础物料, 根据图号查询出库计划,如果不存在生成计划,存在则往计划中添加任务 + WmsOutPlan outPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(technologyBom.getFigureCode()); + if (outPlan == null){ + WmsOutPlan outPlanTemp = new WmsOutPlan(); + outPlanTemp.setPlanCode(technologyBom.getFigureCode()); + outPlanTemp.setWmsBusinessTypeId(12L); + outPlanTemp.setPlanState("1"); + outPlanTemp.setPlanType("ZDCK"); + outPlanTemp.setCreateBy(getUsername()); + outPlanTemp.setCreateTime(DateUtils.getNowDate()); + wmsOutPlanMapper.insertWmsOutPlan(outPlanTemp); + outPlan = outPlanTemp; + } // 锁定物料 Boolean outPlanFlag = true; for (int i = 0; i < zdTask.getProductIdQty(); i++) { + // 构建整刀 BaseKnife baseKnife = new BaseKnife(); MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); baseKnife.setMbbBdMrlId(zdTask.getmProductId()); @@ -575,17 +625,25 @@ public class BaseKnifeController extends BaseController baseKnife.setKnifeUnit(mdItem.getUnitName()); baseKnife.setKnifeType(mdItem.getItemTypeName()); baseKnife.setAreaCode(zdTask.getAttr3()); - baseKnife.setSafeStock(mdItem.getMinStock().toString().split("\\.")[0]); + baseKnife.setSafeStock(mdItem.getMinStock()); baseKnife.setStandardQuantity("1"); - baseKnife.setKnifeLife("100"); + baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); - baseKnife.setIsLocked(0); - baseKnife.setPlanSheet(""); + // 判断是否需要锁定整刀 + if (lockedFlag) { + baseKnife.setIsLocked(1); + baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); + baseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); + } else { + baseKnife.setIsLocked(0); + } + baseKnife.setPlanSheet(zdTask.getAttr4()); baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setCreateBy(getUsername()); baseKnife.setCreateTime(DateUtils.getNowDate()); baseKnifeService.insertBaseKnife(baseKnife); + // 锁定物料 int resetCount = 0; for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) { baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId()); @@ -593,6 +651,7 @@ public class BaseKnifeController extends BaseController baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); if (outPlanFlag) { + // 出库任务 MdItem mdItemOutPlan = mdItemService.selectMdItemById(mbbProduBom.getMdItemId()); WmsOutPlanDetail outPlanDetail = new WmsOutPlanDetail(); outPlanDetail.setWmsOutPlanId(outPlan.getWmsOutPlanId()); @@ -602,7 +661,7 @@ public class BaseKnifeController extends BaseController outPlanDetail.setMdItemUnit(mdItemOutPlan.getUnitName()); outPlanDetail.setPlannedQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty()); outPlanDetail.setRealQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty()); - outPlanDetail.setDetailBatchNum("1"); + outPlanDetail.setDetailBatchNum(batchNum); WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3()); outPlanDetail.setWmStorageAreaId(wmStorageArea.getAreaId()); outPlanDetail.setWmStorageAreaCode(wmStorageArea.getAreaCode()); @@ -611,31 +670,36 @@ public class BaseKnifeController extends BaseController wmsOutPlanDetailList.add(outPlanDetail); } + // 锁定基础 物料 int bomCount = mbbProduBom.getStandardDosage(); for (BaseKnife wmsBaseKnife : baseKnifeList){ if (bomCount > 0){ wmsBaseKnife.setIsLocked(1); wmsBaseKnife.setKnifeFineState(2); - wmsBaseKnife.setLockedStartTime(new Date()); - wmsBaseKnife.setLockedEndTime(new Date()); + wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); + wmsBaseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); wmsBaseKnife.setAttr1(baseKnife.getBaseKnifeId()); baseKnifeListOutPlan.add(wmsBaseKnife); baseKnifeService.updateBaseKnife(wmsBaseKnife); bomCount--; + // 记录刀片重置次数 resetCount += wmsBaseKnife.getResetCount(); } } } + // 更新重置次数 outPlanFlag = false; baseKnife.setResetCount(resetCount); baseKnifeService.updateBaseKnife(baseKnife); } + // 出库 int i = 0; for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){ wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail); + // 出库计划明细 for (int j = 0; j < outPlanDetail.getPlannedQuantity(); j++) { WmsOutPlanDetailEntity wmsOutPlanDetailEntity = new WmsOutPlanDetailEntity(); wmsOutPlanDetailEntity.setBaseKnifeId(baseKnifeListOutPlan.get(i++).getBaseKnifeId()); @@ -645,16 +709,18 @@ public class BaseKnifeController extends BaseController wmsOutPlanDetailEntityMapper.insertWmsOutPlanDetailEntity(wmsOutPlanDetailEntity); } + // 生成出库任务 WmsOutTask wmsOutTask = new WmsOutTask(); wmsOutTask.setWmsOutPlanId(outPlan.getWmsOutPlanId()); - wmsOutTask.setWmsOutPlanCode(outPlan.getPlanCode()); + wmsOutTask.setWmsOutPlanCode(generateTaskCode(outPlan.getPlanCode())); wmsOutTask.setWmsOutPlanDetailId(outPlanDetail.getWmsOutPlanDetailId()); + // 出库类型 12组刀出库 wmsOutTask.setWmsBusinessTypeId(12L); wmsOutTask.setTaskCode(outPlan.getPlanCode()); wmsOutTask.setTaskNumber(outPlanDetail.getPlannedQuantity()); wmsOutTask.setOutNumber(outPlanDetail.getRealQuantity()); wmsOutTask.setWmStorageAreaId(outPlanDetail.getWmStorageAreaId()); - wmsOutTask.setBatchNum("1"); + wmsOutTask.setBatchNum(batchNum); wmsOutTask.setMdItemId(outPlanDetail.getMdItemId()); wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode()); wmsOutTask.setMdItemName(outPlanDetail.getMdItemName()); @@ -664,50 +730,75 @@ public class BaseKnifeController extends BaseController wmsOutTask.setCreateBy(getUsername()); wmsOutTask.setCreateTime(DateUtils.getNowDate()); wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); + + // 更新基础物料数量 + MdItem mdItem = mdItemService.selectMdItemById(outPlanDetail.getMdItemId()); + mdItem.setStandardNumber(mdItem.getStandardNumber() - outPlanDetail.getRealQuantity()); + mdItemService.updateMdItem(mdItem); } - Random random = new Random(); - WmsInPlan wmsInPlan = new WmsInPlan(); - wmsInPlan.setState("1"); - wmsInPlan.setSourceType("SGLR"); - wmsInPlan.setWareId("10"); - wmsInPlan.setCellCode(zdTask.getAttr3()); - wmsInPlan.setPlanCode(zdTask.getCode() + random.nextInt(100)); - wmsInPlan.setRelBillCode("组装单据"); - wmsInPlan.setPlanTypeId("7"); - wmsInPlan.setCreateBy(getUsername()); - wmsInPlan.setCreateTime(DateUtils.getNowDate()); + // 整刀入库计划, 根据图号查询入库计划,如果不存在生成计划,存在则往计划中添加任务 + WmsInPlan wmsInPlan = wmsInPlanService.selectWmsInPlanByPlanCode(technologyBom.getFigureCode()); + if (wmsInPlan == null){ + WmsInPlan wmsInPlanTemp = new WmsInPlan(); + wmsInPlanTemp.setState("1"); + wmsInPlanTemp.setSourceType("SGLR"); + wmsInPlanTemp.setCellCode(zdTask.getAttr3()); + wmsInPlanTemp.setPlanCode(technologyBom.getFigureCode()); + wmsInPlanTemp.setRelBillCode("组装单据"); + wmsInPlanTemp.setPlanTypeId("13"); + wmsInPlanTemp.setCreateBy(getUsername()); + wmsInPlanTemp.setCreateTime(DateUtils.getNowDate()); - List wmsInPlanDetailsList = new ArrayList<>(); - WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); - wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); - wmsInPlanDetails.setBatch("10112"); - wmsInPlanDetails.setCellId("1"); - wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString()); - wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString()); - wmsInPlanDetails.setPlanInStatus("0"); - wmsInPlanDetailsList.add(wmsInPlanDetails); - wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailsList); - wmsInPlanService.insertWmsInPlan(wmsInPlan); + // 入库任务明细 + List wmsInPlanDetailsList = new ArrayList<>(); + WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); + wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); + wmsInPlanDetails.setBatch(batchNum); + wmsInPlanDetails.setCellId("1"); + wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString()); + wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString()); + wmsInPlanDetails.setPlanInStatus("0"); + wmsInPlanDetailsList.add(wmsInPlanDetails); + wmsInPlanTemp.setWmsInPlanDetailsList(wmsInPlanDetailsList); + wmsInPlanService.insertWmsInPlan(wmsInPlanTemp); + wmsInPlan = wmsInPlanTemp; + } else { + // 入库任务明细 + List wmsInPlanDetailsList = wmsInPlan.getWmsInPlanDetailsList(); + WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); + wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); + wmsInPlanDetails.setBatch(batchNum); + wmsInPlanDetails.setCellId("1"); + wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString()); + wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString()); + wmsInPlanDetails.setPlanInStatus("0"); + wmsInPlanDetailsList.add(wmsInPlanDetails); + wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailsList); + wmsInPlanService.updateWmsInPlan(wmsInPlan); + } + // 入库任务 MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); WmsInTask wmsInTask = new WmsInTask(); - wmsInTask.setPlanInId(wmsInPlan.getPlanId()); - wmsInTask.setPlanInCode(wmsInPlan.getPlanCode()); + wmsInTask.setPlanInId(wmsInPlan.getPlanId().toString()); + wmsInTask.setPlanInCode(generateTaskCode(wmsInPlan.getPlanCode())); wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); wmsInTask.setActualInQuantity(zdTask.getProductIdQty()); WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3()); wmsInTask.setCellTgt(wmStorageArea.getAreaId()); - wmsInTask.setBatch("11011"); + wmsInTask.setBatch(batchNum); wmsInTask.setMaterialId(zdTask.getmProductId().toString()); wmsInTask.setPlanTypeId("9"); wmsInTask.setPlanInStatus("1"); wmsInTaskService.insertWmsInTask(wmsInTask); + // 更新数量 mdItem.setStandardNumber(mdItem.getStandardNumber() + zdTask.getProductIdQty()); mdItemService.updateMdItem(mdItem); + // 更新组装任务 zdTask.setStatus("1"); zdTask.setQtyOk(zdTask.getProductIdQty()); zdTaskService.updateWmsZdTask(zdTask); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java index 5f75994..1c9cd4c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java @@ -255,10 +255,10 @@ public class MdItemController extends BaseController { mdItem.setItemTypeName(type.getItemTypeName()); mdItem.setItemOrProduct(type.getItemOrProduct()); } - if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) { - mdItem.setMinStock(0D); - mdItem.setMaxStock(0D); - } +// if (StringUtils.isNotNull(mdItem.getSafeStockFlag()) && "N".equals(mdItem.getSafeStockFlag())) { +// mdItem.setMinStock(0D); +// mdItem.setMaxStock(0D); +// } MdUnitMeasure measure = mdUnitMeasureService.selectMdUnitByCode(mdItem.getUnitOfMeasure()); if (StringUtils.isNotNull(measure)) { mdItem.setUnitName(measure.getMeasureName()); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java index 9d4bf65..218a64c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.List; /** - * 工具台账对象 BASE_KNIFE + * 刀具台账对象 BASE_KNIFE * * @author yinjinlu * @date 2024-10-31 @@ -35,15 +35,15 @@ public class BaseKnife extends BaseEntity { private String rfid; /** - * 工具编码 + * 刀具编码 */ - @Excel(name = "工具编码") + @Excel(name = "刀具编码") private String knifeCode; /** - * 工具名称 + * 刀具名称 */ - @Excel(name = "工具名称") + @Excel(name = "刀具名称") private String knifeName; /** @@ -53,16 +53,16 @@ public class BaseKnife extends BaseEntity { private String knifeUnit; /** - * 工具类型(物料分类) + * 刀具类型(物料分类) */ - @Excel(name = "工具类型", readConverterExp = "物料分类") + @Excel(name = "刀具类型", readConverterExp = "物料分类") private String knifeType; /** * 安全库存 */ @Excel(name = "安全库存") - private String safeStock; + private Integer safeStock; /** * 标准数量 @@ -77,15 +77,15 @@ public class BaseKnife extends BaseEntity { private String areaCode; /** - * 工具寿命 + * 刀具寿命 */ - @Excel(name = "工具寿命") - private String knifeLife; + @Excel(name = "刀具寿命") + private Integer knifeLife; /** - * 工具状态 + * 刀具状态 */ - @Excel(name = "工具状态") + @Excel(name = "刀具状态") private Integer knifeFineState; /** @@ -262,7 +262,7 @@ public class BaseKnife extends BaseEntity { this.knifeType = knifeType; } - public String getSafeStock() { + public Integer getSafeStock() { return safeStock; } @@ -274,7 +274,7 @@ public class BaseKnife extends BaseEntity { this.itemOrProduct = itemOrProduct; } - public void setSafeStock(String safeStock) { + public void setSafeStock(Integer safeStock) { this.safeStock = safeStock; } @@ -294,11 +294,11 @@ public class BaseKnife extends BaseEntity { this.areaCode = areaCode; } - public String getKnifeLife() { + public Integer getKnifeLife() { return knifeLife; } - public void setKnifeLife(String knifeLife) { + public void setKnifeLife(Integer knifeLife) { this.knifeLife = knifeLife; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseTechnologyBom.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseTechnologyBom.java index 370f094..a2ba55c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseTechnologyBom.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseTechnologyBom.java @@ -46,7 +46,7 @@ public class BaseTechnologyBom extends BaseEntity /** 消耗定额 */ @Excel(name = "消耗定额") - private String expendLife; + private Integer expendLife; /** 锁定开始时间 */ @Excel(name = "锁定开始时间") @@ -135,12 +135,12 @@ public class BaseTechnologyBom extends BaseEntity { return knifeCount; } - public void setExpendLife(String expendLife) + public void setExpendLife(Integer expendLife) { this.expendLife = expendLife; } - public String getExpendLife() + public Integer getExpendLife() { return expendLife; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java index e1ffc00..e3102a1 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java @@ -34,11 +34,11 @@ public class MdItem extends BaseEntity { private String itemTypeName; private String enableFlag; private String safeStockFlag; - private Double minStock; + private Integer minStock; private Double maxStock; private String highValue; private Integer attr1; - private String attr2; + private Integer attr2; private String attr3; private String attr4; @@ -163,11 +163,11 @@ public class MdItem extends BaseEntity { this.safeStockFlag = safeStockFlag; } - public Double getMinStock() { + public Integer getMinStock() { return minStock; } - public void setMinStock(Double minStock) { + public void setMinStock(Integer minStock) { this.minStock = minStock; } @@ -195,11 +195,11 @@ public class MdItem extends BaseEntity { this.attr1 = attr1; } - public String getAttr2() { + public Integer getAttr2() { return attr2; } - public void setAttr2(String attr2) { + public void setAttr2(Integer attr2) { this.attr2 = attr2; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java index 15cd215..03562d8 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/mapper/WmsOutPlanMapper.java @@ -101,4 +101,6 @@ public interface WmsOutPlanMapper { ); WmsOutPlanDetail selectWmsOutPlanDetailById(Long wmsOutPlanDetailId); + + WmsOutPlan selectWmsOutPlanByPlanCode(String figureCode); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanDetailEntityController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanDetailEntityController.java new file mode 100644 index 0000000..1ab0b30 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanDetailEntityController.java @@ -0,0 +1,104 @@ +package com.ktg.mes.wm.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; +import com.ktg.mes.wm.service.IWmsInPlanDetailEntityService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 入库计划明细实体Controller + * + * @author yinjinlu + * @date 2024-11-05 + */ +@RestController +@RequestMapping("/wm/wmsInPlanDetailsEntity") +public class WmsInPlanDetailEntityController extends BaseController +{ + @Autowired + private IWmsInPlanDetailEntityService wmsInPlanDetailEntityService; + + /** + * 查询入库计划明细实体列表 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:list')") + @GetMapping("/list") + public TableDataInfo list(WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + startPage(); + List list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity); + return getDataTable(list); + } + + /** + * 导出入库计划明细实体列表 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:export')") + @Log(title = "入库计划明细实体", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + List list = wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity); + ExcelUtil util = new ExcelUtil(WmsInPlanDetailEntity.class); + util.exportExcel(response, list, "入库计划明细实体数据"); + } + + /** + * 获取入库计划明细实体详细信息 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(wmsInPlanDetailEntityService.selectWmsInPlanDetailEntityById(id)); + } + + /** + * 新增入库计划明细实体 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:add')") + @Log(title = "入库计划明细实体", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + return toAjax(wmsInPlanDetailEntityService.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity)); + } + + /** + * 修改入库计划明细实体 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:edit')") + @Log(title = "入库计划明细实体", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + return toAjax(wmsInPlanDetailEntityService.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity)); + } + + /** + * 删除入库计划明细实体 + */ + @PreAuthorize("@ss.hasPermi('wm:wmsInPlanDetailsEntity:remove')") + @Log(title = "入库计划明细实体", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(wmsInPlanDetailEntityService.deleteWmsInPlanDetailEntityByIds(ids)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index e5894b2..1a93db2 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -140,9 +140,9 @@ public class WmsInTaskController extends BaseController { baseKnife.setKnifeUnit(mbbBdMrlMitm.getUnitName()); baseKnife.setKnifeType(mbbBdMrlMitm.getItemTypeName()); baseKnife.setAreaCode(wmStorageArea.getAreaCode()); - baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock().toString().split("\\.")[0]); + baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock()); baseKnife.setStandardQuantity("1"); - baseKnife.setKnifeLife("100"); + baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); baseKnife.setPlanSheet(""); baseKnife.setResetCount(mbbBdMrlMitm.getAttr1()); diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java index e09f82e..f167e5c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlan.java @@ -1,6 +1,7 @@ package com.ktg.mes.wm.domain; import java.util.List; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ktg.common.annotation.Excel; @@ -8,358 +9,379 @@ import com.ktg.common.core.domain.BaseEntity; /** * 入库计划对象 WMS_IN_PLAN - * + * * @author yinjinlu * @date 2024-10-31 */ -public class WmsInPlan extends BaseEntity -{ +public class WmsInPlan extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键 */ - private String planId; + /** + * 主键 + */ + private Long planId; - /** 状态[00-新建 20-执行中 40-关闭 45-手工关闭] */ + /** + * 状态[00-新建 20-执行中 40-关闭 45-手工关闭] + */ @Excel(name = "状态[00-新建 20-执行中 40-关闭 45-手工关闭]") private String state; - /** 来源类型[10-接口 20-手工 30-导入] */ + /** + * 来源类型[10-接口 20-手工 30-导入] + */ @Excel(name = "来源类型[10-接口 20-手工 30-导入]") private String sourceType; - /** 仓库ID */ + /** + * 仓库ID + */ @Excel(name = "仓库ID") private String wareId; - /** 库位编码 */ + /** + * 库位编码 + */ @Excel(name = "库位编码") private String cellCode; - /** 工单号 */ + /** + * 工单号 + */ @Excel(name = "工单号") private String workOrderCode; - /** 计划日期 */ + /** + * 计划日期 + */ @Excel(name = "计划日期") private String expectDate; - /** 发布人 */ + /** + * 发布人 + */ @Excel(name = "发布人") private String publishName; - /** 发布时间 */ + /** + * 发布时间 + */ @Excel(name = "发布时间") private String publishTime; - /** 关闭人(暂不可用) */ + /** + * 关闭人(暂不可用) + */ @Excel(name = "关闭人(暂不可用)") private String closerId; - /** 关闭日期(暂不可用) */ + /** + * 关闭日期(暂不可用) + */ @Excel(name = "关闭日期(暂不可用)") private String closeTime; - /** 关联单据号 */ + /** + * 关联单据号 + */ @Excel(name = "关联单据号") private String relBillCode; - /** 客户ID. */ + /** + * 客户ID. + */ @Excel(name = "客户ID.") private String customerId; - /** 采购单号. */ + /** + * 采购单号. + */ @Excel(name = "采购单号.") private String poCode; - /** 部门ID. */ + /** + * 部门ID. + */ @Excel(name = "部门ID.") private String departmentId; - /** 合同号. */ + /** + * 合同号. + */ @Excel(name = "合同号.") private String contractNo; - /** 供应商ID. */ + /** + * 供应商ID. + */ @Excel(name = "供应商ID.") private String supplierId; - /** 业务类型id. */ + /** + * 业务类型id. + */ @Excel(name = "业务类型id.") private String businessTypeId; - /** 来源出库任务. */ + /** + * 来源出库任务. + */ @Excel(name = "来源出库任务.") private String srcOutTaskId; - /** 激活标识(0激活1冻结) */ + /** + * 激活标识(0激活1冻结) + */ @Excel(name = "激活标识(0激活1冻结)") private String isActive; - /** 删除标识(0未删除1删除) */ + /** + * 删除标识(0未删除1删除) + */ @Excel(name = "删除标识(0未删除1删除)") private String isDelete; - /** 计划编码 */ + /** + * 计划编码 + */ @Excel(name = "计划编码") private String planCode; - /** 入库类型 */ + /** + * 入库类型 + */ @Excel(name = "入库类型") private String planTypeId; - /** 入库计划明细信息 */ + /** + * 入库计划明细信息 + */ private List wmsInPlanDetailsList; - public void setPlanId(String planId) - { + public void setPlanId(Long planId) { this.planId = planId; } - public String getPlanId() - { + public Long getPlanId() { return planId; } - public void setState(String state) - { + + public void setState(String state) { this.state = state; } - public String getState() - { + public String getState() { return state; } - public void setSourceType(String sourceType) - { + + public void setSourceType(String sourceType) { this.sourceType = sourceType; } - public String getSourceType() - { + public String getSourceType() { return sourceType; } - public void setWareId(String wareId) - { + + public void setWareId(String wareId) { this.wareId = wareId; } - public String getWareId() - { + public String getWareId() { return wareId; } - public void setCellCode(String cellCode) - { + + public void setCellCode(String cellCode) { this.cellCode = cellCode; } - public String getCellCode() - { + public String getCellCode() { return cellCode; } - public void setWorkOrderCode(String workOrderCode) - { + + public void setWorkOrderCode(String workOrderCode) { this.workOrderCode = workOrderCode; } - public String getWorkOrderCode() - { + public String getWorkOrderCode() { return workOrderCode; } - public void setExpectDate(String expectDate) - { + + public void setExpectDate(String expectDate) { this.expectDate = expectDate; } - public String getExpectDate() - { + public String getExpectDate() { return expectDate; } - public void setPublishName(String publishName) - { + + public void setPublishName(String publishName) { this.publishName = publishName; } - public String getPublishName() - { + public String getPublishName() { return publishName; } - public void setPublishTime(String publishTime) - { + + public void setPublishTime(String publishTime) { this.publishTime = publishTime; } - public String getPublishTime() - { + public String getPublishTime() { return publishTime; } - public void setCloserId(String closerId) - { + + public void setCloserId(String closerId) { this.closerId = closerId; } - public String getCloserId() - { + public String getCloserId() { return closerId; } - public void setCloseTime(String closeTime) - { + + public void setCloseTime(String closeTime) { this.closeTime = closeTime; } - public String getCloseTime() - { + public String getCloseTime() { return closeTime; } - public void setRelBillCode(String relBillCode) - { + + public void setRelBillCode(String relBillCode) { this.relBillCode = relBillCode; } - public String getRelBillCode() - { + public String getRelBillCode() { return relBillCode; } - public void setCustomerId(String customerId) - { + + public void setCustomerId(String customerId) { this.customerId = customerId; } - public String getCustomerId() - { + public String getCustomerId() { return customerId; } - public void setPoCode(String poCode) - { + + public void setPoCode(String poCode) { this.poCode = poCode; } - public String getPoCode() - { + public String getPoCode() { return poCode; } - public void setDepartmentId(String departmentId) - { + + public void setDepartmentId(String departmentId) { this.departmentId = departmentId; } - public String getDepartmentId() - { + public String getDepartmentId() { return departmentId; } - public void setContractNo(String contractNo) - { + + public void setContractNo(String contractNo) { this.contractNo = contractNo; } - public String getContractNo() - { + public String getContractNo() { return contractNo; } - public void setSupplierId(String supplierId) - { + + public void setSupplierId(String supplierId) { this.supplierId = supplierId; } - public String getSupplierId() - { + public String getSupplierId() { return supplierId; } - public void setBusinessTypeId(String businessTypeId) - { + + public void setBusinessTypeId(String businessTypeId) { this.businessTypeId = businessTypeId; } - public String getBusinessTypeId() - { + public String getBusinessTypeId() { return businessTypeId; } - public void setSrcOutTaskId(String srcOutTaskId) - { + + public void setSrcOutTaskId(String srcOutTaskId) { this.srcOutTaskId = srcOutTaskId; } - public String getSrcOutTaskId() - { + public String getSrcOutTaskId() { return srcOutTaskId; } - public void setIsActive(String isActive) - { + + public void setIsActive(String isActive) { this.isActive = isActive; } - public String getIsActive() - { + public String getIsActive() { return isActive; } - public void setIsDelete(String isDelete) - { + + public void setIsDelete(String isDelete) { this.isDelete = isDelete; } - public String getIsDelete() - { + public String getIsDelete() { return isDelete; } - public void setPlanCode(String planCode) - { + + public void setPlanCode(String planCode) { this.planCode = planCode; } - public String getPlanCode() - { + public String getPlanCode() { return planCode; } - public void setPlanTypeId(String planTypeId) - { + + public void setPlanTypeId(String planTypeId) { this.planTypeId = planTypeId; } - public String getPlanTypeId() - { + public String getPlanTypeId() { return planTypeId; } - public List getWmsInPlanDetailsList() - { + public List getWmsInPlanDetailsList() { return wmsInPlanDetailsList; } - public void setWmsInPlanDetailsList(List wmsInPlanDetailsList) - { + public void setWmsInPlanDetailsList(List wmsInPlanDetailsList) { this.wmsInPlanDetailsList = wmsInPlanDetailsList; } @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("planId", getPlanId()) - .append("state", getState()) - .append("sourceType", getSourceType()) - .append("wareId", getWareId()) - .append("cellCode", getCellCode()) - .append("workOrderCode", getWorkOrderCode()) - .append("expectDate", getExpectDate()) - .append("publishName", getPublishName()) - .append("publishTime", getPublishTime()) - .append("closerId", getCloserId()) - .append("closeTime", getCloseTime()) - .append("relBillCode", getRelBillCode()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("updateBy", getUpdateBy()) - .append("remark", getRemark()) - .append("customerId", getCustomerId()) - .append("poCode", getPoCode()) - .append("departmentId", getDepartmentId()) - .append("contractNo", getContractNo()) - .append("supplierId", getSupplierId()) - .append("businessTypeId", getBusinessTypeId()) - .append("srcOutTaskId", getSrcOutTaskId()) - .append("isActive", getIsActive()) - .append("isDelete", getIsDelete()) - .append("planCode", getPlanCode()) - .append("planTypeId", getPlanTypeId()) - .append("wmsInPlanDetailsList", getWmsInPlanDetailsList()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("planId", getPlanId()) + .append("state", getState()) + .append("sourceType", getSourceType()) + .append("wareId", getWareId()) + .append("cellCode", getCellCode()) + .append("workOrderCode", getWorkOrderCode()) + .append("expectDate", getExpectDate()) + .append("publishName", getPublishName()) + .append("publishTime", getPublishTime()) + .append("closerId", getCloserId()) + .append("closeTime", getCloseTime()) + .append("relBillCode", getRelBillCode()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("updateBy", getUpdateBy()) + .append("remark", getRemark()) + .append("customerId", getCustomerId()) + .append("poCode", getPoCode()) + .append("departmentId", getDepartmentId()) + .append("contractNo", getContractNo()) + .append("supplierId", getSupplierId()) + .append("businessTypeId", getBusinessTypeId()) + .append("srcOutTaskId", getSrcOutTaskId()) + .append("isActive", getIsActive()) + .append("isDelete", getIsDelete()) + .append("planCode", getPlanCode()) + .append("planTypeId", getPlanTypeId()) + .append("wmsInPlanDetailsList", getWmsInPlanDetailsList()) + .toString(); } } 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 new file mode 100644 index 0000000..f7039ff --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java @@ -0,0 +1,115 @@ +package com.ktg.mes.wm.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 入库计划明细实体对象 WMS_IN_PLAN_DETAIL_ENTITY + * + * @author yinjinlu + * @date 2024-11-05 + */ +public class WmsInPlanDetailEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * $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; + + /** + * 消耗寿命 + */ + @Excel(name = "消耗寿命") + private Integer consumeLife; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setPlanId(Long planId) { + this.planId = planId; + } + + public Long getPlanId() { + return planId; + } + + public void setPlanDetailsId(Long planDetailsId) { + this.planDetailsId = planDetailsId; + } + + public Long getPlanDetailsId() { + return planDetailsId; + } + + public void setSource(String source) { + this.source = source; + } + + public String getSource() { + return source; + } + + public void setKnifeId(Long knifeId) { + this.knifeId = knifeId; + } + + public Long getKnifeId() { + return knifeId; + } + + public void setConsumeLife(Integer consumeLife) { + this.consumeLife = consumeLife; + } + + public Integer getConsumeLife() { + return consumeLife; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("planId", getPlanId()) + .append("planDetailsId", getPlanDetailsId()) + .append("source", getSource()) + .append("knifeId", getKnifeId()) + .append("consumeLife", getConsumeLife()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetails.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetails.java index 108e0a3..9fa49ff 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetails.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetails.java @@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ktg.common.annotation.Excel; import com.ktg.common.core.domain.BaseEntity; +import java.util.List; + /** * 入库计划明细对象 WMS_IN_PLAN_DETAILS * @@ -20,9 +22,11 @@ public class WmsInPlanDetails extends BaseEntity /** 入库计划ID */ @Excel(name = "入库计划ID") - private String planId; + private Long planId; - /** 物料ID */ + /** + * 物料ID + */ @Excel(name = "物料ID") private String materialId; @@ -54,8 +58,9 @@ public class WmsInPlanDetails extends BaseEntity @Excel(name = "删除标识(0未删除1删除)") private String isDelete; - public void setDetailsId(Long detailsId) - { + private List wmsInPlanDetailEntityList; + + public void setDetailsId(Long detailsId) { this.detailsId = detailsId; } @@ -63,13 +68,12 @@ public class WmsInPlanDetails extends BaseEntity { return detailsId; } - public void setPlanId(String planId) - { + + public void setPlanId(Long planId) { this.planId = planId; } - public String getPlanId() - { + public Long getPlanId() { return planId; } public void setMaterialId(String materialId) @@ -145,24 +149,33 @@ public class WmsInPlanDetails extends BaseEntity return isDelete; } + public List getWmsInPlanDetailEntityList() { + return wmsInPlanDetailEntityList; + } + + public void setWmsInPlanDetailEntityList(List wmsInPlanDetailEntityList) { + this.wmsInPlanDetailEntityList = wmsInPlanDetailEntityList; + } + @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("detailsId", getDetailsId()) - .append("planId", getPlanId()) - .append("materialId", getMaterialId()) - .append("batch", getBatch()) - .append("cellId", getCellId()) - .append("quantity", getQuantity()) - .append("quantityIn", getQuantityIn()) - .append("planInStatus", getPlanInStatus()) - .append("remark", getRemark()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("isActivy", getIsActivy()) - .append("isDelete", getIsDelete()) - .toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("detailsId", getDetailsId()) + .append("planId", getPlanId()) + .append("materialId", getMaterialId()) + .append("batch", getBatch()) + .append("cellId", getCellId()) + .append("quantity", getQuantity()) + .append("quantityIn", getQuantityIn()) + .append("planInStatus", getPlanInStatus()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("isActivy", getIsActivy()) + .append("isDelete", getIsDelete()) + .append("wmsInPlanDetailEntityList", getWmsInPlanDetailEntityList()) + .toString(); } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java index 61482ef..0a32bbb 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInTask.java @@ -16,7 +16,7 @@ public class WmsInTask extends BaseEntity private static final long serialVersionUID = 1L; /** 主键 */ - private String id; + private Long id; /** 任务编码 */ @Excel(name = "任务编码") @@ -44,7 +44,7 @@ public class WmsInTask extends BaseEntity /** 是否激活 */ @Excel(name = "是否激活") - private String isActivy; + private String isActive; /** 是否删除 */ @Excel(name = "是否删除") @@ -74,12 +74,16 @@ public class WmsInTask extends BaseEntity @Excel(name = "物料编码") private String materialCode; - public void setId(String id) + /** 入库明细ID */ + @Excel(name = "入库明细ID") + private Long detailInId; + + public void setId(Long id) { this.id = id; } - public String getId() + public Long getId() { return id; } @@ -137,14 +141,14 @@ public class WmsInTask extends BaseEntity { return cellOrig; } - public void setIsActivy(String isActivy) + public void setIsActive(String isActivy) { - this.isActivy = isActivy; + this.isActive = isActivy; } - public String getIsActivy() + public String getIsActive() { - return isActivy; + return isActive; } public void setIsDelete(String isDelete) { @@ -210,6 +214,14 @@ public class WmsInTask extends BaseEntity return materialCode; } + public Long getDetailInId() { + return detailInId; + } + + public void setDetailInId(Long detailInId) { + this.detailInId = detailInId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -225,7 +237,7 @@ public class WmsInTask extends BaseEntity .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) - .append("isActivy", getIsActivy()) + .append("isActive", getIsActive()) .append("isDelete", getIsDelete()) .append("batch", getBatch()) .append("materialId", getMaterialId()) @@ -233,6 +245,7 @@ public class WmsInTask extends BaseEntity .append("planInStatus", getPlanInStatus()) .append("planInCode", getPlanInCode()) .append("materialCode", getMaterialCode()) + .append("detailInId", getDetailInId()) .toString(); } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsZdTask.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsZdTask.java index a4f0cf4..ecb10ff 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsZdTask.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsZdTask.java @@ -1,5 +1,6 @@ package com.ktg.mes.wm.domain; +import com.ktg.mes.md.domain.BaseTechnologyBom; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ktg.common.annotation.Excel; @@ -53,6 +54,8 @@ public class WmsZdTask extends BaseEntity @Excel(name = "预留字段1") private Long attr1; + private String planSheet; + /** 预留字段2 */ @Excel(name = "预留字段2") private String attr2; @@ -196,6 +199,14 @@ public class WmsZdTask extends BaseEntity return status; } + public String getPlanSheet() { + return planSheet; + } + + public void setPlanSheet(String planSheet) { + this.planSheet = planSheet; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java new file mode 100644 index 0000000..aba0497 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java @@ -0,0 +1,83 @@ +package com.ktg.mes.wm.mapper; + +import java.util.List; +import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; + +/** + * 入库计划明细实体Mapper接口 + * + * @author yinjinlu + * @date 2024-11-05 + */ +public interface WmsInPlanDetailEntityMapper +{ + /** + * 查询入库计划明细实体 + * + * @param id 入库计划明细实体主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id); + + /** + * 根据入库计划明细 id查询 + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id); + + /** + * 查询入库计划明细实体列表 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 入库计划明细实体集合 + */ + public List selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 新增入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 修改入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 删除入库计划明细实体 + * + * @param id 入库计划明细实体主键 + * @return 结果 + */ + public int deleteWmsInPlanDetailEntityById(Long id); + + /** + * 批量删除入库计划明细实体 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmsInPlanDetailEntityByIds(Long[] ids); + + /** + * 删除入库计划明细实体 根据入库计划明细ID + * + * @param id 入库计划明细主键 + * @return 结果 + */ + public int deleteWmsInPlanDetailEntityByPlanDetailsId(Long id); + + /** + * 批量插入入库计划明细实例 + * @param wmsInPlanDetailEntityList 入库计划明细实例集合 + * @return 结果 + */ + public int batchWmsInPlanDetailEntity(List wmsInPlanDetailEntityList); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanMapper.java index 6b226a2..04fe90c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanMapper.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanMapper.java @@ -84,4 +84,6 @@ public interface WmsInPlanMapper * @return 结果 */ public int deleteWmsInPlanDetailsByPlanId(String planId); + + WmsInPlan selectWmsInPlanByPlanCode(String planCode); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanDetailEntityService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanDetailEntityService.java new file mode 100644 index 0000000..b2ca4e7 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanDetailEntityService.java @@ -0,0 +1,69 @@ +package com.ktg.mes.wm.service; + +import java.util.List; +import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; + +/** + * 入库计划明细实体Service接口 + * + * @author yinjinlu + * @date 2024-11-05 + */ +public interface IWmsInPlanDetailEntityService +{ + /** + * 查询入库计划明细实体 + * + * @param id 入库计划明细实体主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id); + + /** + * 根据入库计划明细ID 查询入库计划明细实体 + * + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id); + + /** + * 查询入库计划明细实体列表 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 入库计划明细实体集合 + */ + public List selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 新增入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 修改入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity); + + /** + * 批量删除入库计划明细实体 + * + * @param ids 需要删除的入库计划明细实体主键集合 + * @return 结果 + */ + public int deleteWmsInPlanDetailEntityByIds(Long[] ids); + + /** + * 删除入库计划明细实体信息 + * + * @param id 入库计划明细实体主键 + * @return 结果 + */ + public int deleteWmsInPlanDetailEntityById(Long id); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java index d9bde35..ca39920 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanService.java @@ -19,6 +19,8 @@ public interface IWmsInPlanService */ public WmsInPlan selectWmsInPlanByPlanId(String planId); + WmsInPlan selectWmsInPlanByPlanCode(String planCode); + /** * 查询入库计划列表 * @@ -58,4 +60,5 @@ public interface IWmsInPlanService * @return 结果 */ public int deleteWmsInPlanByPlanId(String planId); + } 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 new file mode 100644 index 0000000..104938d --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java @@ -0,0 +1,107 @@ +package com.ktg.mes.wm.service.impl; + +import java.util.List; +import com.ktg.common.utils.DateUtils; +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; + +/** + * 入库计划明细实体Service业务层处理 + * + * @author yinjinlu + * @date 2024-11-05 + */ +@Service +public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityService +{ + @Autowired + private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper; + + /** + * 查询入库计划明细实体 + * + * @param id 入库计划明细实体主键 + * @return 入库计划明细实体 + */ + @Override + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id) + { + return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityById(id); + } + + /** + * 根据入库计划明细ID 查询入库计划明细实体 + * + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + @Override + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id) { + return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityByPlanDetailsId(id); + } + + /** + * 查询入库计划明细实体列表 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 入库计划明细实体 + */ + @Override + public List selectWmsInPlanDetailEntityList(WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(wmsInPlanDetailEntity); + } + + /** + * 新增入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + @Override + public int insertWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + wmsInPlanDetailEntity.setCreateTime(DateUtils.getNowDate()); + return wmsInPlanDetailEntityMapper.insertWmsInPlanDetailEntity(wmsInPlanDetailEntity); + } + + /** + * 修改入库计划明细实体 + * + * @param wmsInPlanDetailEntity 入库计划明细实体 + * @return 结果 + */ + @Override + public int updateWmsInPlanDetailEntity(WmsInPlanDetailEntity wmsInPlanDetailEntity) + { + wmsInPlanDetailEntity.setUpdateTime(DateUtils.getNowDate()); + return wmsInPlanDetailEntityMapper.updateWmsInPlanDetailEntity(wmsInPlanDetailEntity); + } + + /** + * 批量删除入库计划明细实体 + * + * @param ids 需要删除的入库计划明细实体主键 + * @return 结果 + */ + @Override + public int deleteWmsInPlanDetailEntityByIds(Long[] ids) + { + return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByIds(ids); + } + + /** + * 删除入库计划明细实体信息 + * + * @param id 入库计划明细实体主键 + * @return 结果 + */ + @Override + public int deleteWmsInPlanDetailEntityById(Long id) + { + return wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityById(id); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java index 1104931..7029a3a 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java @@ -1,10 +1,15 @@ package com.ktg.mes.wm.service.impl; import java.util.List; + import com.ktg.common.utils.DateUtils; +import com.ktg.mes.wm.domain.WmsInPlanDetailEntity; +import com.ktg.mes.wm.mapper.WmsInPlanDetailEntityMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import java.util.ArrayList; + import com.ktg.common.utils.StringUtils; import org.springframework.transaction.annotation.Transactional; import com.ktg.mes.wm.domain.WmsInPlanDetails; @@ -14,50 +19,54 @@ import com.ktg.mes.wm.service.IWmsInPlanService; /** * 入库计划Service业务层处理 - * + * * @author yinjinlu * @date 2024-10-31 */ @Service -public class WmsInPlanServiceImpl implements IWmsInPlanService -{ +public class WmsInPlanServiceImpl implements IWmsInPlanService { @Autowired private WmsInPlanMapper wmsInPlanMapper; + @Autowired + private WmsInPlanDetailEntityMapper wmsInPlanDetailEntityMapper; + /** * 查询入库计划 - * + * * @param planId 入库计划主键 * @return 入库计划 */ @Override - public WmsInPlan selectWmsInPlanByPlanId(String planId) - { + public WmsInPlan selectWmsInPlanByPlanId(String planId) { return wmsInPlanMapper.selectWmsInPlanByPlanId(planId); } + @Override + public WmsInPlan selectWmsInPlanByPlanCode(String planCode) { + return wmsInPlanMapper.selectWmsInPlanByPlanCode(planCode); + } + /** * 查询入库计划列表 - * + * * @param wmsInPlan 入库计划 * @return 入库计划 */ @Override - public List selectWmsInPlanList(WmsInPlan wmsInPlan) - { + public List selectWmsInPlanList(WmsInPlan wmsInPlan) { return wmsInPlanMapper.selectWmsInPlanList(wmsInPlan); } /** * 新增入库计划 - * + * * @param wmsInPlan 入库计划 * @return 结果 */ @Transactional @Override - public int insertWmsInPlan(WmsInPlan wmsInPlan) - { + public int insertWmsInPlan(WmsInPlan wmsInPlan) { wmsInPlan.setCreateTime(DateUtils.getNowDate()); int rows = wmsInPlanMapper.insertWmsInPlan(wmsInPlan); insertWmsInPlanDetails(wmsInPlan); @@ -66,69 +75,89 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService /** * 修改入库计划 - * + * * @param wmsInPlan 入库计划 * @return 结果 */ @Transactional @Override - public int updateWmsInPlan(WmsInPlan wmsInPlan) - { + public int updateWmsInPlan(WmsInPlan wmsInPlan) { wmsInPlan.setUpdateTime(DateUtils.getNowDate()); - wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(wmsInPlan.getPlanId()); + wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(wmsInPlan.getPlanId().toString()); insertWmsInPlanDetails(wmsInPlan); return wmsInPlanMapper.updateWmsInPlan(wmsInPlan); } /** * 批量删除入库计划 - * + * * @param planIds 需要删除的入库计划主键 * @return 结果 */ @Transactional @Override - public int deleteWmsInPlanByPlanIds(String[] planIds) - { + public int deleteWmsInPlanByPlanIds(String[] planIds) { wmsInPlanMapper.deleteWmsInPlanDetailsByPlanIds(planIds); return wmsInPlanMapper.deleteWmsInPlanByPlanIds(planIds); } /** * 删除入库计划信息 - * + * * @param planId 入库计划主键 * @return 结果 */ @Transactional @Override - public int deleteWmsInPlanByPlanId(String planId) - { + public int deleteWmsInPlanByPlanId(String planId) { wmsInPlanMapper.deleteWmsInPlanDetailsByPlanId(planId); return wmsInPlanMapper.deleteWmsInPlanByPlanId(planId); } /** * 新增入库计划明细信息 - * + * * @param wmsInPlan 入库计划对象 */ - public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) - { + public void insertWmsInPlanDetails(WmsInPlan wmsInPlan) { List wmsInPlanDetailsList = wmsInPlan.getWmsInPlanDetailsList(); - String planId = wmsInPlan.getPlanId(); - if (StringUtils.isNotNull(wmsInPlanDetailsList)) - { + Long planId = wmsInPlan.getPlanId(); + if (StringUtils.isNotNull(wmsInPlanDetailsList)) { List list = new ArrayList(); - for (WmsInPlanDetails wmsInPlanDetails : wmsInPlanDetailsList) - { + for (WmsInPlanDetails wmsInPlanDetails : wmsInPlanDetailsList) { wmsInPlanDetails.setPlanId(planId); list.add(wmsInPlanDetails); + + // 插入入库任务明细实例 + wmsInPlanDetailEntityMapper.deleteWmsInPlanDetailEntityByPlanDetailsId(wmsInPlanDetails.getDetailsId()); + insertWmsInPlanDetailEntity(wmsInPlanDetails); } - if (list.size() > 0) - { + if (!list.isEmpty()) { wmsInPlanMapper.batchWmsInPlanDetails(list); } } } + + /** + * 新增入库计划明细实例 + * + * @param wmsInPlanDetails 入库计划明细对象 + */ + public void insertWmsInPlanDetailEntity(WmsInPlanDetails wmsInPlanDetails) { + List wmsInPlanDetailEntityList = wmsInPlanDetails.getWmsInPlanDetailEntityList(); + Long planId = wmsInPlanDetails.getPlanId(); + Long planDetailsId = wmsInPlanDetails.getDetailsId(); + if (StringUtils.isNotNull(wmsInPlanDetailEntityList)) { + ArrayList list = new ArrayList<>(); + for (WmsInPlanDetailEntity wmsInPlanDetailEntity : wmsInPlanDetailEntityList) { + wmsInPlanDetailEntity.setPlanId(planId); + wmsInPlanDetailEntity.setPlanDetailsId(planDetailsId); + + list.add(wmsInPlanDetailEntity); + } + if (!list.isEmpty()) { + wmsInPlanDetailEntityMapper.batchWmsInPlanDetailEntity(list); + } + } + } } diff --git a/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml b/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml index 92afdea..f47a0d6 100644 --- a/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml @@ -83,7 +83,6 @@ BK.IS_LOCKED, BK.LOCKED_START_TIME, BK.LOCKED_END_TIME, - BK.PLAN_SHEET, BK.RESET_COUNT, BK.ITEM_OR_PRODUCT, BK.REMARK, @@ -94,10 +93,12 @@ BK.CREATE_BY, BK.CREATE_TIME, BK.UPDATE_BY, - BK.UPDATE_TIME + BK.UPDATE_TIME, + BTB.FIGURE_CODE PLAN_SHEET from BASE_KNIFE BK LEFT JOIN MD_ITEM MI on BK.MBB_BD_MRL_ID = MI.ITEM_ID LEFT JOIN MD_ITEM_TYPE MIT ON MI.ITEM_TYPE_ID = MIT.ITEM_TYPE_ID + LEFT JOIN BASE_TECHNOLOGY_BOM BTB ON BTB.TECHNOLOGY_BOM_ID = BK.PLAN_SHEET SELECT COUNT(*) FROM BASE_KNIFE BK - WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} + WHERE MBB_BD_MRL_ID = #{mbbBdMrlId} AND KNIFE_FINE_STATE = 0 OR KNIFE_FINE_STATE = 1 + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml new file mode 100644 index 0000000..32e445e --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + select ID, + PLAN_ID, + PLAN_DETAILS_ID, + SOURCE, + KNIFE_ID, + CONSUME_LIFE, + CREATE_BY, + CREATE_TIME, + UPDATE_BY, + UPDATE_TIME + from WMS_IN_PLAN_DETAIL_ENTITY + + + + + + + + + + insert into WMS_IN_PLAN_DETAIL_ENTITY + + PLAN_ID, + PLAN_DETAILS_ID, + SOURCE, + KNIFE_ID, + CONSUME_LIFE, + CREATE_BY, + CREATE_TIME, + UPDATE_BY, + UPDATE_TIME, + + + #{planId}, + #{planDetailsId}, + #{source}, + #{knifeId}, + #{consumeLife}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update WMS_IN_PLAN_DETAIL_ENTITY + + PLAN_ID = #{planId}, + PLAN_DETAILS_ID = #{planDetailsId}, + SOURCE = #{source}, + KNIFE_ID = #{knifeId}, + CONSUME_LIFE = #{consumeLife}, + CREATE_BY = #{createBy}, + CREATE_TIME = #{createTime}, + UPDATE_BY = #{updateBy}, + UPDATE_TIME = #{updateTime}, + + where ID = #{id} + + + + delete + from WMS_IN_PLAN_DETAIL_ENTITY + where ID = #{id} + + + + delete from WMS_IN_PLAN_DETAIL_ENTITY where ID in + + #{id} + + + + + delete + from WMS_IN_PLAN_DETAIL_ENTITY + where PLAN_DETAILS_ID = #{PlanDetailsId} + + + + + insert into WMS_IN_PLAN_DETAIL_ENTITY( + ID,PLAN_ID,PLAN_DETAILS_ID,SOURCE,KNIFE_ID,CONSUME_LIFE,CREATE_BY,CREATE_TIME,UPDATE_BY,UPDATE_TIME) values + + ( #{item.id}, #{item.planId}, #{item.planDetailsId}, #{item.source}, #{item.knifeId}, + #{item.consumeLife},#{item.createBy}, #{item.createTime}, #{item.updateBy}, + #{item.updateTime}) + + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml index 5b74217..e18c73a 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml @@ -1,107 +1,229 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - select PLAN_ID, STATE, SOURCE_TYPE, WARE_ID, CELL_CODE, WORK_ORDER_CODE, EXPECT_DATE, PUBLISH_NAME, PUBLISH_TIME, CLOSER_ID, CLOSE_TIME, REL_BILL_CODE, CREATE_BY, CREATE_TIME, UPDATE_TIME, UPDATE_BY, REMARK, CUSTOMER_ID, PO_CODE, DEPARTMENT_ID, CONTRACT_NO, SUPPLIER_ID, BUSINESS_TYPE_ID, SRC_OUT_TASK_ID, IS_ACTIVE, IS_DELETE, PLAN_CODE, PLAN_TYPE_ID from WMS_IN_PLAN + select PLAN_ID, + STATE, + SOURCE_TYPE, + WARE_ID, + CELL_CODE, + WORK_ORDER_CODE, + EXPECT_DATE, + PUBLISH_NAME, + PUBLISH_TIME, + CLOSER_ID, + CLOSE_TIME, + REL_BILL_CODE, + CREATE_BY, + CREATE_TIME, + UPDATE_TIME, + UPDATE_BY, + REMARK, + CUSTOMER_ID, + PO_CODE, + DEPARTMENT_ID, + CONTRACT_NO, + SUPPLIER_ID, + BUSINESS_TYPE_ID, + SRC_OUT_TASK_ID, + IS_ACTIVE, + IS_DELETE, + PLAN_CODE, + PLAN_TYPE_ID + from WMS_IN_PLAN + order by CREATE_TIME desc - + - + + + insert into WMS_IN_PLAN @@ -132,7 +254,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IS_DELETE, PLAN_CODE, PLAN_TYPE_ID, - + #{state}, #{sourceType}, @@ -161,7 +283,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{isDelete}, #{planCode}, #{planTypeId}, - + @@ -199,31 +321,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from WMS_IN_PLAN where PLAN_ID = #{planId} + delete + from WMS_IN_PLAN + where PLAN_ID = #{planId} - delete from WMS_IN_PLAN where PLAN_ID in + delete from WMS_IN_PLAN where PLAN_ID in #{planId} - + - delete from WMS_IN_PLAN_DETAILS where PLAN_ID in + delete from WMS_IN_PLAN_DETAILS where PLAN_ID in #{planId} - delete from WMS_IN_PLAN_DETAILS where PLAN_ID = #{planId} + delete + from WMS_IN_PLAN_DETAILS + where PLAN_ID = #{planId} - insert into WMS_IN_PLAN_DETAILS( PLAN_ID, MATERIAL_ID, BATCH, CELL_ID, QUANTITY, QUANTITY_IN, PLAN_IN_STATUS, REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE) values - - ( #{item.planId}, #{item.materialId}, #{item.batch}, #{item.cellId}, #{item.quantity}, #{item.quantityIn}, #{item.planInStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.isActivy}, #{item.isDelete}) + insert into WMS_IN_PLAN_DETAILS( PLAN_ID, MATERIAL_ID, BATCH, CELL_ID, QUANTITY, QUANTITY_IN, PLAN_IN_STATUS, + REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE) values + + ( #{item.planId}, #{item.materialId}, #{item.batch}, #{item.cellId}, #{item.quantity}, #{item.quantityIn}, + #{item.planInStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, + #{item.updateTime}, #{item.isActivy}, #{item.isDelete}) \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml index 7ed847e..1680e81 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml @@ -1,66 +1,91 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - select ID, TASK_IN_CODE, PLAN_IN_ID, TASK_IN_QUANTITY, ACTUAL_IN_QUANTITY, CELL_TGT, CELL_ORIG, REMARK, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, IS_ACTIVY, IS_DELETE, BATCH, MATERIAL_ID, PLAN_TYPE_ID, PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE from WMS_IN_TASK + select ID, + TASK_IN_CODE, + PLAN_IN_ID, + TASK_IN_QUANTITY, + ACTUAL_IN_QUANTITY, + CELL_TGT, + CELL_ORIG, + REMARK, + CREATE_BY, + CREATE_TIME, + UPDATE_BY, + UPDATE_TIME, + IS_ACTIVE, + IS_DELETE, + BATCH, + MATERIAL_ID, + PLAN_TYPE_ID, + PLAN_IN_STATUS, + PLAN_IN_CODE, + MATERIAL_CODE, + DETAIL_IN_ID + from WMS_IN_TASK - + - + insert into WMS_IN_TASK @@ -75,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CREATE_TIME, UPDATE_BY, UPDATE_TIME, - IS_ACTIVY, + IS_ACTIVE, IS_DELETE, BATCH, MATERIAL_ID, @@ -83,7 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE, - + DETAIL_IN_ID, + #{taskInCode}, #{planInId}, @@ -96,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - #{isActivy}, + #{isActive}, #{isDelete}, #{batch}, #{materialId}, @@ -104,7 +130,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{planInStatus}, #{planInCode}, #{materialCode}, - + #{detailInId}, + @@ -121,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CREATE_TIME = #{createTime}, UPDATE_BY = #{updateBy}, UPDATE_TIME = #{updateTime}, - IS_ACTIVY = #{isActivy}, + IS_ACTIVE = #{isActive}, IS_DELETE = #{isDelete}, BATCH = #{batch}, MATERIAL_ID = #{materialId}, @@ -129,16 +156,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PLAN_IN_STATUS = #{planInStatus}, PLAN_IN_CODE = #{planInCode}, MATERIAL_CODE = #{materialCode}, + DETAIL_IN_ID = #{detailInId}, where ID = #{id} - delete from WMS_IN_TASK where ID = #{id} + delete + from WMS_IN_TASK + where ID = #{id} - delete from WMS_IN_TASK where ID in + delete from WMS_IN_TASK where ID in #{id} diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml index 0242f26..ab10022 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml @@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -29,9 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wzt.WMS_ZD_TASK_ID, wzt.CODE, wzt."name", wzt.M_PRODUCT_ID, wzt."product_id_qty", wzt.QTY, wzt.PLAN_OUT_ID, wzt.PLAN_OUT_TYPE, wzt.QTY_OK, wzt.REMARK, wzt.ATTR1, wzt.ATTR3, wzt.ATTR4, wzt.CREATE_BY, wzt.CREATE_TIME, - wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2 + wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2, btb.figure_code plan_sheet from WMS_ZD_TASK wzt left join md_item mi on wzt.m_product_id = mi.item_id + left join base_technology_bom btb on btb.technology_bom_id = wzt.attr4