Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom
This commit is contained in:
commit
a9111be8ab
|
|
@ -256,7 +256,7 @@ public class DQBomApi extends BaseApi {
|
||||||
*/
|
*/
|
||||||
@PostMapping("queryMaterials")
|
@PostMapping("queryMaterials")
|
||||||
@ApiOperation("批量查询物料信息")
|
@ApiOperation("批量查询物料信息")
|
||||||
public ResultVO<List<BaseMaterialVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
public ResultVO<List<QueryMaterialsVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
||||||
return ResultVO.success(dQBomService.queryMaterials(query));
|
return ResultVO.success(dQBomService.queryMaterials(query));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ public class EbomApi extends BaseApi {
|
||||||
public ResultVO<BomNewEbomParentVO> temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
public ResultVO<BomNewEbomParentVO> temporary(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||||
|
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||||
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||||
|
|
||||||
return ResultVO.success(temporary);
|
return ResultVO.success(temporary);
|
||||||
|
|
@ -388,7 +388,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-暂存添加")
|
@LogRecord(success = "Ebom-暂存添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-暂存添加")
|
||||||
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
public ResultVO<BomNewEbomParentVO> temporaryAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||||
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
BomNewEbomParentVO temporary = bomNewEbomParentService.temporary(dto);
|
||||||
// bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
// bomNewEbomParentService.getBaseMapper().updateRootForWaitReview();
|
||||||
return ResultVO.success(temporary);
|
return ResultVO.success(temporary);
|
||||||
|
|
@ -399,7 +399,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-提交添加")
|
@LogRecord(success = "Ebom-提交添加,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交添加")
|
||||||
public ResultVO<Boolean> submitAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
public ResultVO<Boolean> submitAdd(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||||
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,7 +409,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-提交")
|
@LogRecord(success = "Ebom-提交,物料编码:{{#dto.parent.materialNo}}-版本:{{#dto.parent.currentVersion}},操作结果:{{#_ret.state}} {{#_ret.msg}}", bizNo = "{{#dto.parent.rowId}}", type = "Ebom-提交")
|
||||||
public ResultVO<Boolean> submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
public ResultVO<Boolean> submit(@RequestBody BomNewEBomParentEditDTO dto) throws ExecutionException, InterruptedException {
|
||||||
checkDeleteRule(dto);
|
checkDeleteRule(dto);
|
||||||
bomNewEbomParentService.deleteBomChild(dto.getDelDatas());
|
bomNewEbomParentService.deleteBomChild(dto.getDelDatas(), dto.getParent());
|
||||||
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
return ResultVO.success(bomNewEbomParentService.submit(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -464,7 +464,7 @@ public class EbomApi extends BaseApi {
|
||||||
*/
|
*/
|
||||||
@PostMapping("queryMaterials")
|
@PostMapping("queryMaterials")
|
||||||
@ApiOperation("批量查询物料信息")
|
@ApiOperation("批量查询物料信息")
|
||||||
public ResultVO<List<BaseMaterialVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
public ResultVO<List<QueryMaterialsVO>> queryMaterials(@Valid @RequestBody @NotEmpty List<QueryMaterialsQuery> query) {
|
||||||
return ResultVO.success(bomNewEbomParentService.queryMaterials(query));
|
return ResultVO.success(bomNewEbomParentService.queryMaterials(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.nflg.product.bomnew.pojo.vo;
|
||||||
|
|
||||||
|
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||||
|
import com.nflg.product.bomnew.constant.EBomStatusEnum;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 曹鹏飞
|
||||||
|
* @date 2024/5/26 16:38:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class QueryMaterialsVO extends BaseMaterialVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计人员名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "设计人员名称")
|
||||||
|
private String deviseName = SessionUtil.getRealName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计维护部门名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "设计维护部门名称")
|
||||||
|
private String deptName = SessionUtil.getFullDeptName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createdTime = LocalDateTime.now();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本过期时间=下个版本的创建时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "版本过期时间=下个版本的创建时间")
|
||||||
|
private LocalDateTime expireEndTime = LocalDateTime.parse("9999-12-31 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "1=待复核、2=已复核、3=已退回、4=定版(已发布PBOM)99=借用件 100=引用件")
|
||||||
|
private Integer status = EBomStatusEnum.CHECKED.getValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有BOM: 0-否 1-是
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "是否有BOM: 0-否 1-是")
|
||||||
|
private Integer bomExist = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty("单重1")
|
||||||
|
private BigDecimal unitWeight;
|
||||||
|
|
||||||
|
public BigDecimal getUnitWeight() {
|
||||||
|
return getMaterialWeight();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1980,7 +1980,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
* 从原始Bom导入的数据,数据没有异常的情况下,用户不可以删除;
|
* 从原始Bom导入的数据,数据没有异常的情况下,用户不可以删除;
|
||||||
* 用户可以直接删除,用户单击暂存或是提交时才会保存至数据库。
|
* 用户可以直接删除,用户单击暂存或是提交时才会保存至数据库。
|
||||||
*/
|
*/
|
||||||
public void deleteBomChild(List<BomNewEbomParentVO> delList) {
|
public void deleteBomChild(List<BomNewEbomParentVO> delList, BomNewEbomParentVO parent) {
|
||||||
if (CollUtil.isEmpty(delList)) {
|
if (CollUtil.isEmpty(delList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1993,12 +1993,15 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
List<BomNewEbomChildEntity> delTagList = new ArrayList<>();
|
List<BomNewEbomChildEntity> delTagList = new ArrayList<>();
|
||||||
|
|
||||||
//检查原始bom里过来数据是否包含正常数据
|
//检查原始bom里过来数据是否包含正常数据
|
||||||
List<BomNewEbomChildEntity> check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
// List<BomNewEbomChildEntity> check1List = delChildList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
&& Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
// && Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());
|
||||||
|
//
|
||||||
if (CollUtil.isNotEmpty(check1List)) {
|
// if (CollUtil.isNotEmpty(check1List)) {
|
||||||
throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以删除 ", StrUtil.join(",", check1List.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList()))));
|
// throw new NflgBusinessException(STATE.Error, StrUtil.format("从原始Bom导入的数据,数据没有异常的情况下,{} 不可以删除 ", StrUtil.join(",", check1List.stream().map(BomNewEbomChildEntity::getMaterialNo).collect(Collectors.toList()))));
|
||||||
}
|
// }
|
||||||
|
VUtils.isTure(parent.getMaterialNo().startsWith("31")
|
||||||
|
&& delChildList.stream().anyMatch(d -> !Objects.equals(d.getVirtualPartType(), VirtualPackageTypeEnum.UN_VIRTUAL_PACKAGE.getValue())))
|
||||||
|
.throwMessage("不能删除31码下的虚拟包");
|
||||||
|
|
||||||
//检查有bom数据关系是否可以删?
|
//检查有bom数据关系是否可以删?
|
||||||
// List<BomNewEbomParentVO> check2List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
// List<BomNewEbomParentVO> check2List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
|
||||||
|
|
@ -2218,7 +2221,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
roots.forEach(this::buildChildren);
|
roots.forEach(this::buildChildren);
|
||||||
//从子级开始查找
|
//从子级开始查找
|
||||||
List<BomNewEbomParentVO> boms = this.getBaseMapper().getBom(query.getMaterialNo(), query.getDrawingNo());
|
List<BomNewEbomParentVO> boms = this.getBaseMapper().getBom(query.getMaterialNo(), query.getDrawingNo());
|
||||||
boms.removeIf(c -> Objects.equals(c.getLastVersionIs(), 0));
|
boms.removeIf(c -> Objects.equals(c.getLastVersionIs(), 0) || Objects.equals(c.getStatus(), EBomStatusEnum.PUBLISHED.getValue()));
|
||||||
boms.forEach(this::buildChildren);
|
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()));
|
roots.addAll(boms.stream().filter(b -> b.getRootIs() == 0 && b.getUserRootIs() == 0 && b.getRootIsForWaitReview() == 0).map(this::buildParent).flatMap(List::stream).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
|
@ -2364,7 +2367,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
public List<QueryMaterialsVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||||
List<BaseMaterialVO> datas = new ArrayList<>();
|
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||||
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||||
.filter(StrUtil::isNotBlank)
|
.filter(StrUtil::isNotBlank)
|
||||||
|
|
@ -2381,7 +2384,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
if (CollUtil.isNotEmpty(keys)) {
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
||||||
}
|
}
|
||||||
return datas;
|
return Convert.toList(QueryMaterialsVO.class, datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getSapErrorNum() {
|
public Integer getSapErrorNum() {
|
||||||
|
|
|
||||||
|
|
@ -666,7 +666,7 @@ public class DQBomService {
|
||||||
return datas;
|
return datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<BaseMaterialVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
public List<QueryMaterialsVO> queryMaterials(List<QueryMaterialsQuery> query) {
|
||||||
List<BaseMaterialVO> datas = new ArrayList<>();
|
List<BaseMaterialVO> datas = new ArrayList<>();
|
||||||
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
List<String> keys = query.stream().map(QueryMaterialsQuery::getMaterialNo)
|
||||||
.filter(StrUtil::isNotBlank)
|
.filter(StrUtil::isNotBlank)
|
||||||
|
|
@ -683,6 +683,6 @@ public class DQBomService {
|
||||||
if (CollUtil.isNotEmpty(keys)) {
|
if (CollUtil.isNotEmpty(keys)) {
|
||||||
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
datas.addAll(SpringUtil.getBean(MaterialMainMapper.class).getMaterialByDrawingNo(keys));
|
||||||
}
|
}
|
||||||
return datas;
|
return Convert.toList(QueryMaterialsVO.class, datas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -402,13 +402,10 @@
|
||||||
AND status IN (1,3) AND (root_is=1 OR user_root_is=1 OR root_is_for_wait_review=1) AND
|
AND status IN (1,3) AND (root_is=1 OR user_root_is=1 OR root_is_for_wait_review=1) AND
|
||||||
created_by=#{userCode}
|
created_by=#{userCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="userJob==1 and query.dataType==0">
|
<if test="userJob==1">
|
||||||
AND ((root_is=1 OR user_root_is=1) AND status=2) OR (status IN (1,3) AND (root_is=1 OR user_root_is=1 OR
|
AND ((root_is=1 OR user_root_is=1) AND status=2) OR (status IN (1,3) AND (root_is=1 OR user_root_is=1 OR
|
||||||
root_is_for_wait_review=1) AND created_by=#{userCode})
|
root_is_for_wait_review=1) AND created_by=#{userCode})
|
||||||
</if>
|
</if>
|
||||||
<if test="userJob==1 and query.dataType==1">
|
|
||||||
AND (root_is=1 OR user_root_is=1) AND status=4
|
|
||||||
</if>
|
|
||||||
<if test="query.deviseName!=null and query.deviseName!=''">
|
<if test="query.deviseName!=null and query.deviseName!=''">
|
||||||
AND devise_name=#{query.deviseName}
|
AND devise_name=#{query.deviseName}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue