From fe1aa26549788679426e5d151c9d00b4f037766a Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 5 Nov 2024 10:27:38 +0800 Subject: [PATCH 01/25] =?UTF-8?q?refactor:=20=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-druid.yml | 2 +- ktg-admin/src/main/resources/application.yml | 60 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) 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 From b4566baedc63ee3743259b39dbf9fe9e724b0342 Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 5 Nov 2024 10:58:29 +0800 Subject: [PATCH 02/25] =?UTF-8?q?refactor:=20=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=88=97=E8=A1=A8=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/wm/WmsInPlanMapper.xml | 262 ++++++++++++------ 1 file changed, 171 insertions(+), 91 deletions(-) diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml index 5b74217..c5e3695 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml @@ -1,107 +1,180 @@ + 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 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" IS_DELETE, PLAN_CODE, PLAN_TYPE_ID, - + #{state}, #{sourceType}, @@ -161,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{isDelete}, #{planCode}, #{planTypeId}, - + @@ -199,31 +272,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 From 74147f270361724f44c0e07d4e91c85dcfd182dc Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 5 Nov 2024 10:59:33 +0800 Subject: [PATCH 03/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1):=20=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E5=80=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/wm/WmsInTaskMapper.xml | 125 +++++++++++------- 1 file changed, 75 insertions(+), 50 deletions(-) diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml index 7ed847e..c29ee9c 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml @@ -1,66 +1,89 @@ + 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_ACTIVY, + IS_DELETE, + BATCH, + MATERIAL_ID, + PLAN_TYPE_ID, + PLAN_IN_STATUS, + PLAN_IN_CODE, + MATERIAL_CODE + from WMS_IN_TASK + order by CREATE_TIME desc - + - + insert into WMS_IN_TASK @@ -83,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE, - + #{taskInCode}, #{planInId}, @@ -104,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{planInStatus}, #{planInCode}, #{materialCode}, - + @@ -134,11 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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} From 70f4f0bb271eecccf96c8e06c84f08d656a13a48 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Tue, 5 Nov 2024 16:07:36 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 32 ++++++++++--------- .../java/com/ktg/mes/md/domain/BaseKnife.java | 6 ++-- .../ktg/mes/md/domain/BaseTechnologyBom.java | 6 ++-- .../wm/controller/WmsInTaskController.java | 2 +- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index b873937..6ff72c9 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 @@ -95,8 +95,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 +126,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)); // 构建日志 @@ -164,10 +166,11 @@ public class BaseKnifeController extends BaseController 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()); // 如果台账表中不存在,尝试组刀任务查询 @@ -191,7 +194,7 @@ 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())); + sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -229,7 +232,7 @@ 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); } @@ -245,7 +248,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 +257,7 @@ 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())); + sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -346,7 +348,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()); // 如果台账表中不存在,尝试组刀任务查询 @@ -371,7 +373,7 @@ 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())); + sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -409,7 +411,7 @@ 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); } @@ -435,7 +437,7 @@ 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())); + sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -487,9 +489,9 @@ public class BaseKnifeController extends BaseController 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--; } } @@ -577,7 +579,7 @@ public class BaseKnifeController extends BaseController baseKnife.setAreaCode(zdTask.getAttr3()); baseKnife.setSafeStock(mdItem.getMinStock().toString().split("\\.")[0]); baseKnife.setStandardQuantity("1"); - baseKnife.setKnifeLife("100"); + baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); baseKnife.setIsLocked(0); baseKnife.setPlanSheet(""); @@ -674,7 +676,7 @@ public class BaseKnifeController extends BaseController wmsInPlan.setCellCode(zdTask.getAttr3()); wmsInPlan.setPlanCode(zdTask.getCode() + random.nextInt(100)); wmsInPlan.setRelBillCode("组装单据"); - wmsInPlan.setPlanTypeId("7"); + wmsInPlan.setPlanTypeId("13"); wmsInPlan.setCreateBy(getUsername()); wmsInPlan.setCreateTime(DateUtils.getNowDate()); 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..cfa5dd2 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 @@ -80,7 +80,7 @@ public class BaseKnife extends BaseEntity { * 工具寿命 */ @Excel(name = "工具寿命") - private String knifeLife; + private Integer knifeLife; /** * 工具状态 @@ -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/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index b37ab90..b3b9094 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 @@ -149,7 +149,7 @@ public class WmsInTaskController extends BaseController { baseKnife.setAreaCode(wmStorageArea.getAreaCode()); baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock().toString().split("\\.")[0]); baseKnife.setStandardQuantity("1"); - baseKnife.setKnifeLife("100"); + baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); baseKnife.setPlanSheet(""); baseKnife.setResetCount(mbbBdMrlMitm.getAttr1()); From 1cdbbdb3b0b1b89a5c26695a9708d5c8c55183ce Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 5 Nov 2024 17:16:29 +0800 Subject: [PATCH 05/25] =?UTF-8?q?feat(=E5=85=A5=E5=BA=93=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=98=8E=E7=BB=86):=20=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsInPlanDetailEntityController.java | 104 ++++++++++++++++ .../mes/wm/domain/WmsInPlanDetailEntity.java | 111 ++++++++++++++++++ .../mapper/WmsInPlanDetailEntityMapper.java | 61 ++++++++++ .../IWmsInPlanDetailEntityService.java | 61 ++++++++++ .../WmsInPlanDetailEntityServiceImpl.java | 96 +++++++++++++++ .../mapper/wm/WmsInPlanDetailEntityMapper.xml | 96 +++++++++++++++ 6 files changed, 529 insertions(+) create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInPlanDetailEntityController.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanDetailEntityService.java create mode 100644 ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java create mode 100644 ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml 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/domain/WmsInPlanDetailEntity.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java new file mode 100644 index 0000000..9857dd3 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java @@ -0,0 +1,111 @@ +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 String planId; + + /** 入库计划明细ID */ + @Excel(name = "入库计划明细ID") + private String planDetailsId; + + /** 来源 */ + @Excel(name = "来源") + private String source; + + /** 台账ID */ + @Excel(name = "台账ID") + private String knifeId; + + /** 消耗寿命 */ + @Excel(name = "消耗寿命") + private String comsumeLife; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setPlanId(String planId) + { + this.planId = planId; + } + + public String getPlanId() + { + return planId; + } + public void setPlanDetailsId(String planDetailsId) + { + this.planDetailsId = planDetailsId; + } + + public String getPlanDetailsId() + { + return planDetailsId; + } + public void setSource(String source) + { + this.source = source; + } + + public String getSource() + { + return source; + } + public void setKnifeId(String knifeId) + { + this.knifeId = knifeId; + } + + public String getKnifeId() + { + return knifeId; + } + public void setComsumeLife(String comsumeLife) + { + this.comsumeLife = comsumeLife; + } + + public String getComsumeLife() + { + return comsumeLife; + } + + @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("comsumeLife", getComsumeLife()) + .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/mapper/WmsInPlanDetailEntityMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java new file mode 100644 index 0000000..206e324 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmsInPlanDetailEntityMapper.java @@ -0,0 +1,61 @@ +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); + + /** + * 查询入库计划明细实体列表 + * + * @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); +} 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..845aafb --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmsInPlanDetailEntityService.java @@ -0,0 +1,61 @@ +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); + + /** + * 查询入库计划明细实体列表 + * + * @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/impl/WmsInPlanDetailEntityServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java new file mode 100644 index 0000000..335275b --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java @@ -0,0 +1,96 @@ +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); + } + + /** + * 查询入库计划明细实体列表 + * + * @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/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml new file mode 100644 index 0000000..0718775 --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + select ID, PLAN_ID, PLAN_DETAILS_ID, SOURCE, KNIFE_ID, COMSUME_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, + COMSUME_LIFE, + CREATE_BY, + CREATE_TIME, + UPDATE_BY, + UPDATE_TIME, + + + #{planId}, + #{planDetailsId}, + #{source}, + #{knifeId}, + #{comsumeLife}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update WMS_IN_PLAN_DETAIL_ENTITY + + PLAN_ID = #{planId}, + PLAN_DETAILS_ID = #{planDetailsId}, + SOURCE = #{source}, + KNIFE_ID = #{knifeId}, + COMSUME_LIFE = #{comsumeLife}, + 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} + + + \ No newline at end of file From 17e64f7c753bb209e6c4c4f981e183ca78932341 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Tue, 5 Nov 2024 17:17:07 +0800 Subject: [PATCH 06/25] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 15 ++++++++----- .../mes/md/controller/MdItemController.java | 8 +++---- .../java/com/ktg/mes/md/domain/BaseKnife.java | 22 +++++++++---------- .../java/com/ktg/mes/md/domain/MdItem.java | 6 ++--- .../main/resources/mapper/md/MdItemMapper.xml | 3 ++- 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 6ff72c9..5526774 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 @@ -541,6 +541,10 @@ public class BaseKnifeController extends BaseController @PutMapping("/zdTask") public AjaxResult zdTask(@RequestBody WmsZdTask zdTask) { + String planSheet = "JHD001"; + String batchNum = "ZZPC001"; + + // 判断物料是否充足 BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1()); BaseKnife baseKnifeWrapper = new BaseKnife(); @@ -582,7 +586,7 @@ public class BaseKnifeController extends BaseController baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); baseKnife.setIsLocked(0); - baseKnife.setPlanSheet(""); + baseKnife.setPlanSheet(planSheet); baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setCreateBy(getUsername()); baseKnife.setCreateTime(DateUtils.getNowDate()); @@ -604,7 +608,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()); @@ -656,7 +660,7 @@ public class BaseKnifeController extends BaseController 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()); @@ -672,7 +676,6 @@ public class BaseKnifeController extends BaseController 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("组装单据"); @@ -683,7 +686,7 @@ public class BaseKnifeController extends BaseController List wmsInPlanDetailsList = new ArrayList<>(); WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); - wmsInPlanDetails.setBatch("10112"); + wmsInPlanDetails.setBatch(batchNum); wmsInPlanDetails.setCellId("1"); wmsInPlanDetails.setQuantity(zdTask.getProductIdQty().toString()); wmsInPlanDetails.setQuantityIn(zdTask.getProductIdQty().toString()); @@ -701,7 +704,7 @@ public class BaseKnifeController extends BaseController 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"); 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 53c44b2..6958c67 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 @@ -252,10 +252,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 cfa5dd2..feca504 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,9 +53,9 @@ public class BaseKnife extends BaseEntity { private String knifeUnit; /** - * 工具类型(物料分类) + * 刀具类型(物料分类) */ - @Excel(name = "工具类型", readConverterExp = "物料分类") + @Excel(name = "刀具类型", readConverterExp = "物料分类") private String knifeType; /** @@ -77,15 +77,15 @@ public class BaseKnife extends BaseEntity { private String areaCode; /** - * 工具寿命 + * 刀具寿命 */ - @Excel(name = "工具寿命") + @Excel(name = "刀具寿命") private Integer knifeLife; /** - * 工具状态 + * 刀具状态 */ - @Excel(name = "工具状态") + @Excel(name = "刀具状态") private Integer knifeFineState; /** 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..4bf9366 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 @@ -38,7 +38,7 @@ public class MdItem extends BaseEntity { private Double maxStock; private String highValue; private Integer attr1; - private String attr2; + private Integer attr2; private String attr3; private String attr4; @@ -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/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index 90d4006..a6ee012 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -51,6 +51,7 @@ max_stock, high_value, attr1, + attr2, create_by, create_time, remark @@ -183,7 +184,7 @@ enable_flag, safe_stock_flag, - + min_stock, From b1dc3ceba06150ff388b920598c4457a95b33709 Mon Sep 17 00:00:00 2001 From: LJW Date: Wed, 6 Nov 2024 10:48:38 +0800 Subject: [PATCH 07/25] =?UTF-8?q?refactor:=20=E5=AD=97=E6=AE=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java | 12 ++++++------ .../mapper/wm/WmsInPlanDetailEntityMapper.xml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java index 9857dd3..664fb19 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java @@ -36,7 +36,7 @@ public class WmsInPlanDetailEntity extends BaseEntity /** 消耗寿命 */ @Excel(name = "消耗寿命") - private String comsumeLife; + private String consumeLife; public void setId(Long id) { @@ -83,14 +83,14 @@ public class WmsInPlanDetailEntity extends BaseEntity { return knifeId; } - public void setComsumeLife(String comsumeLife) + public void setconsumeLife(String consumeLife) { - this.comsumeLife = comsumeLife; + this.consumeLife = consumeLife; } - public String getComsumeLife() + public String getconsumeLife() { - return comsumeLife; + return consumeLife; } @Override @@ -101,7 +101,7 @@ public class WmsInPlanDetailEntity extends BaseEntity .append("planDetailsId", getPlanDetailsId()) .append("source", getSource()) .append("knifeId", getKnifeId()) - .append("comsumeLife", getComsumeLife()) + .append("consumeLife", getconsumeLife()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml index 0718775..5a97787 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml @@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select ID, PLAN_ID, PLAN_DETAILS_ID, SOURCE, KNIFE_ID, COMSUME_LIFE, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from WMS_IN_PLAN_DETAIL_ENTITY + 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, @@ -53,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CREATE_TIME, UPDATE_BY, UPDATE_TIME, - + #{planId}, #{planDetailsId}, @@ -64,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + @@ -84,13 +96,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from WMS_IN_PLAN_DETAIL_ENTITY where ID = #{id} + delete + from WMS_IN_PLAN_DETAIL_ENTITY + where ID = #{id} - delete from WMS_IN_PLAN_DETAIL_ENTITY where ID in + delete from WMS_IN_PLAN_DETAIL_ENTITY where ID in #{id} + + + + 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 From 180f4dd9959d928bd27999a06e8e3e1dfdd97e09 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 14:28:29 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E7=BB=84=E8=A3=85=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ktg/mes/wm/domain/WmsZdTask.java | 11 +++++++++++ .../src/main/resources/mapper/md/BaseKnifeMapper.xml | 5 +++-- .../src/main/resources/mapper/wm/WmsZdTaskMapper.xml | 6 ++++-- 3 files changed, 18 insertions(+), 4 deletions(-) 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/resources/mapper/md/BaseKnifeMapper.xml b/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml index 3dd0850..d27d504 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 From a73166c26e10fb4c7ba69f6f43634ff2c867f9ab Mon Sep 17 00:00:00 2001 From: LJW Date: Thu, 7 Nov 2024 15:04:36 +0800 Subject: [PATCH 12/25] =?UTF-8?q?refactor:=20POM=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/pom.xml | 48 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) 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} From 3ebca24a5134e8cbf9c9475fbb1ee560c5862926 Mon Sep 17 00:00:00 2001 From: LJW Date: Thu, 7 Nov 2024 15:06:23 +0800 Subject: [PATCH 13/25] =?UTF-8?q?fix(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86)?= =?UTF-8?q?:=20=E6=8F=92=E5=85=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index db0ad4f..be5e264 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -193,10 +193,10 @@ remark, - + attr1, - + attr2, From ce7a6197ae33cc4b8fa7e300c61b4569c4a02e8a Mon Sep 17 00:00:00 2001 From: LJW Date: Thu, 7 Nov 2024 15:06:58 +0800 Subject: [PATCH 14/25] =?UTF-8?q?fix(=E5=85=A5=E5=BA=93=E4=BA=BA=E7=89=A9)?= =?UTF-8?q?:=20=E6=9F=A5=E8=AF=A2=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml index c29ee9c..2fbef0b 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml @@ -49,7 +49,6 @@ PLAN_IN_CODE, MATERIAL_CODE from WMS_IN_TASK - order by CREATE_TIME desc 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 From 1fb81c6bed7fb51dc39823737f738a8407389531 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 15:53:34 +0800 Subject: [PATCH 16/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=80=E6=9F=84?= =?UTF-8?q?=E4=B9=9F=E8=BF=9B=E8=A1=8C=E8=AE=A1=E7=AE=97=E5=AF=BF=E5=91=BD?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 87d20d7..baf2ae9 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 @@ -166,7 +166,6 @@ public class BaseKnifeController extends BaseController return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); } - // 查询台账数据 baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setIsLocked(0); List tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); @@ -184,7 +183,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()) { @@ -194,7 +193,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -233,6 +231,7 @@ public class BaseKnifeController extends BaseController // 将物料填入集合 tempList.forEach(item -> { if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) { + // 更新数量 knifeCount.getAndDecrement(); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); } @@ -241,6 +240,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()); @@ -257,7 +257,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -378,7 +377,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); @@ -456,7 +454,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); From 65969a44ec8d21756c0c63c71134b4dbadb9c1d6 Mon Sep 17 00:00:00 2001 From: LJW Date: Thu, 7 Nov 2024 16:13:16 +0800 Subject: [PATCH 17/25] =?UTF-8?q?fix(=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=AE=9E=E4=BD=93):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E6=98=8E?= =?UTF-8?q?=E7=BB=86ID=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/wm/mapper/WmsInPlanDetailEntityMapper.java | 7 +++++++ .../mes/wm/service/IWmsInPlanDetailEntityService.java | 8 ++++++++ .../impl/WmsInPlanDetailEntityServiceImpl.java | 11 +++++++++++ .../mapper/wm/WmsInPlanDetailEntityMapper.xml | 5 +++++ 4 files changed, 31 insertions(+) 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 index 206e324..345315a 100644 --- 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 @@ -19,6 +19,13 @@ public interface WmsInPlanDetailEntityMapper */ public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id); + /** + * 根据入库计划明细 id查询 + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id); + /** * 查询入库计划明细实体列表 * 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 index 845aafb..b2ca4e7 100644 --- 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 @@ -19,6 +19,14 @@ public interface IWmsInPlanDetailEntityService */ public WmsInPlanDetailEntity selectWmsInPlanDetailEntityById(Long id); + /** + * 根据入库计划明细ID 查询入库计划明细实体 + * + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id); + /** * 查询入库计划明细实体列表 * diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java index 335275b..104938d 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanDetailEntityServiceImpl.java @@ -32,6 +32,17 @@ public class WmsInPlanDetailEntityServiceImpl implements IWmsInPlanDetailEntityS return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityById(id); } + /** + * 根据入库计划明细ID 查询入库计划明细实体 + * + * @param id 入库计划明细主键 + * @return 入库计划明细实体 + */ + @Override + public WmsInPlanDetailEntity selectWmsInPlanDetailEntityByPlanDetailsId(Long id) { + return wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityByPlanDetailsId(id); + } + /** * 查询入库计划明细实体列表 * diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml index 75eb5a3..e542da5 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml @@ -52,6 +52,11 @@ where ID = #{id} + + insert into WMS_IN_PLAN_DETAIL_ENTITY From 8429137f088c0eb166a4caee9b525b457e83f2ad Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 16:37:26 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 4 +++- ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index baf2ae9..548ad87 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 * @@ -752,7 +754,7 @@ public class BaseKnifeController extends BaseController MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); WmsInTask wmsInTask = new WmsInTask(); wmsInTask.setPlanInId(wmsInPlan.getPlanId()); - wmsInTask.setPlanInCode(wmsInPlan.getPlanCode()); + wmsInTask.setPlanInCode(generateTaskCode(wmsInPlan.getPlanCode())); wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); wmsInTask.setActualInQuantity(zdTask.getProductIdQty()); diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml index eee8781..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,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -29,8 +30,8 @@ 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.CREATE_BY, wzt.CREATE_TIME, - wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2, btb.figure_code attr4 + 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, 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 @@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ATTR1 = #{attr1} and ATTR2 = #{attr2} and ATTR3 = #{attr3} - and ATTR4 = #{attr4} + and ATTR4 = #{attr4} and CREATE_BY = #{createBy} and CREATE_TIME = #{createTime} and UPDATE_BY = #{updateBy} @@ -123,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ATTR1 = #{attr1}, ATTR2 = #{attr2}, ATTR3 = #{attr3}, - ATTR4 = #{attr4}, CREATE_BY = #{createBy}, CREATE_TIME = #{createTime}, UPDATE_BY = #{updateBy}, From 17e93ace05240b6362ce234450622782d3bfaa14 Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 14:41:14 +0800 Subject: [PATCH 19/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92):=20=E5=AE=9E=E4=BD=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 2 +- .../java/com/ktg/mes/wm/domain/WmsInPlan.java | 332 ++++++++++-------- 2 files changed, 178 insertions(+), 156 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 548ad87..d67e6a2 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 @@ -753,7 +753,7 @@ public class BaseKnifeController extends BaseController // 入库任务 MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); WmsInTask wmsInTask = new WmsInTask(); - wmsInTask.setPlanInId(wmsInPlan.getPlanId()); + wmsInTask.setPlanInId(wmsInPlan.getPlanId().toString()); wmsInTask.setPlanInCode(generateTaskCode(wmsInPlan.getPlanCode())); wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); 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(); } } From bc0aa1e44ab81353c2dd66d9580cd583f4b08b6b Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 14:42:53 +0800 Subject: [PATCH 20/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1):=20=E5=AE=9E=E4=BD=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ktg/mes/wm/domain/WmsInTask.java | 31 +++++++++++++------ .../resources/mapper/wm/WmsInTaskMapper.xml | 20 +++++++----- 2 files changed, 35 insertions(+), 16 deletions(-) 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/resources/mapper/wm/WmsInTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml index 2fbef0b..1680e81 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInTaskMapper.xml @@ -17,7 +17,7 @@ - + @@ -25,6 +25,7 @@ + @@ -40,14 +41,15 @@ CREATE_TIME, UPDATE_BY, UPDATE_TIME, - IS_ACTIVY, + IS_ACTIVE, IS_DELETE, BATCH, MATERIAL_ID, PLAN_TYPE_ID, PLAN_IN_STATUS, PLAN_IN_CODE, - MATERIAL_CODE + MATERIAL_CODE, + DETAIL_IN_ID from WMS_IN_TASK @@ -67,7 +69,7 @@ and CREATE_TIME = #{createTime} and UPDATE_BY = #{updateBy} and UPDATE_TIME = #{updateTime} - and IS_ACTIVY = #{isActivy} + and IS_ACTIVE = #{isActive} and IS_DELETE = #{isDelete} and BATCH = #{batch} and MATERIAL_ID = #{materialId} @@ -75,6 +77,7 @@ and PLAN_IN_STATUS = #{planInStatus} and PLAN_IN_CODE = #{planInCode} and MATERIAL_CODE = #{materialCode} + and DETAIL_IN_ID = #{detailInId} @@ -97,7 +100,7 @@ CREATE_TIME, UPDATE_BY, UPDATE_TIME, - IS_ACTIVY, + IS_ACTIVE, IS_DELETE, BATCH, MATERIAL_ID, @@ -105,6 +108,7 @@ PLAN_IN_STATUS, PLAN_IN_CODE, MATERIAL_CODE, + DETAIL_IN_ID, #{taskInCode}, @@ -118,7 +122,7 @@ #{createTime}, #{updateBy}, #{updateTime}, - #{isActivy}, + #{isActive}, #{isDelete}, #{batch}, #{materialId}, @@ -126,6 +130,7 @@ #{planInStatus}, #{planInCode}, #{materialCode}, + #{detailInId}, @@ -143,7 +148,7 @@ CREATE_TIME = #{createTime}, UPDATE_BY = #{updateBy}, UPDATE_TIME = #{updateTime}, - IS_ACTIVY = #{isActivy}, + IS_ACTIVE = #{isActive}, IS_DELETE = #{isDelete}, BATCH = #{batch}, MATERIAL_ID = #{materialId}, @@ -151,6 +156,7 @@ PLAN_IN_STATUS = #{planInStatus}, PLAN_IN_CODE = #{planInCode}, MATERIAL_CODE = #{materialCode}, + DETAIL_IN_ID = #{detailInId}, where ID = #{id} From d6de6d9a3816319d59fc999cd165741dfd6ef406 Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 14:46:23 +0800 Subject: [PATCH 21/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=98=8E=E7=BB=86=E5=AE=9E=E4=BE=8B):=20=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/wm/domain/WmsInPlanDetailEntity.java | 102 +++++++++--------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java index 664fb19..f7039ff 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmsInPlanDetailEntity.java @@ -7,105 +7,109 @@ import com.ktg.common.core.domain.BaseEntity; /** * 入库计划明细实体对象 WMS_IN_PLAN_DETAIL_ENTITY - * + * * @author yinjinlu * @date 2024-11-05 */ -public class WmsInPlanDetailEntity extends BaseEntity -{ +public class WmsInPlanDetailEntity extends BaseEntity { private static final long serialVersionUID = 1L; - /** $column.columnComment */ + /** + * $column.columnComment + */ private Long id; - /** 入库计划ID */ + /** + * 入库计划ID + */ @Excel(name = "入库计划ID") - private String planId; + private Long planId; - /** 入库计划明细ID */ + /** + * 入库计划明细ID + */ @Excel(name = "入库计划明细ID") - private String planDetailsId; + private Long planDetailsId; - /** 来源 */ + /** + * 来源 + */ @Excel(name = "来源") private String source; - /** 台账ID */ + /** + * 台账ID + */ @Excel(name = "台账ID") - private String knifeId; + private Long knifeId; - /** 消耗寿命 */ + /** + * 消耗寿命 + */ @Excel(name = "消耗寿命") - private String consumeLife; + private Integer consumeLife; - public void setId(Long id) - { + public void setId(Long id) { this.id = id; } - public Long getId() - { + public Long getId() { return id; } - public void setPlanId(String planId) - { + + public void setPlanId(Long planId) { this.planId = planId; } - public String getPlanId() - { + public Long getPlanId() { return planId; } - public void setPlanDetailsId(String planDetailsId) - { + + public void setPlanDetailsId(Long planDetailsId) { this.planDetailsId = planDetailsId; } - public String getPlanDetailsId() - { + public Long getPlanDetailsId() { return planDetailsId; } - public void setSource(String source) - { + + public void setSource(String source) { this.source = source; } - public String getSource() - { + public String getSource() { return source; } - public void setKnifeId(String knifeId) - { + + public void setKnifeId(Long knifeId) { this.knifeId = knifeId; } - public String getKnifeId() - { + public Long getKnifeId() { return knifeId; } - public void setconsumeLife(String consumeLife) - { + + public void setConsumeLife(Integer consumeLife) { this.consumeLife = consumeLife; } - public String getconsumeLife() - { + 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(); + 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(); } } From 703ca49d2ef4511a21556330246825b1fbd31237 Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 14:46:44 +0800 Subject: [PATCH 22/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=98=8E=E7=BB=86):=20=E5=AE=9E=E4=BD=93=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ktg/mes/wm/domain/WmsInPlanDetails.java | 63 +++++++++++-------- 1 file changed, 38 insertions(+), 25 deletions(-) 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(); } } From 50f96b0bdd5e3ed4388695215de68f564503ea84 Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 17:05:48 +0800 Subject: [PATCH 23/25] =?UTF-8?q?refactor(=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92):=20=E6=96=B0=E5=A2=9E=E5=85=A5=E5=BA=93=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=98=8E=E7=BB=86=E5=AE=9E=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/service/impl/WmsInPlanServiceImpl.java | 88 ++++++++++++------- 1 file changed, 56 insertions(+), 32 deletions(-) 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..cf06451 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,49 @@ 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); } /** * 查询入库计划列表 - * + * * @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 +70,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); + } + } + } } From 1b79b7908202cd6ae1eb44fcd821e10fbb5da8fc Mon Sep 17 00:00:00 2001 From: LJW Date: Fri, 8 Nov 2024 17:08:52 +0800 Subject: [PATCH 24/25] =?UTF-8?q?feat(=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=AE=9E=E4=BE=8B):=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E6=98=8E?= =?UTF-8?q?=E7=BB=86ID=E5=88=A0=E9=99=A4=E3=80=81=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E5=AE=9E=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/mapper/WmsInPlanDetailEntityMapper.java | 15 +++++++++++++++ .../mapper/wm/WmsInPlanDetailEntityMapper.xml | 6 ++++++ 2 files changed, 21 insertions(+) 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 index 345315a..aba0497 100644 --- 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 @@ -65,4 +65,19 @@ public interface WmsInPlanDetailEntityMapper * @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/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml index e542da5..32e445e 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanDetailEntityMapper.xml @@ -113,6 +113,12 @@ + + delete + from WMS_IN_PLAN_DETAIL_ENTITY + where PLAN_DETAILS_ID = #{PlanDetailsId} + + insert into WMS_IN_PLAN_DETAIL_ENTITY( From 3d21743a378433fe2f14803f605d152db53cd024 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Mon, 11 Nov 2024 10:09:04 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=90=8C=E4=B8=80?= =?UTF-8?q?=E5=9B=BE=E5=8F=B7=E7=9A=84=E7=BB=84=E8=A3=85=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95=E5=90=88?= =?UTF-8?q?=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 96 ++++++++++++------- .../ktg/mes/md/mapper/WmsOutPlanMapper.java | 2 + .../ktg/mes/wm/mapper/WmsInPlanMapper.java | 2 + .../ktg/mes/wm/service/IWmsInPlanService.java | 3 + .../wm/service/impl/WmsInPlanServiceImpl.java | 5 + .../resources/mapper/md/WmsOutPlanMapper.xml | 43 +++++++++ .../resources/mapper/wm/WmsInPlanMapper.xml | 49 ++++++++++ 7 files changed, 166 insertions(+), 34 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index d67e6a2..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 @@ -329,6 +329,7 @@ public class BaseKnifeController extends BaseController operLog.setOperParam(json); operLog.setStatus(1); operLog.setOperTime(new Date()); + // 接口返回信息 String msg = "生产准备验证成功!"; // 记录所需物料数量的map @@ -351,6 +352,7 @@ public class BaseKnifeController extends BaseController return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); } + // 查询复合条件的台账 baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setIsLocked(0); List tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); @@ -573,6 +575,7 @@ public class BaseKnifeController extends BaseController 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); @@ -588,6 +591,7 @@ public class BaseKnifeController extends BaseController // 查询工艺bom BaseTechnologyBom technologyBom = new BaseTechnologyBom(); Boolean lockedFlag = false; + // attr4 组装任务所属计划单, 如果为空则是手动组装任务不需要锁定 if (zdTask.getAttr4() != null){ lockedFlag = true; technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4()); @@ -595,15 +599,19 @@ public class BaseKnifeController extends BaseController technologyBom.setFigureCode(zdTask.getCode()); } - // 出库基础物料 - WmsOutPlan outPlan = new WmsOutPlan(); - outPlan.setPlanCode(technologyBom.getFigureCode()); - outPlan.setWmsBusinessTypeId(12L); - outPlan.setPlanState("1"); - outPlan.setPlanType("ZDCK"); - outPlan.setCreateBy(getUsername()); - outPlan.setCreateTime(DateUtils.getNowDate()); - wmsOutPlanMapper.insertWmsOutPlan(outPlan); + // 出库基础物料, 根据图号查询出库计划,如果不存在生成计划,存在则往计划中添加任务 + 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; @@ -621,6 +629,7 @@ public class BaseKnifeController extends BaseController baseKnife.setStandardQuantity("1"); baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); + // 判断是否需要锁定整刀 if (lockedFlag) { baseKnife.setIsLocked(1); baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); @@ -661,7 +670,7 @@ public class BaseKnifeController extends BaseController wmsOutPlanDetailList.add(outPlanDetail); } - // 锁定物料 + // 锁定基础 物料 int bomCount = mbbProduBom.getStandardDosage(); for (BaseKnife wmsBaseKnife : baseKnifeList){ if (bomCount > 0){ @@ -673,6 +682,7 @@ public class BaseKnifeController extends BaseController baseKnifeListOutPlan.add(wmsBaseKnife); baseKnifeService.updateBaseKnife(wmsBaseKnife); bomCount--; + // 记录刀片重置次数 resetCount += wmsBaseKnife.getResetCount(); } } @@ -699,11 +709,12 @@ 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()); @@ -726,29 +737,46 @@ public class BaseKnifeController extends BaseController mdItemService.updateMdItem(mdItem); } - // 整刀入库计划 - WmsInPlan wmsInPlan = new WmsInPlan(); - wmsInPlan.setState("1"); - wmsInPlan.setSourceType("SGLR"); - wmsInPlan.setCellCode(zdTask.getAttr3()); - wmsInPlan.setPlanCode(technologyBom.getFigureCode()); - wmsInPlan.setRelBillCode("组装单据"); - wmsInPlan.setPlanTypeId("13"); - 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(batchNum); - 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()); 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/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/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/WmsInPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmsInPlanServiceImpl.java index cf06451..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 @@ -42,6 +42,11 @@ public class WmsInPlanServiceImpl implements IWmsInPlanService { return wmsInPlanMapper.selectWmsInPlanByPlanId(planId); } + @Override + public WmsInPlan selectWmsInPlanByPlanCode(String planCode) { + return wmsInPlanMapper.selectWmsInPlanByPlanCode(planCode); + } + /** * 查询入库计划列表 * diff --git a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml index 85e0494..9f2c617 100644 --- a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml @@ -390,4 +390,47 @@ FROM WMS_OUT_PLAN_DETAIL WHERE WMS_OUT_PLAN_DETAIL_ID = #{wmsOutPlanDetailId}; + + \ 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 c5e3695..e18c73a 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsInPlanMapper.xml @@ -175,6 +175,55 @@ where a.PLAN_ID = #{planId} + + insert into WMS_IN_PLAN