From 737c8dd0f86a57edfb4ac07f998ddbe3bf44d15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Sun, 26 May 2024 16:53:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(dqbom):=20=E8=B0=83=E6=95=B4=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/api/user/DQBomApi.java | 2 +- .../bomnew/pojo/vo/QueryMaterialsVO.java | 56 +++++++++++++++++++ .../product/bomnew/service/DQBomService.java | 4 +- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/QueryMaterialsVO.java diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java index 564e2179..26144656 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/DQBomApi.java @@ -256,7 +256,7 @@ public class DQBomApi extends BaseApi { */ @PostMapping("queryMaterials") @ApiOperation("批量查询物料信息") - public ResultVO> queryMaterials(@Valid @RequestBody @NotEmpty List query) { + public ResultVO> queryMaterials(@Valid @RequestBody @NotEmpty List query) { return ResultVO.success(dQBomService.queryMaterials(query)); } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/QueryMaterialsVO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/QueryMaterialsVO.java new file mode 100644 index 00000000..16a738c9 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/vo/QueryMaterialsVO.java @@ -0,0 +1,56 @@ +package com.nflg.product.bomnew.pojo.vo; + +import com.nflg.product.base.core.conmon.util.SessionUtil; +import com.nflg.product.bomnew.constant.EBomStatusEnum; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +/** + * @author 曹鹏飞 + * @date 2024/5/26 16:38:29 + */ +@Data +@Accessors(chain = true) +public class QueryMaterialsVO extends BaseMaterialVO implements Serializable { + + /** + * 设计人员名称 + */ + @ApiModelProperty(value = "设计人员名称") + private String deviseName = SessionUtil.getRealName(); + + /** + * 设计维护部门名称 + */ + @ApiModelProperty(value = "设计维护部门名称") + private String deptName = SessionUtil.getFullDeptName(); + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + private LocalDateTime createdTime = LocalDateTime.now(); + + /** + * 修改时间 + */ + @ApiModelProperty(value = "修改时间") + private LocalDateTime modifyTime; + + /** + * 版本过期时间=下个版本的创建时间 + */ + @ApiModelProperty(value = "版本过期时间=下个版本的创建时间") + private LocalDateTime expireEndTime = LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + + /** + * 1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM) + */ + @ApiModelProperty(value = "1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM)99=借用件 100=引用件") + private Integer status = EBomStatusEnum.CHECKED.getValue(); +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java index 5af786c0..a9f69cce 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/DQBomService.java @@ -666,7 +666,7 @@ public class DQBomService { return datas; } - public List queryMaterials(List query) { + public List queryMaterials(List query) { List datas = new ArrayList<>(); List keys = query.stream().map(QueryMaterialsQuery::getMaterialNo) .filter(StrUtil::isNotBlank) @@ -683,6 +683,6 @@ public class DQBomService { if (CollUtil.isNotEmpty(keys)) { datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys)); } - return datas; + return Convert.toList(QueryMaterialsVO.class, datas); } } From 02c7ec9ac3438594ab28c3af28e9507f212d5da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Sun, 26 May 2024 17:23:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(ebom):=20=E8=B0=83=E6=95=B4=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=A7=84=E5=88=99=EF=BC=8C=E5=AF=BC=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8F=AF=E4=BB=A5=E5=88=A0=E9=99=A4=EF=BC=9B?= =?UTF-8?q?=E4=BD=86=E6=98=AF31=E7=A0=81=E4=B8=8B=E7=9A=84=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E5=8C=85=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/EbomApi.java | 10 ++++----- .../service/BomNewEbomParentService.java | 21 +++++++++++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java index 47553ef5..6a949986 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/EbomApi.java @@ -377,7 +377,7 @@ public class EbomApi extends BaseApi { public ResultVO temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { checkDeleteRule(dto); - bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); + bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); return ResultVO.success(temporary); @@ -388,7 +388,7 @@ public class EbomApi extends BaseApi { @LogRecord(success = "Ebom-暂存添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存添加") public ResultVO temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { checkDeleteRule(dto); - bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); + bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); // bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); return ResultVO.success(temporary); @@ -399,7 +399,7 @@ public class EbomApi extends BaseApi { @LogRecord(success = "Ebom-提交添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交添加") public ResultVO submitAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { checkDeleteRule(dto); - bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); + bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent()); return ResultVO.success(bomNewEbomParentService.submit(dto)); } @@ -409,7 +409,7 @@ public class EbomApi extends BaseApi { @LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交") public ResultVO submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { checkDeleteRule(dto); - bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); + bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent()); return ResultVO.success(bomNewEbomParentService.submit(dto)); } @@ -464,7 +464,7 @@ public class EbomApi extends BaseApi { */ @PostMapping("queryMaterials") @ApiOperation("批量查询物料信息") - public ResultVO> queryMaterials(@Valid @RequestBody @NotEmpty List query) { + public ResultVO> queryMaterials(@Valid @RequestBody @NotEmpty List query) { return ResultVO.success(bomNewEbomParentService.queryMaterials(query)); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index ef86e871..be32b7e9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -1980,7 +1980,7 @@ public class BomNewEbomParentService extends ServiceImpl delList) { + public void deleteBomChild(List delList, BomNewEbomParentVO parent) { if (CollUtil.isEmpty(delList)) { return; } @@ -1993,12 +1993,15 @@ public class BomNewEbomParentService extends ServiceImpl delTagList = new ArrayList<>(); //检查原始bom里过来数据是否包含正常数据 - List check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) - && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); - - if (CollUtil.isNotEmpty(check1List)) { - throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以删除 ", StrUtil.join(",", check1List.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList())))); - } + // List check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) + // && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); + // + // if (CollUtil.isNotEmpty(check1List)) { + // throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以删除 ", StrUtil.join(",", check1List.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList())))); + // } + VUtils.isTure(parent.getMaterialNo().startsWith("31") + && delChildList.stream().anyMatch(d -> !Objects.equals(d.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue()))) + .throwMessage("不能删除31码下的虚拟包"); //检查有bom数据关系是否可以删? // List check2List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) @@ -2364,7 +2367,7 @@ public class BomNewEbomParentService extends ServiceImpl queryMaterials(List query) { + public List queryMaterials(List query) { List datas = new ArrayList<>(); List keys = query.stream().map(QueryMaterialsQuery::getMaterialNo) .filter(StrUtil::isNotBlank) @@ -2381,7 +2384,7 @@ public class BomNewEbomParentService extends ServiceImpl