Merge branch 'refs/heads/feature/DM/nflg-bom' into feature/DM/nflg-bom-transition

This commit is contained in:
曹鹏飞 2024-06-18 15:35:31 +08:00
commit 42d4c1c47d
10 changed files with 78 additions and 34 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

@ -680,7 +680,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();
//保存异常
@ -688,7 +688,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);
//保存异常
@ -733,7 +733,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();
//保存异常
@ -758,7 +758,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();
//保存异常
@ -767,6 +767,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")) {
@ -2383,7 +2391,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

@ -71,7 +71,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;

View File

@ -556,7 +556,7 @@
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`,`dept_row_id`, a.`level_num`,
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

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)