From 00c1c1e30f7c40ef0724efd23e9e04fdfbc15a36 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, 24 Feb 2025 14:44:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jhgk/impl/YdjhImportNewService.java | 121 +++++++++--------- 1 file changed, 57 insertions(+), 64 deletions(-) diff --git a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportNewService.java b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportNewService.java index 4f61666..7d8ce0b 100644 --- a/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportNewService.java +++ b/src/main/java/com/dsic/gj_erp/service/jhgk/impl/YdjhImportNewService.java @@ -75,18 +75,21 @@ public class YdjhImportNewService extends ServiceImpl{ - item.set二跨面板板数(size+""); + item.set一垮龙门板数(size+""); 板数.addAndGet(size); }); + item.set一垮数控板数("0"); this.getBomSize(item, "8",(size)->{ - item.set二跨面板板数(size+""); + item.set一垮数控板数(size+""); 板数.addAndGet(size); }); } if (item.get切割完成2() != null) { + item.set二跨面板板数("0"); this.getBomSize(item, "5",(size)->{ item.set二跨面板板数(size+""); 板数.addAndGet(size); @@ -110,23 +113,27 @@ public class YdjhImportNewService extends ServiceImpl{ - item.set三跨平铁板数(size.toString()); + atomicInteger.addAndGet(size); + 板数.addAndGet(size); + }); + this.getBomSize(item, "13", (size)->{ + atomicInteger.addAndGet(size); 板数.addAndGet(size); }); + item.set三跨平铁板数(atomicInteger.toString()); } - if(item.get曲平铁曲完成()!=null){ - this.getBomSize(item, "13", 板数::addAndGet); - } - - if (item.get切割完成5() != null) { + if (item.get切割完成5() != null||item.get三跨数控板数()!=null) { + item.set三跨数控板数("0"); this.getBomSize(item, "14",(size)->{ item.set三跨数控板数(size+""); 板数.addAndGet(size); @@ -134,6 +141,7 @@ public class YdjhImportNewService extends ServiceImpl{ item.set四区腹板板数(size+""); 板数.addAndGet(size); @@ -148,16 +156,13 @@ public class YdjhImportNewService extends ServiceImpl{ - atomicInteger.addAndGet(size); - 板数.addAndGet(size); - }); + item.set四区数控板数("0"); item.set四区数控板数(atomicInteger.toString()); } - if(item.get光电完成()!=null){ - this.getBomSize(item, "17", 板数::addAndGet); - } +// if(item.get光电完成()!=null){ +// this.getBomSize(item, "17", 板数::addAndGet); +// } item.set板数(板数.toString()); }); @@ -270,20 +275,16 @@ public class YdjhImportNewService extends ServiceImpl { ydjhs.forEach(ydjh->{ - DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get曲平铁曲完成()); + DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成4()); dmYdjh.setId(ydjh.getId()); updateList.add(dmYdjh); }); }); } - if (item.get切割完成5() != null) { + if (item.get切割完成5() != null||item.get三跨数控板数()!=null) { Optional.ofNullable(collect.get("14")).ifPresent(ydjhs -> { ydjhs.forEach(ydjh->{ DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成5()); @@ -312,14 +313,6 @@ public class YdjhImportNewService extends ServiceImpl { - ydjhs.forEach(ydjh->{ - DmYdjh dmYdjh = this.updateYdjh(item.get上料完成(),item.get抛丸完成(),item.get切割完成7()); - dmYdjh.setId(ydjh.getId()); - updateList.add(dmYdjh); - }); - }); } if(item.get光电完成()!=null){ @@ -335,6 +328,8 @@ public class YdjhImportNewService extends ServiceImpl updateData(LambdaQueryWrapper wrapper, Consumer handler) { @@ -516,7 +509,7 @@ public class YdjhImportNewService extends ServiceImpl { redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_13",boms.size()); boms.forEach(bom -> { DmSygdMx dmSygdMx = new DmSygdMx(); dmSygdMx.setDcCh(item.getDcCh()); dmSygdMx.setDcPl(item.getDcPl()); - dmSygdMx.setQgrq(item.get曲平铁曲完成()); + dmSygdMx.setQgrq(item.get切割完成4()); dmSygdMx.setQbs("1"); - dmSygdMx.setQjgrq(item.get曲外板曲完成()); - dmSygdMx.setJssj(item.getQfxqrqxz()); + dmSygdMx.setQjgrq(item.get曲平铁曲完成()); + dmSygdMx.setJssj(item.get小组配送完成()); dmSygdMx.setGjjsDz(item.getQfxqrqdz()); dmSygdMx.setBomData(bom); addList.add(dmSygdMx); }); }); + } - if (item.get切割完成5() != null) { + if (item.get切割完成5() != null||item.get三跨数控板数()!=null) { Optional.ofNullable(collect.get("14")).ifPresent(boms -> { redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_14",boms.size()); boms.forEach(bom -> { @@ -641,12 +631,28 @@ public class YdjhImportNewService extends ServiceImpl { +// redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_14",boms.size()); +// boms.forEach(bom -> { +// DmSygdMx dmSygdMx = new DmSygdMx(); +// dmSygdMx.setDcCh(item.getDcCh()); +// dmSygdMx.setDcPl(item.getDcPl()); +// dmSygdMx.setQgrq(item.get切割完成5()); +// dmSygdMx.setQbs("1"); +// dmSygdMx.setQjgrq(item.get曲外板曲完成()); +// dmSygdMx.setJssj(item.get小组配送完成()); +// dmSygdMx.setGjjsDz(item.getQfxqrqdz()); +// dmSygdMx.setBomData(bom); +// addList.add(dmSygdMx); +// }); +// }); } if (item.get切割完成6() != null) { @@ -657,7 +663,7 @@ public class YdjhImportNewService extends ServiceImpl { - redisTemplate.opsForHash().put(GJSCGK_BOM_COUNT_KEY+item.getDcCh(), finalDcPl +"_16",boms.size()); - boms.forEach(bom -> { - DmSygdMx dmSygdMx = new DmSygdMx(); - dmSygdMx.setDcCh(item.getDcCh()); - dmSygdMx.setDcPl(item.getDcPl()); - dmSygdMx.setQgrq(item.get切割完成7()); - dmSygdMx.setJssj(item.getQfxqrqxz()); - dmSygdMx.setGjjsDz(item.getQfxqrqdz()); - dmSygdMx.setBomData(bom); - addList.add(dmSygdMx); - }); - }); } if(item.get光电完成()!=null){ @@ -703,7 +696,7 @@ public class YdjhImportNewService extends ServiceImpl Date: Tue, 25 Feb 2025 16:13:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=B8=8A=E6=96=99=E9=A2=84=E5=A4=84=E7=90=86=E5=9E=9B=E4=BD=8D?= =?UTF-8?q?=E5=B1=82=E6=95=B0=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=202.=E5=A2=9E=E5=8A=A0=E5=88=87=E5=89=B2?= =?UTF-8?q?=E5=90=8E=E6=91=86=E6=94=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/zyjh/GetXXXController.java | 35 +++++++++++++++++++ .../controller/zyjh/ZyjhController.java | 11 ++++++ .../service/jcsj/impl/DmDwxxpService.java | 8 +++++ .../resources/mappers/jcsj/DmDwxxpMapper.xml | 5 +++ 4 files changed, 59 insertions(+) create mode 100644 src/main/java/com/dsic/gj_erp/controller/zyjh/GetXXXController.java create mode 100644 src/main/resources/mappers/jcsj/DmDwxxpMapper.xml diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/GetXXXController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/GetXXXController.java new file mode 100644 index 0000000..4d2b7fa --- /dev/null +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/GetXXXController.java @@ -0,0 +1,35 @@ +package com.dsic.gj_erp.controller.zyjh; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.dsic.gj_erp.bean.ResultBean; +import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; +import com.dsic.gj_erp.service.jcsj.impl.DmDwxxpService; +import com.dsic.gj_erp.service.jhgk.DmYdjhLjService; +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("zyjh") +@AllArgsConstructor +public class GetXXXController { + + private final DmDwxxpService dmDwxxpService; + private final DmYdjhLjService ydjhLjService; + + @PostMapping("getYdjhlj") + public ResultBean getYdjhlj(@RequestBody DmYdjhLj lj){ + List list = ydjhLjService.list(Wrappers.lambdaQuery() + .eq(DmYdjhLj::getCzbh, lj.getCzbh()) + .eq(StrUtil.isNotEmpty(lj.getPl()), DmYdjhLj::getPl, lj.getPl()) + ); + return new ResultBean<>(list); + } + + @GetMapping("getBFangDwxx") + public ResultBean getBFangDwxx(){ + return new ResultBean<>(dmDwxxpService.getDwxxForSelect()); + } +} 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 ad349d3..42c9a5a 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 @@ -59,6 +59,17 @@ public class ZyjhController { private final MpDhsjServcie mpDhsjServcie; + /** + * 零件摆放 + * @param list + * @return + */ + @PostMapping("ljbf") + public ResultBean ljbf(@RequestBody List list){ + + return new ResultBean<>(); + } + @GetMapping("getBzryByBz") public ResultBean getBzryByBz(String zyq, String zt){ return new ResultBean<>(zyjhService.getBzryByBz(zyq,zt)); diff --git a/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java b/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java index 819e2d8..c1651ca 100644 --- a/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java +++ b/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java @@ -7,10 +7,17 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Service public class DmDwxxpService extends MppServiceImpl { + public Map> getDwxxForSelect(){ + List list = this.list(); + return list.stream().collect(Collectors.groupingBy(DmDwxxp::getQy)); + } + @Transactional(rollbackFor = Exception.class) public void saveOrEdit(List list){ this.saveOrUpdateBatchByMultiId(list); @@ -18,4 +25,5 @@ public class DmDwxxpService extends MppServiceImpl { public void remove(DmDwxxp dwxxp){ baseMapper.deleteByMultiId(dwxxp); } + } diff --git a/src/main/resources/mappers/jcsj/DmDwxxpMapper.xml b/src/main/resources/mappers/jcsj/DmDwxxpMapper.xml new file mode 100644 index 0000000..68696b6 --- /dev/null +++ b/src/main/resources/mappers/jcsj/DmDwxxpMapper.xml @@ -0,0 +1,5 @@ + + + + + From c0994e8f46c5e6e6fb30abcdca1c9e2cc8418ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Fri, 28 Feb 2025 09:28:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E4=BF=AE=E6=AD=A3=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E4=B8=8A=E6=96=99=E9=A2=84=E5=A4=84=E7=90=86=E5=9E=9B=E4=BD=8D?= =?UTF-8?q?=E5=B1=82=E6=95=B0=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=202.=E5=A2=9E=E5=8A=A0=E5=88=87=E5=89=B2?= =?UTF-8?q?=E5=90=8E=E6=91=86=E6=94=BE=E5=8A=9F=E8=83=BD=203.=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=8F=AD=E7=BB=84=E4=BA=BA=E5=91=98=E8=81=8C=E4=BD=8D?= =?UTF-8?q?=E4=B8=BA=E5=88=92=E7=BA=BF=E6=97=B6=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=204.=E4=BD=9C=E4=B8=9A=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=BF=E6=95=B0=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=A5=97=E6=96=99=E5=9B=BE=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/dsic/gj_erp/bean/jcsj/DmDwxxp.java | 12 +++++------- src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java | 8 ++++++++ .../gj_erp/controller/jcsj/DmDwxxpController.java | 7 +++++-- .../gj_erp/controller/zyjh/DmYppyzController.java | 1 + .../gj_erp/service/jcsj/impl/DmDwxxpService.java | 4 ++-- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/dsic/gj_erp/bean/jcsj/DmDwxxp.java b/src/main/java/com/dsic/gj_erp/bean/jcsj/DmDwxxp.java index 3e80c66..3f3eb66 100644 --- a/src/main/java/com/dsic/gj_erp/bean/jcsj/DmDwxxp.java +++ b/src/main/java/com/dsic/gj_erp/bean/jcsj/DmDwxxp.java @@ -1,5 +1,7 @@ package com.dsic.gj_erp.bean.jcsj; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.github.jeffreyning.mybatisplus.anno.MppMultiId; import lombok.Getter; @@ -15,15 +17,11 @@ import java.io.Serializable; @TableName("dm_dwxxp") public class DmDwxxp implements Serializable { - @MppMultiId + @TableId(type=IdType.AUTO) + private Integer id; + private String dwh;//垛位号 - @MppMultiId private String qy;//区域 - private String dcCh; - - private String dcPl; - - private String dcFd; } diff --git a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java index bd6ad45..06f855e 100644 --- a/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java +++ b/src/main/java/com/dsic/gj_erp/bean/zyjh/DmYppyz.java @@ -31,4 +31,12 @@ public class DmYppyz { private String ppch;//配盘船号 private String ypph;//预配盘号 + + private Integer dwxxId; + + private StatusEnum status=StatusEnum.未设置垛位; + + private enum StatusEnum{ + 未设置垛位,设置垛位,已配送 + } } diff --git a/src/main/java/com/dsic/gj_erp/controller/jcsj/DmDwxxpController.java b/src/main/java/com/dsic/gj_erp/controller/jcsj/DmDwxxpController.java index aed259c..09b82e9 100644 --- a/src/main/java/com/dsic/gj_erp/controller/jcsj/DmDwxxpController.java +++ b/src/main/java/com/dsic/gj_erp/controller/jcsj/DmDwxxpController.java @@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Map; +import java.util.Optional; @RestController @RequestMapping("dwxx") @@ -24,13 +25,15 @@ public class DmDwxxpController { @PostMapping("addOrEdit") public ResultBean add(@RequestBody Map> map){ try { - dwxxpService.saveOrEdit(map.get("add")); + Optional.ofNullable(map.get("add")).ifPresent(item->{ + item.forEach(dwxxpService::save); + }); dwxxpService.saveOrEdit(map.get("edit")); }catch (Exception e){ throw new RuntimeException("同一个区域存在相同垛位号,禁止保存"); } if (map.get("remove")!=null&& !map.get("remove").isEmpty()){ - map.get("remove").forEach(dwxxpService::deleteByMultiId); + map.get("remove").forEach(dwxxpService::removeById); } return new ResultBean<>(); diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java index 976dff4..c77d1fe 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/DmYppyzController.java @@ -47,6 +47,7 @@ public class DmYppyzController { public ResultBean list(@RequestBody DmYppyz entity){ List list = service.list(Wrappers.lambdaQuery() .eq(StrUtil.isNotEmpty(entity.getDcCh()), DmYppyz::getDcCh, entity.getDcCh()) + .eq(StrUtil.isNotEmpty(entity.getDcPl()), DmYppyz::getDcPl, entity.getDcPl()) ); return new ResultBean<>(list); } diff --git a/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java b/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java index c1651ca..fa0e4eb 100644 --- a/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java +++ b/src/main/java/com/dsic/gj_erp/service/jcsj/impl/DmDwxxpService.java @@ -20,10 +20,10 @@ public class DmDwxxpService extends MppServiceImpl { @Transactional(rollbackFor = Exception.class) public void saveOrEdit(List list){ - this.saveOrUpdateBatchByMultiId(list); + this.saveOrUpdateBatch(list); } public void remove(DmDwxxp dwxxp){ - baseMapper.deleteByMultiId(dwxxp); + baseMapper.deleteById(dwxxp); } }