fix(ebom): 优化从excel导入
This commit is contained in:
parent
2a982f0c45
commit
bb56ba1b0c
|
|
@ -76,8 +76,7 @@ public class EbomV2Api extends BaseApi {
|
|||
@ApiOperation("从excel导入数据")
|
||||
@PostMapping("importBom")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@LogRecord(success = "原始BOM-导入:文件名:{{#fileNme}},操作结果:{{#_ret}}",
|
||||
bizNo = "", type = "原始BOM导入")
|
||||
@LogRecord(success = "EBOM-导入:文件名:{{#fileNme}},操作结果:{{#_ret}}", bizNo = "", type = "EBOM导入")
|
||||
public ResultVO<List<OperationErrorMsgVO>> importBom(@RequestParam(value = "file") MultipartFile file) throws Exception {
|
||||
if (file != null && !file.getOriginalFilename().endsWith("xls") && !file.getOriginalFilename().endsWith("xlsx")) {
|
||||
return ResultVO.error("请上传Excel文件");
|
||||
|
|
|
|||
|
|
@ -333,18 +333,22 @@ public class EBomImportService {
|
|||
String maxOrderNum = pcs.get(pcs.size() - 1).getOrderNumber();
|
||||
child.setOrderNumber(OrderNoUtil.next(maxOrderNum));
|
||||
}
|
||||
child.setMaterialDesc(data.getMaterialDesc());
|
||||
BaseMaterialVO vo = materialBaseInfos.stream()
|
||||
.filter(m -> m.getMaterialNo().equals(child.getMaterialNo()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (!Objects.isNull(vo)) {
|
||||
child.setMaterialCategoryCode(vo.getMaterialCategoryCode());
|
||||
child.setMaterialName(vo.getMaterialName());
|
||||
child.setDrawingNo(vo.getDrawingNo());
|
||||
child.setUnitWeight(vo.getMaterialWeight());
|
||||
child.setMaterialUnit(vo.getMaterialUnit());
|
||||
child.setMaterialTexture(vo.getMaterialTexture());
|
||||
if (StrUtil.isBlank(child.getMaterialDesc())) {
|
||||
child.setMaterialDesc(vo.getMaterialDesc());
|
||||
}
|
||||
}
|
||||
child.setMaterialDesc(data.getMaterialDesc());
|
||||
child.setMaterialOriginalUnit(data.getUnit());
|
||||
child.setNum(data.getNum());
|
||||
child.setRemark(data.getRemark());
|
||||
|
|
|
|||
Loading…
Reference in New Issue