From fe1aa26549788679426e5d151c9d00b4f037766a Mon Sep 17 00:00:00 2001 From: LJW Date: Tue, 5 Nov 2024 10:27:38 +0800 Subject: [PATCH 1/5] =?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 70f4f0bb271eecccf96c8e06c84f08d656a13a48 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Tue, 5 Nov 2024 16:07:36 +0800 Subject: [PATCH 2/5] =?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 17e64f7c753bb209e6c4c4f981e183ca78932341 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Tue, 5 Nov 2024 17:17:07 +0800 Subject: [PATCH 3/5] =?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 1ea32ca5e50ecc371733f19f635da8dd8fc1fb33 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Wed, 6 Nov 2024 15:51:45 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=87=86=E5=A4=87=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 77 +++++++++++++++---- .../java/com/ktg/mes/md/domain/BaseKnife.java | 6 +- .../java/com/ktg/mes/md/domain/MdItem.java | 6 +- .../wm/controller/WmsInTaskController.java | 2 +- .../resources/mapper/md/BomRouteMapper.xml | 4 +- .../main/resources/mapper/md/MdItemMapper.xml | 8 +- 6 files changed, 74 insertions(+), 29 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 5526774..6a243fb 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 @@ -306,11 +306,15 @@ public class BaseKnifeController extends BaseController @PostMapping("/open/productionArrangements") @ResponseBody public AjaxResult productionArrangements(@RequestBody String json) { + // 验证请求数据 List technologyBomList = JSON.parseArray(json, BaseTechnologyBom.class); if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) return AjaxResult.error("未检测到工艺bom项"); technologyBomList.forEach(baseTechnologyBom -> baseTechnologyBomService.insertBaseTechnologyBom(baseTechnologyBom)); + // 记录数据修改 + List baseKnifeOriginList = new ArrayList<>(); + // 构建日志 SysOperLog operLog = new SysOperLog(); operLog.setTitle("生产准备"); @@ -340,6 +344,7 @@ public class BaseKnifeController extends BaseController // 台账表中查询工具 :并记录数量 mdItemTemp = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); if (mdItemTemp == null){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("物料台账查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); @@ -358,12 +363,12 @@ public class BaseKnifeController extends BaseController bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); } - BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); if (!bomRoute.getMbbProduBomList().isEmpty()) { @@ -376,6 +381,7 @@ public class BaseKnifeController extends BaseController sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -383,6 +389,7 @@ public class BaseKnifeController extends BaseController if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -393,17 +400,20 @@ public class BaseKnifeController extends BaseController // 判断基础物料是否充足 if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); } } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("暂无记录整刀bom项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); @@ -412,8 +422,16 @@ 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); + // 记录源数据然后锁定 + baseKnifeOriginList.add(item); + item.setPlanSheet(techBom.getTechnologyBomId()); + item.setIsLocked(1); + item.setLockedStartTime(techBom.getLockedStartTime()); + item.setLockedEndTime(techBom.getLockedEndTime()); + baseKnifeService.updateBaseKnife(item); } }); if (knifeCount.get() > 0) { @@ -423,6 +441,7 @@ public class BaseKnifeController extends BaseController List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); @@ -440,6 +459,7 @@ public class BaseKnifeController extends BaseController sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -447,6 +467,7 @@ public class BaseKnifeController extends BaseController if (sitmTempList.size() >= bom.getStandardDosage() * knifeCount.get()){ countMap.put(sitmTempList.get(0).getKnifeCode(), bom.getStandardDosage() * knifeCount.get()); } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); @@ -457,17 +478,20 @@ public class BaseKnifeController extends BaseController // 判断基础物料是否充足 if (sitmTempList.size() < countMap.get(sitmTempList.get(0).getKnifeCode()) && countMap.get(sitmTempList.get(0).getKnifeCode()) > bom.getStandardDosage() * knifeCount.get()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足进行组装工具:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足进行组装工具", bom.getMdItemCode()); } } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("暂无记录整刀bom项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("暂无记录整刀bom项", techBom.getKnifeCode()); } } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("基础物料不足:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("基础物料不足", techBom.getKnifeCode()); @@ -504,6 +528,7 @@ public class BaseKnifeController extends BaseController List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); @@ -511,14 +536,16 @@ public class BaseKnifeController extends BaseController WmsZdTask wmsZdTask = new WmsZdTask(); wmsZdTask.setmProductId(mdItem.getItemId()); - wmsZdTask.setCode(techBom.getProcessCode() + mdItem.getItemCode()); - wmsZdTask.setName(techBom.getProcessName() + "[" + mdItem.getItemName() + "]"); + wmsZdTask.setAttr4(techBom.getTechnologyBomId()); + wmsZdTask.setCode(techBom.getProcessCode()); + wmsZdTask.setName(techBom.getProcessName()); wmsZdTask.setProductIdQty(count); wmsZdTask.setAttr1(bomRouteList.get(0).getBomRouteId()); wmsZdTask.setCreateTime(DateUtils.getNowDate()); zdTaskService.insertWmsZdTask(wmsZdTask); - msg = "生产准备验证成功!已生成组装任务!"; + msg = "生产准备验证成功!缺少物料已生成组装任务!"; } else { + baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); operLog.setJsonResult("缺少BOM项:" + techBom.getKnifeCode()); operLogService.insertOperlog(operLog); return AjaxResult.error("缺少BOM项", techBom.getKnifeCode()); @@ -541,10 +568,8 @@ 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(); @@ -561,8 +586,19 @@ public class BaseKnifeController extends BaseController List wmsOutPlanDetailList = new ArrayList<>(); List baseKnifeListOutPlan = new ArrayList<>(); + // 查询工艺bom + BaseTechnologyBom technologyBom = new BaseTechnologyBom(); + if (zdTask.getAttr4() != null){ + technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4()); + } else { + technologyBom.setFigureCode(zdTask.getCode()); + technologyBom.setLockedStartTime(DateUtils.getNowDate()); + technologyBom.setLockedEndTime(DateUtils.getNowDate()); + } + + // 出库基础物料 WmsOutPlan outPlan = new WmsOutPlan(); - outPlan.setPlanCode(zdTask.getCode()); + outPlan.setPlanCode(technologyBom.getFigureCode()); outPlan.setWmsBusinessTypeId(12L); outPlan.setPlanState("1"); outPlan.setPlanType("ZDCK"); @@ -573,6 +609,7 @@ public class BaseKnifeController extends BaseController // 锁定物料 Boolean outPlanFlag = true; for (int i = 0; i < zdTask.getProductIdQty(); i++) { + // 构建整刀 BaseKnife baseKnife = new BaseKnife(); MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); baseKnife.setMbbBdMrlId(zdTask.getmProductId()); @@ -581,17 +618,20 @@ public class BaseKnifeController extends BaseController baseKnife.setKnifeUnit(mdItem.getUnitName()); baseKnife.setKnifeType(mdItem.getItemTypeName()); baseKnife.setAreaCode(zdTask.getAttr3()); - baseKnife.setSafeStock(mdItem.getMinStock().toString().split("\\.")[0]); + baseKnife.setSafeStock(mdItem.getMinStock()); baseKnife.setStandardQuantity("1"); baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); - baseKnife.setIsLocked(0); - baseKnife.setPlanSheet(planSheet); + baseKnife.setIsLocked(1); + baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); + baseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); + baseKnife.setPlanSheet(zdTask.getAttr4()); baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setCreateBy(getUsername()); baseKnife.setCreateTime(DateUtils.getNowDate()); baseKnifeService.insertBaseKnife(baseKnife); + // 锁定物料 int resetCount = 0; for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) { baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId()); @@ -599,6 +639,7 @@ public class BaseKnifeController extends BaseController baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); if (outPlanFlag) { + // 出库任务 MdItem mdItemOutPlan = mdItemService.selectMdItemById(mbbProduBom.getMdItemId()); WmsOutPlanDetail outPlanDetail = new WmsOutPlanDetail(); outPlanDetail.setWmsOutPlanId(outPlan.getWmsOutPlanId()); @@ -617,13 +658,14 @@ public class BaseKnifeController extends BaseController wmsOutPlanDetailList.add(outPlanDetail); } + // 锁定物料 int bomCount = mbbProduBom.getStandardDosage(); for (BaseKnife wmsBaseKnife : baseKnifeList){ if (bomCount > 0){ wmsBaseKnife.setIsLocked(1); wmsBaseKnife.setKnifeFineState(2); - wmsBaseKnife.setLockedStartTime(new Date()); - wmsBaseKnife.setLockedEndTime(new Date()); + wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); + wmsBaseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); wmsBaseKnife.setAttr1(baseKnife.getBaseKnifeId()); baseKnifeListOutPlan.add(wmsBaseKnife); baseKnifeService.updateBaseKnife(wmsBaseKnife); @@ -633,15 +675,18 @@ public class BaseKnifeController extends BaseController } } + // 更新重置次数 outPlanFlag = false; baseKnife.setResetCount(resetCount); baseKnifeService.updateBaseKnife(baseKnife); } + // 出库 int i = 0; for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){ wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail); + // 出库计划明细 for (int j = 0; j < outPlanDetail.getPlannedQuantity(); j++) { WmsOutPlanDetailEntity wmsOutPlanDetailEntity = new WmsOutPlanDetailEntity(); wmsOutPlanDetailEntity.setBaseKnifeId(baseKnifeListOutPlan.get(i++).getBaseKnifeId()); @@ -651,6 +696,7 @@ public class BaseKnifeController extends BaseController wmsOutPlanDetailEntityMapper.insertWmsOutPlanDetailEntity(wmsOutPlanDetailEntity); } + // 出库任务 WmsOutTask wmsOutTask = new WmsOutTask(); wmsOutTask.setWmsOutPlanId(outPlan.getWmsOutPlanId()); wmsOutTask.setWmsOutPlanCode(outPlan.getPlanCode()); @@ -672,17 +718,19 @@ public class BaseKnifeController extends BaseController wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); } + // 整刀入库计划 Random random = new Random(); WmsInPlan wmsInPlan = new WmsInPlan(); wmsInPlan.setState("1"); wmsInPlan.setSourceType("SGLR"); wmsInPlan.setCellCode(zdTask.getAttr3()); - wmsInPlan.setPlanCode(zdTask.getCode() + random.nextInt(100)); + wmsInPlan.setPlanCode(technologyBom.getFigureCode()); wmsInPlan.setRelBillCode("组装单据"); wmsInPlan.setPlanTypeId("13"); wmsInPlan.setCreateBy(getUsername()); wmsInPlan.setCreateTime(DateUtils.getNowDate()); + // 入库任务明细 List wmsInPlanDetailsList = new ArrayList<>(); WmsInPlanDetails wmsInPlanDetails = new WmsInPlanDetails(); wmsInPlanDetails.setMaterialId(zdTask.getmProductId().toString()); @@ -695,6 +743,7 @@ public class BaseKnifeController extends BaseController wmsInPlan.setWmsInPlanDetailsList(wmsInPlanDetailsList); wmsInPlanService.insertWmsInPlan(wmsInPlan); + // 入库任务 MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); WmsInTask wmsInTask = new WmsInTask(); wmsInTask.setPlanInId(wmsInPlan.getPlanId()); @@ -710,9 +759,11 @@ public class BaseKnifeController extends BaseController wmsInTask.setPlanInStatus("1"); wmsInTaskService.insertWmsInTask(wmsInTask); + // 更新数量 mdItem.setStandardNumber(mdItem.getStandardNumber() + zdTask.getProductIdQty()); mdItemService.updateMdItem(mdItem); + // 更新组装任务 zdTask.setStatus("1"); zdTask.setQtyOk(zdTask.getProductIdQty()); zdTaskService.updateWmsZdTask(zdTask); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java index feca504..218a64c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/BaseKnife.java @@ -62,7 +62,7 @@ public class BaseKnife extends BaseEntity { * 安全库存 */ @Excel(name = "安全库存") - private String safeStock; + private Integer safeStock; /** * 标准数量 @@ -262,7 +262,7 @@ public class BaseKnife extends BaseEntity { this.knifeType = knifeType; } - public String getSafeStock() { + public Integer getSafeStock() { return safeStock; } @@ -274,7 +274,7 @@ public class BaseKnife extends BaseEntity { this.itemOrProduct = itemOrProduct; } - public void setSafeStock(String safeStock) { + public void setSafeStock(Integer safeStock) { this.safeStock = safeStock; } 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 4bf9366..e3102a1 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java @@ -34,7 +34,7 @@ public class MdItem extends BaseEntity { private String itemTypeName; private String enableFlag; private String safeStockFlag; - private Double minStock; + private Integer minStock; private Double maxStock; private String highValue; private Integer attr1; @@ -163,11 +163,11 @@ public class MdItem extends BaseEntity { this.safeStockFlag = safeStockFlag; } - public Double getMinStock() { + public Integer getMinStock() { return minStock; } - public void setMinStock(Double minStock) { + public void setMinStock(Integer minStock) { this.minStock = minStock; } 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 b3b9094..e7d9b72 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 @@ -147,7 +147,7 @@ public class WmsInTaskController extends BaseController { baseKnife.setKnifeUnit(mbbBdMrlMitm.getUnitName()); baseKnife.setKnifeType(mbbBdMrlMitm.getItemTypeName()); baseKnife.setAreaCode(wmStorageArea.getAreaCode()); - baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock().toString().split("\\.")[0]); + baseKnife.setSafeStock(mbbBdMrlMitm.getMinStock()); baseKnife.setStandardQuantity("1"); baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); diff --git a/ktg-mes/src/main/resources/mapper/md/BomRouteMapper.xml b/ktg-mes/src/main/resources/mapper/md/BomRouteMapper.xml index 7dcaaf1..69565e3 100644 --- a/ktg-mes/src/main/resources/mapper/md/BomRouteMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/BomRouteMapper.xml @@ -154,9 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into MBB_PRODU_BOM( MBB_PRODU_BOM_ID, BOM_ROUTE_ID, MD_ITEM_ID, MD_ITEM_NAME, MD_ITEM_CODE, MD_ITEM_UNIT, STANDARD_DOSAGE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values + insert into MBB_PRODU_BOM( BOM_ROUTE_ID, MD_ITEM_ID, MD_ITEM_NAME, MD_ITEM_CODE, MD_ITEM_UNIT, STANDARD_DOSAGE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values - ( #{item.mbbProduBomId}, #{item.bomRouteId}, #{item.mdItemId}, #{item.mdItemName}, #{item.mdItemCode}, #{item.mdItemUnit}, #{item.standardDosage}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + ( #{item.bomRouteId}, #{item.mdItemId}, #{item.mdItemName}, #{item.mdItemCode}, #{item.mdItemUnit}, #{item.standardDosage}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index a6ee012..2aa8d4e 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -187,9 +187,6 @@ min_stock, - - max_stock, - high_value, @@ -239,12 +236,9 @@ #{enableFlag}, #{safeStockFlag}, - + #{minStock}, - - #{maxStock}, - #{highValue}, From 0c6e34b6c39b8596fe62888d9e2f3e704239c4e0 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 09:52:54 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 2 +- ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml | 8 ++++---- ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml | 8 ++++---- 3 files changed, 9 insertions(+), 9 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 6a243fb..ccf6231 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 @@ -507,7 +507,7 @@ public class BaseKnifeController extends BaseController List bomList; for (BaseTechnologyBom techBom : technologyBomList){ mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); - count = techBom.getKnifeCount(); + count = techBom.getKnifeCount() - countMap.get(techBom.getKnifeCode()); // 先从台账表找 baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId()); diff --git a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index 2aa8d4e..db0ad4f 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -245,10 +245,10 @@ #{remark}, - + #{attr1}, - + #{attr2}, @@ -314,10 +314,10 @@ remark = #{remark}, - + attr1=#{attr1}, - + attr2=#{attr2}, diff --git a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml index f47a689..85e0494 100644 --- a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml @@ -344,13 +344,13 @@ - insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, + insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values - (#{item.wmsOutPlanDetailId}, #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName}, + ( #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName}, #{item.mdItemUnit}, #{item.plannedQuantity}, #{item.realQuantity}, #{item.detailBatchNum}, #{item.wmStorageAreaId}, #{item.wmStorageAreaCode}, #{item.wmStorageAreaName}, #{item.detailState}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, @@ -360,12 +360,12 @@ - insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, + insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) - values (#{wmsOutPlanDetailId}, #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName}, + values ( #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName}, #{mdItemUnit}, #{plannedQuantity}, #{realQuantity}, #{detailBatchNum}, #{wmStorageAreaId}, #{wmStorageAreaCode}, #{wmStorageAreaName}, #{detailState}, #{remark}, #{attr1}, #{attr2}, #{attr3}, #{attr4}, #{createBy},