Merge branch 'feature/DM/nflg-bom' of http://112.74.186.154:3000/nflj/nflg_project into feature/DM/nflg-bom
# Conflicts: # nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/CheckEBomException.java
This commit is contained in:
commit
cfc4280ba5
|
|
@ -14,10 +14,7 @@ import com.nflg.product.bomnew.pojo.query.BomNewEbomMaterialQuery;
|
|||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.*;
|
||||
import com.nflg.product.bomnew.service.BomNewEbomParentService;
|
||||
import com.nflg.product.bomnew.service.BomNewOriginalParentService;
|
||||
import com.nflg.product.bomnew.service.MaterialMainService;
|
||||
import com.nflg.product.bomnew.service.UserRoleService;
|
||||
import com.nflg.product.bomnew.service.*;
|
||||
import com.nflg.product.bomnew.service.domain.EBom.VirtualPackageBase;
|
||||
import com.nflg.product.bomnew.service.domain.EBom.VirtualPackageFor31;
|
||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||
|
|
@ -66,6 +63,9 @@ public class EbomApi extends BaseApi {
|
|||
@Resource
|
||||
private UserRoleService userRoleService;
|
||||
|
||||
@Resource
|
||||
private BomNewEbomUpgradeChangeService upgradeChangeService;
|
||||
|
||||
|
||||
@PostMapping("workDetailsListByPage")
|
||||
@ApiOperation("Ebom-工作明细列表")
|
||||
|
|
@ -81,10 +81,28 @@ public class EbomApi extends BaseApi {
|
|||
|
||||
@PostMapping("changeImpact")
|
||||
@ApiOperation("Ebom-变更影响")
|
||||
public ResultVO<Page<BomNewEbomParentVO>> changeImpact(@RequestBody BomNewEbomParentQuery query) {
|
||||
return ResultVO.success(bomNewEbomParentService.formalWorksheet(query));
|
||||
public ResultVO<Page<BomNewEbomUpgradeChangeVO>> changeImpact(@RequestBody BomNewEbomParentQuery query) {
|
||||
return ResultVO.success(bomNewEbomParentService.getUpgradeChangeList(query));
|
||||
}
|
||||
|
||||
@PostMapping("delChangeImpact")
|
||||
@ApiOperation("Ebom-删除变更影响")
|
||||
public ResultVO<Boolean> delChangeImpact(@RequestBody List<Long> rowIds){
|
||||
VUtils.isTure(CollUtil.isEmpty(rowIds)).throwMessage("请选择要删除的数据");
|
||||
upgradeChangeService.delChangeImpact(rowIds);
|
||||
return ResultVO.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("updateChangeImpactVersion")
|
||||
@ApiOperation("Ebom-更新版本")
|
||||
public ResultVO<Boolean> updateChangeImpactVersion(@RequestBody List<Long> rowIds){
|
||||
VUtils.isTure(CollUtil.isEmpty(rowIds)).throwMessage("请选择要更新版本的数据");
|
||||
upgradeChangeService.updateChangeImpactVersion(rowIds);
|
||||
return ResultVO.success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("getChild")
|
||||
@ApiOperation("获取子级")
|
||||
public ResultVO<List<BomNewEbomParentVO>> getChild(@RequestParam("bomRowId") Long bomRowId) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ public class OriginalBomApi extends BaseApi {
|
|||
public ResultVO<List<TreeNode<BomOriginalListVO>>> getChildTree(@RequestParam("rowId") Long rowId) throws ExecutionException, InterruptedException {
|
||||
return ResultVO.success(originalParentService.getChildTree(rowId));
|
||||
}
|
||||
|
||||
@PostMapping("saveBom")
|
||||
@ApiOperation("编辑时-暂存")
|
||||
public ResultVO<Boolean> saveBom(@Valid @RequestBody OriginalSaveBomDTO bom) {
|
||||
|
|
@ -120,6 +121,7 @@ public class OriginalBomApi extends BaseApi {
|
|||
|
||||
/**
|
||||
* 原始BOM转EBom
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("convertToEBom")
|
||||
|
|
@ -160,12 +162,7 @@ public class OriginalBomApi extends BaseApi {
|
|||
|
||||
//计算层级
|
||||
originalParentService.computeLevelNumAndRootState();
|
||||
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
|
||||
// @Override
|
||||
// public void afterCommit() {
|
||||
// originalParentService.computeLevelNumAndRootState();
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
return ResultVO.success(true);
|
||||
}
|
||||
|
|
@ -198,17 +195,14 @@ public class OriginalBomApi extends BaseApi {
|
|||
public ResultVO<Boolean> testImportBom() throws IOException {
|
||||
InputStream inputStream = new FileInputStream("C:\\Users\\01956\\Desktop\\西卡印尼烘干线总站BOM.xlsx");
|
||||
originalParentService.importBomTest(inputStream);
|
||||
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
|
||||
@Override
|
||||
public void afterCommit() {
|
||||
|
||||
// originalParentService.computeLevelNumAndRootState();
|
||||
|
||||
originalParentService.computeLevelNumAndRootState();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return ResultVO.success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
|
|||
import com.nflg.product.bomnew.pojo.query.BomNewEbomParentQuery;
|
||||
import com.nflg.product.bomnew.pojo.query.OriginalBomQuery;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomNewEbomUpgradeChangeVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.BomOriginalListVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.MaterialHistoryProjectTypeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -38,6 +39,8 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
* @return
|
||||
*/
|
||||
Page<BomNewEbomParentVO> formalWorksheet(Page<BomNewEbomParentVO> page, @Param("query") BomNewEbomParentQuery query);
|
||||
|
||||
Page<BomNewEbomUpgradeChangeVO> getUpgradeChangeList(Page<BomNewEbomUpgradeChangeVO> page, @Param("query") BomNewEbomParentQuery query);
|
||||
/**
|
||||
* 获取子级
|
||||
* @param rowId
|
||||
|
|
@ -58,4 +61,6 @@ public interface BomNewEbomParentMapper extends BaseMapper<BomNewEbomParentEntit
|
|||
void updateRootState();
|
||||
|
||||
void delBatch(@Param("rowIds") List<Long> rowIds);
|
||||
|
||||
void updateStateBatchByRowIds(@Param("status") Integer status, @Param("list") List<Long> list );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,5 +33,8 @@ public interface BomNewOriginalParentMapper extends BaseMapper<BomNewOriginalPar
|
|||
/**
|
||||
* 更新是否根节点状态
|
||||
*/
|
||||
void updateRootState();
|
||||
void updateRootState_1();
|
||||
|
||||
void updateRootState_2();
|
||||
void updateRootState_3();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
package com.nflg.product.bomnew.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* t_bom_new_ebom_upgrade_change
|
||||
* ebom-变更影响
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-23 16:10:19
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="com-nflg-product-bomnew-pojo-new-vo-BomNewEbomUpgradeChangeEntityVO")
|
||||
public class BomNewEbomUpgradeChangeVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键-行ID
|
||||
*/
|
||||
@ApiModelProperty(value = "主键-行ID")
|
||||
private Long rowId;
|
||||
|
||||
/**
|
||||
* 受影响的物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "受影响的物料编码")
|
||||
private String materialNo;
|
||||
|
||||
/**
|
||||
* 修订版(旧)
|
||||
*/
|
||||
@ApiModelProperty(value = "修订版(旧)")
|
||||
private String versionOld;
|
||||
|
||||
/**
|
||||
* 修订版(新)
|
||||
*/
|
||||
@ApiModelProperty(value = "修订版(新)")
|
||||
private String versionNew;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 图号
|
||||
*/
|
||||
@ApiModelProperty(value = "图号")
|
||||
private String drawingNo;
|
||||
|
||||
/**
|
||||
* 设计人员
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员")
|
||||
private String deviseName;
|
||||
|
||||
/**
|
||||
* 设计人员部门
|
||||
*/
|
||||
@ApiModelProperty(value = "设计人员部门")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 关联物料编码
|
||||
*/
|
||||
@ApiModelProperty(value = "关联物料编码")
|
||||
private String relMaterialNo;
|
||||
|
||||
/**
|
||||
* 关联物料描述
|
||||
*/
|
||||
@ApiModelProperty(value = "关联物料描述")
|
||||
private String relMaterialDesc;
|
||||
|
||||
/**
|
||||
* 状态:0-未升级处理 1-已升级处理
|
||||
*/
|
||||
@ApiModelProperty(value = "状态:0-未升级处理 1-已升级处理")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -201,6 +201,20 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取变更影响
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
public Page<BomNewEbomUpgradeChangeVO> getUpgradeChangeList(BomNewEbomParentQuery query) {
|
||||
Page<BomNewEbomUpgradeChangeVO> result = this.getBaseMapper().getUpgradeChangeList(new Page<>(query.getPage(), query.getPageSize()), query);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取子级
|
||||
*
|
||||
|
|
@ -248,6 +262,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
}
|
||||
}
|
||||
}
|
||||
//初始化错误
|
||||
initBomException(parentChild);
|
||||
return parentChild;
|
||||
|
||||
}
|
||||
|
|
@ -446,11 +462,16 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
|
||||
BomNewEbomParentVO parent = Convert.convert(BomNewEbomParentVO.class, this.getById(bomRowId));
|
||||
List<BomNewEbomParentVO> bomTree = getBomTree(bomRowId);
|
||||
|
||||
EBomToPBom eBomToPBom = new EBomToPBom(parent, bomTree, paramDto.getFacCodes());
|
||||
parent.setBomRowId(parent.getRowId());
|
||||
parent.setChildBomRowId(parent.getRowId());
|
||||
parent.setParentRowId(0L);
|
||||
bomTree.add(parent);
|
||||
EBomToPBom eBomToPBom = new EBomToPBom(parent, bomTree, paramDto.getFacCodes(),0L);
|
||||
eBomToPBom.convert();
|
||||
|
||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomParentResult())) {
|
||||
pBomParentService.saveOrUpdateBatch(eBomToPBom.getPBomParentResult());
|
||||
|
||||
}
|
||||
if (CollUtil.isNotEmpty(eBomToPBom.getPBomChildResult())) {
|
||||
pBomChildService.saveOrUpdateBatch(eBomToPBom.getPBomChildResult());
|
||||
|
|
@ -461,6 +482,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
if(CollUtil.isNotEmpty(eBomToPBom.getUpgradeChangeResult())){
|
||||
upgradeChangeService.saveOrUpdateBatch(eBomToPBom.getUpgradeChangeResult());
|
||||
};
|
||||
if(CollUtil.isNotEmpty(eBomToPBom.getHasConvertEBomRowIds())){
|
||||
this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(),eBomToPBom.getHasConvertEBomRowIds());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.nflg.product.bomnew.mapper.master.BomNewEbomUpgradeChangeMapper;
|
|||
import com.nflg.product.bomnew.pojo.entity.BomNewEbomUpgradeChangeEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* t_bom_new_ebom_upgrade_change 表服务实现类
|
||||
|
|
@ -16,4 +18,25 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class BomNewEbomUpgradeChangeService extends ServiceImpl<BomNewEbomUpgradeChangeMapper, BomNewEbomUpgradeChangeEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public void delChangeImpact(List<Long> rowIds){
|
||||
this.getBaseMapper().deleteBatchIds(rowIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新版本
|
||||
*/
|
||||
public void updateChangeImpactVersion(List<Long> rowIds){
|
||||
List<BomNewEbomUpgradeChangeEntity> upList = this.getBaseMapper().selectBatchIds(rowIds);
|
||||
//
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.product.base.core.config.SpringContextUtils;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.base.core.exception.NflgBusinessException;
|
||||
import com.nflg.product.bomnew.constant.OriginalConstant;
|
||||
import com.nflg.product.bomnew.constant.OriginalEditStatusEnum;
|
||||
import com.nflg.product.bomnew.constant.OriginalSourceEnum;
|
||||
|
|
@ -233,7 +234,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
for (BomNewOriginalParentEntity bom : list) {
|
||||
bom.setRootIs(1);
|
||||
// bom.setRootIs(1);
|
||||
List<BomOriginalListVO> bomDetail = this.getBaseMapper().getParentChild(bom.getRowId());
|
||||
OriginalBomDetailTask detailTask = new OriginalBomDetailTask(bomDetail);
|
||||
detailTask.setLevelNum(1);
|
||||
|
|
@ -284,16 +285,18 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
* 计算层级数和根节点状态
|
||||
*/
|
||||
public void computeLevelNumAndRootState() {
|
||||
//计算树的层级数
|
||||
// CompletableFuture.runAsync(() -> {
|
||||
|
||||
try {
|
||||
this.getBaseMapper().updateRootState();
|
||||
this.getBaseMapper().updateRootState_1();
|
||||
this.getBaseMapper().updateRootState_2();
|
||||
this.getBaseMapper().updateRootState_3();
|
||||
this.compucteLevelNum();
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
log.info("计算层级出错:" + e.getMessage());
|
||||
}
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -385,7 +388,6 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
|||
/**
|
||||
* 原始BOM导入
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importBom(MultipartFile file) throws IOException {
|
||||
rowNum.set(1);
|
||||
excelContextTL.set(new ArrayList<>());
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class CheckEBomException {
|
|||
List<BomNewEbomParentVO> allBomDetail ;
|
||||
|
||||
public CheckEBomException(Long bomRowId) throws ExecutionException, InterruptedException {
|
||||
|
||||
// allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).getBomTree(bomRowId);
|
||||
// BomNewEbomParentEntity parent = SpringUtil.getBean(BomNewEbomParentService.class).getById(bomRowId);
|
||||
// BomNewEbomParentVO convert = Convert.convert(BomNewEbomParentVO.class, parent);
|
||||
|
|
@ -46,6 +47,7 @@ public class CheckEBomException {
|
|||
// allBomDetail.add(convert);
|
||||
|
||||
allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).buildBomTreeContainSelf(bomRowId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class EBomDetailTask extends RecursiveTask<List<BomNewEbomParentVO>> {
|
|||
BomNewEbomParentEntity ebomParentEntity = stringBomNewOriginalParentEntityMap.get(detailVO.getMaterialNo());
|
||||
detailVO.setChildBomRowId(ebomParentEntity.getRowId());
|
||||
detailVO.setBomRowId(ebomParentEntity.getRowId());
|
||||
|
||||
detailVO.setCurrentVersion(ebomParentEntity.getCurrentVersion());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.nflg.product.bomnew.util.ListCommonUtil;
|
|||
import com.nflg.product.bomnew.util.VUtils;
|
||||
import com.nflg.product.bomnew.util.VersionUtil;
|
||||
import lombok.Getter;
|
||||
import org.bouncycastle.crypto.engines.EthereumIESEngine;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -58,17 +59,20 @@ public class EBomToPBom {
|
|||
@Getter
|
||||
private List<BomNewEbomUpgradeChangeEntity> upgradeChangeResult = new ArrayList<>();
|
||||
|
||||
@Getter
|
||||
private List<Long> hasConvertEBomRowIds=new ArrayList<>();
|
||||
|
||||
|
||||
private Map<String, String> generateDrawingNoMap = new HashMap<>();
|
||||
|
||||
private Set<String> upChangeMaterialSet = new HashSet<>();
|
||||
|
||||
|
||||
public EBomToPBom(BomNewEbomParentVO inParent, List<BomNewEbomParentVO> inAllBomDetail, List<String> inFacCodes) {
|
||||
public EBomToPBom(BomNewEbomParentVO inParent, List<BomNewEbomParentVO> inAllBomDetail, List<String> inFacCodes, Long parentRowId) {
|
||||
this.parent = inParent;
|
||||
this.allBomDetail = inAllBomDetail;
|
||||
this.facCodes = inFacCodes;
|
||||
generateDrawingNo(allBomDetail, inParent.getRowId(), "");
|
||||
generateDrawingNo(allBomDetail, parentRowId, "");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -83,6 +87,7 @@ public class EBomToPBom {
|
|||
List<BomNewEbomParentVO> parentList = result.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList());
|
||||
|
||||
for (String facCode : facCodes) {
|
||||
//buildPBomParent(parent, facCode);
|
||||
for (BomNewEbomParentVO vo : parentList) {
|
||||
BomNewPbomParentEntity parentEnt = buildPBomParent(vo, facCode);
|
||||
//子级
|
||||
|
|
@ -94,6 +99,7 @@ public class EBomToPBom {
|
|||
childEnt.setRowId(IdWorker.getId());
|
||||
childEnt.setParentRowId(parentEnt.getRowId());
|
||||
childEnt.setFacCode(facCode);
|
||||
childEnt.setIdentityNo(StrUtil.join("-", parentEnt.getMaterialNo(), eb.getMaterialNo()));
|
||||
this.pBomChildResult.add(childEnt);
|
||||
}
|
||||
}
|
||||
|
|
@ -121,6 +127,7 @@ public class EBomToPBom {
|
|||
.eq(BomNewPbomParentEntity::getMaterialNo, parentVo.getMaterialNo())
|
||||
.eq(BomNewPbomParentEntity::getFacCode, facCode).one();
|
||||
|
||||
this.hasConvertEBomRowIds.add(parentVo.getRowId());
|
||||
if (Objects.nonNull(oldParent) && !EBomStatusEnum.PUBLISHED.equalsValue(oldParent.getStatus())) {
|
||||
SpringUtil.getBean(BomNewPbomChildService.class).getBaseMapper().deleteByMap(ImmutableMap.of("parent_row_id", oldParent.getRowId()));
|
||||
oldParent.setCurrentVersion(parentVo.getCurrentVersion());
|
||||
|
|
@ -155,8 +162,7 @@ public class EBomToPBom {
|
|||
vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId()));
|
||||
vo.setParentRowId(lastVirtualPackage.getBomRowId());
|
||||
result.add(vo);
|
||||
}
|
||||
else { //当没找到直发包时,记录到变更影响
|
||||
} else { //当没找到直发包时,记录到变更影响
|
||||
buildUpgradeChange(vo);
|
||||
}
|
||||
continue;
|
||||
|
|
@ -169,8 +175,7 @@ public class EBomToPBom {
|
|||
vo.setSourceParentMaterialNo(getParentMaterialNo(vo.getBomRowId()));
|
||||
vo.setParentRowId(lastVirtualPackage.getBomRowId());
|
||||
result.add(vo);
|
||||
}
|
||||
else { //当没找到直发包时,记录到变更影响
|
||||
} else { //当没找到直发包时,记录到变更影响
|
||||
buildUpgradeChange(vo);
|
||||
}
|
||||
continue;
|
||||
|
|
@ -224,7 +229,6 @@ public class EBomToPBom {
|
|||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 提层汇总数量
|
||||
*
|
||||
|
|
@ -272,11 +276,9 @@ public class EBomToPBom {
|
|||
List<BomNewEbomParentVO> voParent = allBomDetail.stream().filter(u -> u.getBomRowId().equals(vo.getParentRowId())).collect(Collectors.toList());
|
||||
VUtils.isTure(CollUtil.isEmpty(voParent)).throwMessage(vo.getMaterialNo() + " 未找到父级");
|
||||
if (voParent.get(0).getMaterialName().contains(VirtualPackageTypeEnum.DIRECT_DELIVERY_PACKAGE.getConMaterialName()) &&
|
||||
!voParent.get(0).getMaterialName().contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getConMaterialName()) && !voParent.get(0).getMaterialName().contains(VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName()))
|
||||
{
|
||||
!voParent.get(0).getMaterialName().contains(VirtualPackageTypeEnum.PRE_ASSEMBLY_PACKAGE.getConMaterialName()) && !voParent.get(0).getMaterialName().contains(VirtualPackageTypeEnum.MAKING_PACKAGE.getConMaterialName())) {
|
||||
packageCompositionEntity.setParentMaterialNo(voParent.get(0).getMaterialNo());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
packageCompositionEntity.setParentMaterialNo(vo.getMaterialNo());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public class EbomInitProjectType {
|
|||
sameLevelChild = getChilds(child.getParentRowId());
|
||||
sResult = sameLevelChild.stream().filter(u -> u.getMaterialCategoryCode().startsWith("2005") || u.getMaterialCategoryCode().startsWith("2006")).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(sResult)) {
|
||||
List<String> projectType = sResult.stream().map(u -> u.getProjectType()).distinct().collect(Collectors.toList());
|
||||
List<String> projectType = sResult.stream().filter(u->StrUtil.isNotBlank(u.getProjectType())).map(u -> u.getProjectType()).distinct().collect(Collectors.toList());
|
||||
if (projectType.size() == 1 && projectType.get(0).equals("Q")) {
|
||||
child.setProjectType("Q");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.nflg.product.bomnew.service.domain.EBom;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 更新-变更影响版本
|
||||
*/
|
||||
public class UpdateChangeVersion {
|
||||
|
||||
@ApiModelProperty("变更行ID")
|
||||
private Long upChangeRowId;
|
||||
|
||||
|
||||
public UpdateChangeVersion (Long inUpChangeRowId){
|
||||
this.upChangeRowId=inUpChangeRowId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -231,6 +231,7 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
|||
eBomParent.setConvertToEbomTime(LocalDateTime.now());
|
||||
eBomParent.setSourceRowId(parentEnt.getBomRowId());
|
||||
eBomParent.setLastVersionIs(1);
|
||||
eBomParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
eBomParent.setModifyTime(LocalDateTime.now());
|
||||
eBomParent.setBomExist(parentEnt.getBomRowId()>0?1:0);
|
||||
//工艺岗直接到已复核
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@
|
|||
<!--Ebom工作列表-->
|
||||
<select id="getEBomListPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||
<if test="job==0">
|
||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where status=1 and created_by=#{createdBy} and user_root_is=1 and
|
||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where created_by=#{createdBy} and user_root_is=1 and
|
||||
(status=1 or status=3)
|
||||
<include refid="whr"/>
|
||||
</if>
|
||||
<if test="job==1">
|
||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where status=2 and user_root_is=1 and ( status=2 or status=4 )
|
||||
select * ,row_id as bomRowId from t_bom_new_ebom_parent where user_root_is=1 and ( status=2 or status=4 )
|
||||
<include refid="whr"/>
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -119,10 +119,31 @@
|
|||
|
||||
<!--BOM-正式工作表-->
|
||||
<select id="formalWorksheet" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||
select row_id as bomRowId, * from t_bom_new_ebom_parent where status=4
|
||||
select * , row_id as bomRowId from t_bom_new_ebom_parent where status=4
|
||||
<include refid="whr"/>
|
||||
</select>
|
||||
|
||||
<sql id="getUpgradeChangeListWhr">
|
||||
<if test="query.drawingNo!=null and query.drawingNo!=''">
|
||||
and drawing_no=#{query.drawingNo}
|
||||
</if>
|
||||
<if test="query.materialNo!=null and query.materialNo!=''">
|
||||
and material_no=#{query.materialNo}
|
||||
</if>
|
||||
<if test="query.deviseName!=null and query.deviseName!=''">
|
||||
and devise_name=#{query.deviseName}
|
||||
</if>
|
||||
<if test="query.startDate!=null and query.startDate!=''">
|
||||
and updated_time between #{query.startDate} and #{query.endDate}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!--BOM-变更影响-->
|
||||
<select id="getUpgradeChangeList" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomUpgradeChangeVO">
|
||||
select * from t_bom_new_ebom_upgrade_change where status=0
|
||||
<include refid="getUpgradeChangeListWhr"/>
|
||||
</select>
|
||||
|
||||
<!--获取子级-->
|
||||
<select id="getParentChild" resultType="com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO">
|
||||
select *
|
||||
|
|
@ -186,6 +207,13 @@
|
|||
</foreach>;
|
||||
</delete>
|
||||
|
||||
<update id="updateStateBatchByRowIds">
|
||||
update t_bom_new_ebom_parent set status=#{status} where row_id in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
and status=2
|
||||
|
||||
<if test="query.startDate==null or query.startDate==''">
|
||||
and created_time> DATE_ADD(now(), INTERVAL -3 DAY)
|
||||
and convert_to_ebom_time> DATE_ADD(now(), INTERVAL -3 DAY)
|
||||
</if>
|
||||
</if>
|
||||
<if test="query.status==1">
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
</delete>
|
||||
|
||||
<update id="updateBomState">
|
||||
update t_bom_new_original_parent set status = #{status} where
|
||||
update t_bom_new_original_parent set status = #{status},convert_to_ebom_time=now() where
|
||||
row_id in
|
||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||
#{rowId}
|
||||
|
|
@ -124,23 +124,27 @@
|
|||
</foreach>;
|
||||
</update>
|
||||
|
||||
<update id="updateRootState">
|
||||
<update id="updateRootState_1">
|
||||
|
||||
update t_bom_new_original_parent set root_is=0,user_root_is=0 where last_version_is=1;
|
||||
update t_bom_new_original_parent set root_is=0,user_root_is=0 where last_version_is=1
|
||||
|
||||
</update>
|
||||
<update id="updateRootState_2">
|
||||
update t_bom_new_original_parent a join (
|
||||
select a.row_id from t_bom_new_original_parent a
|
||||
left join t_bom_new_original_child b
|
||||
on a.drawing_no=b.drawing_no
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.root_is=1;
|
||||
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.root_is=1
|
||||
</update>
|
||||
|
||||
<update id="updateRootState_3">
|
||||
update t_bom_new_original_parent a join (
|
||||
select a.row_id from t_bom_new_original_parent a
|
||||
left join t_bom_new_original_child b
|
||||
on a.drawing_no=b.drawing_no and a.created_by=b.created_by
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.user_root_is=1;
|
||||
|
||||
where a.last_version_is=1 and b.row_id is null ) t on a.row_id=t.row_id set a.user_root_is=1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue