1.问题修复
This commit is contained in:
parent
b2ce4ad31c
commit
b9f3434995
|
|
@ -28,9 +28,9 @@ public interface BomNewOriginalParentMapper extends BaseMapper<BomNewOriginalPar
|
||||||
|
|
||||||
void delBatch(@Param("rowIds") List<Long> rowIds);
|
void delBatch(@Param("rowIds") List<Long> rowIds);
|
||||||
|
|
||||||
void updateBomState(@Param("status") Integer status ,@Param("rowIds") List<Long> rowIds);
|
void updateBomState(@Param("editStatus") Integer editStatus, @Param("status") Integer status ,@Param("rowIds") List<Long> rowIds);
|
||||||
|
|
||||||
void updateRevertBom(@Param("status") Integer status ,@Param("editStatus") Integer editStatus ,@Param("rowIds") List<Long> rowIds);
|
void updateRevertBom( @Param("status") Integer status ,@Param("editStatus") Integer editStatus ,@Param("rowIds") List<Long> rowIds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,12 +116,16 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
if (CollUtil.isNotEmpty(parentMaterialByMaterialNo)) {
|
||||||
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo);
|
List<BomNewEbomParentVO> parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo);
|
||||||
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo);
|
List<BomNewEbomParentVO> childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo, materialNo);
|
||||||
|
List<BomNewEbomParentVO> data=new ArrayList<>();
|
||||||
|
data.addAll(parents);
|
||||||
|
data.addAll(childs);
|
||||||
|
materialMainService.intiMaterialInfo(data , "material","materialTexture","projectType");
|
||||||
returnResult = handSeachToTree(parents, childs);
|
returnResult = handSeachToTree(parents, childs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Page<BomNewEbomParentVO> result = this.getBaseMapper().getEBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode());
|
Page<BomNewEbomParentVO> result = this.getBaseMapper().getEBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode());
|
||||||
|
materialMainService.intiMaterialInfo(result.getRecords() , "material","materialTexture","projectType");
|
||||||
returnResult = result;
|
returnResult = result;
|
||||||
}
|
}
|
||||||
return returnResult;
|
return returnResult;
|
||||||
|
|
@ -534,7 +538,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
newParent.setRowId(IdWorker.getId());
|
newParent.setRowId(IdWorker.getId());
|
||||||
newParent.setLastVersionIs(1);
|
newParent.setLastVersionIs(1);
|
||||||
newParent.setCurrentVersion(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion()));
|
newParent.setCurrentVersion(VersionUtil.getNextVersionForSmallVersion(parent.getCurrentVersion()));
|
||||||
|
newParent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_11.getValue());
|
||||||
parent.setLastVersionIs(0);
|
parent.setLastVersionIs(0);
|
||||||
parentResult.add(newParent);
|
parentResult.add(newParent);
|
||||||
parentResult.add(parent);
|
parentResult.add(parent);
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
|
||||||
}
|
}
|
||||||
//将原始BOM及子级转为已处理
|
//将原始BOM及子级转为已处理
|
||||||
if (CollUtil.isNotEmpty(convert.getHasHandlerParentIds())) {
|
if (CollUtil.isNotEmpty(convert.getHasHandlerParentIds())) {
|
||||||
this.getBaseMapper().updateBomState(OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
this.getBaseMapper().updateBomState(OriginalEditStatusEnum.HANDLER_FINISHED.getValue(), OriginalStatusEnum.OVER_CONVERT.getValue(), convert.getHasHandlerParentIds());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,9 @@ public class CheckEBomException {
|
||||||
|
|
||||||
public void checkException(){
|
public void checkException(){
|
||||||
for (BomNewEbomParentVO vo : allBomDetail) {
|
for (BomNewEbomParentVO vo : allBomDetail) {
|
||||||
if(Objects.isNull(vo.getExceptionStatus())) {
|
// if(Objects.isNull(vo.getExceptionStatus())) {
|
||||||
vo.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
vo.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||||
}
|
// }
|
||||||
if (StrUtil.isNotBlank(vo.getMaterialNo())
|
if (StrUtil.isNotBlank(vo.getMaterialNo())
|
||||||
&& (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(vo.getMaterialState())
|
&& (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(vo.getMaterialState())
|
||||||
|| MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(vo.getMaterialState()))) {
|
|| MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(vo.getMaterialState()))) {
|
||||||
|
|
@ -89,8 +89,8 @@ public class CheckEBomException {
|
||||||
} else if (StrUtil.isBlank(vo.getProjectType())) {
|
} else if (StrUtil.isBlank(vo.getProjectType())) {
|
||||||
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
|
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
|
||||||
}
|
}
|
||||||
else if (StrUtil.isBlank(vo.getNoticeNums())){
|
else if (StrUtil.isNotBlank(vo.getNoticeNums()) && EBomExceptionStatusEnum.EXCEPT_NO_11.equals(vo.getExceptionStatus())){
|
||||||
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_11.getValue());
|
vo.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ public class EBomToPBom {
|
||||||
*/
|
*/
|
||||||
public void convert() {
|
public void convert() {
|
||||||
//效验数据是否OK
|
//效验数据是否OK
|
||||||
// check();
|
check();
|
||||||
//bom 提层
|
//bom 提层
|
||||||
liftingLayer();
|
liftingLayer();
|
||||||
List<BomNewEbomParentVO> parentList = result.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList());
|
List<BomNewEbomParentVO> parentList = result.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList());
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,8 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
//合并相同编码的物料
|
//合并相同编码的物料
|
||||||
// List<BomOriginalListVO> mergeResult = mergeBOM(parentChild);
|
// List<BomOriginalListVO> mergeResult = mergeBOM(parentChild);
|
||||||
Long parentRowId = buildEBomParent(parentEnt);
|
Long parentRowId = buildEBomParent(parentEnt);
|
||||||
buildEBomChild(parentChild, parentRowId);
|
// buildEBomChild(parentChild, parentRowId);
|
||||||
|
handlerChild(parentEnt,parentChild);
|
||||||
} else { //无子级
|
} else { //无子级
|
||||||
|
|
||||||
MaterialMateVO materialByRel = getMaterialByRel(parent.getMaterialName(), parent.getMaterialTexture());
|
MaterialMateVO materialByRel = getMaterialByRel(parent.getMaterialName(), parent.getMaterialTexture());
|
||||||
|
|
@ -132,7 +133,8 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
|
|
||||||
List<BomOriginalListVO> mergeResult = mergeBOM(parentChild);
|
List<BomOriginalListVO> mergeResult = mergeBOM(parentChild);
|
||||||
Long parentRowId = buildEBomParent(parentEnt);
|
Long parentRowId = buildEBomParent(parentEnt);
|
||||||
buildEBomChild(mergeResult, parentRowId);
|
// buildEBomChild(mergeResult, parentRowId);
|
||||||
|
handlerChild(parentEnt,mergeResult);
|
||||||
|
|
||||||
} else { //无子级
|
} else { //无子级
|
||||||
//一板零部件
|
//一板零部件
|
||||||
|
|
@ -177,13 +179,13 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
* 处理子级
|
* 处理子级
|
||||||
*
|
*
|
||||||
* @param parentEntity
|
* @param parentEntity
|
||||||
* @param originalSourceEnum
|
* @param
|
||||||
*/
|
*/
|
||||||
private void handlerChild(BomOriginalListVO parentEntity, List<BomOriginalListVO> parentChild, OriginalSourceEnum originalSourceEnum) {
|
private void handlerChild(BomOriginalListVO parentEntity, List<BomOriginalListVO> parentChild) {
|
||||||
|
|
||||||
for (BomOriginalListVO childVo : parentChild) {
|
for (BomOriginalListVO childVo : parentChild) {
|
||||||
//一般零部件
|
//一般零部件
|
||||||
if (com.github.xiaoymin.knife4j.core.util.StrUtil.isNotBlank(childVo.getMaterialCategoryCode()) && childVo.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) {
|
if (StrUtil.isNotBlank(childVo.getMaterialCategoryCode()) && childVo.getMaterialCategoryCode().equals(OriginalConstant.COMMON_MATERIAL_CATEGORY_CODE)) {
|
||||||
MaterialMateVO materialByRel = getMaterialByRel(childVo);
|
MaterialMateVO materialByRel = getMaterialByRel(childVo);
|
||||||
//找到对应物料
|
//找到对应物料
|
||||||
if (Objects.nonNull(materialByRel)) {
|
if (Objects.nonNull(materialByRel)) {
|
||||||
|
|
@ -200,13 +202,15 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
newChild.setParentRowId(parentRowId);
|
newChild.setParentRowId(parentRowId);
|
||||||
this.eBomChildResult.add(newChild);
|
this.eBomChildResult.add(newChild);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Long parentRowId = buildEBomParent(childVo);
|
||||||
|
buildEBomChild(childVo, parentRowId);
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
buildEBomChild(childVo,parentEntity.getRowId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -232,11 +236,10 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
* 构建EBom父级
|
* 构建EBom父级
|
||||||
*/
|
*/
|
||||||
private Long buildEBomParent(BomOriginalListVO parentEnt) {
|
private Long buildEBomParent(BomOriginalListVO parentEnt) {
|
||||||
BomNewEbomParentEntity ebom = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, parentEnt.getMaterialNo())
|
BomNewEbomParentEntity ebom = SpringUtil.getBean(BomNewEbomParentService.class).lambdaQuery().eq(BomNewEbomParentEntity::getMaterialNo, parentEnt.getMaterialNo()).eq(BomNewEbomParentEntity::getLastVersionIs, 1).one();
|
||||||
.eq(BomNewEbomParentEntity::getLastVersionIs, 1).one();
|
|
||||||
BomNewEbomParentEntity eBomParent = new BomNewEbomParentEntity();
|
BomNewEbomParentEntity eBomParent = new BomNewEbomParentEntity();
|
||||||
BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType");
|
BeanUtil.copyProperties(parentEnt, eBomParent, "materialGetType");
|
||||||
eBomParent.setRowId(parentEnt.getEBomRowId()>0?parentEnt.getEBomRowId(): IdWorker.getId());
|
eBomParent.setRowId(parentEnt.getEBomRowId() > 0 ? parentEnt.getEBomRowId() : IdWorker.getId());
|
||||||
eBomParent.setSource(EBomSourceEnum.FROM_BOM.getValue());
|
eBomParent.setSource(EBomSourceEnum.FROM_BOM.getValue());
|
||||||
eBomParent.setCurrentVersion(Objects.isNull(ebom) ? "" : VersionUtil.getNextVersion(ebom.getCurrentVersion()));
|
eBomParent.setCurrentVersion(Objects.isNull(ebom) ? "" : VersionUtil.getNextVersion(ebom.getCurrentVersion()));
|
||||||
eBomParent.setConvertToEbomTime(LocalDateTime.now());
|
eBomParent.setConvertToEbomTime(LocalDateTime.now());
|
||||||
|
|
@ -245,6 +248,12 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
eBomParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
eBomParent.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||||
eBomParent.setModifyTime(LocalDateTime.now());
|
eBomParent.setModifyTime(LocalDateTime.now());
|
||||||
eBomParent.setBomExist(parentEnt.getBomRowId() > 0 ? 1 : 0);
|
eBomParent.setBomExist(parentEnt.getBomRowId() > 0 ? 1 : 0);
|
||||||
|
eBomParent.setDeviseName(SessionUtil.getRealName());
|
||||||
|
eBomParent.setDeptName(SessionUtil.getDepartName());
|
||||||
|
eBomParent.setDeviseUserCode(SessionUtil.getUserCode());
|
||||||
|
if (Objects.isNull(ebom)) {
|
||||||
|
eBomParent.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_11.getValue());
|
||||||
|
}
|
||||||
//工艺岗直接到已复核
|
//工艺岗直接到已复核
|
||||||
eBomParent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue());
|
eBomParent.setStatus(SpringUtil.getBean(UserRoleService.class).technician() ? EBomStatusEnum.CHECKED.getValue() : EBomStatusEnum.WAIT_CHECK.getValue());
|
||||||
eBomParent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
eBomParent.setCreatedJob(SpringUtil.getBean(UserRoleService.class).technician() ? UserJobEnum.ENGINEER.getValue() : UserJobEnum.DESIGNER.getValue());
|
||||||
|
|
@ -272,11 +281,24 @@ public class OriginalBomToEBomConvert extends BaseConvert {
|
||||||
childEntity.setIdentityNo(StrUtil.join("_", parentRowId.toString(), childEntity.getRowId()));
|
childEntity.setIdentityNo(StrUtil.join("_", parentRowId.toString(), childEntity.getRowId()));
|
||||||
childEntity.setModifyTime(LocalDateTime.now());
|
childEntity.setModifyTime(LocalDateTime.now());
|
||||||
this.eBomChildResult.add(childEntity);
|
this.eBomChildResult.add(childEntity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buildEBomChild(BomOriginalListVO child, Long parentRowId) {
|
||||||
|
|
||||||
|
|
||||||
|
BomNewEbomChildEntity childEntity = new BomNewEbomChildEntity();
|
||||||
|
BeanUtil.copyProperties(child, childEntity, "materialGetType");
|
||||||
|
childEntity.setRowId(IdWorker.getId());
|
||||||
|
childEntity.setParentRowId(parentRowId);
|
||||||
|
childEntity.setIdentityNo(StrUtil.join("_", parentRowId.toString(), childEntity.getRowId()));
|
||||||
|
childEntity.setModifyTime(LocalDateTime.now());
|
||||||
|
this.eBomChildResult.add(childEntity);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并相同物料
|
* 合并相同物料
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -131,13 +131,13 @@
|
||||||
|
|
||||||
|
|
||||||
<update id="updateBomState">
|
<update id="updateBomState">
|
||||||
update t_bom_new_original_parent set status = #{status},convert_to_ebom_time=now() where
|
update t_bom_new_original_parent set status = #{status},edit_status=#{editStatus}, convert_to_ebom_time=now() where
|
||||||
row_id in
|
row_id in
|
||||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||||
#{rowId}
|
#{rowId}
|
||||||
</foreach>;
|
</foreach>;
|
||||||
|
|
||||||
update t_bom_new_original_child set status = #{status} where
|
update t_bom_new_original_child set status = #{status} ,edit_status=#{editStatus} where
|
||||||
parent_row_id in
|
parent_row_id in
|
||||||
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
<foreach collection="rowIds" item="rowId" open="(" separator="," close=")">
|
||||||
#{rowId}
|
#{rowId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue