|
|
@ -310,7 +310,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
StringUtils.isBlank(list.get(i).getRuleNo()) || |
|
|
|
StringUtils.isBlank(list.get(i).getRuleNo()) || |
|
|
|
StringUtils.isBlank(list.get(i).getProjectId()) || |
|
|
|
StringUtils.isBlank(list.get(i).getProjectId()) || |
|
|
|
StringUtils.isBlank(list.get(i).getRuleCode()) || |
|
|
|
// StringUtils.isBlank(list.get(i).getRuleCode()) ||
|
|
|
|
// StringUtils.isBlank() list.get(i).getPmDescribe() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getPmDescribe() == null &&
|
|
|
|
StringUtils.isBlank(list.get(i).getModuleId()) || |
|
|
|
StringUtils.isBlank(list.get(i).getModuleId()) || |
|
|
|
StringUtils.isBlank(list.get(i).getFunctionId()) || |
|
|
|
StringUtils.isBlank(list.get(i).getFunctionId()) || |
|
|
@ -501,7 +501,10 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
rulex.setFieldId(fieldx.getId()); |
|
|
|
rulex.setFieldId(fieldx.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
Double duration = null; |
|
|
|
Double duration = null; |
|
|
|
|
|
|
|
String duration1 = ruleVo.getDuration(); |
|
|
|
|
|
|
|
if(!StringUtils.isBlank(duration1)) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
duration = Double.valueOf(duration1); |
|
|
|
if (duration < 0) { |
|
|
|
if (duration < 0) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
@ -509,7 +512,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
duration = Double.valueOf(ruleVo.getDuration()); |
|
|
|
|
|
|
|
rulex.setDuration(duration); |
|
|
|
rulex.setDuration(duration); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
@ -519,6 +522,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Double d; |
|
|
|
Double d; |
|
|
|
String realDuration = ruleVo.getRealDuration(); |
|
|
|
String realDuration = ruleVo.getRealDuration(); |
|
|
@ -645,48 +649,57 @@ String workLevel = ruleVo.getWorkLevel(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//规则编码
|
|
|
|
//规则编码
|
|
|
|
String ruleCode = ruleVo.getRuleCode(); |
|
|
|
// String ruleCode = ruleVo.getRuleCode();
|
|
|
|
String functionCode1 = functionx.getFunctionCode(); |
|
|
|
// String functionCode1 = functionx.getFunctionCode();
|
|
|
|
if (ruleCode == null) { |
|
|
|
// if (ruleCode == null) {
|
|
|
|
message.put("isError", "true"); |
|
|
|
// message.put("isError", "true");
|
|
|
|
message.put("closeable", "true"); |
|
|
|
// message.put("closeable", "true");
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
//截取到功能编码校验(去除后三位)
|
|
|
|
// //截取到功能编码校验(去除后三位)
|
|
|
|
if (!ruleCode.substring(0, ruleCode.length() - 3).equals(functionCode1)) { |
|
|
|
// if (!ruleCode.substring(0, ruleCode.length() - 3).equals(functionCode1)) {
|
|
|
|
message.put("isError", "true"); |
|
|
|
// message.put("isError", "true");
|
|
|
|
message.put("closeable", "true"); |
|
|
|
// message.put("closeable", "true");
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
//后三位
|
|
|
|
// //后三位
|
|
|
|
String substring = ruleCode.substring(ruleCode.length() - 3); |
|
|
|
// String substring = ruleCode.substring(ruleCode.length() - 3);
|
|
|
|
try { |
|
|
|
// try {
|
|
|
|
Integer integer1 = Integer.valueOf(substring); |
|
|
|
// Integer integer1 = Integer.valueOf(substring);
|
|
|
|
if (integer1 < 0) { |
|
|
|
// if (integer1 < 0) {
|
|
|
|
message.put("isError", "true"); |
|
|
|
// message.put("isError", "true");
|
|
|
|
message.put("closeable", "true"); |
|
|
|
// message.put("closeable", "true");
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
// } catch (NumberFormatException e) {
|
|
|
|
message.put("isError", "true"); |
|
|
|
// message.put("isError", "true");
|
|
|
|
message.put("closeable", "true"); |
|
|
|
// message.put("closeable", "true");
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对"); |
|
|
|
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
|
|
|
|
} |
|
|
|
// }
|
|
|
|
rulex.setRuleCode(ruleCode); |
|
|
|
// rulex.setRuleCode(ruleCode);
|
|
|
|
//规则序号
|
|
|
|
//规则序号
|
|
|
|
|
|
|
|
// String ruleNo = ruleVo.getRuleNo();
|
|
|
|
|
|
|
|
// String c = ruleCode.substring(ruleCode.length() - ruleNo.length());
|
|
|
|
|
|
|
|
////三位数整数且与编码后三位相同
|
|
|
|
|
|
|
|
// if (!(c.equals(ruleNo) && ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000))) {
|
|
|
|
|
|
|
|
// message.put("isError", "true");
|
|
|
|
|
|
|
|
// message.put("closeable", "true");
|
|
|
|
|
|
|
|
// message.put("status", "第" + (i + 1) + "条数据,规则序号错误,请核对");
|
|
|
|
|
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
|
|
|
|
// return Result.error("第" + (i + 1) + "条数据,规则序号错误,请核对");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// rulex.setRuleNo(ruleNo);
|
|
|
|
String ruleNo = ruleVo.getRuleNo(); |
|
|
|
String ruleNo = ruleVo.getRuleNo(); |
|
|
|
String c = ruleCode.substring(ruleCode.length() - ruleNo.length()); |
|
|
|
if(!ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000)){ |
|
|
|
//三位数整数且与编码后三位相同
|
|
|
|
|
|
|
|
if (!(c.equals(ruleNo) && ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000))) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则序号错误,请核对"); |
|
|
|
message.put("status", "第" + (i + 1) + "条数据,规则序号错误,请核对"); |
|
|
@ -694,7 +707,17 @@ String workLevel = ruleVo.getWorkLevel(); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则序号错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,规则序号错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
rulex.setRuleNo(ruleNo); |
|
|
|
rulex.setRuleNo(ruleNo); |
|
|
|
{ |
|
|
|
String functionCode1 = functionx.getFunctionCode(); |
|
|
|
|
|
|
|
if (ruleNo.length()==1){ |
|
|
|
|
|
|
|
ruleNo="00"+ruleNo; |
|
|
|
|
|
|
|
}else if (ruleNo.length()==2){ |
|
|
|
|
|
|
|
ruleNo="0"+ruleNo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String ruleCode =functionCode1+ruleNo; |
|
|
|
|
|
|
|
rulex.setRuleCode(ruleCode); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//规则描述
|
|
|
|
//规则描述
|
|
|
|
String pmDescribe = ruleVo.getPmDescribe(); |
|
|
|
String pmDescribe = ruleVo.getPmDescribe(); |
|
|
@ -765,7 +788,7 @@ String workLevel = ruleVo.getWorkLevel(); |
|
|
|
rulexList.add(rulex); |
|
|
|
rulexList.add(rulex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} finally{ |
|
|
|
finally{ |
|
|
|
//清理预存表
|
|
|
|
//清理预存表
|
|
|
|
iRuleVoService.remove(null); |
|
|
|
iRuleVoService.remove(null); |
|
|
|
} |
|
|
|
} |
|
|
|