parent
c420b2812c
commit
8548f82c67
|
|
@ -39,6 +39,10 @@ public class MaterialSelfExcelDTO extends BaseImportExcelDTO {
|
||||||
@IgnoreExport
|
@IgnoreExport
|
||||||
private String materialDesc;
|
private String materialDesc;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "英文描述")
|
||||||
|
@IgnoreExport
|
||||||
|
private String materialDescEn;
|
||||||
|
|
||||||
@IgnoreExport
|
@IgnoreExport
|
||||||
private String applyUserCode;
|
private String applyUserCode;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,9 @@ public class MaterialExcelService {
|
||||||
// 20231107大改动:制作物料批量导入,先保存物料数据,流程状态为待提交(这样可避免OA处理过久timeout报错,而丢失保存物料数据),
|
// 20231107大改动:制作物料批量导入,先保存物料数据,流程状态为待提交(这样可避免OA处理过久timeout报错,而丢失保存物料数据),
|
||||||
// 再发起OA流程,等OA流程返回信息,再更新物料表的oaRowId字段
|
// 再发起OA流程,等OA流程返回信息,再更新物料表的oaRowId字段
|
||||||
excelEnt.setProcessState(MaterialProcessStateEnum.WAIT_SUBMIT.getValue());
|
excelEnt.setProcessState(MaterialProcessStateEnum.WAIT_SUBMIT.getValue());
|
||||||
|
if (ObjectUtil.isNotEmpty(excelEnt.getMaterialName())) {
|
||||||
|
excelEnt.setMaterialDescEn(query21MaterialDescEn(excelEnt.getMaterialName().split(" ")[0]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查图号不能重复
|
//检查图号不能重复
|
||||||
|
|
@ -563,4 +566,15 @@ public class MaterialExcelService {
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String query21MaterialDescEn(String cn) {
|
||||||
|
if (ObjectUtil.isEmpty(cn)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
ResultVO<MaterialAttrValueI18n21Entity> i18n21EntityResultVO = SpringContextUtils.getBean(MaterialAttrValueService.class).getI18n21(cn);
|
||||||
|
if (ObjectUtil.isNotEmpty(i18n21EntityResultVO.getData())) {
|
||||||
|
return i18n21EntityResultVO.getData().getAttrValueEn();
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2846,7 +2846,21 @@ public class MaterialMainService extends ServiceImpl<MaterialMainMapper, Materia
|
||||||
update.setTwoYearsUsage(new BigDecimal(out.get("BDMNG").toString()));
|
update.setTwoYearsUsage(new BigDecimal(out.get("BDMNG").toString()));
|
||||||
updateList.add(update);
|
updateList.add(update);
|
||||||
});
|
});
|
||||||
materialMainMapper.updateBatchTwoYearsUsage(updateList);
|
|
||||||
|
// updateList 太大,会超过 mysql 数据包大小(默认4M),所以每次10000条分批次执行
|
||||||
|
for (int i = 0; i < (updateList.size() / 10000) + 1; i++) {
|
||||||
|
int startIdx = i * 10000;
|
||||||
|
int endIdx = startIdx + 10000;
|
||||||
|
if (endIdx > updateList.size()) {
|
||||||
|
endIdx = updateList.size();
|
||||||
|
}
|
||||||
|
if (startIdx == updateList.size()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
log.info("第" + (i + 1) + "次循环,区间:" + startIdx + "," + endIdx);
|
||||||
|
List<MaterialMainEntity> subList = updateList.subList(startIdx, endIdx);
|
||||||
|
materialMainMapper.updateBatchTwoYearsUsage(subList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("【ZRFC_MM_003】异常:{}", e.getMessage());
|
log.error("【ZRFC_MM_003】异常:{}", e.getMessage());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue