Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
# Conflicts: # nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java
This commit is contained in:
commit
839a2bd0d4
|
|
@ -1,8 +1,8 @@
|
|||
package com.nflg.product.bomnew.api.user;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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;
|
||||
|
|
@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author 曹鹏飞
|
||||
|
|
@ -23,20 +24,19 @@ import javax.validation.Valid;
|
|||
@RequestMapping("bom/new/cache")
|
||||
public class CacheApi extends BaseApi {
|
||||
|
||||
private static final String PREFIX = "frontend:";
|
||||
private static final String PREFIX = "frontend";
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
/**
|
||||
* 设置用户缓存
|
||||
* @param key 缓存key
|
||||
* @param content 缓存内容
|
||||
* @param data 缓存数据
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("set")
|
||||
@ApiOperation("设置缓存")
|
||||
public ResultVO<String> setCache(@Valid @RequestBody CacheDTO data) {
|
||||
public ResultVO<Void> setCache(@Valid @RequestBody CacheDTO data) {
|
||||
redisTemplate.boundValueOps(buildKey(data.key)).set(data.value);
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
|
@ -49,22 +49,27 @@ public class CacheApi extends BaseApi {
|
|||
@GetMapping("get")
|
||||
@ApiOperation("获取缓存")
|
||||
public ResultVO<String> getCache(@Valid @RequestParam @NonNull String key) {
|
||||
return ResultVO.success(redisTemplate.boundValueOps(buildKey(key)).get());
|
||||
Object o = redisTemplate.boundValueOps(buildKey(key)).get();
|
||||
if (Objects.isNull(o)) {
|
||||
return ResultVO.success();
|
||||
} else {
|
||||
return ResultVO.success(JSON.toJSONString(o));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户缓存
|
||||
* @param key 缓存key
|
||||
* @param data 缓存数据
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("del")
|
||||
@ApiOperation("删除缓存")
|
||||
public ResultVO<String> delCache(@Valid @RequestBody CacheDTO data) {
|
||||
public ResultVO<Void> delCache(@Valid @RequestBody CacheDTO data) {
|
||||
redisTemplate.delete(buildKey(data.key));
|
||||
return ResultVO.success();
|
||||
}
|
||||
|
||||
private String buildKey(String key) {
|
||||
return StrUtil.format("{}:{}:{}", PREFIX, SessionUtil.getUserCode(), key);
|
||||
return StrUtil.format("{}:{}", PREFIX, key);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
|
||||
List<BomNewEbomParentVO> getChildren(Long bomRowId, int type);
|
||||
|
||||
List<BomNewEbomParentVO> getBom(String materialNo, String drawingNo);
|
||||
List<BomNewEbomParentVO> getBom(Integer state, String materialNo, String drawingNo);
|
||||
|
||||
List<BomNewEbomParentVO> getVOById(Long parentRowId);
|
||||
|
||||
|
|
|
|||
|
|
@ -232,6 +232,13 @@ public class BomNewPbomChildEntity implements Serializable {
|
|||
@ApiModelProperty("BOM-版本rowId(parent表rowId关联)")
|
||||
private Long bomVersionRowId;
|
||||
|
||||
/**
|
||||
* 来源 1-ebom转换 2-dqbom转换 3-从SAP导入
|
||||
*/
|
||||
@TableField(value = "source")
|
||||
@ApiModelProperty(value = "来源 1-ebom转换 2-dqbom转换 3-从SAP导入")
|
||||
private Integer source;
|
||||
|
||||
private static final long serialVersionUID = -76633783850936076L;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,6 +362,13 @@ public class BomNewPbomParentEntity implements Serializable {
|
|||
@ApiModelProperty(value = "创建人所属部门rowId")
|
||||
private Long deptRowId;
|
||||
|
||||
/**
|
||||
* 来源 1-ebom转换 2-dqbom转换 3-从SAP导入
|
||||
*/
|
||||
@TableField(value = "source")
|
||||
@ApiModelProperty(value = "来源 1-ebom转换 2-dqbom转换 3-从SAP导入")
|
||||
private Integer source;
|
||||
|
||||
private static final long serialVersionUID = -31999878274445137L;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ import java.io.OutputStream;
|
|||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.ForkJoinTask;
|
||||
|
|
@ -946,10 +945,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
|
||||
// SpringUtil.getBean(BomNewEbomParentFormalService.class).copyEbomFormal(bomRowId);
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
importToSAP(bomRowId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2241,7 +2236,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
.collect(Collectors.toList());
|
||||
roots.forEach(this::buildChildren);
|
||||
//从子级开始查找
|
||||
List<BomNewEbomParentVO> boms = this.getBaseMapper().getBom(query.getMaterialNo(), query.getDrawingNo());
|
||||
List<BomNewEbomParentVO> boms = this.getBaseMapper().getBom(0, query.getMaterialNo(), query.getDrawingNo());
|
||||
boms.removeIf(c -> Objects.equals(c.getLastVersionIs(), 0) || Objects.equals(c.getStatus(), EBomStatusEnum.PUBLISHED.getValue()));
|
||||
boms.forEach(this::buildChildren);
|
||||
roots.addAll(boms.stream().filter(b -> b.getRootIs() == 0 && b.getUserRootIs() == 0 && b.getRootIsForWaitReview() == 0).map(this::buildParent).flatMap(List::stream).collect(Collectors.toList()));
|
||||
|
|
|
|||
|
|
@ -309,10 +309,15 @@
|
|||
</delete>
|
||||
|
||||
<update id="updateStateBatchByRowIds">
|
||||
update t_bom_new_ebom_parent set status=#{status} , convert_to_ebom_time=now() where row_id in
|
||||
update t_bom_new_ebom_parent set status=#{status} , convert_to_ebom_time=now(),edit_status=2,exception_status=1
|
||||
where row_id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</foreach>;
|
||||
UPDATE t_bom_new_ebom_child SET edit_status=2 WHERE parent_row_id IN
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>;
|
||||
</update>
|
||||
|
||||
|
||||
|
|
@ -464,6 +469,12 @@
|
|||
<if test="drawingNo!=null and drawingNo!=''">
|
||||
AND b.drawing_no = #{drawingNo}
|
||||
</if>
|
||||
<if test="state==0">
|
||||
AND a.status < 4
|
||||
</if>
|
||||
<if test="state==1">
|
||||
AND a.status = 4
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY b.order_number
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue