From 436d6d44808210ded50343c94d8e3f148812c956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 9 Apr 2024 08:43:59 +0800 Subject: [PATCH 01/13] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=9F?= =?UTF-8?q?=E5=A7=8Bbom=E8=BD=ACebom=E5=90=8E=EF=BC=8C=E5=AD=90=E7=BA=A7?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=80=BB=E9=87=8D=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/entity/BomNewOriginalChildEntity.java | 15 +++++++-------- .../service/BomNewOriginalParentService.java | 4 +++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewOriginalChildEntity.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewOriginalChildEntity.java index d2fd6cbc..b403de79 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewOriginalChildEntity.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewOriginalChildEntity.java @@ -1,19 +1,18 @@ package com.nflg.product.bomnew.pojo.entity; -import java.math.BigDecimal; - import cn.hutool.core.util.NumberUtil; -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; -import java.time.LocalDate; /** * t_bom_new_original_child @@ -136,7 +135,7 @@ public class BomNewOriginalChildEntity implements Serializable { private Long bomVersionRowId; public BigDecimal getTotalWeight() { - return NumberUtil.mul(this.getUnitWeight(), this.num); + return NumberUtil.mul(this.unitWeight, this.num); } private static final long serialVersionUID = -61829104329368344L; diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java index 57e95ae5..59259f21 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewOriginalParentService.java @@ -564,7 +564,7 @@ public class BomNewOriginalParentService extends ServiceImpl { syncToFormal(convert.getHasHandlerParentIds()); - },syncOriginalBomToFormalPool ); + }, syncOriginalBomToFormalPool); } //记录子级BOM版本行ID @@ -573,6 +573,8 @@ public class BomNewOriginalParentService extends ServiceImpl Date: Tue, 9 Apr 2024 09:05:26 +0800 Subject: [PATCH 02/13] =?UTF-8?q?fix:=20PBOM=E9=83=BD=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BA=86=EF=BC=8C=E7=8A=B6=E6=80=81=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=88=B7=E6=88=90=E5=B7=B2=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/master/BomNewPbomParentMapper.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml index 536e34ac..274f9130 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomParentMapper.xml @@ -142,7 +142,8 @@ - update t_bom_new_pbom_parent set status=#{status} , release_user_name=#{releaseUserName} , release_time=now() + update t_bom_new_pbom_parent set status=#{status} ,edit_status=3, release_user_name=#{releaseUserName} , + release_time=now() where row_id in #{rowId} From 142b11837fd68f435fbaee513e894cf5b2086208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Tue, 9 Apr 2024 09:54:00 +0800 Subject: [PATCH 03/13] =?UTF-8?q?feat:=20=E4=B8=BA=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=93=E5=AD=98=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/CacheApi.java | 47 +++++++++++++++++++ .../main/resources/bootstrap-prod.properties | 4 +- .../main/resources/bootstrap-sit.properties | 5 +- 3 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java new file mode 100644 index 00000000..7829fda1 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java @@ -0,0 +1,47 @@ +package com.nflg.product.bomnew.api.user; + +import com.nflg.product.base.core.api.BaseApi; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import nflg.product.common.vo.ResultVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.lang.NonNull; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +/** + * @author 曹鹏飞 + * @date 2024/4/9 09:22:09 + */ +@Api(tags = "缓存接口") +@RestController +@RequestMapping("bom/new/cache") +public class CacheApi extends BaseApi { + + private static final String PREFIX = "frontend:"; + + @Autowired + private RedisTemplate redisTemplate; + + @PostMapping("set") + @ApiOperation("设置缓存") + public ResultVO setCache(@Valid @RequestParam @NonNull String key, @Valid @RequestParam @NonNull String content) { + redisTemplate.boundValueOps(PREFIX + key).set(content); + return ResultVO.success(); + } + + @GetMapping("get") + @ApiOperation("获取缓存") + public ResultVO getCache(@Valid @RequestParam @NonNull String key) { + return ResultVO.success(redisTemplate.boundValueOps(PREFIX + key).get()); + } + + @PostMapping("del") + @ApiOperation("删除缓存") + public ResultVO delCache(@Valid @RequestParam @NonNull String key) { + redisTemplate.delete(PREFIX + key); + return ResultVO.success(); + } +} diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-prod.properties b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-prod.properties index bf784475..de276987 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-prod.properties +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-prod.properties @@ -1,12 +1,12 @@ nacos.server-addr=192.168.0.191:8848 - +spring.cache.type=redis spring.redis.database=0 spring.redis.host=192.168.0.191 spring.redis.password= spring.redis.port=6379 spring.redis.timeout=0 spring.redis.ssl=false -spring.redis.lettuce.pool.max-wait=1ms +spring.redis.lettuce.pool.max-wait=-1ms spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.min-idle=0 diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-sit.properties b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-sit.properties index 9137d34c..98ebd6f8 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-sit.properties +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-sit.properties @@ -1,14 +1,13 @@ #nacos.server-addr=114.132.64.230:8123 nacos.server-addr=192.168.0.194:8848 - - +spring.cache.type=redis spring.redis.database=0 spring.redis.host=192.168.0.194 spring.redis.password= spring.redis.port=6379 spring.redis.timeout=0 spring.redis.ssl=false -spring.redis.lettuce.pool.max-wait=1ms +spring.redis.lettuce.pool.max-wait=-1ms spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.min-idle=0 From fb83dca188a0adfd73cd42401d79d781dfbbbd58 Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 9 Apr 2024 16:56:44 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=9B=E5=BB=BAbom?= =?UTF-8?q?=20=E8=AE=BE=E8=AE=A1=E5=A4=8D=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/EbomApi.java | 7 +++-- .../service/BomNewEbomParentService.java | 16 ++++++++++-- .../bomnew/service/domain/EBom/EBomEdit.java | 26 +++++++++++++------ 3 files changed, 35 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 d656043f..2c3d1da6 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 @@ -260,8 +260,7 @@ public class EbomApi extends BaseApi { dto.setRevertUserName(SessionUtil.getUserName()); dto.setUserCode(SessionUtil.getUserCode()); bomNewEbomParentService.revertDesign(dto); - //更新-待复核根节点 - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + return ResultVO.success(true); @@ -367,7 +366,7 @@ public class EbomApi extends BaseApi { checkDeleteRule(dto); bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + return ResultVO.success(temporary); } @@ -378,7 +377,7 @@ public class EbomApi extends BaseApi { checkDeleteRule(dto); bomNewEbomParentService.deleteBomChild(dto.getDelDatas()); BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto); - bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); + // bomNewEbomParentService.getBaseMapper().updateRootForWaitReview(); return ResultVO.success(temporary); } 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 174df938..4022db9a 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 @@ -1174,7 +1174,8 @@ public class BomNewEbomParentService extends ServiceImpl computeLevelNumAndRootState()); + if (eBomEdit.isRootForWaitReview()) { + this.getBaseMapper().updateRootForWaitReview(); + } + + + + BomNewEbomParentVO retParentVO = Convert.convert(BomNewEbomParentVO.class, eBomEdit.getParentEntity()); retParentVO.setBomRowId(retParentVO.getRowId()); @@ -1713,7 +1723,9 @@ public class BomNewEbomParentService extends ServiceImpl parentEntities; @Getter private BomNewEbomParentEntity parentEntity; + @Getter + private boolean isRootForWaitReview=false; public List childEntities; @@ -78,9 +80,16 @@ public class EBomEdit { parent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue()); parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); + boolean isTechnician= SpringUtil.getBean(UserRoleService.class).technician(); + parent.setStatus(isTechnician? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue()); + parent.setCreatedJob(isTechnician? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue()); - parent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue()); - parent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue()); + //工艺人不用更新 + if(isTechnician){ + isRootForWaitReview=false; + }else{ + isRootForWaitReview=true; + } parent.setCreatedTime(LocalDateTime.now()); parent.setModifyTime(LocalDateTime.now()); @@ -125,12 +134,12 @@ public class EBomEdit { }); - if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) { - //工艺人员 - if (roleList.contains(EBomConstant.TECHNICIAN)) { - parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue()); - } - } +// if (Objects.equals(createDTO.getOpType(), EbomEditStatusEnum.HANDLER_FINISHED.getValue())) { +// //工艺人员 +// if (roleList.contains(EBomConstant.TECHNICIAN)) { +// parentEntity.setStatus(EBomStatusEnum.CHECKED.getValue()); +// } +// } childEntities.addAll(updateOrCreateChild(createDTO)); @@ -293,6 +302,7 @@ public class EBomEdit { //rowId is null 必定是未入库作为根 if (dto.getParent().getRowId() == null || dto.getParent().getRowId().longValue() == 0) { createRootBom(dto); + return; } From b65b7edf5130afb3fda5a27b03e31ca3599938d2 Mon Sep 17 00:00:00 2001 From: jing's Date: Tue, 9 Apr 2024 17:39:33 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a5896263..06fc0ee2 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 @@ -1029,7 +1029,7 @@ public class BomNewEbomParentService extends ServiceImpl Date: Tue, 9 Apr 2024 22:22:34 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E9=80=80=E5=9B=9E=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/service/BomNewEbomParentService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 06fc0ee2..ffd7e5d4 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 @@ -1175,7 +1175,7 @@ public class BomNewEbomParentService extends ServiceImpl Date: Wed, 10 Apr 2024 15:02:10 +0800 Subject: [PATCH 07/13] =?UTF-8?q?refactor:=20=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=97=B6=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E5=BC=82=E5=B8=B8=EF=BC=8C=E4=B8=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/EbomApi.java | 4 +- .../base/core/conmon/util/SessionUtil.java | 71 ++++++++++++------- 2 files changed, 47 insertions(+), 28 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 2c3d1da6..20c79012 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 @@ -440,8 +440,8 @@ public class EbomApi extends BaseApi { dto.setRealName("郑军榕"); dto.setDepartName("信息流程中心/IT支持"); dto.setFullDeptName("信息流程中心/IT支持"); - dto.setRowId(1585164668335439881l); - SessionUtil.loginUser.set(dto); + dto.setRowId(1585164668335439881L); + BaseApi.loginUser.set(dto); return ResultVO.success(); } diff --git a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java index 7b60cd73..e833f0bb 100644 --- a/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java +++ b/nflg_project_dev/nflg-boot-base/nflg-boot-core/src/main/java/com/nflg/product/base/core/conmon/util/SessionUtil.java @@ -1,10 +1,12 @@ package com.nflg.product.base.core.conmon.util; -import cn.hutool.core.util.StrUtil; import com.nflg.product.base.core.api.BaseApi; +import com.nflg.product.base.core.exception.NflgBusinessException; +import nflg.product.common.constant.STATE; import nflg.product.common.dto.LoginUserInfoDTO; -import java.util.*; +import java.util.List; +import java.util.Optional; /** * @decription @@ -12,7 +14,7 @@ import java.util.*; * @Date 2022/7/15 9:04 **/ public class SessionUtil { - public static ThreadLocal loginUser= BaseApi.loginUser; + //public static ThreadLocal loginUser= BaseApi.loginUser; /** * 获取登入用户编号 @@ -20,7 +22,8 @@ public class SessionUtil { * @return */ public static Long getRowId() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getRowId).orElse(1585164668335439881L); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getRowId).orElse(1585164668335439881L); + return getUser().getRowId(); } /** @@ -29,7 +32,9 @@ public class SessionUtil { * @return */ public static String getUserCode() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getUserCode).orElse("QHI17062100"); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getUserCode).orElse("QHI17062100"); + return getUser().getUserCode(); + } /** @@ -38,7 +43,8 @@ public class SessionUtil { * @return */ public static String getUserName() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getUserName).orElse("郑军榕"); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getUserName).orElse("郑军榕"); + return getUser().getUserName(); } /** @@ -47,48 +53,61 @@ public class SessionUtil { * @return */ public static Long getPartRowId() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getDepartRowId).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getDepartRowId).orElse(null); + return getUser().getDepartRowId(); } public static String getRealName() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getRealName).orElse("郑军榕"); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getRealName).orElse("郑军榕"); + return getUser().getRealName(); } public static String getDepartName() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getDepartName).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getDepartName).orElse(null); + return getUser().getDepartName(); } public static List getAruList() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getAruList).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getAruList).orElse(null); + return getUser().getAruList(); } // 获取岗位代码 public static Integer getQueryData() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getQueryData).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getQueryData).orElse(null); + return getUser().getQueryData(); } public static String getFullDeptName() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse(null); + return getUser().getFullDeptName(); } - //获取2级部门以下 - public static String getSecondFullDeptName() { - String depName = Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse(""); - - depName= StrUtil.replace(depName,"OU=","").replace("福建南方路面机械有限公司,DC=nflg",""); - List depts = new ArrayList<>(Arrays.asList(StrUtil.split(depName, ","))); - depts.remove(""); - Collections.reverse(depts ); - return StrUtil.join("/",depts); - - - } + // //获取2级部门以下 + // public static String getSecondFullDeptName() { + // String depName = Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getFullDeptName).orElse(""); + // + // depName= StrUtil.replace(depName,"OU=","").replace("福建南方路面机械有限公司,DC=nflg",""); + // List depts = new ArrayList<>(Arrays.asList(StrUtil.split(depName, ","))); + // depts.remove(""); + // Collections.reverse(depts ); + // return StrUtil.join("/",depts); + // + // + // } public static String getLanguage() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getLanguage).orElse(""); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getLanguage).orElse(""); + return getUser().getLanguage(); } public static String getSessionKey() { - return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getSessionKey).orElse(null); + //return Optional.ofNullable(loginUser.get()).map(LoginUserInfoDTO::getSessionKey).orElse(null); + return getUser().getSessionKey(); + } + + private static LoginUserInfoDTO getUser() { + return Optional.ofNullable(BaseApi.loginUser.get()) + .orElseThrow(() -> new NflgBusinessException(STATE.LoginError, "请登录")); } } From 02027ee26decb73d96f9da925b98a7d1a9ab2978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Wed, 10 Apr 2024 15:03:01 +0800 Subject: [PATCH 08/13] =?UTF-8?q?feat:=20=E5=AF=BC=E5=85=A5=E5=8E=9F?= =?UTF-8?q?=E5=A7=8Bbom=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/domain/OriginalBom/PlmBomToOriginalConvert.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OriginalBom/PlmBomToOriginalConvert.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OriginalBom/PlmBomToOriginalConvert.java index 23118d43..0516dcf2 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OriginalBom/PlmBomToOriginalConvert.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/OriginalBom/PlmBomToOriginalConvert.java @@ -152,6 +152,8 @@ public class PlmBomToOriginalConvert extends BaseConvert { originalBom.setLastVersionIs(0); this.resultParent.add(originalBom); handlerChild(parentEntity,originalSourceEnum); + } else { + importErrorResult.add(new ImportOriginalBomVO(parent.getChartNo(), "已忽略,ebom正式表中有相同的数据")); } } } From cdfdb4b0ce79295aceb50bbe8352b81dff64eaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Wed, 10 Apr 2024 15:04:27 +0800 Subject: [PATCH 09/13] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9dev?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-dev.properties | 12 +++++++++++- .../src/main/resources/bootstrap.properties | 2 +- .../nflg-bom-new/src/main/resources/logback-sit.xml | 2 +- .../src/main/resources/bootstrap.properties | 8 +++----- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-dev.properties b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-dev.properties index e6acef83..79e58e6d 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-dev.properties +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap-dev.properties @@ -1,4 +1,14 @@ #nacos.server-addr=114.132.64.230:8123 nacos.server-addr=192.168.0.194:8848 - +spring.cache.type=redis +spring.redis.database=1 +spring.redis.host=192.168.0.194 +spring.redis.password= +spring.redis.port=6379 +spring.redis.timeout=0 +spring.redis.ssl=false +spring.redis.lettuce.pool.max-wait=-1ms +spring.redis.lettuce.pool.max-active=8 +spring.redis.lettuce.pool.max-idle=8 +spring.redis.lettuce.pool.min-idle=0 logging.config=classpath:logback-sit.xml \ No newline at end of file diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap.properties b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap.properties index 82bcabbb..7b3858e8 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap.properties +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/bootstrap.properties @@ -1,5 +1,5 @@ spring.application.name=bom-new -spring.profiles.active=sit +spring.profiles.active=dev spring.jackson.date-format=yyyy-MM-dd HH:mm:ss diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/logback-sit.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/logback-sit.xml index 9127e28e..1dad47bf 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/logback-sit.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/logback-sit.xml @@ -39,7 +39,7 @@ - + diff --git a/nflg_project_dev/nflg-cloud-gateway/src/main/resources/bootstrap.properties b/nflg_project_dev/nflg-cloud-gateway/src/main/resources/bootstrap.properties index 26dd8a3d..97e1f0f9 100644 --- a/nflg_project_dev/nflg-cloud-gateway/src/main/resources/bootstrap.properties +++ b/nflg_project_dev/nflg-cloud-gateway/src/main/resources/bootstrap.properties @@ -3,12 +3,10 @@ spring.application.name=gateway spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.time-zone=GMT+8 server.port=89 - -spring.cloud.nacos.config.namespace=nflg_dev -spring.cloud.nacos.discovery.namespace=nflg_dev +spring.cloud.nacos.config.namespace=nflg +spring.cloud.nacos.discovery.namespace=nflg spring.cloud.nacos.config.file-extension=properties - -nacos.plugin.namespace=nflg_dev +nacos.plugin.namespace=nflg #configuration From a50007a526b09504660e426dfa5f34893ba153f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Wed, 10 Apr 2024 15:05:09 +0800 Subject: [PATCH 10/13] =?UTF-8?q?refactor:=20=E6=8C=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/api/user/CacheApi.java | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java index 7829fda1..bdaafa53 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java @@ -1,14 +1,16 @@ package com.nflg.product.bomnew.api.user; +import cn.hutool.core.util.StrUtil; import com.nflg.product.base.core.api.BaseApi; +import com.nflg.product.base.core.conmon.util.SessionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import nflg.product.common.vo.ResultVO; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.lang.NonNull; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.validation.Valid; /** @@ -22,26 +24,46 @@ public class CacheApi extends BaseApi { private static final String PREFIX = "frontend:"; - @Autowired + @Resource private RedisTemplate redisTemplate; + /** + * 设置用户缓存 + * @param key 缓存key + * @param content 缓存内容 + * @return + */ @PostMapping("set") @ApiOperation("设置缓存") - public ResultVO setCache(@Valid @RequestParam @NonNull String key, @Valid @RequestParam @NonNull String content) { - redisTemplate.boundValueOps(PREFIX + key).set(content); + public ResultVO setCache(@Valid @RequestParam @NonNull String key, @Valid @RequestParam @NonNull String content) { + redisTemplate.boundValueOps(buildKey(key)).set(content); return ResultVO.success(); } + /** + * 获取用户缓存 + * @param key 缓存key + * @return + */ @GetMapping("get") @ApiOperation("获取缓存") - public ResultVO getCache(@Valid @RequestParam @NonNull String key) { - return ResultVO.success(redisTemplate.boundValueOps(PREFIX + key).get()); + public ResultVO getCache(@Valid @RequestParam @NonNull String key) { + return ResultVO.success(redisTemplate.boundValueOps(buildKey(key)).get()); } - @PostMapping("del") + /** + * 删除用户缓存 + * @param key 缓存key + * @return + */ + @DeleteMapping("del") @ApiOperation("删除缓存") - public ResultVO delCache(@Valid @RequestParam @NonNull String key) { - redisTemplate.delete(PREFIX + key); + public ResultVO delCache(@Valid @RequestParam @NonNull String key) { + redisTemplate.delete(buildKey(key)); return ResultVO.success(); } + + private String buildKey(String key) { + return StrUtil.format("{}:{}:{}", PREFIX, SessionUtil.getUserCode(), key); + } } From f1f44b01bda365f37dbb3667292916d2508a1b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 11 Apr 2024 09:24:12 +0800 Subject: [PATCH 11/13] =?UTF-8?q?feat:=20pbom=E5=88=A0=E9=99=A4=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E5=8C=85=E6=97=B6=EF=BC=8C=E5=B0=86=E5=85=B6=E4=B8=8B?= =?UTF-8?q?=E5=AD=90=E7=BA=A7=E6=8F=90=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/PBomApi.java | 8 +++-- .../bomnew/constant/MaterialMainConstant.java | 4 +++ .../mapper/master/BomNewPbomChildMapper.java | 4 +++ .../pojo/entity/BomNewPbomChildEntity.java | 16 ++++----- .../pojo/entity/BomNewPbomParentEntity.java | 17 ++++----- .../service/BomNewPbomChildService.java | 9 +++++ .../service/BomNewPbomParentService.java | 35 +++++++++++++++---- .../mapper/master/BomNewPbomChildMapper.xml | 18 ++++++++++ 8 files changed, 87 insertions(+), 24 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java index 4e8121f9..cbc41601 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/PBomApi.java @@ -155,13 +155,17 @@ public class PBomApi extends BaseApi { return ResultVO.success(true); } + /** + * 删除 + * @param param 包含删除BOM所需信息的DTO(数据传输对象) + * @return data字段表示删除的bom中是否包含工艺包,包含工艺包时需要刷新列表数据(true为包含,false为不包含) + */ @PostMapping("editDel") @ApiOperation("编辑-删除") @LogRecord(success = "PBom-编辑-删除,物料编码:{{#bom.materialNo}}-版本:{{#bom.currentVersion}},操作结果:{{#_ret}}", bizNo = "{{#param.bomRowId}}",type = "PBom-编辑-删除") public ResultVO editDel(@Valid @RequestBody EditPBomDelDTO param){ VUtils.isTure(CollUtil.isEmpty(param.getRowIdList())).throwMessage("请选择要删除的数据行"); - bomNewPbomParentService.editDel(param); - return ResultVO.success(true); + return ResultVO.success(bomNewPbomParentService.editDel(param)); } @PostMapping("setVirtualPart") diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MaterialMainConstant.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MaterialMainConstant.java index c78476a6..6694e9b5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MaterialMainConstant.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/MaterialMainConstant.java @@ -8,4 +8,8 @@ public class MaterialMainConstant { public static final String MaterialNo_31="31"; + /* + * 工艺包类别编号 + */ + public static final String CATEGORYCODE_TECHNOLOGYPACKAGE = "201201"; } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewPbomChildMapper.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewPbomChildMapper.java index 91ac2598..91a3e5ea 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewPbomChildMapper.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/mapper/master/BomNewPbomChildMapper.java @@ -23,4 +23,8 @@ public interface BomNewPbomChildMapper extends BaseMapper void delByParentRowId(@Param("parentRowId") Long parentRowId); void setProductionFactoryCode(@Param("productionFactoryCode")String productionFactoryCode, @Param("rowIds") List rowIds); + + List getChildrenByChildRowId(Long rowId); + + void setParentRowId(List rowIds, Long parentRowId); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomChildEntity.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomChildEntity.java index 12c635d1..23b5dd8c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomChildEntity.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomChildEntity.java @@ -1,19 +1,17 @@ package com.nflg.product.bomnew.pojo.entity; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; -import java.time.LocalDate; /** * t_bom_new_pbom_child @@ -148,6 +146,7 @@ public class BomNewPbomChildEntity implements Serializable { /** * 生产工厂设置方式 0-默认 1-规则匹配 2-手工 + * @see com.nflg.product.bomnew.constant.ProductionFactoryCodeInputTypeEnum */ @TableField(value = "production_factory_code_input_type") @ApiModelProperty("生产工厂设置方式 0-默认 1-规则匹配 2-手工") @@ -218,6 +217,7 @@ public class BomNewPbomChildEntity implements Serializable { /** * 0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包 + * @see com.nflg.product.bomnew.constant.VirtualPackageTypeEnum */ @TableField(value = "virtual_part_type") @ApiModelProperty(value = "0-非虚拟包 1-发货包 2-制作包 4-直发包 8-发货前装配包") diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomParentEntity.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomParentEntity.java index 24b1f754..986638e5 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomParentEntity.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/entity/BomNewPbomParentEntity.java @@ -1,19 +1,17 @@ package com.nflg.product.bomnew.pojo.entity; -import java.math.BigDecimal; -import java.time.LocalDateTime; - -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; - -import java.io.Serializable; - import lombok.Data; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.math.BigDecimal; import java.time.LocalDateTime; -import java.time.LocalDate; /** * t_bom_new_pbom_parent @@ -169,6 +167,7 @@ public class BomNewPbomParentEntity implements Serializable { /** * 1=待处理、2=暂存 3=已处理 + * @see com.nflg.product.bomnew.constant.PBomEditStatusEnum */ @TableField(value = "edit_status") @ApiModelProperty(value = "1=待处理、2=暂存 3=已处理") @@ -176,6 +175,7 @@ public class BomNewPbomParentEntity implements Serializable { /** * BOM状态:1=待发布 2=待分配工厂 3=已分配工厂 4=已发布 + * @see com.nflg.product.bomnew.constant.PBomStatusEnum */ @TableField(value = "status") @ApiModelProperty(value = "BOM状态:1=待发布 4=已发布 8=待分配工厂 16=已分配工厂") @@ -247,6 +247,7 @@ public class BomNewPbomParentEntity implements Serializable { /** * 创建人员所属岗位 0-设计人员 1-工艺人员 2-其他 + * @see com.nflg.product.bomnew.constant.UserJobEnum */ @TableField(value = "created_job") @ApiModelProperty(value = "创建人员所属岗位 0-设计人员 1-工艺人员 2-其他") diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomChildService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomChildService.java index 5fafa438..f37cd1f6 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomChildService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomChildService.java @@ -6,6 +6,8 @@ import com.nflg.product.bomnew.mapper.master.BomNewPbomChildMapper; import com.nflg.product.bomnew.pojo.entity.BomNewPbomChildEntity; import org.springframework.stereotype.Service; +import java.util.List; + /** * t_bom_new_pbom_child 表服务实现类 @@ -17,4 +19,11 @@ import org.springframework.stereotype.Service; @Service public class BomNewPbomChildService extends ServiceImpl { + public List getChildrenByChildRowId(Long rowId) { + return this.getBaseMapper().getChildrenByChildRowId(rowId); + } + + public void setParentRowId(List rowIds, Long parentRowId) { + this.getBaseMapper().setParentRowId(rowIds, parentRowId); + } } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java index 93795834..95d71802 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewPbomParentService.java @@ -366,28 +366,51 @@ public class BomNewPbomParentService extends ServiceImpl childList = pbomChildService.getBaseMapper().selectBatchIds(paramDTO.getRowIdList()); List childListVO = Convert.toList(BomNewPbomParentVO.class, childList); - materialMainService.intiMaterialInfo(childListVO); + + // 判断是否是工艺包 + List technologypackages = childListVO.stream() + .filter(c -> MaterialMainConstant.CATEGORYCODE_TECHNOLOGYPACKAGE.equals(c.getMaterialCategoryCode())) + .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(technologypackages)) { + //将工艺包子级提层 + for (BomNewPbomParentVO t : technologypackages) { + //找出所有子级 + List cc = pbomChildService.getChildrenByChildRowId(t.getRowId()); + if (!cc.isEmpty()) { + hasTechnologypackage = true; + //将子级的父级id设置为工艺包的父级id + pbomChildService.setParentRowId(cc.stream().map(BomNewPbomChildEntity::getRowId).collect(Collectors.toList()), + t.getParentRowId()); + } + } + } + + materialMainService.intiMaterialInfo(ImmutableList.of(parentVO)); + // 机加工件 的子级可直接删除 if (parentVO.getMaterialCategoryCode().startsWith("200301")) { pbomChildService.getBaseMapper().delByRowId(paramDTO.getRowIdList()); - return; + return hasTechnologypackage; } //删除辅助物料 - List noDelList = childListVO.stream().filter(u -> !u.getMaterialCategoryCode().startsWith("1003") && !u.getMaterialCategoryCode().startsWith("1020") && !u.getMaterialCategoryCode().startsWith("1021")).collect(Collectors.toList()); + List noDelList = childListVO.stream() + .filter(u -> !u.getMaterialCategoryCode().startsWith("1003") && !u.getMaterialCategoryCode().startsWith("1020") && !u.getMaterialCategoryCode().startsWith("1021")) + .collect(Collectors.toList()); + noDelList.removeAll(technologypackages); VUtils.isTure(CollUtil.isNotEmpty(noDelList)).throwMessage("非机加工件的子级只能删除辅助物料"); pbomChildService.getBaseMapper().delByRowId(paramDTO.getRowIdList()); - + return hasTechnologypackage; } /** diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomChildMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomChildMapper.xml index a329b790..0fa4e758 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomChildMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewPbomChildMapper.xml @@ -68,4 +68,22 @@ #{item} + + + + From ea328f17cbdfa0c1fac8f22d797a9fa42f6ac944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 11 Apr 2024 09:25:13 +0800 Subject: [PATCH 12/13] =?UTF-8?q?fix:=20ebom=E8=BD=ACpbom=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E7=BD=AE=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=BA=E5=BE=85=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/domain/EBom/EBomToPBom.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBom.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBom.java index 3982909e..ce1b8ee9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBom.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/EBomToPBom.java @@ -9,10 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import com.nflg.product.base.core.conmon.util.SessionUtil; -import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum; -import com.nflg.product.bomnew.constant.EBomStatusEnum; -import com.nflg.product.bomnew.constant.PBomStatusEnum; -import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; +import com.nflg.product.bomnew.constant.*; import com.nflg.product.bomnew.pojo.entity.*; import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; import com.nflg.product.bomnew.service.BomNewEbomVirtualPackageCompositionService; @@ -24,7 +21,6 @@ import com.nflg.product.bomnew.util.VUtils; import com.nflg.product.bomnew.util.VersionUtil; import lombok.Getter; import lombok.NoArgsConstructor; -import org.bouncycastle.crypto.engines.EthereumIESEngine; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -175,6 +171,7 @@ public class EBomToPBom { pBomParent.setTechnologyUserCode(SessionUtil.getUserCode()); pBomParent.setTechnologyUserName(SessionUtil.getRealName()); pBomParent.setCurrentVersion(VersionUtil.getNextVersion("")); + pBomParent.setEditStatus(PBomEditStatusEnum.HANDLER_CREATED.getValue()); if(Objects.nonNull(oldParent)){ pBomParent.setCurrentVersion(VersionUtil.getNextVersion(oldParent.getCurrentVersion())); oldParent.setExpireEndTime(LocalDateTime.now()); From 3f20301028780765717c21087e18f8f6dc0e0401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Thu, 11 Apr 2024 09:26:34 +0800 Subject: [PATCH 13/13] =?UTF-8?q?refactor:=20=E6=96=B9=E4=BE=BF=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nflg/product/bomnew/api/user/CacheApi.java | 9 +++++---- .../nflg/product/bomnew/pojo/dto/CacheDTO.java | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/CacheDTO.java diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java index bdaafa53..a977cd9c 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/api/user/CacheApi.java @@ -3,6 +3,7 @@ package com.nflg.product.bomnew.api.user; import cn.hutool.core.util.StrUtil; import com.nflg.product.base.core.api.BaseApi; import com.nflg.product.base.core.conmon.util.SessionUtil; +import com.nflg.product.bomnew.pojo.dto.CacheDTO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import nflg.product.common.vo.ResultVO; @@ -35,8 +36,8 @@ public class CacheApi extends BaseApi { */ @PostMapping("set") @ApiOperation("设置缓存") - public ResultVO setCache(@Valid @RequestParam @NonNull String key, @Valid @RequestParam @NonNull String content) { - redisTemplate.boundValueOps(buildKey(key)).set(content); + public ResultVO setCache(@Valid @RequestBody CacheDTO data) { + redisTemplate.boundValueOps(buildKey(data.key)).set(data.value); return ResultVO.success(); } @@ -58,8 +59,8 @@ public class CacheApi extends BaseApi { */ @DeleteMapping("del") @ApiOperation("删除缓存") - public ResultVO delCache(@Valid @RequestParam @NonNull String key) { - redisTemplate.delete(buildKey(key)); + public ResultVO delCache(@Valid @RequestBody CacheDTO data) { + redisTemplate.delete(buildKey(data.key)); return ResultVO.success(); } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/CacheDTO.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/CacheDTO.java new file mode 100644 index 00000000..a1401c20 --- /dev/null +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/pojo/dto/CacheDTO.java @@ -0,0 +1,18 @@ +package com.nflg.product.bomnew.pojo.dto; + +/** + * @author 曹鹏飞 + * @date 2024/4/10 17:31:57 + */ +public class CacheDTO { + + /* + * 缓存key + */ + public String key; + + /* + * 缓存value + */ + public String value; +}