|
|
|
@ -409,25 +409,24 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
String name = formatter.formatCellValue(cell,evaluator); |
|
|
|
|
propertyNames.add(name); |
|
|
|
|
} |
|
|
|
|
if(propertyNames.size()!=19 || !propertyNames.get(0).equals("上级模块名称") |
|
|
|
|
if(propertyNames.size()!=18 || !propertyNames.get(0).equals("上级模块名称") |
|
|
|
|
|| !propertyNames.get(1).equals("项目名称") |
|
|
|
|
|| !propertyNames.get(2).equals("中文名称") |
|
|
|
|
|| !propertyNames.get(3).equals("英文名称") |
|
|
|
|
|| !propertyNames.get(4).equals("模块编码") |
|
|
|
|
|| !propertyNames.get(5).equals("内容描述") |
|
|
|
|
|| !propertyNames.get(6).equals("责任人") |
|
|
|
|
|| !propertyNames.get(7).equals("任务等级") |
|
|
|
|
|| !propertyNames.get(8).equals("任务状态") |
|
|
|
|
|| !propertyNames.get(9).equals("发布时间") |
|
|
|
|
|| !propertyNames.get(10).equals("任务时长") |
|
|
|
|
|| !propertyNames.get(11).equals("开始时间") |
|
|
|
|
|| !propertyNames.get(12).equals("提交时间") |
|
|
|
|
|| !propertyNames.get(13).equals("实际时长") |
|
|
|
|
|| !propertyNames.get(14).equals("用户角色") |
|
|
|
|
|| !propertyNames.get(15).equals("关联实体") |
|
|
|
|
|| !propertyNames.get(16).equals("模块状态") |
|
|
|
|
|| !propertyNames.get(17).equals("版本状态") |
|
|
|
|
|| !propertyNames.get(18).equals("版本号")){ |
|
|
|
|
|| !propertyNames.get(4).equals("内容描述") |
|
|
|
|
|| !propertyNames.get(5).equals("责任人") |
|
|
|
|
|| !propertyNames.get(6).equals("任务等级") |
|
|
|
|
|| !propertyNames.get(7).equals("任务状态") |
|
|
|
|
|| !propertyNames.get(8).equals("发布时间") |
|
|
|
|
|| !propertyNames.get(9).equals("任务时长") |
|
|
|
|
|| !propertyNames.get(10).equals("开始时间") |
|
|
|
|
|| !propertyNames.get(11).equals("提交时间") |
|
|
|
|
|| !propertyNames.get(12).equals("实际时长") |
|
|
|
|
|| !propertyNames.get(13).equals("用户角色") |
|
|
|
|
|| !propertyNames.get(14).equals("关联实体") |
|
|
|
|
|| !propertyNames.get(15).equals("模块状态") |
|
|
|
|
|| !propertyNames.get(16).equals("版本状态") |
|
|
|
|
|| !propertyNames.get(17).equals("版本号")){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status", "模块管理execl表格不规范,请对比模板重新上传"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
@ -459,48 +458,52 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
modulexVo.setModuleEnName(value); |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
modulexVo.setModuleCode(value); |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
if(value.length()>500){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"内容描述过长"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("内容描述过长,"+"请重新导入"); |
|
|
|
|
} |
|
|
|
|
modulexVo.setPmDescribe(value); |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
case 5: |
|
|
|
|
modulexVo.setManagerUsers(value); |
|
|
|
|
break; |
|
|
|
|
case 7: |
|
|
|
|
case 6: |
|
|
|
|
modulexVo.setWorkLevel(value); |
|
|
|
|
break; |
|
|
|
|
case 8: |
|
|
|
|
case 7: |
|
|
|
|
modulexVo.setWorkStatus(value); |
|
|
|
|
break; |
|
|
|
|
case 9: |
|
|
|
|
case 8: |
|
|
|
|
modulexVo.setPublishTime(value); |
|
|
|
|
break; |
|
|
|
|
case 10: |
|
|
|
|
case 9: |
|
|
|
|
modulexVo.setDuration(value); |
|
|
|
|
break; |
|
|
|
|
case 11: |
|
|
|
|
case 10: |
|
|
|
|
modulexVo.setStartTime(value); |
|
|
|
|
break; |
|
|
|
|
case 12: |
|
|
|
|
case 11: |
|
|
|
|
modulexVo.setSubmitTime(value); |
|
|
|
|
break; |
|
|
|
|
case 13: |
|
|
|
|
case 12: |
|
|
|
|
modulexVo.setRealDuration(value); |
|
|
|
|
break; |
|
|
|
|
case 14: |
|
|
|
|
case 13: |
|
|
|
|
modulexVo.setUserRole(value); |
|
|
|
|
break; |
|
|
|
|
case 15: |
|
|
|
|
case 14: |
|
|
|
|
modulexVo.setRelatedBean(value); |
|
|
|
|
break; |
|
|
|
|
case 16: |
|
|
|
|
case 15: |
|
|
|
|
modulexVo.setStatus(value); |
|
|
|
|
break; |
|
|
|
|
case 17: |
|
|
|
|
case 16: |
|
|
|
|
modulexVo.setVerisonStatus(value); |
|
|
|
|
break; |
|
|
|
|
case 18: |
|
|
|
|
case 17: |
|
|
|
|
modulexVo.setVerison(value); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
@ -660,14 +663,14 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,英文名称不能为空"); |
|
|
|
|
}modulex.setModuleEnName(moduleEnName); |
|
|
|
|
String moduleCode = modulexTemplate.getModuleCode(); |
|
|
|
|
if(moduleCode==null||moduleCode.length()>30){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不能为空或者模块编码过长"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,模块编码不能为空或者模块编码过长"); |
|
|
|
|
} |
|
|
|
|
// String moduleCode = modulexTemplate.getModuleCode();
|
|
|
|
|
// if(moduleCode==null||moduleCode.length()>30){
|
|
|
|
|
// message.put("isError", "true");
|
|
|
|
|
// message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不能为空或者模块编码过长");
|
|
|
|
|
// message.put("closeable","true");
|
|
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
|
// return Result.error("导入失败,模块编码不能为空或者模块编码过长");
|
|
|
|
|
// }
|
|
|
|
|
String modulecode = null; |
|
|
|
|
LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
queryWrapper.eq(Projectx::getProjectName,projectId); |
|
|
|
@ -676,20 +679,20 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
String projectCode = projectx.getProjectCode(); |
|
|
|
|
if(projectCode==null){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"项目编码不存在,请重新填写"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"模块对应的项目编码不存在,请完善对应项目里的项目编码后,重新导入"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("项目编码不存在,请重新填写"); |
|
|
|
|
return Result.error("导入失败,模块对应的项目编码不存在,请完善对应项目里的项目编码后,重新导入"); |
|
|
|
|
} |
|
|
|
|
modulecode = projectCode + firstChar; |
|
|
|
|
if(!modulecode.equals(moduleCode)){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不规范,导入失败"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("模块编码不规范,导入失败"); |
|
|
|
|
} |
|
|
|
|
modulex.setModuleCode(moduleCode); |
|
|
|
|
// if(!modulecode.equals(moduleCode)){
|
|
|
|
|
// message.put("isError", "true");
|
|
|
|
|
// message.put("status","导入失败,第" + (i+4) +"行" +"模块编码不规范,导入失败");
|
|
|
|
|
// message.put("closeable","true");
|
|
|
|
|
// webSocketUtils.sendMessage(loginUser.getId(), message);
|
|
|
|
|
// return Result.error("模块编码不规范,导入失败");
|
|
|
|
|
// }
|
|
|
|
|
modulex.setModuleCode(modulecode); |
|
|
|
|
String pmDescribe = modulexTemplate.getPmDescribe(); |
|
|
|
|
if(StringUtils.isBlank(pmDescribe)){ |
|
|
|
|
modulex.setPmDescribe(null); |
|
|
|
@ -829,6 +832,13 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,任务时长不规范"); |
|
|
|
|
} |
|
|
|
|
if(parseDouble<0){ |
|
|
|
|
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(); |
|
|
|
@ -865,11 +875,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
} |
|
|
|
|
String realDuration = modulexTemplate.getRealDuration(); |
|
|
|
|
if(StringUtils.isBlank(realDuration)){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"实际时长不能为空"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,实际时长不能为空"); |
|
|
|
|
modulex.setRealDuration(null); |
|
|
|
|
}else { |
|
|
|
|
double parseDouble = 0; |
|
|
|
|
try { |
|
|
|
@ -883,10 +889,10 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
} |
|
|
|
|
if(parseDouble<0.1){ |
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"最小时间0.1小时"); |
|
|
|
|
message.put("status","导入失败,第" + (i+4) +"行" +"实际时长最小时间0.1小时"); |
|
|
|
|
message.put("closeable","true"); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,最小时间0.1小时"); |
|
|
|
|
return Result.error("导入失败,实际时长最小时间0.1小时"); |
|
|
|
|
} |
|
|
|
|
modulex.setRealDuration(parseDouble); |
|
|
|
|
} |
|
|
|
@ -992,6 +998,13 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
return Result.error("导入失败,版本号不能为空"); |
|
|
|
|
} |
|
|
|
|
if(parseInt<0){ |
|
|
|
|
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); |
|
|
|
|