模块管理导入功能交互

dev^2
lijinyu 1 year ago
parent ab6758c9a8
commit ff8e8754b9
  1. 33
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java

@ -819,7 +819,16 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,任务时长不能为空"); return Result.error("导入失败,任务时长不能为空");
}else { }else {
double parseDouble = Double.parseDouble(duration); double parseDouble = 0;
try {
parseDouble = Double.parseDouble(duration);
} catch (Exception e) {
message.put("isError", "true");
message.put("status","导入失败,第" + (i+4) +"行" +"任务时长不规范");
message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,任务时长不规范");
}
modulex.setDuration(parseDouble); modulex.setDuration(parseDouble);
} }
String startTime = modulexTemplate.getStartTime(); String startTime = modulexTemplate.getStartTime();
@ -862,7 +871,16 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,实际时长不能为空"); return Result.error("导入失败,实际时长不能为空");
}else { }else {
double parseDouble = Double.parseDouble(realDuration); double parseDouble = 0;
try {
parseDouble = Double.parseDouble(realDuration);
} catch (Exception e) {
message.put("isError", "true");
message.put("status","导入失败,第" + (i+4) +"行" +"实际时长不规范");
message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,实际时长不规范");
}
if(parseDouble<0.1){ if(parseDouble<0.1){
message.put("isError", "true"); message.put("isError", "true");
message.put("status","导入失败,第" + (i+4) +"行" +"最小时间0.1小时"); message.put("status","导入失败,第" + (i+4) +"行" +"最小时间0.1小时");
@ -964,7 +982,16 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message); webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,版本号不能为空"); return Result.error("导入失败,版本号不能为空");
}else { }else {
int parseInt = Integer.parseInt(verison); int parseInt = 0;
try {
parseInt = Integer.parseInt(verison);
} catch (Exception e) {
message.put("isError", "true");
message.put("status","导入失败,第" + (i+4) +"行" + "版本号不能规范");
message.put("closeable","true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,版本号不能为空");
}
modulex.setVerison(parseInt); modulex.setVerison(parseInt);
} }
modulexList.add(modulex); modulexList.add(modulex);

Loading…
Cancel
Save