Merge remote-tracking branch 'origin/feature/DM/nflg-bom' into feature/DM/nflg-bom

# Conflicts:
#	nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml
This commit is contained in:
大米 2024-06-18 16:16:34 +08:00
commit 313ffc9532
10 changed files with 97 additions and 38 deletions

View File

@ -20,7 +20,7 @@ import java.util.Date;
@Data
@ApiModel("ebom选配件表")
@Accessors(chain = true)
public class OptionalEbomImportChildVO implements Serializable {
public class OptionalEbomImportChildVO extends BaseMaterialVO {
/**
* 主键
*/
@ -36,26 +36,26 @@ public class OptionalEbomImportChildVO implements Serializable {
*/
@ApiModelProperty(value = "根节点id")
private Long rootRowId;
/**
* 物料编码
*/
@ApiModelProperty(value = "物料编码")
private String materialNo;
/**
* 物料名
*/
@ApiModelProperty(value = "物料名")
private String materialName;
/**
* 物料描述
*/
@ApiModelProperty(value = "物料描述")
private String materialDesc;
/**
* 图号
*/
@ApiModelProperty(value = "图号")
private String drawingNo;
// /**
// * 物料编码
// */
// @ApiModelProperty(value = "物料编码")
// private String materialNo;
// /**
// * 物料名
// */
// @ApiModelProperty(value = "物料名")
// private String materialName;
// /**
// * 物料描述
// */
// @ApiModelProperty(value = "物料描述")
// private String materialDesc;
// /**
// * 图号
// */
// @ApiModelProperty(value = "图号")
// private String drawingNo;
/**
* 部件类型(1 单选 2 多选)
*/

View File

@ -678,7 +678,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* @param bomRowId bom行ID
*/
public void initBomException(Long bomRowId) throws ExecutionException, InterruptedException {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
checkEBomException.initException();
//保存异常
@ -686,7 +686,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}
public void initBomException(Long bomRowId, List<Integer> ignoreCheckException) throws ExecutionException, InterruptedException {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
checkEBomException.initException(ignoreCheckException);
//保存异常
@ -731,7 +731,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
* 检查 并保存异常信息
*/
public void checkAndSaveEBomException(Long bomRowId) throws ExecutionException, InterruptedException {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
checkEBomException.initException();
//保存异常
@ -756,7 +756,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
*/
public void batchCheckAndSaveEBomException(List<Long> bomRowIds) {
for (Long bomRowId : bomRowIds) {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId);
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, null);
checkEBomException.initException();
//保存异常
@ -765,6 +765,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}
public void checkAndSaveEBomException(Long bomRowId, Long childRowId) {
CheckEBomException checkEBomException = new CheckEBomException(bomRowId, childRowId);
checkEBomException.initException();
//保存异常
saveException(checkEBomException);
}
public void checkAndInitVirtualPackageEnum(VirtualPackageParamDto paramDto, BomNewEbomParentEntity root) {
if (root.getVirtrualPackageEnum() <= 0) {
if (root.getMaterialNo().startsWith("31")) {
@ -2381,7 +2389,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
BomExceptionQuery bom = query.get(index);
BomExceptionVO vo = new BomExceptionVO();
if (index == 0) {
batchCheckAndSaveEBomException(Collections.singletonList(bom.getBomRowId()));
checkAndSaveEBomException(bom.getBomRowId(), bom.getRowId());
BomNewEbomParentEntity parent = getById(bom.getBomRowId());
vo.setMaterialNo(parent.getMaterialNo());

View File

@ -211,11 +211,17 @@ public class OptionalEbomConfigService extends ServiceImpl<OptionalEbomConfigMap
* @return
*/
public List<OptionalEbomImportChildVO> getTmpOptionList(Long rowId) {
return this.getBaseMapper().getTmpOptionList(rowId);
List<OptionalEbomImportChildVO> list= this.getBaseMapper().getTmpOptionList(rowId);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(list);
return list;
}
public List<OptionalEbomImportChildVO> getPreviewOptionList(Long rowId) {
return this.getBaseMapper().getPreviewOptionList(rowId);
List<OptionalEbomImportChildVO> list= this.getBaseMapper().getPreviewOptionList(rowId);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(list);
return list;
}

View File

@ -48,7 +48,11 @@ public class OptionalEbomImportChildService extends ServiceImpl<OptionalEbomImpo
}
public List<OptionalEbomImportChildVO> getByRootRowList(OptionalEbomImportChildQuery query) {
return getBaseMapper().getByRootRowList(query);
List<OptionalEbomImportChildVO> list= getBaseMapper().getByRootRowList(query);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(list);
return list;
}

View File

@ -72,7 +72,7 @@ public class OptionalMbomMaterialService extends ServiceImpl<OptionalMbomMateria
}
}
materialMainService.intiMaterialInfo(page.getRecords());
return page;
}

View File

@ -259,6 +259,9 @@ public class AggregOptionConfigService {
tmpVo.setDeviceInfo(optionalEbomConfigVO);
List<OptionalEbomImportVO> listParent = optionalEbomImportService.getByRootIdList(optionalEbomConfigEntity.getParentRowId());
List<OptionalEbomImportChildVO> listChild = optionalEbomConfigService.getBaseMapper().getTmpOptionInfoList(rowId);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(listChild);
OptionalEbomConfigAggregVO optionalEbomConfigAggregVO= filterTree(listParent,listChild);
tmpVo.setSingleList(optionalEbomConfigAggregVO.getSingleList());
tmpVo.setMulList(optionalEbomConfigAggregVO.getMulList());

View File

@ -50,12 +50,23 @@ public class PublishMaterialService {
@Transactional(rollbackFor = Exception.class)
public ResultVO<String> publishWork(OptionalEbomPublishAddDTO optionalEbomPublishAddDTO) {
//check 机台格式
optionalEbomPublishAddDTO.setMachineNo(optionalEbomPublishAddDTO.getMachineNo().toUpperCase());
String machineNo=optionalEbomPublishAddDTO.getMachineNo();
String regx="^[a-zA-Z0-9]{1,5}$";
if(!machineNo.matches(regx)){
return ResultVO.error("机台号包含范围a-zA-Z0-9长度1-5位");
}
List<OptionalEbomImportChildVO> optionList = optionalEbomConfigService.getPreviewOptionList(optionalEbomPublishAddDTO.getRowId());
if (CollectionUtil.isEmpty(optionList)) {
return ResultVO.error("发布未查询到物料数据");
}
OptionalEbomConfigEntity configEntity = SpringUtil.getBean(OptionalEbomConfigService.class).getById(optionalEbomPublishAddDTO.getRowId());
if (configEntity == null) {

View File

@ -9,9 +9,11 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import com.nflg.product.base.core.exception.NflgBusinessException;
import com.nflg.product.bomnew.constant.*;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity;
import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity;
import com.nflg.product.bomnew.pojo.vo.BaseMaterialVO;
import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO;
import com.nflg.product.bomnew.service.BomNewEbomChildService;
import com.nflg.product.bomnew.service.BomNewEbomParentService;
import com.nflg.product.bomnew.service.MaterialMainService;
import com.nflg.product.bomnew.util.*;
@ -52,7 +54,7 @@ public class CheckEBomException {
}
public CheckEBomException(Long bomRowId) {
public CheckEBomException(Long bomRowId, Long childRowId) {
allBomDetail = SpringUtil.getBean(BomNewEbomParentService.class).getBomTree(bomRowId, true);
//只检查待复核和自己的
@ -65,6 +67,13 @@ public class CheckEBomException {
convert.setBomRowId(convert.getRowId());
convert.setParentRowId(0L);
convert.setLevelNumber(BigDecimal.ZERO);
if (Objects.nonNull(childRowId) && childRowId > 0) {
BomNewEbomChildEntity c = SpringUtil.getBean(BomNewEbomChildService.class).getById(childRowId);
if (Objects.nonNull(c)) {
convert.setProjectType(c.getProjectType());
convert.setNum(c.getNum());
}
}
allBomDetail.add(convert);
checkWaring=true;
@ -84,21 +93,21 @@ public class CheckEBomException {
*/
public void initException() {
//初始化物料信息
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
checkException();
}
public void initException(List<Integer> unCheckException) {
//初始化物料信息
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT);
this.unCheckExcept=unCheckException;
checkException();
}
public void initException(String... ignorePropertyList) {
// List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList);
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(allBomDetail, ignorePropertyList);
checkException();
}

View File

@ -511,8 +511,23 @@
</select>
<insert id="insertEBomFormalParent">
INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`,`dept_row_id`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`)
select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`, a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`, a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`, a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`, a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`, a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`, a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`, a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_row_id`, a.`dept_name`, a.`level_num`, a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time`
INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`,
`material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`,
`total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`,
`bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`,
`exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`,
`created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`,
`revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`,
`dept_name`,`dept_row_id`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`)
select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`,
a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`,
a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`,
a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`,
a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`,
a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`,
a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`,
a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_name`,a.`dept_row_id`, a.`level_num`,
a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time`
from t_bom_new_ebom_parent a
left join t_bom_new_ebom_parent_formal b on a.row_id = b.row_id
where a.row_id in

View File

@ -124,8 +124,11 @@ public class BaseGlobalExceptionHandle {
@ResponseBody
public ResultVO<String> handleRuntimeExceptionException(RuntimeException e) {
log.error(e.getMessage(),e);
//throw new NflgBusinessException(STATE.Error, "系统错误,请联系管理员");
return ResultVO.error("系统错误,请联系管理员");
if (StrUtil.isNotBlank(e.getMessage()) && e.getMessage().contains("Deadlock")) {
return ResultVO.error("操作失败,请重试");
} else {
return ResultVO.error("系统错误,请联系管理员");
}
}
@ExceptionHandler(value = BadSqlGrammarException.class)