From 9ae1b1484239d31c5bbea65030bd0a706fde9001 Mon Sep 17 00:00:00 2001 From: jing's Date: Sat, 30 Mar 2024 18:56:49 +0800 Subject: [PATCH] =?UTF-8?q?+ebom=E7=BC=96=E8=BE=91=20=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=88=A0=E9=99=A4=E4=B8=8E=E7=BC=96=E8=BE=91=E8=A1=8C?= =?UTF-8?q?=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/EbomApi.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 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 3dd97b1d..a5359725 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 @@ -2,6 +2,7 @@ package com.nflg.product.bomnew.api.user; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.ImmutableList; @@ -34,6 +35,7 @@ import java.io.IOException; import java.util.List; import java.util.Objects; import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; /** @@ -338,7 +340,22 @@ public class EbomApi extends BaseApi { } -//temporary + + void checkDeleteRule(BomNewEBomParentEditDTO dto){ + + if(CollUtil.isNotEmpty(dto.getDelDatas()) && CollUtil.isNotEmpty(dto.getDelDatas())){ + List delList=dto.getDelDatas().stream().map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); + + List dataList=dto.getDelDatas().stream().filter(u-> ObjectUtil.isNotNull(u.getRowId())&& u.getRowId().longValue()>0).map(BomNewEbomParentVO::getRowId).collect(Collectors.toList()); + + //交 删除编辑出现相同(互斥) + List sameList= CollectionUtil.intersection(delList,dataList).stream().collect(Collectors.toList());; + if(CollUtil.isNotEmpty(sameList)){ + VUtils.isTure(true).throwMessage(StrUtil.format("删除数据与编辑数据出现相同行 {}",StrUtil.join(",",sameList))); + } + } + + } @PostMapping("temporary") @@ -346,7 +363,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 temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException { - + checkDeleteRule(dto); bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); return ResultVO.success(bomNewEbomParentService.temporary(dto)); } @@ -355,7 +372,7 @@ public class EbomApi extends BaseApi { @ApiOperation("暂存添加") @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()); return ResultVO.success(bomNewEbomParentService.temporary(dto)); } @@ -364,6 +381,7 @@ public class EbomApi extends BaseApi { @ApiOperation("提交添加") @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()); return ResultVO.success(bomNewEbomParentService.submit(dto)); } @@ -373,6 +391,7 @@ public class EbomApi extends BaseApi { @ApiOperation("提交") @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()); return ResultVO.success(bomNewEbomParentService.submit(dto)); }