Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom
This commit is contained in:
commit
c722c0c261
|
|
@ -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<String, String> 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -12,10 +12,10 @@ public enum EBomStatusEnum implements ValueEnum<Integer> {
|
||||||
CHECKED(2,"已复核"),
|
CHECKED(2,"已复核"),
|
||||||
RETURNED(3,"已退回"),
|
RETURNED(3,"已退回"),
|
||||||
PUBLISHED(4,"定版(已发布PBOM)"),
|
PUBLISHED(4,"定版(已发布PBOM)"),
|
||||||
BORROWED_PARTS(99, "借用件"),
|
BORROWED_PARTS(99, "借用件");
|
||||||
|
|
||||||
//非自己创建的
|
//非自己创建的
|
||||||
REFERENCE(100, "引用件");
|
//REFERENCE(100, "引用件");
|
||||||
|
|
||||||
|
|
||||||
private final Integer value;
|
private final Integer value;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
package com.nflg.product.bomnew.pojo.entity;
|
package com.nflg.product.bomnew.pojo.entity;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
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.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* t_bom_new_original_child
|
* t_bom_new_original_child
|
||||||
|
|
@ -136,7 +135,7 @@ public class BomNewOriginalChildEntity implements Serializable {
|
||||||
private Long bomVersionRowId;
|
private Long bomVersionRowId;
|
||||||
|
|
||||||
public BigDecimal getTotalWeight() {
|
public BigDecimal getTotalWeight() {
|
||||||
return NumberUtil.mul(this.getUnitWeight(), this.num);
|
return NumberUtil.mul(this.unitWeight, this.num);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = -61829104329368344L;
|
private static final long serialVersionUID = -61829104329368344L;
|
||||||
|
|
|
||||||
|
|
@ -340,10 +340,10 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
|
if (parentEntity.getStatus().equals(EBomStatusEnum.PUBLISHED.getValue())) {
|
||||||
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
child.setStatus(EBomStatusEnum.BORROWED_PARTS.getValue());
|
||||||
}
|
}
|
||||||
//非本人则为借用件
|
// //非本人则为借用件
|
||||||
else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
|
// else if (!parentEntity.getCreatedBy().equals(child.getCreatedBy())) {
|
||||||
child.setStatus(EBomStatusEnum.REFERENCE.getValue());
|
// child.setStatus(EBomStatusEnum.REFERENCE.getValue());
|
||||||
}
|
// }
|
||||||
|
|
||||||
} else { //无BOM-版本时 确定版本号
|
} else { //无BOM-版本时 确定版本号
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -564,7 +564,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
//原始BOM-同步到历史表
|
//原始BOM-同步到历史表
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
syncToFormal(convert.getHasHandlerParentIds());
|
syncToFormal(convert.getHasHandlerParentIds());
|
||||||
},syncOriginalBomToFormalPool );
|
}, syncOriginalBomToFormalPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
//记录子级BOM版本行ID
|
//记录子级BOM版本行ID
|
||||||
|
|
@ -573,6 +573,8 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
BomNewOriginalChildEntity entChild = new BomNewOriginalChildEntity();
|
BomNewOriginalChildEntity entChild = new BomNewOriginalChildEntity();
|
||||||
entChild.setRowId(k.getRowId());
|
entChild.setRowId(k.getRowId());
|
||||||
entChild.setBomVersionRowId(k.getBomRowId());
|
entChild.setBomVersionRowId(k.getBomRowId());
|
||||||
|
entChild.setNum(k.getNum());
|
||||||
|
entChild.setUnitWeight(k.getUnitWeight());
|
||||||
originalChildEntities.add(entChild);
|
originalChildEntities.add(entChild);
|
||||||
});
|
});
|
||||||
if (CollUtil.isNotEmpty(originalChildEntities)) {
|
if (CollUtil.isNotEmpty(originalChildEntities)) {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
nacos.server-addr=192.168.0.191:8848
|
nacos.server-addr=192.168.0.191:8848
|
||||||
|
spring.cache.type=redis
|
||||||
spring.redis.database=0
|
spring.redis.database=0
|
||||||
spring.redis.host=192.168.0.191
|
spring.redis.host=192.168.0.191
|
||||||
spring.redis.password=
|
spring.redis.password=
|
||||||
spring.redis.port=6379
|
spring.redis.port=6379
|
||||||
spring.redis.timeout=0
|
spring.redis.timeout=0
|
||||||
spring.redis.ssl=false
|
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-active=8
|
||||||
spring.redis.lettuce.pool.max-idle=8
|
spring.redis.lettuce.pool.max-idle=8
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
spring.redis.lettuce.pool.min-idle=0
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
#nacos.server-addr=114.132.64.230:8123
|
#nacos.server-addr=114.132.64.230:8123
|
||||||
nacos.server-addr=192.168.0.194:8848
|
nacos.server-addr=192.168.0.194:8848
|
||||||
|
spring.cache.type=redis
|
||||||
|
|
||||||
spring.redis.database=0
|
spring.redis.database=0
|
||||||
spring.redis.host=192.168.0.194
|
spring.redis.host=192.168.0.194
|
||||||
spring.redis.password=
|
spring.redis.password=
|
||||||
spring.redis.port=6379
|
spring.redis.port=6379
|
||||||
spring.redis.timeout=0
|
spring.redis.timeout=0
|
||||||
spring.redis.ssl=false
|
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-active=8
|
||||||
spring.redis.lettuce.pool.max-idle=8
|
spring.redis.lettuce.pool.max-idle=8
|
||||||
spring.redis.lettuce.pool.min-idle=0
|
spring.redis.lettuce.pool.min-idle=0
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,8 @@
|
||||||
</select>
|
</select>
|
||||||
<!--bom发布-->
|
<!--bom发布-->
|
||||||
<update id="bomRelease">
|
<update id="bomRelease">
|
||||||
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
|
where row_id in
|
||||||
<foreach collection="rowIds" item="rowId" open="(" close=")" separator=",">
|
<foreach collection="rowIds" item="rowId" open="(" close=")" separator=",">
|
||||||
#{rowId}
|
#{rowId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue