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/pojo/vo/BomNewPbomParentVO.java
This commit is contained in:
jing's 2024-01-23 21:56:41 +08:00
commit b65c7d3953
9 changed files with 64 additions and 21 deletions

View File

@ -29,6 +29,14 @@ public class TechnologyPackageParam {
@NotNull(message = "项目类别不能为空") @NotNull(message = "项目类别不能为空")
private String projectType; private String projectType;
@ApiModelProperty("图号")
private String drawingNo;
@ApiModelProperty("名称")
private String materialName;
@ApiModelProperty("描述")
private String materialDesc;
@ApiModelProperty("工艺包类型rowId(创建工艺包时用)") @ApiModelProperty("工艺包类型rowId(创建工艺包时用)")
private Long technologyPackageTypeRowId; private Long technologyPackageTypeRowId;

View File

@ -274,9 +274,11 @@ public class BomNewPbomParentVO extends BaseMaterialVO implements Serializable {
private String levelNo; private String levelNo;
// @ApiModelProperty("物料一级分类编码") // @ApiModelProperty("物料一级分类编码")
// private String relCategoryCode; // private String relCategoryCode;
@ApiModelProperty("子级") @ApiModelProperty("子级")
List<BomNewPbomParentVO> childNodes; List<BomNewPbomParentVO> childNodes;

View File

@ -279,7 +279,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
//排除项目类别的赋值 //排除项目类别的赋值
materialMainService.intiMaterialInfoInPattern(parentChild, "^21 | ^31", EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); materialMainService.intiMaterialInfoInPattern(parentChild, "^21 | ^31", EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
if (CollUtil.isNotEmpty(parentChild)) { if (CollUtil.isNotEmpty(parentChild)) {
List<String> materialNos = parentChild.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList()); List<String> materialNos = parentChild.stream().filter(u->StrUtil.isNotBlank(u.getMaterialNo())).map(u -> u.getMaterialNo()).collect(Collectors.toList());
if (CollUtil.isNotEmpty(materialNos)) { if (CollUtil.isNotEmpty(materialNos)) {
List<BomNewEbomParentEntity> list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos) List<BomNewEbomParentEntity> list = this.lambdaQuery().in(BomNewEbomParentEntity::getMaterialNo, materialNos)
.eq(BomNewEbomParentEntity::getLastVersionIs, 1) .eq(BomNewEbomParentEntity::getLastVersionIs, 1)
@ -440,6 +440,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
childEntity.setRowId(u.getRowId()); childEntity.setRowId(u.getRowId());
childEntity.setProjectType(u.getProjectType()); childEntity.setProjectType(u.getProjectType());
childEntity.setProjectTypeInputType(u.getProjectTypeInputType()); childEntity.setProjectTypeInputType(u.getProjectTypeInputType());
if(Objects.isNull(u.getExceptionStatus())) {
childEntity.setExceptionStatus(u.getExceptionStatus());
}
child.add(childEntity); child.add(childEntity);
}); });
@ -496,6 +499,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
saveException(checkEBomException); saveException(checkEBomException);
} }
public void initBomException(Long bomRowId, List<Integer> ignoreCheckException) throws ExecutionException, InterruptedException {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
checkEBomException.initException(ignoreCheckException);
//保存异常
saveException(checkEBomException);
}
private void saveException(CheckEBomException checkEBomException) { private void saveException(CheckEBomException checkEBomException) {
List<BomNewEbomParentVO> allBomDetail = checkEBomException.getAllBomDetail(); List<BomNewEbomParentVO> allBomDetail = checkEBomException.getAllBomDetail();
//父级 //父级

View File

@ -140,7 +140,7 @@ public class BomNewOriginalParentService extends ServiceImpl<BomNewOriginalParen
* @return 原始BOM列表 * @return 原始BOM列表
*/ */
public Page<BomOriginalListVO> getOriginalBomListPage(OriginalBomQuery query) { public Page<BomOriginalListVO> getOriginalBomListPage(OriginalBomQuery query) {
Page<BomOriginalListVO> result=null; Page<BomOriginalListVO> result= new Page<>();
//物料编码搜索或图号搜索 //物料编码搜索或图号搜索
if (CollUtil.isNotEmpty(query.getMaterialNos()) || CollUtil.isNotEmpty(query.getDrawingNos())) { if (CollUtil.isNotEmpty(query.getMaterialNos()) || CollUtil.isNotEmpty(query.getDrawingNos())) {
List<String> queryDrawingNos= new ArrayList<>(); List<String> queryDrawingNos= new ArrayList<>();

View File

@ -9,6 +9,7 @@ import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.excel.enums.BooleanEnum; import com.alibaba.excel.enums.BooleanEnum;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -385,9 +386,9 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
VUtils.isTure(Objects.isNull(packageParam.getTechnologyPackageTypeRowId())).throwMessage("请选择工艺包类型"); VUtils.isTure(Objects.isNull(packageParam.getTechnologyPackageTypeRowId())).throwMessage("请选择工艺包类型");
BomNewTechnologyPackageTypeEntity technologyPackageTypeEntity = technologyPackageTypeService.getById(packageParam.getTechnologyPackageTypeRowId()); BomNewTechnologyPackageTypeEntity technologyPackageTypeEntity = technologyPackageTypeService.getById(packageParam.getTechnologyPackageTypeRowId());
//单条物料 //单条物料
String drawingNo = ""; String drawingNo = packageParam.getDrawingNo();
String materialName = ""; String materialName = packageParam.getMaterialName();
String materialDesc = ""; String materialDesc = packageParam.getMaterialDesc();
BomNewPbomParentVO result = null; BomNewPbomParentVO result = null;
if (packageParam.getRowIds().size() == 1) { if (packageParam.getRowIds().size() == 1) {
BomNewPbomChildEntity child = pbomChildService.getById(packageParam.getRowIds().get(0)); BomNewPbomChildEntity child = pbomChildService.getById(packageParam.getRowIds().get(0));
@ -399,7 +400,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
materialMainService.intiMaterialInfo(ImmutableList.of(result)); materialMainService.intiMaterialInfo(ImmutableList.of(result));
VUtils.isTure(StrUtil.isBlank(result.getMaterialCategoryCode()) || !result.getMaterialCategoryCode().startsWith("20")).throwMessage("插入工艺包的物料需时制作物料"); VUtils.isTure(StrUtil.isBlank(result.getMaterialCategoryCode()) || !result.getMaterialCategoryCode().startsWith("20")).throwMessage("插入工艺包的物料需时制作物料");
drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix()); // drawingNo = StrUtil.join("", result.getDrawingNo(), technologyPackageTypeEntity.getDrawingNoSuffix());
// 检查改图号是否已存在主数据中 // 检查改图号是否已存在主数据中
List<MaterialMainEntity> materials = materialMainService.lambdaQuery().eq(MaterialMainEntity::getDrawingNo, drawingNo).list(); List<MaterialMainEntity> materials = materialMainService.lambdaQuery().eq(MaterialMainEntity::getDrawingNo, drawingNo).list();
@ -408,11 +409,18 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
} }
materialName = StrUtil.join("", result.getMaterialName(), technologyPackageTypeEntity.getRemark()); // materialName = StrUtil.join("", result.getMaterialName(), technologyPackageTypeEntity.getRemark());
materialDesc = StrUtil.join(" ", materialName, drawingNo); // materialDesc = StrUtil.join(" ", materialName, drawingNo);
AddVirtrualMaterialDTO toM =new AddVirtrualMaterialDTO();
String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201"); String key=String.valueOf(IdWorker.getId()) ;
toM.setKey(key);
toM.setMaterialName(materialName);
toM.setDrawingNo(drawingNo);
toM.setMaterialDesc(materialDesc);
toM.setMaterialCategoryCode("201201");
Map<String, AddVirtrualMaterialDTO> mMap = materialService.batchAddMaterial(ImmutableList.of(toM));
// String materialNo = materialService.addMaterial(drawingNo, materialName, materialDesc, "201201");
String materialNo=mMap.get(key).getMaterialNo();
return materialMainService.getMaterialBaseInfo(ImmutableList.of(materialNo)).get(0); return materialMainService.getMaterialBaseInfo(ImmutableList.of(materialNo)).get(0);
} }
@ -804,7 +812,7 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds); this.getBaseMapper().bomRelease(state, SessionUtil.getUserName(), bomRowIds);
//同步sap //同步sap
// saySyncDEMO(); // saySyncDEMO();
// importSap(parent,allBom); importSap(parent,allBom);
// //
} catch (Exception ex) { } catch (Exception ex) {
throw new NflgBusinessException(STATE.BusinessError, "发布Pbom失败" + ex.getMessage()); throw new NflgBusinessException(STATE.BusinessError, "发布Pbom失败" + ex.getMessage());

View File

@ -90,6 +90,14 @@ public class CheckEBomException {
} }
public void initException(List<Integer> unCheckException) {
//初始化物料信息
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
this.unCheckExcept=unCheckException;
checkException();
}
public void initException(String... ignorePropertyList) { public void initException(String... ignorePropertyList) {
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList); SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList);

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.nflg.product.bomnew.constant.EBomExceptionStatusEnum;
import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum; import com.nflg.product.bomnew.constant.ProjectTypeInputTypeEnum;
import com.nflg.product.bomnew.mapper.master.BomNewEbomParentMapper; import com.nflg.product.bomnew.mapper.master.BomNewEbomParentMapper;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity;
@ -112,14 +113,15 @@ public class EbomInitProjectType {
} }
//11 //11
if (StrUtil.isNotBlank(child.getMaterialCategoryCode()) && (child.getMaterialCategoryCode().startsWith("10") || child.getMaterialCategoryCode().startsWith("40")) && !child.getMaterialCategoryCode().startsWith("1013") && !child.getMaterialCategoryCode().startsWith("100601")); // if (StrUtil.isNotBlank(child.getMaterialCategoryCode()) && (child.getMaterialCategoryCode().startsWith("10") || child.getMaterialCategoryCode().startsWith("40")) && !child.getMaterialCategoryCode().startsWith("1013") && !child.getMaterialCategoryCode().startsWith("100601"));
{ // {
MaterialHistoryProjectTypeVO materialHistoryProjectType = SpringUtil.getBean(BomNewEbomParentMapper.class).getMaterialHistoryProjectType(child.getMaterialNo()); // MaterialHistoryProjectTypeVO materialHistoryProjectType = SpringUtil.getBean(BomNewEbomParentMapper.class).getMaterialHistoryProjectType(child.getMaterialNo());
if (Objects.nonNull(materialHistoryProjectType)) { // if (Objects.nonNull(materialHistoryProjectType)) {
child.setProjectType(materialHistoryProjectType.getProjectType()); // child.setProjectType(materialHistoryProjectType.getProjectType());
child.setProjectTypeInputType(ProjectTypeInputTypeEnum.HISTORY_STATISTICS.getValue()); // child.setProjectTypeInputType(ProjectTypeInputTypeEnum.HISTORY_STATISTICS.getValue());
} // child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_14.getValue());
} // }
// }
} }

View File

@ -115,11 +115,15 @@ public class ConvertToMBom {
mBomParent.setModifyTime(LocalDateTime.now()); mBomParent.setModifyTime(LocalDateTime.now());
mBomParent.setSourceRowId(parent.getRowId()); mBomParent.setSourceRowId(parent.getRowId());
mBomParent.setLastVersionIs(1); mBomParent.setLastVersionIs(1);
mBomParent.setStatus(MBomConstantEnum.MBomStatusEnum.UNPUB_SAP.getValue());
this.mBomParentResult.add(mBomParent); this.mBomParentResult.add(mBomParent);
//1010 不做处理 //1010 不做处理
// buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChildTreeList_1010 : allChildTreeList_1020, mBomParent.getRowId()); // buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChildTreeList_1010 : allChildTreeList_1020, mBomParent.getRowId());
allChild_1010.forEach(u->{
u.setRelParentRowId(u.getParentRowId());
});
buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChild_1010 : allChildTreeList_1020, mBomParent.getRowId()); buildChild(EBomConstant.MAIN_FACTORY_CODE_1010.equals(facCode) ? allChild_1010 : allChildTreeList_1020, mBomParent.getRowId());

View File

@ -99,7 +99,7 @@
<!--获取已发布列表--> <!--获取已发布列表-->
<select id="releaseListByPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO"> <select id="releaseListByPage" resultType="com.nflg.product.bomnew.pojo.vo.BomNewPbomParentVO">
select * , row_id as bomRowId select * , row_id as bomRowId
from t_bom_new_pbom_parent where status &gt;= 4 from t_bom_new_pbom_parent where root_is=1 and status &gt;= 4
<if test="query.startDate== null"> <if test="query.startDate== null">
and release_time > DATE_SUB(release_time, INTERVAL 4 DAY) and release_time > DATE_SUB(release_time, INTERVAL 4 DAY)
</if> </if>