From b86499121ab85d5ebd86a1ddd6da56a9f2dd80bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Wed, 2 Apr 2025 16:14:45 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E9=A2=84=E9=85=8D=E7=9B=98?= =?UTF-8?q?=E6=91=86=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dsic/gj_erp/bean/zyjh/DmYppyz.java | 4 ++ .../controller/zyjh/ZyjhController.java | 6 ++ .../gj_erp/controller/zyjh/dto/YppDto.java | 37 ++++++++++ .../dsic/gj_erp/service/zyjh/ZyjhService.java | 55 ++++++++------- .../resources/mappers/zyjh/YppyzMapper.xml | 69 +++++++++++-------- 5 files changed, 116 insertions(+), 55 deletions(-) create mode 100644 src/main/java/com/dsic/gj_erp/controller/zyjh/dto/YppDto.java 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 f3ddc9f..39eed75 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 @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; +import com.dsic.gj_erp.bean.jcsj.DmBom; import com.dsic.gj_erp.bean.jhgk.DmYdjh; import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; import lombok.Getter; @@ -50,6 +51,9 @@ public class DmYppyz extends Model { @TableField(exist = false) private List ljList; + @TableField(exist = false) + private List bomList; + public void 设置状态(String name){ this.status=StatusEnum.valueOf(name); } 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 38d9520..cf33cc6 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 @@ -101,6 +101,12 @@ public class ZyjhController { * 零件摆放,预配盘报工 */ @PostMapping("ppBGong") + public ResultBean ppBGong0(@RequestBody List list){ + zyjhService.ppBGong(list); + return new ResultBean<>(); + } + + public ResultBean ppBGong(@RequestBody List ppBGongDtoList){ ppBGongDtoList.forEach(dto->{ if (ObjUtil.isNotEmpty(dto.getLjList())){ diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/YppDto.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/YppDto.java new file mode 100644 index 0000000..0ceff86 --- /dev/null +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/dto/YppDto.java @@ -0,0 +1,37 @@ +package com.dsic.gj_erp.controller.zyjh.dto; + +import com.dsic.gj_erp.bean.jcsj.DmBom; +import com.dsic.gj_erp.bean.jhgk.DmYdjhLj; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class YppDto { + + private String id; + + public String dcCh; + + private String dcPl; + + private String dcFd; + + private String kw; + + private String zl; + + private String tz; + + private String lx; + + private String xj; + + private Integer dwxxId;//配盘原则预设摆放位置信息 + + private List ljList; + + private List bomList; +} 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 95300db..5264733 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 @@ -69,6 +69,10 @@ public class ZyjhService extends ServiceImpl { } } + public void ppBGong(List list){ + ljService.updateBatchById(list); + } + public void ppBGong(List list,String dcCh,String dcPl,String zyq){ ljService.updateBatchById(list); } @@ -165,31 +169,32 @@ public class ZyjhService extends ServiceImpl { ljService.saveBatch(ljInfo); //自动生成无摆放位置的预配盘原则 - Map> collect = ljInfo.stream() - .collect(Collectors - .groupingBy(item -> - item.getCzbh() + " " - + item.getPl() + " " - + item.getFd() + " " - + item.getZl() + " " - + (StrUtil.isNotEmpty(item.getLx())?item.getLx():"") - )); - - collect.keySet().forEach(item -> { - DmYppyz dmYppyz = DmYppyz.of(item); - if (dmYppyz!=null){ - int count = yppyzService.count(Wrappers.lambdaQuery() - .eq(DmYppyz::getDcCh, dmYppyz.getDcCh()) - .eq(DmYppyz::getDcPl, dmYppyz.getDcPl()) - .eq(DmYppyz::getDcFd, dmYppyz.getDcFd()) - .eq(DmYppyz::getZl, dmYppyz.getZl()) - .eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx()) - ); - if (count==0){ - yppyzService.save(dmYppyz); - } - } - }); + //2050401取消配盘原则自动生成功能,改为手动设置 +// Map> collect = ljInfo.stream() +// .collect(Collectors +// .groupingBy(item -> +// item.getCzbh() + " " +// + item.getPl() + " " +// + item.getFd() + " " +// + item.getZl() + " " +// + (StrUtil.isNotEmpty(item.getLx())?item.getLx():"") +// )); +// +// collect.keySet().forEach(item -> { +// DmYppyz dmYppyz = DmYppyz.of(item); +// if (dmYppyz!=null){ +// int count = yppyzService.count(Wrappers.lambdaQuery() +// .eq(DmYppyz::getDcCh, dmYppyz.getDcCh()) +// .eq(DmYppyz::getDcPl, dmYppyz.getDcPl()) +// .eq(DmYppyz::getDcFd, dmYppyz.getDcFd()) +// .eq(DmYppyz::getZl, dmYppyz.getZl()) +// .eq(StrUtil.isNotEmpty(dmYppyz.getLx()),DmYppyz::getLx, dmYppyz.getLx()) +// ); +// if (count==0){ +// yppyzService.save(dmYppyz); +// } +// } +// }); return ljInfo; } diff --git a/src/main/resources/mappers/zyjh/YppyzMapper.xml b/src/main/resources/mappers/zyjh/YppyzMapper.xml index d7d7e18..f5a8fc1 100644 --- a/src/main/resources/mappers/zyjh/YppyzMapper.xml +++ b/src/main/resources/mappers/zyjh/YppyzMapper.xml @@ -2,12 +2,14 @@ - - + + + + @@ -17,42 +19,49 @@ + + + + + +