From a4f400159ed24749577c55c886329d9f9a3e03c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Tue, 24 Jun 2025 11:17:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1.=E6=9D=90=E8=B4=A8=E8=AF=81=E4=BB=B6?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=AD=A3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E9=98=B2=E6=AD=A2=E6=9C=AA=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E9=85=8D=E5=A5=97=E8=A1=A8=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E5=B7=A5=E5=AF=BC=E8=87=B4=E6=9D=90=E8=B4=A8=E8=AF=81=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E9=97=AE=E9=A2=98=202.=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=88=87=E5=89=B2=E6=8A=A5=E5=B7=A5=E9=9B=B6=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=80=BB=E8=BE=91=E5=85=BC=E5=AE=B9=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E4=BD=9C=E4=B8=9A=E6=8A=A5=E5=B7=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81,=E9=98=B2=E6=AD=A2=E7=9B=B4=E6=8E=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AF=BC=E8=87=B4=E6=8A=A5=E5=B7=A5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java | 21 ++++++-- .../controller/zyjh/ZyjhController.java | 50 ++++++++++++------- .../dsic/gj_erp/service/zyjh/ZyjhService.java | 29 ++++++++--- 3 files changed, 71 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java b/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java index 971273f..b7d9dda 100644 --- a/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java +++ b/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java @@ -350,11 +350,24 @@ public class DmYdjhLj implements Serializable { return !"03".equals(this.pkZt)||!"03".equals(this.qjgZt)||!"03".equals(this.dmZt); } + //报工检测 + public boolean checkZtBg(){ + return "03".equals(this.pkZt)||"03".equals(this.qjgZt)||"03".equals(this.dmZt); + } + public void updateZtWithDb(DmYdjhLj dbLj){ + this.setId(dbLj.getId()); + this.setDmZt(dbLj.getDmZt()); + this.setPkZt(dbLj.getPkZt()); + this.setQjgZt(dbLj.getQjgZt()); + this.setPpzt(dbLj.getPpzt()); + } - - - - + public boolean tmpEq(DmYdjhLj lj){ + return lj.getCzbh().equals(this.czbh) + &&lj.getPl().equals(this.pl) + &&lj.getTlth().equals(this.tlth) + &&lj.getLjbh().equals(this.ljbh); + } } diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index e7930e2..20f5056 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -291,6 +291,36 @@ public class ZyjhController { return new ResultBean<>(); } + @PostMapping("sdtbczzj") + public ResultBean sdTbCzzj(@RequestBody List list){ + ArrayList mpDhsjSaveList = new ArrayList<>(); + list.forEach(item-> zlgzCreate(item,mpDhsjSaveList)); + mpDhsjServcie.saveBatch(mpDhsjSaveList); + return new ResultBean<>(); + } + + private void zlgzCreate(DmYdjh item,ArrayList mpDhsjSaveList){ + List ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh()); + Map mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh()); + //质量跟踪数据 + List collect = new ArrayList<>(); + String date = DateUtil.date().toString("yyyy/MM/dd"); + String mpDhsjDhh = zyjhService.getMpDhsjDhh(); + for (int j = 0; j < ljList.size(); j++) { + DmYdjhLj item2 = ljList.get(j); + if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用 + MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph()); + String xh = StrUtil.padPre(j + 1 + "", 3, "0"); + mpDhsj.setDhh(mpDhsjDhh+"-"+xh); + if (ObjUtil.isNotEmpty(mpsycljljbp)) { + mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3")); + } + collect.add(mpDhsj); + mpDhsjSaveList.add(mpDhsj); + } + } + } + /** * 作业计划执行,派工&反馈 */ @@ -365,8 +395,6 @@ public class ZyjhController { updateYlList.add(dmYlInfo); } } - //生成零件信息 - List ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh()); //临时使用异常捕获,防止生产未更新余料库存表导致无法正常切割报工 try { @@ -396,24 +424,8 @@ public class ZyjhController { continue; } - Map mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh()); //质量跟踪数据 - List collect = new ArrayList<>(); - String date = DateUtil.date().toString("yyyy/MM/dd"); - String mpDhsjDhh = zyjhService.getMpDhsjDhh(); - for (int j = 0; j < ljList.size(); j++) { - DmYdjhLj item2 = ljList.get(j); - if (StrUtil.isNotEmpty(item.getSllph())){//兼容没有炉批号的老数据用 - MpDhsj mpDhsj = MpDhsj.of(item2, date, item.getSllph()); - String xh = StrUtil.padPre(j + 1 + "", 3, "0"); - mpDhsj.setDhh(mpDhsjDhh+"-"+xh); - if (ObjUtil.isNotEmpty(mpsycljljbp)) { - mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3")); - } - collect.add(mpDhsj); - MpDhsjSaveList.add(mpDhsj); - } - } + zlgzCreate(item,MpDhsjSaveList); } mpDhsjServcie.saveBatch(MpDhsjSaveList); diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java index 5dda61d..d8430fa 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java @@ -33,7 +33,6 @@ import org.springframework.transaction.annotation.Transactional; import java.io.File; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; import java.util.stream.Collectors; @Service @@ -175,12 +174,30 @@ public class ZyjhService extends ServiceImpl { } }); - ljService.remove(Wrappers.lambdaQuery() - .eq(DmYdjhLj::getCzbh,dcCh) - .eq(DmYdjhLj::getPl,dcPl) - .eq(DmYdjhLj::getTlth,tzbh) + //如果零件已报工,不可以删除,取消整图删除零件,改为修正 + List list = ljService.list(Wrappers.lambdaQuery() + .eq(DmYdjhLj::getCzbh, dcCh) + .eq(DmYdjhLj::getPl, dcPl) + .eq(DmYdjhLj::getTlth, tzbh) ); - ljService.saveBatch(ljInfo); + if (!list.isEmpty()){ + list.forEach(item->{ + ljInfo.forEach(lj->{ + if (lj.tmpEq(item)){ + //修正零件状态信息 + lj.updateZtWithDb(item); + } + }); + }); + ljService.saveOrUpdateBatch(ljInfo); + }else{ + ljService.remove(Wrappers.lambdaQuery() + .eq(DmYdjhLj::getCzbh,dcCh) + .eq(DmYdjhLj::getPl,dcPl) + .eq(DmYdjhLj::getTlth,tzbh) + ); + ljService.saveBatch(ljInfo); + } return ljInfo; } From 935c2d39e965eb53d47bf7716a118f5791c89076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Tue, 24 Jun 2025 19:34:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.=E6=9D=90=E8=B4=A8=E8=AF=81=E4=BB=B6?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=AD=A3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E9=98=B2=E6=AD=A2=E6=9C=AA=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E9=85=8D=E5=A5=97=E8=A1=A8=E6=97=B6=E6=8A=A5?= =?UTF-8?q?=E5=B7=A5=E5=AF=BC=E8=87=B4=E6=9D=90=E8=B4=A8=E8=AF=81=E4=BB=B6?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E9=97=AE=E9=A2=98=202.=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=88=87=E5=89=B2=E6=8A=A5=E5=B7=A5=E9=9B=B6=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=80=BB=E8=BE=91=E5=85=BC=E5=AE=B9=E5=90=8E=E7=BB=AD?= =?UTF-8?q?=E9=9B=B6=E4=BB=B6=E4=BD=9C=E4=B8=9A=E6=8A=A5=E5=B7=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81,=E9=98=B2=E6=AD=A2=E7=9B=B4=E6=8E=A5=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=AF=BC=E8=87=B4=E6=8A=A5=E5=B7=A5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java | 3 +++ .../dsic/gj_erp/controller/zyjh/ZyjhController.java | 11 +++++++++-- .../com/dsic/gj_erp/service/zyjh/ZyjhService.java | 5 +++++ src/main/resources/mappers/jhgk/DmYdjhMapper.xml | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java b/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java index b7d9dda..0188383 100644 --- a/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java +++ b/src/main/java/com/dsic/gj_erp/bean/jhgk/DmYdjhLj.java @@ -345,6 +345,8 @@ public class DmYdjhLj implements Serializable { private String ypph; @TableField(exist = false) private String yzkw; + @TableField(exist = false) + private String sllph; public boolean checkZt(){ return !"03".equals(this.pkZt)||!"03".equals(this.qjgZt)||!"03".equals(this.dmZt); @@ -367,6 +369,7 @@ public class DmYdjhLj implements Serializable { return lj.getCzbh().equals(this.czbh) &&lj.getPl().equals(this.pl) &&lj.getTlth().equals(this.tlth) + &&lj.getLjbh()!=null &&lj.getLjbh().equals(this.ljbh); } diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 20f5056..267b053 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -302,8 +302,16 @@ public class ZyjhController { private void zlgzCreate(DmYdjh item,ArrayList mpDhsjSaveList){ List ljList = zyjhService.createLj(item.getDcCh(), item.getDcPl(), item.getTzbh()); Map mpsycljljbp = zyjhService.getMPSYCLJLJBP(item.getDcCh(), item.getTzbh()); + //兼容手动处理没有上料炉批号的问题 + if (StrUtil.isEmpty(item.getSllph())&&!ljList.isEmpty()){ + item.setSllph(ljList.get(0).getSllph()); + } + mpDhsjServcie.remove(Wrappers.lambdaQuery() + .eq(MpDhsj::getDcCh,item.getDcCh()) + .eq(MpDhsj::getDcPl,item.getDcPl()) + .eq(MpDhsj::getDcTh,item.getTzbh()) + ); //质量跟踪数据 - List collect = new ArrayList<>(); String date = DateUtil.date().toString("yyyy/MM/dd"); String mpDhsjDhh = zyjhService.getMpDhsjDhh(); for (int j = 0; j < ljList.size(); j++) { @@ -315,7 +323,6 @@ public class ZyjhController { if (ObjUtil.isNotEmpty(mpsycljljbp)) { mpDhsj.setGysbh("BZGY-"+mpsycljljbp.get("gzzx3")); } - collect.add(mpDhsj); mpDhsjSaveList.add(mpDhsj); } } diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java index d8430fa..5c36377 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java @@ -182,6 +182,11 @@ public class ZyjhService extends ServiceImpl { ); if (!list.isEmpty()){ list.forEach(item->{ + //清理错误数据 + if (StrUtil.isEmpty(item.getLjbh())){ + ljService.removeById(item); + return; + } ljInfo.forEach(lj->{ if (lj.tmpEq(item)){ //修正零件状态信息 diff --git a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml index 69076e7..f5af4e6 100644 --- a/src/main/resources/mappers/jhgk/DmYdjhMapper.xml +++ b/src/main/resources/mappers/jhgk/DmYdjhMapper.xml @@ -902,6 +902,7 @@ REPLACE(CAST(CAST(NEWID()AS BINARY(10)) + CAST(GETDATE() AS BINARY(6)) AS UNIQUEIDENTIFIER),'-','') as id, dm_ydjh.dc_ch as czbh, dm_ydjh.dc_pl as pl, + dm_ydjh.sllph as sllph, dm_bom.fd as fd, dm_ydjh.kw as kw, dm_bom.zl as zl, From 0b00133bb2d14ac30b651d30b5867e4b38c00dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Mon, 30 Jun 2025 18:15:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=B8=8B=E5=8F=91=E5=8A=9F=E8=83=BD,?= =?UTF-8?q?=E4=BB=85=E5=8F=AF=E4=B8=8B=E5=8F=91=E6=9C=AA=E4=B8=8A=E6=96=99?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=9A=84=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java b/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java index 121d215..6927c07 100644 --- a/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java @@ -110,7 +110,7 @@ public class DmYdjhController { List list= service.list(new QueryWrapper() .eq(StrUtil.isNotEmpty(map.get("dcCh")),"dc_ch",map.get("dcCh")) .ge(StrUtil.isNotEmpty(map.get("zt")),"zt",map.get("zt")) - .lt("zt","61") + .lt("zt","11")//仅可下发未上料打印的计划 .ge(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd")) .le(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.endOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd")) .orderByAsc("jssj,dc_ch,dc_pl,zl,lqlb") From d60bbdae095e3dd1ba23d62c9a99410e18d8a95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Mon, 30 Jun 2025 19:40:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=B8=8B=E5=8F=91=E5=8A=9F=E8=83=BD,?= =?UTF-8?q?=E4=BB=85=E5=8F=AF=E4=B8=8B=E5=8F=91=E6=9C=AA=E4=B8=8A=E6=96=99?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E7=9A=84=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dsic/gj_erp/controller/jhgk/DmYdjhController.java | 2 +- .../dsic/gj_erp/service/jhgk/impl/DmYdjhServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java b/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java index 6927c07..7e1fcb1 100644 --- a/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/jhgk/DmYdjhController.java @@ -110,7 +110,7 @@ public class DmYdjhController { List list= service.list(new QueryWrapper() .eq(StrUtil.isNotEmpty(map.get("dcCh")),"dc_ch",map.get("dcCh")) .ge(StrUtil.isNotEmpty(map.get("zt")),"zt",map.get("zt")) - .lt("zt","11")//仅可下发未上料打印的计划 + .lt("zt",11)//仅可下发未上料打印的计划 .ge(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.beginOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd")) .le(StrUtil.isNotEmpty(map.get("yf")), "jssj", DateUtil.endOfMonth(DateUtil.parseDate(map.get("yf"))).toString("yyyy/MM/dd")) .orderByAsc("jssj,dc_ch,dc_pl,zl,lqlb") diff --git a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/DmYdjhServiceImpl.java b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/DmYdjhServiceImpl.java index 3f3f4ef..934254e 100644 --- a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/DmYdjhServiceImpl.java +++ b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/DmYdjhServiceImpl.java @@ -324,9 +324,9 @@ public class DmYdjhServiceImpl extends ServiceImpl impleme DmYdjh dmYdjh = new DmYdjh(); dmYdjh.setId(item.getId()); dmYdjh.setZt("2"); - String perfix=item.getSljhrq().replace("/",""); - perfix=perfix.substring(2); - dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh))); + //String perfix=item.getSljhrq().replace("/",""); + //perfix=perfix.substring(2); + //dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh))); dmYdjh.setGxsj(gxsj); dmYdjh.setPlxh(item.getPlxh()); return dmYdjh;