|
|
@ -29,6 +29,8 @@ import org.jeecg.modules.fieldx.entity.Fieldx; |
|
|
|
import org.jeecg.modules.fieldx.service.IFieldxService; |
|
|
|
import org.jeecg.modules.fieldx.service.IFieldxService; |
|
|
|
import org.jeecg.modules.modulex.entity.Modulex; |
|
|
|
import org.jeecg.modules.modulex.entity.Modulex; |
|
|
|
import org.jeecg.modules.modulex.service.IModulexService; |
|
|
|
import org.jeecg.modules.modulex.service.IModulexService; |
|
|
|
|
|
|
|
import org.jeecg.modules.projectx.entity.Projectx; |
|
|
|
|
|
|
|
import org.jeecg.modules.projectx.service.impl.ProjectxServiceImpl; |
|
|
|
import org.jeecg.modules.system.entity.SysDictItem; |
|
|
|
import org.jeecg.modules.system.entity.SysDictItem; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
import org.jeecg.modules.system.mapper.SysDictItemMapper; |
|
|
|
import org.jeecg.modules.system.mapper.SysDictItemMapper; |
|
|
@ -96,6 +98,9 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private WebSocketUtils webSocketUtils; |
|
|
|
private WebSocketUtils webSocketUtils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ProjectxServiceImpl projectxService; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${jeecg.wordPath}") |
|
|
|
@Value("${jeecg.wordPath}") |
|
|
|
private String wordPath; |
|
|
|
private String wordPath; |
|
|
|
|
|
|
|
|
|
|
@ -258,13 +263,13 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
message.put("uploaded", "0"); |
|
|
|
message.put("uploaded", "0"); |
|
|
|
message.put("status", "判断文件结构"); |
|
|
|
message.put("status", "判断文件结构"); |
|
|
|
message.put("isError", "false"); |
|
|
|
message.put("isError", "false"); |
|
|
|
message.put("closeable","false"); |
|
|
|
message.put("closeable", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
//判断文件是否为空
|
|
|
|
//判断文件是否为空
|
|
|
|
if (file == null) { |
|
|
|
if (file == null) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable","true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("status","文件上传失败,请重新上传"); |
|
|
|
message.put("status", "文件上传失败,请重新上传"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("文件上传失败,请重新上传"); |
|
|
|
return Result.error("文件上传失败,请重新上传"); |
|
|
|
} |
|
|
|
} |
|
|
@ -274,8 +279,8 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
(!originalFilename.endsWith("xls") && |
|
|
|
(!originalFilename.endsWith("xls") && |
|
|
|
!originalFilename.endsWith("xlsx"))) { |
|
|
|
!originalFilename.endsWith("xlsx"))) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable","true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("status","文件格式不正确"); |
|
|
|
message.put("status", "文件格式不正确"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("文件格式不正确"); |
|
|
|
return Result.error("文件格式不正确"); |
|
|
|
} |
|
|
|
} |
|
|
@ -295,8 +300,8 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
if (list == null || list.size() <= 0) { |
|
|
|
if (list == null || list.size() <= 0) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable","true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("status","文件导入失败:模板中暂无数据"); |
|
|
|
message.put("status", "文件导入失败:模板中暂无数据"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("文件导入失败:模板中暂无数据"); |
|
|
|
return Result.error("文件导入失败:模板中暂无数据"); |
|
|
|
} |
|
|
|
} |
|
|
@ -304,30 +309,31 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
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).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()) || |
|
|
|
// StringUtils.isBlank() list.get(i).getDiagrams() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getDiagrams() == null &&
|
|
|
|
StringUtils.isBlank( list.get(i).getTableId() ) || |
|
|
|
// StringUtils.isBlank(list.get(i).getTableId()) ||
|
|
|
|
// StringUtils.isBlank() list.get(i).getFieldId() == null ||
|
|
|
|
// StringUtils.isBlank() list.get(i).getFieldId() == null ||
|
|
|
|
StringUtils.isBlank( list.get(i).getManagerUsers())|| |
|
|
|
StringUtils.isBlank(list.get(i).getManagerUsers()) || |
|
|
|
StringUtils.isBlank(list.get(i).getWorkLevel()) || |
|
|
|
StringUtils.isBlank(list.get(i).getWorkLevel()) || |
|
|
|
StringUtils.isBlank(list.get(i).getWorkStatus()) || |
|
|
|
StringUtils.isBlank(list.get(i).getWorkStatus()) || |
|
|
|
// StringUtils.isBlank() list.get(i).getStartTime() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getStartTime() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getManagerUsers() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getManagerUsers() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getDuration() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getDuration() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getSubmitTime() == null &&
|
|
|
|
// StringUtils.isBlank() list.get(i).getSubmitTime() == null &&
|
|
|
|
StringUtils.isBlank(list.get(i).getRealDuration()) && |
|
|
|
// StringUtils.isBlank(list.get(i).getRealDuration()) &&
|
|
|
|
StringUtils.isBlank(list.get(i).getStatus() ) || |
|
|
|
StringUtils.isBlank(list.get(i).getStatus()) || |
|
|
|
StringUtils.isBlank( list.get(i).getVerisonStatus()) || |
|
|
|
StringUtils.isBlank(list.get(i).getVerisonStatus()) || |
|
|
|
StringUtils.isBlank(list.get(i).getVerison()) ) { |
|
|
|
StringUtils.isBlank(list.get(i).getVerison())) { |
|
|
|
|
|
|
|
|
|
|
|
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) + "条不能为空,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
//存入预存表
|
|
|
|
//存入预存表
|
|
|
|
iRuleVoService.save(list.get(i)); |
|
|
|
iRuleVoService.save(list.get(i)); |
|
|
@ -339,8 +345,8 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
|
|
|
|
|
|
|
|
if (ruleVoList.size() <= 0 || ruleVoList == null) { |
|
|
|
if (ruleVoList.size() <= 0 || ruleVoList == null) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("closeable","true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("status","文件导入失败,模板不匹配有空值"); |
|
|
|
message.put("status", "文件导入失败,模板不匹配有空值"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("文件导入失败,模板不匹配有空值"); |
|
|
|
return Result.error("文件导入失败,模板不匹配有空值"); |
|
|
|
} |
|
|
|
} |
|
|
@ -355,13 +361,24 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
for (int i = 0; i < ruleVoList.size(); i++) { |
|
|
|
for (int i = 0; i < ruleVoList.size(); i++) { |
|
|
|
Rulex rulex = new Rulex(); |
|
|
|
Rulex rulex = new Rulex(); |
|
|
|
RuleVo ruleVo = ruleVoList.get(i); |
|
|
|
RuleVo ruleVo = ruleVoList.get(i); |
|
|
|
|
|
|
|
String projectId = ruleVo.getProjectId(); |
|
|
|
String pModuleId = ruleVo.getModulePid(); |
|
|
|
String pModuleId = ruleVo.getModulePid(); |
|
|
|
String moduleId = ruleVo.getModuleId(); |
|
|
|
String moduleId = ruleVo.getModuleId(); |
|
|
|
//对应模块
|
|
|
|
//对应模块
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Projectx> projectxLambdaQueryWrapper =new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
projectxLambdaQueryWrapper.eq(Projectx::getProjectName,projectId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Projectx projectx = projectxService.getOne(projectxLambdaQueryWrapper); |
|
|
|
|
|
|
|
if (projectx==null){ |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,项目输入错误,请核对"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,项目输入错误,请核对"); |
|
|
|
|
|
|
|
} |
|
|
|
//判断上级模块是否存在
|
|
|
|
//判断上级模块是否存在
|
|
|
|
int n = 0; |
|
|
|
int n = 0; |
|
|
|
if (!StringUtils.isBlank(pModuleId) ) { |
|
|
|
if (!StringUtils.isBlank(pModuleId)) { |
|
|
|
//存在
|
|
|
|
//存在
|
|
|
|
String pid = ""; |
|
|
|
String pid = ""; |
|
|
|
for (Modulex modulex : modulexList) { |
|
|
|
for (Modulex modulex : modulexList) { |
|
|
@ -380,10 +397,20 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
return Result.error("第" + (i + 1) + "条数据,上级模块输入错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,上级模块输入错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//判断上级模块+模块是否存在
|
|
|
|
//判断上级模块+模块是否存在且是否属于当前项目下
|
|
|
|
|
|
|
|
|
|
|
|
for (Modulex modulex : modulexList) { |
|
|
|
for (Modulex modulex : modulexList) { |
|
|
|
if (modulex.getModuleName().equals(moduleId) && modulex.getPid().equals(pid)) { |
|
|
|
if (modulex.getModuleName().equals(moduleId) && modulex.getPid().equals(pid)) { |
|
|
|
|
|
|
|
if (!modulex.getProjectId().equals(projectx.getId())) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,该模块与项目不对应输入错误,请核对"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,该模块与项目不对应输入错误,请核对"); |
|
|
|
|
|
|
|
} |
|
|
|
rulex.setModuleId(modulex.getId()); |
|
|
|
rulex.setModuleId(modulex.getId()); |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
n++; |
|
|
|
n++; |
|
|
@ -397,9 +424,17 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
n = 0; |
|
|
|
n = 0; |
|
|
|
//判断模块是否存在
|
|
|
|
//判断模块是否存在且是否属于当前项目下
|
|
|
|
for (Modulex modulex : modulexList) { |
|
|
|
for (Modulex modulex : modulexList) { |
|
|
|
if (modulex.getModuleName().equals(moduleId) && modulex.getPid() == null) { |
|
|
|
if (modulex.getModuleName().equals(moduleId) && modulex.getPid() == null) { |
|
|
|
|
|
|
|
if (!modulex.getProjectId().equals(projectx.getId())) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,该模块与项目不对应输入错误,请核对"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,该模块与项目不对应输入错误,请核对"); |
|
|
|
|
|
|
|
} |
|
|
|
rulex.setModuleId(modulex.getId()); |
|
|
|
rulex.setModuleId(modulex.getId()); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -430,7 +465,9 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
rulex.setFunctionId(functionx.getId()); |
|
|
|
rulex.setFunctionId(functionx.getId()); |
|
|
|
//
|
|
|
|
//
|
|
|
|
//对应实体
|
|
|
|
//对应实体
|
|
|
|
|
|
|
|
|
|
|
|
String tableId = ruleVo.getTableId(); |
|
|
|
String tableId = ruleVo.getTableId(); |
|
|
|
|
|
|
|
if (!StringUtils.isBlank(tableId)) { |
|
|
|
LambdaQueryWrapper<Tablex> tableLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Tablex> tableLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
tableLambdaQueryWrapper.eq(Tablex::getTableName, tableId).eq(Tablex::getModuleId, rulex.getModuleId()); |
|
|
|
tableLambdaQueryWrapper.eq(Tablex::getTableName, tableId).eq(Tablex::getModuleId, rulex.getModuleId()); |
|
|
|
Tablex tablex = iTablexService.getOne(tableLambdaQueryWrapper); |
|
|
|
Tablex tablex = iTablexService.getOne(tableLambdaQueryWrapper); |
|
|
@ -444,11 +481,12 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
return Result.error("第" + (i + 1) + "条数据,对应实体输入错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,对应实体输入错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
rulex.setTableId(tablex.getId()); |
|
|
|
rulex.setTableId(tablex.getId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//对应字段
|
|
|
|
//对应字段
|
|
|
|
String fieldId = ruleVo.getFieldId(); |
|
|
|
String fieldId = ruleVo.getFieldId(); |
|
|
|
String tableId1 = rulex.getTableId(); |
|
|
|
String tableId1 = rulex.getTableId(); |
|
|
|
if (!StringUtils.isBlank(fieldId) ) { |
|
|
|
if (!StringUtils.isBlank(fieldId)) { |
|
|
|
LambdaQueryWrapper<Fieldx> rulexLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Fieldx> rulexLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId).eq(Fieldx::getTableId, tableId1); |
|
|
|
rulexLambdaQueryWrapper.eq(Fieldx::getFieldName, fieldId).eq(Fieldx::getTableId, tableId1); |
|
|
|
Fieldx fieldx = iFieldxService.getOne(rulexLambdaQueryWrapper); |
|
|
|
Fieldx fieldx = iFieldxService.getOne(rulexLambdaQueryWrapper); |
|
|
@ -462,11 +500,17 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
rulex.setFieldId(fieldx.getId()); |
|
|
|
rulex.setFieldId(fieldx.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
Double aDouble = null; |
|
|
|
Double duration = null; |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (aDouble != null) |
|
|
|
if (duration < 0){ |
|
|
|
aDouble = Double.valueOf(ruleVo.getDuration()); |
|
|
|
message.put("isError", "true"); |
|
|
|
rulex.setDuration(aDouble); |
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
duration = Double.valueOf(ruleVo.getDuration()); |
|
|
|
|
|
|
|
rulex.setDuration(duration); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
@ -477,8 +521,17 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Double d; |
|
|
|
Double d; |
|
|
|
|
|
|
|
String realDuration = ruleVo.getRealDuration(); |
|
|
|
|
|
|
|
if (!StringUtils.isBlank(realDuration)) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
d = Double.valueOf(ruleVo.getRealDuration()); |
|
|
|
d = Double.valueOf(realDuration); |
|
|
|
|
|
|
|
if (d < 0) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
message.put("status", "第" + (i + 1) + "条数据,实际时长输入错误,请核对"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("第" + (i + 1) + "条数据,实际时长输入错误,请核对"); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
@ -488,18 +541,17 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
return Result.error("第" + (i + 1) + "条数据,实际时长输入错误,请核对"); |
|
|
|
return Result.error("第" + (i + 1) + "条数据,实际时长输入错误,请核对"); |
|
|
|
} |
|
|
|
} |
|
|
|
rulex.setRealDuration(d); |
|
|
|
rulex.setRealDuration(d); |
|
|
|
Integer integer; |
|
|
|
} |
|
|
|
try { |
|
|
|
|
|
|
|
integer = Integer.valueOf(ruleVo.getWorkLevel()); |
|
|
|
String workLevel = ruleVo.getWorkLevel(); |
|
|
|
} catch (Exception e) { |
|
|
|
if (!workLevel.matches("^[1-5]$")){ |
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
|
|
|
|
|
|
|
|
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.setWorkLevel(integer); |
|
|
|
rulex.setWorkLevel(Integer.valueOf(workLevel)); |
|
|
|
String workStatus = ruleVo.getWorkStatus(); |
|
|
|
String workStatus = ruleVo.getWorkStatus(); |
|
|
|
// LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
// LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
// sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762");
|
|
|
|
// sysDictItemLambdaQueryWrapper.eq(SysDictItem::getItemText, workStatus).eq(SysDictItem::getDictId, "1645268542514421762");
|
|
|
@ -576,7 +628,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String submitTime = ruleVo.getSubmitTime(); |
|
|
|
String submitTime = ruleVo.getSubmitTime(); |
|
|
|
if (!StringUtils.isBlank(submitTime)){ |
|
|
|
if (!StringUtils.isBlank(submitTime)) { |
|
|
|
String submitTimeT = getTime(submitTime); |
|
|
|
String submitTimeT = getTime(submitTime); |
|
|
|
try { |
|
|
|
try { |
|
|
|
date = simpleDateFormat.parse(submitTimeT); |
|
|
|
date = simpleDateFormat.parse(submitTimeT); |
|
|
@ -591,9 +643,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//规则序号
|
|
|
|
|
|
|
|
String ruleNo = ruleVo.getRuleNo(); |
|
|
|
|
|
|
|
rulex.setRuleNo(ruleNo); |
|
|
|
|
|
|
|
//规则编码
|
|
|
|
//规则编码
|
|
|
|
String ruleCode = ruleVo.getRuleCode(); |
|
|
|
String ruleCode = ruleVo.getRuleCode(); |
|
|
|
String functionCode1 = functionx.getFunctionCode(); |
|
|
|
String functionCode1 = functionx.getFunctionCode(); |
|
|
@ -632,14 +682,24 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
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 pmDescribe = ruleVo.getPmDescribe(); |
|
|
|
String pmDescribe = ruleVo.getPmDescribe(); |
|
|
|
if (pmDescribe != null) |
|
|
|
if (pmDescribe != null) |
|
|
|
rulex.setPmDescribe(pmDescribe); |
|
|
|
rulex.setPmDescribe(pmDescribe); |
|
|
|
//分析图
|
|
|
|
|
|
|
|
String diagrams = ruleVo.getDiagrams(); |
|
|
|
|
|
|
|
if (diagrams != null) |
|
|
|
|
|
|
|
rulex.setDiagrams(diagrams); |
|
|
|
|
|
|
|
//版本号
|
|
|
|
//版本号
|
|
|
|
String verison = ruleVo.getVerison(); |
|
|
|
String verison = ruleVo.getVerison(); |
|
|
|
if (ruleVo.getVerison() == null || verison.length() >= 5) { |
|
|
|
if (ruleVo.getVerison() == null || verison.length() >= 5) { |
|
|
@ -671,7 +731,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
|
|
|
|
|
|
|
|
//责任人
|
|
|
|
//责任人
|
|
|
|
String managerUsers = ruleVo.getManagerUsers(); |
|
|
|
String managerUsers = ruleVo.getManagerUsers(); |
|
|
|
if (managerUsers != null) { |
|
|
|
if (!StringUtils.isBlank(managerUsers)) { |
|
|
|
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
String[] split = managerUsers.split(","); |
|
|
|
String[] split = managerUsers.split(","); |
|
|
|
sysUserLambdaQueryWrapper.in(SysUser::getUsername, split); |
|
|
|
sysUserLambdaQueryWrapper.in(SysUser::getUsername, split); |
|
|
@ -704,7 +764,8 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
//存入集合待存真实表
|
|
|
|
//存入集合待存真实表
|
|
|
|
rulexList.add(rulex); |
|
|
|
rulexList.add(rulex); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} |
|
|
|
|
|
|
|
} finally{ |
|
|
|
//清理预存表
|
|
|
|
//清理预存表
|
|
|
|
iRuleVoService.remove(null); |
|
|
|
iRuleVoService.remove(null); |
|
|
|
} |
|
|
|
} |
|
|
@ -716,12 +777,14 @@ public class RulexController extends JeecgController<Rulex, IRulexService> { |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.ok("文件导入成功!"); |
|
|
|
return Result.ok("文件导入成功!"); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return Result.error("文件导入失败!"); |
|
|
|
return Result.error("文件导入失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/sort") |
|
|
|
@GetMapping(value = "/sort") |
|
|
|
public Result<?> sort(@RequestParam(name = "id", required = true) String id) { |
|
|
|
public Result<?> sort(@RequestParam(name = "id", required = true) String id) { |
|
|
|
return rulexService.sort(id); |
|
|
|
return rulexService.sort(id); |
|
|
|