diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java index 33c1f54..d0805df 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java +++ b/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 impl webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("导入失败,任务时长不能为空"); }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); } String startTime = modulexTemplate.getStartTime(); @@ -862,7 +871,16 @@ public class ModulexServiceImpl extends ServiceImpl impl webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("导入失败,实际时长不能为空"); }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){ message.put("isError", "true"); message.put("status","导入失败,第" + (i+4) +"行" +"最小时间0.1小时"); @@ -964,7 +982,16 @@ public class ModulexServiceImpl extends ServiceImpl impl webSocketUtils.sendMessage(loginUser.getId(), message); return Result.error("导入失败,版本号不能为空"); }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); } modulexList.add(modulex);