From b902e685ece15e0adc7b438a8c9c39c94ab7a2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 8 Apr 2024 09:40:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20ebom=E4=B8=AD=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=BC=95=E7=94=A8=E4=BB=B6=E7=9A=84=E6=A6=82=E5=BF=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/nflg/product/bomnew/constant/EBomStatusEnum.java | 4 ++-- .../product/bomnew/service/BomNewEbomParentService.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EBomStatusEnum.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EBomStatusEnum.java index f7c8951b..aca4b0f9 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EBomStatusEnum.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/constant/EBomStatusEnum.java @@ -12,10 +12,10 @@ public enum EBomStatusEnum implements ValueEnum { CHECKED(2,"已复核"), RETURNED(3,"已退回"), PUBLISHED(4,"定版(已发布PBOM)"), - BORROWED_PARTS(99, "借用件"), + BORROWED_PARTS(99, "借用件"); //非自己创建的 - REFERENCE(100, "引用件"); + //REFERENCE(100, "引用件"); private final Integer value; 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..51d3a0ea 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 @@ -340,10 +340,10 @@ public class BomNewEbomParentService extends ServiceImpl Date: Tue, 9 Apr 2024 08:43:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=9F=E5=A7=8B?= =?UTF-8?q?bom=E8=BD=ACebom=E5=90=8E=EF=BC=8C=E5=AD=90=E7=BA=A7=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=80=BB=E9=87=8D=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=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 3/4] =?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 4/4] =?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