|
@@ -2025,23 +2025,27 @@ public class ApsReportRecordsServiceImpl extends ServiceImpl<ApsReportRecordsDao
|
|
|
String nextChar = "";
|
|
|
int index = outputCode.indexOf(nowYear);
|
|
|
if (index != -1) {
|
|
|
- nextChar = String.valueOf(outputCode.charAt(index + nowYear.length()));
|
|
|
//需要判断每条数据在当前月
|
|
|
- if ("铸轧".equals(apsProcessOperationDo.getProcess()) && nodeMonthCode.equals(nextChar)) {
|
|
|
- //取出批次号最后三位字符串
|
|
|
- String lastThreeChars = outputCode.substring(outputCode.length() - 3);
|
|
|
- //校验序列号大小是否大于等于批次号后三位
|
|
|
- if (info.getSerialnumber() != null && info.getSerialnumber() >= Long.parseLong(lastThreeChars)) {
|
|
|
- // 删除批次号原来的后三位字符串,将序列号的三位数字更新到批次号中
|
|
|
- String newOutput = outputCode.substring(0, outputCode.length() - 3);
|
|
|
- String formatSerialnumber = String.format("%03d", info.getSerialnumber());
|
|
|
- info.setOutputnumber(newOutput + formatSerialnumber);
|
|
|
- //加工设备ID
|
|
|
- String processdeviceid = apsProcessOperationProcessEquDo.getProcessdeviceid();
|
|
|
- //在流水表中的标识
|
|
|
- String moduleCode = "aps_report_output_" + processdeviceid;
|
|
|
- //更新流水表中的当前值
|
|
|
- apsProcessOperationProcessEquDao.updateSerialNumberCurvalue(moduleCode, info.getSerialnumber());
|
|
|
+ if ("铸轧".equals(apsProcessOperationDo.getProcess())) {
|
|
|
+ if (outputCode.length()>index + nowYear.length()){
|
|
|
+ nextChar = String.valueOf(outputCode.charAt(index + nowYear.length()));
|
|
|
+ if (nodeMonthCode.equals(nextChar)){
|
|
|
+ //取出批次号最后三位字符串
|
|
|
+ String lastThreeChars = outputCode.substring(outputCode.length() - 3);
|
|
|
+ //校验序列号大小是否大于等于批次号后三位
|
|
|
+ if (info.getSerialnumber() != null && info.getSerialnumber() >= Long.parseLong(lastThreeChars)) {
|
|
|
+ // 删除批次号原来的后三位字符串,将序列号的三位数字更新到批次号中
|
|
|
+ String newOutput = outputCode.substring(0, outputCode.length() - 3);
|
|
|
+ String formatSerialnumber = String.format("%03d", info.getSerialnumber());
|
|
|
+ info.setOutputnumber(newOutput + formatSerialnumber);
|
|
|
+ //加工设备ID
|
|
|
+ String processdeviceid = apsProcessOperationProcessEquDo.getProcessdeviceid();
|
|
|
+ //在流水表中的标识
|
|
|
+ String moduleCode = "aps_report_output_" + processdeviceid;
|
|
|
+ //更新流水表中的当前值
|
|
|
+ apsProcessOperationProcessEquDao.updateSerialNumberCurvalue(moduleCode, info.getSerialnumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|