Merge branch 'feature/DM/nflg-bom' into feature/DM/nflg-bom-transition
# Conflicts: # nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageBase.java
This commit is contained in:
commit
f7495c978f
|
|
@ -239,4 +239,16 @@ public class DQBomApi extends BaseApi {
|
|||
public ResultVO<List<BomExceptionVO>> getBomException(@Valid @RequestBody @NotEmpty List<BomExceptionQuery> query) {
|
||||
return ResultVO.success(dQBomService.getBomException(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出错误信息到excel
|
||||
* @param messages 错误信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("exportErrorToExcel")
|
||||
@ApiOperation("导出错误信息到excel")
|
||||
public void exportErrorToExcel(@Valid @RequestBody @NotNull List<OperationErrorMsgVO> messages
|
||||
, HttpServletResponse response) throws IOException {
|
||||
EecExcelUtil.export(response, messages, OperationErrorMsgVO.class, "错误信息");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,10 @@ import com.mzt.logapi.starter.annotation.LogRecord;
|
|||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.pojo.dto.*;
|
||||
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomEditDetailVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomUpgradeChangeVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.*;
|
||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||
import com.nflg.product.bomnew.util.VUtils;
|
||||
|
|
@ -411,7 +409,7 @@ public class EbomApi extends BaseApi {
|
|||
@PostMapping("intiException")
|
||||
@ApiOperation("初始化错误类型")
|
||||
@LogRecord(success = "Ebom-初始化错误类型,操作结果:{{#_ret}}", bizNo = "{{#bomRowIds.toString()}}", type = "Ebom-初始化错误类型")
|
||||
public ResultVO<Boolean> intiException(@RequestBody List<Long> bomRowIds) throws ExecutionException, InterruptedException {
|
||||
public ResultVO<Boolean> intiException(@RequestBody List<Long> bomRowIds) {
|
||||
|
||||
bomNewEbomParentService.batchCheckAndSaveEBomException(bomRowIds);
|
||||
return ResultVO.success(true);
|
||||
|
|
@ -464,4 +462,15 @@ public class EbomApi extends BaseApi {
|
|||
VUtils.isTure(rootBomRowIds.size() > 1).throwMessage("每次只能导入1条");
|
||||
return bomNewEbomParentService.importToSAP(rootBomRowIds.get(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取节点异常状态
|
||||
* @param query query
|
||||
* @return 节点异常状态
|
||||
*/
|
||||
@PostMapping("getBomException")
|
||||
@ApiOperation("获取节点异常状态")
|
||||
public ResultVO<List<BomExceptionVO>> getBomException(@Valid @RequestBody @NotEmpty List<BomExceptionQuery> query) {
|
||||
return ResultVO.success(bomNewEbomParentService.getBomException(query));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,12 @@ import io.swagger.annotations.ApiOperation;
|
|||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -30,6 +33,10 @@ public class TestApi {
|
|||
@Resource
|
||||
SapOpUtilService sapOpUtilService;
|
||||
|
||||
/**
|
||||
* sap接口测试
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("sap")
|
||||
@ApiOperation("sap接口测试")
|
||||
public ResultVO<List<OperationErrorMsgVO>> workDetailsListByPage() {
|
||||
|
|
@ -52,4 +59,19 @@ public class TestApi {
|
|||
sapDto.setT1(t1s);
|
||||
return ResultVO.success(sapOpUtilService.importToSapV2(sapDto, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取异常信息
|
||||
* @param num 数量
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getErrors")
|
||||
@ApiOperation("获取异常信息")
|
||||
public ResultVO<List<OperationErrorMsgVO>> getErrors(@Valid @RequestParam("num") @NotNull Integer num) {
|
||||
List<OperationErrorMsgVO> msgs = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
msgs.add(OperationErrorMsgVO.create("主键数据:" + i, "错误描述:" + i));
|
||||
}
|
||||
return ResultVO.success(msgs);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.ttzero.excel.annotation.ExcelColumn;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -11,6 +12,7 @@ import java.io.Serializable;
|
|||
public class OperationErrorMsgBaseVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("错误描述")
|
||||
@ExcelColumn("异常信息")
|
||||
public String msg;
|
||||
|
||||
public OperationErrorMsgBaseVO() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.ttzero.excel.annotation.ExcelColumn;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -8,9 +10,11 @@ import java.io.Serializable;
|
|||
* @author 曹鹏飞
|
||||
* @date 2024-03-21 14:49:05
|
||||
*/
|
||||
@Data
|
||||
public class OperationErrorMsgVO extends OperationErrorMsgBaseVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("主键数据")
|
||||
@ExcelColumn("所在行")
|
||||
public String primaryKey;
|
||||
|
||||
public OperationErrorMsgVO() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.nflg.product.bomnew.pojo.dto.*;
|
|||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.ImportSapParamDTO;
|
||||
import com.nflg.product.bomnew.pojo.dto.sap.impart2.T1DTO;
|
||||
import com.nflg.product.bomnew.pojo.entity.*;
|
||||
import com.nflg.product.bomnew.pojo.query.BomExceptionQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
|
|
@ -527,10 +528,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
*
|
||||
* @param rowId
|
||||
* @return
|
||||
* @throws ExecutionException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<BomNewEbomParentVO> getBomTree(Long rowId, Boolean generateLevelNumberFlag) throws ExecutionException, InterruptedException {
|
||||
public List<BomNewEbomParentVO> getBomTree(Long rowId, Boolean generateLevelNumberFlag) {
|
||||
List<BomNewEbomParentVO> bomDetail = this.getBaseMapper().getParentChild(rowId);
|
||||
// EBomDetailTask detailTask = new EBomDetailTask(bomDetail);
|
||||
|
||||
|
|
@ -719,7 +718,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
/**
|
||||
* 检查 并保存异常信息
|
||||
*/
|
||||
public void batchCheckAndSaveEBomException(List<Long> bomRowIds) throws ExecutionException, InterruptedException {
|
||||
public void batchCheckAndSaveEBomException(List<Long> bomRowIds) {
|
||||
for (Long bomRowId : bomRowIds) {
|
||||
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
|
||||
checkEBomException.initException();
|
||||
|
|
@ -2254,4 +2253,32 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<BomExceptionVO> getBomException(List<BomExceptionQuery> query) {
|
||||
List<BomExceptionVO> datas = new ArrayList<>();
|
||||
for (int index = 0, count = query.size(); index < count; index++) {
|
||||
BomExceptionQuery bom = query.get(index);
|
||||
BomExceptionVO vo = new BomExceptionVO();
|
||||
if (index == 0) {
|
||||
batchCheckAndSaveEBomException(Collections.singletonList(bom.getBomRowId()));
|
||||
|
||||
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
||||
vo.setMaterialNo(parent.getMaterialNo());
|
||||
vo.setExceptionStatus(parent.getExceptionStatus());
|
||||
} else {
|
||||
BomNewEbomChildEntity child = ebomChildService.getById(bom.getRowId());
|
||||
vo.setMaterialNo(child.getMaterialNo());
|
||||
if (Objects.equals(child.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())) {
|
||||
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
|
||||
vo.setExceptionStatus(parent.getExceptionStatus());
|
||||
} else {
|
||||
vo.setExceptionStatus(child.getExceptionStatus());
|
||||
}
|
||||
}
|
||||
vo.setBomRowId(bom.getBomRowId());
|
||||
vo.setRowId(bom.getRowId());
|
||||
datas.add(vo);
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import nflg.product.common.constant.STATE;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +52,7 @@ public class CheckEBomException {
|
|||
}
|
||||
|
||||
|
||||
public CheckEBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||
public CheckEBomException(Long bomRowId) {
|
||||
|
||||
allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).getBomTree(bomRowId, true);
|
||||
//只检查待复核和自己的
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.nflg.product.bomnew.service.MaterialMainService;
|
|||
import com.nflg.product.bomnew.service.MaterialService;
|
||||
import com.nflg.product.bomnew.util.VersionUtil;
|
||||
import lombok.Getter;
|
||||
import org.ttzero.excel.reader.Col;
|
||||
import org.bouncycastle.LICENSE;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -33,10 +34,10 @@ public abstract class VirtualPackageBase {
|
|||
|
||||
|
||||
@Getter
|
||||
protected List<BomNewEbomParentEntity> parentResult=new ArrayList<>();
|
||||
protected List<BomNewEbomParentEntity> parentResult = new ArrayList<>();
|
||||
|
||||
@Getter
|
||||
protected List<BomNewEbomChildEntity> childResult=new ArrayList<>();
|
||||
protected List<BomNewEbomChildEntity> childResult = new ArrayList<>();
|
||||
|
||||
protected Long bomRowId;
|
||||
|
||||
|
|
@ -49,28 +50,41 @@ public abstract class VirtualPackageBase {
|
|||
protected List<Integer> virtualPackageValue;
|
||||
|
||||
//虚拟包编码
|
||||
protected Map<String, AddVirtrualMaterialDTO> vMNos=new HashMap<>();
|
||||
|
||||
protected Map<String, AddVirtrualMaterialDTO> vMNos = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
* 申请虚拟包
|
||||
*
|
||||
* @param child
|
||||
* @param virtualPackageTypeEnums
|
||||
* @return
|
||||
*/
|
||||
protected void generateVMNoFor31(String parentDrawingNo, List<BomNewEbomChildEntity> child, VirtualPackageTypeEnum... virtualPackageTypeEnums) {
|
||||
List<AddVirtrualMaterialDTO> params=new ArrayList<>();
|
||||
List<AddVirtrualMaterialDTO> params = new ArrayList<>();
|
||||
Set<String> vDrawingNoSet = new HashSet<>();
|
||||
for (BomNewEbomChildEntity ch : child) {
|
||||
for (VirtualPackageTypeEnum vpy : virtualPackageTypeEnums) {
|
||||
String vDrawingNo = String.join("","(",parentDrawingNo,")","(",ch.getMaterialName(),")","(",vpy.getConMaterialName(),")" );
|
||||
params.add(buildAddMaterialParamDo(StrUtil.join("",ch.getRowId().toString(), vpy.getConMaterialName()), vDrawingNo, vDrawingNo, vpy));
|
||||
String vDrawingNo = String.join("", "(", parentDrawingNo, ")", "(", ch.getMaterialName(), ")", "(", vpy.getConMaterialName(), ")");
|
||||
vDrawingNoSet.add(vDrawingNo);
|
||||
}
|
||||
}
|
||||
List<AddVirtrualMaterialDTO> addM = params.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(addM)) {
|
||||
Map<String, AddVirtrualMaterialDTO> vMNosResult = SpringUtil.getBean(MaterialService.class).batchAddMaterial(addM);
|
||||
vMNos.putAll(vMNosResult);
|
||||
if (CollUtil.isNotEmpty(vDrawingNoSet)) {
|
||||
|
||||
List<MaterialMainEntity> oldMaterialList = SpringUtil.getBean(MaterialMainService.class).lambdaQuery().in(MaterialMainEntity::getDrawingNo, vDrawingNoSet).list();
|
||||
Map<String, MaterialMainEntity> oldMaterialMap = oldMaterialList.stream().collect(Collectors.toMap(MaterialMainEntity::getDrawingNo, Function.identity(), (k1, k2) -> k1));
|
||||
|
||||
for (BomNewEbomChildEntity ch : child) {
|
||||
for (VirtualPackageTypeEnum vpy : virtualPackageTypeEnums) {
|
||||
String vDrawingNo = String.join("", "(", parentDrawingNo, ")", "(", ch.getMaterialName(), ")", "(", vpy.getConMaterialName(), ")");
|
||||
params.add(buildAddMaterialParamDo(StrUtil.join("", ch.getRowId().toString(), vpy.getConMaterialName()), vDrawingNo, vDrawingNo, vpy, oldMaterialMap));
|
||||
}
|
||||
}
|
||||
List<AddVirtrualMaterialDTO> addM = params.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(addM)) {
|
||||
Map<String, AddVirtrualMaterialDTO> vMNosResult = SpringUtil.getBean(MaterialService.class).batchAddMaterial(addM);
|
||||
vMNos.putAll(vMNosResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -111,13 +125,16 @@ public abstract class VirtualPackageBase {
|
|||
|
||||
/**
|
||||
* 申请虚拟包
|
||||
*
|
||||
* @param child
|
||||
* @param virtualPackageTypeEnums
|
||||
* @return
|
||||
*/
|
||||
protected void generateVMNoF21(String parentDrawingNo, List<BomNewEbomParentVO> child,VirtualPackageTypeEnum ... virtualPackageTypeEnums){
|
||||
List<AddVirtrualMaterialDTO> params=new ArrayList<>();
|
||||
for ( BomNewEbomParentVO ch: child ) {
|
||||
protected void generateVMNoF21(String parentDrawingNo, List<BomNewEbomParentVO> child, VirtualPackageTypeEnum... virtualPackageTypeEnums) {
|
||||
List<AddVirtrualMaterialDTO> params = new ArrayList<>();
|
||||
|
||||
Set<String> vDrawingNoSet = new HashSet<>();
|
||||
for (BomNewEbomParentVO ch : child) {
|
||||
for (VirtualPackageTypeEnum vpy : virtualPackageTypeEnums) {
|
||||
String vDrawingNo;
|
||||
if (vpy == VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE) {
|
||||
|
|
@ -125,37 +142,56 @@ public abstract class VirtualPackageBase {
|
|||
} else {
|
||||
vDrawingNo = String.join("", "(", parentDrawingNo, ch.getMaterialName(), ")", "(", vpy.getConMaterialName(), ")");
|
||||
}
|
||||
params.add(buildAddMaterialParamDo(StrUtil.join("",ch.getRowId().toString(), vpy.getConMaterialName()), vDrawingNo, vDrawingNo, vpy));
|
||||
vDrawingNoSet.add(vDrawingNo);
|
||||
}
|
||||
}
|
||||
List<AddVirtrualMaterialDTO> addM = params.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());
|
||||
vMNos= SpringUtil.getBean(MaterialService.class).batchAddMaterial(addM);
|
||||
if (CollUtil.isNotEmpty(vDrawingNoSet)) {
|
||||
|
||||
List<MaterialMainEntity> oldMaterialList = SpringUtil.getBean(MaterialMainService.class).lambdaQuery().in(MaterialMainEntity::getDrawingNo, vDrawingNoSet).list();
|
||||
Map<String, MaterialMainEntity> oldMaterialMap = oldMaterialList.stream().collect(Collectors.toMap(MaterialMainEntity::getDrawingNo, Function.identity(), (k1, k2) -> k1));
|
||||
|
||||
|
||||
for (BomNewEbomParentVO ch : child) {
|
||||
for (VirtualPackageTypeEnum vpy : virtualPackageTypeEnums) {
|
||||
String vDrawingNo;
|
||||
if (vpy == VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE) {
|
||||
vDrawingNo = String.join("", parentDrawingNo, ".FHQ", "(", ch.getMaterialName(), ")", "(", vpy.getConMaterialName(), ")");
|
||||
} else {
|
||||
vDrawingNo = String.join("", "(", parentDrawingNo, ch.getMaterialName(), ")", "(", vpy.getConMaterialName(), ")");
|
||||
}
|
||||
params.add(buildAddMaterialParamDo(StrUtil.join("", ch.getRowId().toString(), vpy.getConMaterialName()), vDrawingNo, vDrawingNo, vpy, oldMaterialMap));
|
||||
}
|
||||
}
|
||||
List<AddVirtrualMaterialDTO> addM = params.stream().filter(u -> StrUtil.isBlank(u.getMaterialNo())).collect(Collectors.toList());
|
||||
vMNos = SpringUtil.getBean(MaterialService.class).batchAddMaterial(addM);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//申请物料编码
|
||||
private AddVirtrualMaterialDTO buildAddMaterialParamDo(String key, String drawingNo, String materialName, VirtualPackageTypeEnum virtualPackageType){
|
||||
|
||||
List<MaterialMainEntity> oldMaterialList = SpringUtil.getBean(MaterialMainService.class).lambdaQuery().eq(MaterialMainEntity::getDrawingNo, drawingNo)
|
||||
.list();
|
||||
AddVirtrualMaterialDTO ent=new AddVirtrualMaterialDTO();
|
||||
if(CollUtil.isNotEmpty(oldMaterialList)){
|
||||
//申请物料编码
|
||||
private AddVirtrualMaterialDTO buildAddMaterialParamDo(String key, String drawingNo, String materialName, VirtualPackageTypeEnum virtualPackageType, Map<String, MaterialMainEntity> oldMaterialMap) {
|
||||
|
||||
// List<MaterialMainEntity> oldMaterialList = SpringUtil.getBean(MaterialMainService.class).lambdaQuery().eq(MaterialMainEntity::getDrawingNo, drawingNo)
|
||||
// .list();
|
||||
MaterialMainEntity oldMaterial = oldMaterialMap.get(drawingNo);
|
||||
AddVirtrualMaterialDTO ent = new AddVirtrualMaterialDTO();
|
||||
if (Objects.nonNull(oldMaterial)) {
|
||||
ent.setKey(key);
|
||||
ent.setDrawingNo(drawingNo);
|
||||
ent.setMaterialNo(oldMaterialList.get(0).getMaterialNo());
|
||||
ent.setMaterialName(oldMaterialList.get(0).getMaterialName());
|
||||
ent.setMaterialDesc(oldMaterialList.get(0).getMaterialDesc());
|
||||
ent.setMaterialCategoryCode(oldMaterialList.get(0).getMaterialCategoryCode());
|
||||
vMNos.put(ent.getKey(),ent);
|
||||
}
|
||||
else {
|
||||
ent.setMaterialNo(oldMaterial.getMaterialNo());
|
||||
ent.setMaterialName(oldMaterial.getMaterialName());
|
||||
ent.setMaterialDesc(oldMaterial.getMaterialDesc());
|
||||
ent.setMaterialCategoryCode(oldMaterial.getMaterialCategoryCode());
|
||||
vMNos.put(ent.getKey(), ent);
|
||||
} else {
|
||||
ent.setKey(key);
|
||||
ent.setDrawingNo(drawingNo);
|
||||
ent.setMaterialName(materialName);
|
||||
ent.setMaterialDesc(materialName);
|
||||
ent.setMaterialCategoryCode(virtualPackageType.getMaterialCategoryCode());
|
||||
}
|
||||
return ent;
|
||||
return ent;
|
||||
}
|
||||
|
||||
private AddVirtrualMaterialDTO buildAddMaterialParamDo(String key, String drawingNo, String materialName, VirtualPackageTypeEnum virtualPackageType,Map<String,MaterialMainEntity> oldMaterialMap){
|
||||
|
|
@ -238,30 +274,30 @@ public abstract class VirtualPackageBase {
|
|||
|
||||
protected BomNewEbomParentEntity buildParentVirtualPackage(Long rowId, VirtualPackageTypeEnum virtualPackageTypeEnum, String orderNum, BomNewEbomParentEntity p) {
|
||||
|
||||
AddVirtrualMaterialDTO addM = vMNos.get(StrUtil.join("",rowId,virtualPackageTypeEnum.getConMaterialName()));
|
||||
BomNewEbomParentEntity oldParent= SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery()
|
||||
AddVirtrualMaterialDTO addM = vMNos.get(StrUtil.join("", rowId, virtualPackageTypeEnum.getConMaterialName()));
|
||||
BomNewEbomParentEntity oldParent = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery()
|
||||
.eq(BomNewEbomParentEntity::getMaterialNo, addM.getMaterialNo())
|
||||
.eq(BomNewEbomParentEntity::getLastVersionIs,1)
|
||||
.eq(BomNewEbomParentEntity::getLastVersionIs, 1)
|
||||
//.ne(BomNewEbomParentEntity::getStatus, EBomStatusEnum.PUBLISHED.getValue())
|
||||
.one();
|
||||
|
||||
if(Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus()) ){
|
||||
if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) {
|
||||
return oldParent;
|
||||
}
|
||||
|
||||
if(Objects.nonNull(oldParent)){
|
||||
if (Objects.nonNull(oldParent)) {
|
||||
oldParent.setLastVersionIs(0);
|
||||
this.parentResult.add(oldParent);
|
||||
}
|
||||
// String materialNo = SpringUtil.getBean(MaterialService.class).addMaterial(drawingNo, vMaterialName,materialDesc, virtualPackageType.getMaterialCategoryCode());
|
||||
BomNewEbomParentEntity parent =new BomNewEbomParentEntity();
|
||||
BomNewEbomParentEntity parent = new BomNewEbomParentEntity();
|
||||
parent.setRowId(IdWorker.getId());
|
||||
parent.setOrderNumber(StrUtil.isNotBlank(orderNum) ? StrUtil.padPre(orderNum,3,"0"):"001");
|
||||
parent.setDrawingNo(addM.getDrawingNo() );
|
||||
parent.setOrderNumber(StrUtil.isNotBlank(orderNum) ? StrUtil.padPre(orderNum, 3, "0") : "001");
|
||||
parent.setDrawingNo(addM.getDrawingNo());
|
||||
parent.setMaterialNo(addM.getMaterialNo());
|
||||
parent.setMaterialName(addM.getMaterialName());
|
||||
parent.setMaterialDesc(addM.getMaterialDesc());
|
||||
parent.setCurrentVersion(VersionUtil.getNextVersion(Objects.nonNull(oldParent)?oldParent.getCurrentVersion():""));
|
||||
parent.setCurrentVersion(VersionUtil.getNextVersion(Objects.nonNull(oldParent) ? oldParent.getCurrentVersion() : ""));
|
||||
parent.setVirtualPackageIs(1);
|
||||
// parent.setProjectType("L");
|
||||
// parent.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
|
||||
|
|
@ -285,11 +321,12 @@ public abstract class VirtualPackageBase {
|
|||
|
||||
/**
|
||||
* 构建子级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo,VirtualPackageTypeEnum virtualPackageTypeEnum,String rootMaterialNo){
|
||||
BomNewEbomChildEntity childEntity =new BomNewEbomChildEntity();
|
||||
BeanUtil.copyProperties(parent,childEntity);
|
||||
protected BomNewEbomChildEntity buildChild(BomNewEbomParentEntity parent, Long parentRowId, String orderNo, VirtualPackageTypeEnum virtualPackageTypeEnum, String rootMaterialNo) {
|
||||
BomNewEbomChildEntity childEntity = new BomNewEbomChildEntity();
|
||||
BeanUtil.copyProperties(parent, childEntity);
|
||||
childEntity.setRowId(IdWorker.getId());
|
||||
childEntity.setParentRowId(parentRowId);
|
||||
childEntity.setIdentityNo(parent.getRowId().toString());
|
||||
|
|
@ -303,21 +340,22 @@ public abstract class VirtualPackageBase {
|
|||
childEntity.setProjectTypeInputType(ProjectTypeInputTypeEnum.AUTO_MATCH.getValue());
|
||||
childEntity.setVirtualPartRootMaterialNo(rootMaterialNo);
|
||||
this.childResult.add(childEntity);
|
||||
return childEntity;
|
||||
return childEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected List<BomNewEbomParentVO> getChild(){
|
||||
protected List<BomNewEbomParentVO> getChild() {
|
||||
return SpringUtil.getBean(BomNewEbomParentService.class).getChildForVirtualPackage(bomRowId);
|
||||
}
|
||||
|
||||
protected BomNewEbomParentEntity getParentZhiZuo(String inDrawingNo){
|
||||
protected BomNewEbomParentEntity getParentZhiZuo(String inDrawingNo) {
|
||||
|
||||
return SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getDrawingNo,StrUtil.join("","(", inDrawingNo,VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName(),")"))
|
||||
.eq(BomNewEbomParentEntity::getLastVersionIs,1).one();
|
||||
return SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getDrawingNo, StrUtil.join("", "(", inDrawingNo, VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName(), ")"))
|
||||
.eq(BomNewEbomParentEntity::getLastVersionIs, 1).one();
|
||||
|
||||
// List<BomNewEbomChildEntity> list = SpringUtil.getBean(BomNewEbomChildService.class).lambdaQuery().eq(BomNewEbomChildEntity::getParentRowId, inBomRowId).list();
|
||||
// List<BomNewEbomChildEntity> zhiZuo = list.stream().filter(u -> u.getMaterialName().contains(VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName())).collect(Collectors.toList());
|
||||
|
|
@ -331,10 +369,11 @@ public abstract class VirtualPackageBase {
|
|||
|
||||
/**
|
||||
* 获取父节点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected BomNewEbomParentEntity getParentByRowId(Long rowId){
|
||||
return SpringUtil.getBean(BomNewEbomParentService.class).getById(rowId);
|
||||
protected BomNewEbomParentEntity getParentByRowId(Long rowId) {
|
||||
return SpringUtil.getBean(BomNewEbomParentService.class).getById(rowId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue