|
|
@ -65,7 +65,6 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
message.put("closeable", "false"); |
|
|
|
message.put("closeable", "false"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
//创建输出流对象
|
|
|
|
//创建输出流对象
|
|
|
|
Workbook wb; |
|
|
|
Workbook wb; |
|
|
|
/*判断文件是xlsx结尾还是xls结尾 声明XSSF或HSSF对象*/ |
|
|
|
/*判断文件是xlsx结尾还是xls结尾 声明XSSF或HSSF对象*/ |
|
|
@ -98,8 +97,8 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
Sheet sheet = wb.getSheetAt(0); |
|
|
|
Sheet sheet = wb.getSheetAt(0); |
|
|
|
//获取工作表页中行数据
|
|
|
|
//获取工作表页中行数据
|
|
|
|
//读取的总的行数
|
|
|
|
//读取的总的行数
|
|
|
|
int rowNum = sheet.getPhysicalNumberOfRows(); |
|
|
|
int lastRowIndex = sheet.getLastRowNum(); |
|
|
|
if (rowNum < 1) { |
|
|
|
if (lastRowIndex < 1) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "文件无内容或格式错误"); |
|
|
|
message.put("status", "文件无内容或格式错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
@ -110,7 +109,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
|
|
|
|
List<FunctionxTest> listVo = new ArrayList<>(); |
|
|
|
List<FunctionxTest> listVo = new ArrayList<>(); |
|
|
|
for (int i = 1; i <= rowNum; i++) { |
|
|
|
for (int i = 1; i <= lastRowIndex; i++) { |
|
|
|
Row row = sheet.getRow(i); // 行
|
|
|
|
Row row = sheet.getRow(i); // 行
|
|
|
|
if (row == null ) { |
|
|
|
if (row == null ) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
@ -131,10 +130,6 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
list.add(cellValue); |
|
|
|
list.add(cellValue); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!funCheck(list)){ |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//------------接收-------------
|
|
|
|
//------------接收-------------
|
|
|
|
FunctionxTest fun = new FunctionxTest(); |
|
|
|
FunctionxTest fun = new FunctionxTest(); |
|
|
|
fun.setPModuleName(list.get(0)); |
|
|
|
fun.setPModuleName(list.get(0)); |
|
|
@ -218,7 +213,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
functionx.setCreateTime(new Date()); //创建日期
|
|
|
|
functionx.setCreateTime(new Date()); //创建日期
|
|
|
|
if (StringUtils.isBlank(moduleId)) { |
|
|
|
if (StringUtils.isBlank(moduleId)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + i + "行数据对应模块不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行对应模块不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("对应模块不能为空"); |
|
|
|
return Result.error("对应模块不能为空"); |
|
|
@ -251,7 +246,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
} |
|
|
|
} |
|
|
|
if (functionx.getModuleId() == null) { |
|
|
|
if (functionx.getModuleId() == null) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据对应模块有错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行对应模块有错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("请输入正确的对应模块"); |
|
|
|
return Result.error("请输入正确的对应模块"); |
|
|
@ -260,7 +255,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(functionName)) { |
|
|
|
if (StringUtils.isBlank(functionName)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据中文名称不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行中文名称不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("中文名称不能为空"); |
|
|
|
return Result.error("中文名称不能为空"); |
|
|
@ -271,7 +266,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
int count = functionxService.count(queryWrapper1); |
|
|
|
int count = functionxService.count(queryWrapper1); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据中文名称在模块下重复"); |
|
|
|
message.put("status", "第" + (i + 2) + "行中文名称在模块下重复"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("中文名称在模块下重复"); |
|
|
|
return Result.error("中文名称在模块下重复"); |
|
|
@ -280,7 +275,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(functionEnName)) { |
|
|
|
if (StringUtils.isBlank(functionEnName)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据英文名称不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行英文名称不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("英文名称不能为空"); |
|
|
|
return Result.error("英文名称不能为空"); |
|
|
@ -291,7 +286,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
int count = functionxService.count(queryWrapper2); |
|
|
|
int count = functionxService.count(queryWrapper2); |
|
|
|
if (count > 0) { |
|
|
|
if (count > 0) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据英文名称在模块下重复"); |
|
|
|
message.put("status", "第" + (i + 2) + "行英文名称在模块下重复"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("英文名称在模块下重复"); |
|
|
|
return Result.error("英文名称在模块下重复"); |
|
|
@ -303,7 +298,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
int type; |
|
|
|
int type; |
|
|
|
if (StringUtils.isBlank(functionType)) { // 空和null
|
|
|
|
if (StringUtils.isBlank(functionType)) { // 空和null
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据功能类型不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行功能类型不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("功能类型不能为空"); |
|
|
|
return Result.error("功能类型不能为空"); |
|
|
@ -335,7 +330,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据功能类型错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行功能类型错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("功能类型错误"); |
|
|
|
return Result.error("功能类型错误"); |
|
|
@ -345,7 +340,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
// 模块编码+功能缩写;自动填充+手动修改
|
|
|
|
// 模块编码+功能缩写;自动填充+手动修改
|
|
|
|
if (StringUtils.isBlank(functionCode)) { |
|
|
|
if (StringUtils.isBlank(functionCode)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据功能编码不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行功能编码不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("功能编码不能为空"); |
|
|
|
return Result.error("功能编码不能为空"); |
|
|
@ -358,7 +353,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
String str = moduleCode + firstChar; |
|
|
|
String str = moduleCode + firstChar; |
|
|
|
if (!str.equals(functionCode)) { |
|
|
|
if (!str.equals(functionCode)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据功能编码错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行功能编码错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("功能编码错误"); |
|
|
|
return Result.error("功能编码错误"); |
|
|
@ -373,12 +368,12 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
if (StringUtils.isNotBlank(userRole)) { // 用户角色
|
|
|
|
if (StringUtils.isNotBlank(userRole)) { // 用户角色
|
|
|
|
LambdaQueryWrapper<ProjectUserRole> queryWrapperUser = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<ProjectUserRole> queryWrapperUser = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapperUser.eq(ProjectUserRole::getUserRole, userRole); // 是否匹配项目id?
|
|
|
|
queryWrapperUser.eq(ProjectUserRole::getUserRole, userRole); // 是否匹配项目id?
|
|
|
|
List<ProjectUserRole> list1 = projectUserRoleService.list(queryWrapperUser); |
|
|
|
int count = projectUserRoleService.count(queryWrapperUser); |
|
|
|
if (list1.size() > 0) |
|
|
|
if (count > 0) |
|
|
|
functionx.setUserRole(list1.get(0).getId()); |
|
|
|
functionx.setUserRole(userRole); |
|
|
|
else { |
|
|
|
else { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据请输入正确的用户角色"); |
|
|
|
message.put("status", "第" + (i + 2) + "行请输入正确的用户角色"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("请输入正确的用户角色"); |
|
|
|
return Result.error("请输入正确的用户角色"); |
|
|
@ -388,24 +383,20 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
if (StringUtils.isNotBlank(managerUsers)) { // 责任人
|
|
|
|
if (StringUtils.isNotBlank(managerUsers)) { // 责任人
|
|
|
|
String[] splitManager = managerUsers.split("\\s+|,|;|、"); |
|
|
|
String[] splitManager = managerUsers.split("\\s+|,|;|、"); |
|
|
|
|
|
|
|
|
|
|
|
int count = 1; |
|
|
|
int count = 0; |
|
|
|
String idManager = ""; |
|
|
|
|
|
|
|
for (String manager : splitManager) { |
|
|
|
for (String manager : splitManager) { |
|
|
|
LambdaQueryWrapper<SysUser> queryWrapperUserName = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<SysUser> queryWrapperUserName = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapperUserName.eq(!manager.isEmpty(), SysUser::getUsername, manager); |
|
|
|
queryWrapperUserName.eq(!manager.isEmpty(), SysUser::getUsername, manager); |
|
|
|
List<SysUser> list1 = sysUserService.list(queryWrapperUserName); |
|
|
|
count = sysUserService.count(queryWrapperUserName); |
|
|
|
if (list1.isEmpty()) { |
|
|
|
if (count == 0) { |
|
|
|
count=0; |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
idManager = idManager+list1.get(0).getId()+","; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (count > 0){ |
|
|
|
|
|
|
|
functionx.setManagerUsers(idManager); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (count > 0) |
|
|
|
|
|
|
|
functionx.setManagerUsers(managerUsers); |
|
|
|
else { |
|
|
|
else { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据请输入正确的责任人,并确保多个责任人之间用空格或者逗号、分号隔开"); |
|
|
|
message.put("status", "第" + (i + 2) + "行请输入正确的责任人,并确保多个责任人之间用空格或者逗号、分号隔开"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("请输入正确的责任人,并确保多个责任人之间用空格或者逗号、分号隔开"); |
|
|
|
return Result.error("请输入正确的责任人,并确保多个责任人之间用空格或者逗号、分号隔开"); |
|
|
@ -415,7 +406,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
// 值:1、2、3、4、5,默认2
|
|
|
|
// 值:1、2、3、4、5,默认2
|
|
|
|
if (StringUtils.isBlank(workLevel)) { // 任务等级
|
|
|
|
if (StringUtils.isBlank(workLevel)) { // 任务等级
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据任务等级不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行任务等级不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("任务等级不能为空"); |
|
|
|
return Result.error("任务等级不能为空"); |
|
|
@ -423,7 +414,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
int integer = Integer.parseInt(workLevel); |
|
|
|
int integer = Integer.parseInt(workLevel); |
|
|
|
if (integer < 1 || integer > 5) { |
|
|
|
if (integer < 1 || integer > 5) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据任务等级错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行任务等级错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("任务等级错误"); |
|
|
|
return Result.error("任务等级错误"); |
|
|
@ -433,7 +424,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(workStatus)) { |
|
|
|
if (StringUtils.isBlank(workStatus)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据任务状态不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行任务状态不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("任务状态不能为空"); |
|
|
|
return Result.error("任务状态不能为空"); |
|
|
@ -460,7 +451,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据任务状态错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行任务状态错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("任务状态错误"); |
|
|
|
return Result.error("任务状态错误"); |
|
|
@ -473,7 +464,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
Boolean isTime = checkTime(publishTime); |
|
|
|
Boolean isTime = checkTime(publishTime); |
|
|
|
if (!isTime) { |
|
|
|
if (!isTime) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据发布时间格式错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行发布时间格式错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("发布时间错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("发布时间错误,应为" + pattern + "类型"); |
|
|
@ -482,7 +473,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
date = dateFormat.parse(publishTime); |
|
|
|
date = dateFormat.parse(publishTime); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据发布时间错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行发布时间错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("发布时间错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("发布时间错误,应为" + pattern + "类型"); |
|
|
@ -495,7 +486,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
Boolean isTime = checkTime(startTime); |
|
|
|
Boolean isTime = checkTime(startTime); |
|
|
|
if (!isTime) { |
|
|
|
if (!isTime) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据开始时间格式错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行开始时间格式错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("开始时间错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("开始时间错误,应为" + pattern + "类型"); |
|
|
@ -504,7 +495,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
date = dateFormat.parse(startTime); |
|
|
|
date = dateFormat.parse(startTime); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据开始时间错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行开始时间错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("开始时间错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("开始时间错误,应为" + pattern + "类型"); |
|
|
@ -522,7 +513,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
Boolean isTime = checkTime(submitTime); |
|
|
|
Boolean isTime = checkTime(submitTime); |
|
|
|
if (!isTime) { |
|
|
|
if (!isTime) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据提交时间格式错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行提交时间格式错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("提交时间格式错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("提交时间格式错误,应为" + pattern + "类型"); |
|
|
@ -531,7 +522,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
date = dateFormat.parse(submitTime); |
|
|
|
date = dateFormat.parse(submitTime); |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据提交时间时间错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行提交时间时间错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("提交时间时间错误,应为" + pattern + "类型"); |
|
|
|
return Result.error("提交时间时间错误,应为" + pattern + "类型"); |
|
|
@ -542,7 +533,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
Double aDouble = Double.valueOf(realDuration); |
|
|
|
Double aDouble = Double.valueOf(realDuration); |
|
|
|
if (aDouble < 0.1) { |
|
|
|
if (aDouble < 0.1) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据实际时长错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行实际时长错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("实际时长错误"); |
|
|
|
return Result.error("实际时长错误"); |
|
|
@ -552,7 +543,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(status)) { // 空和null
|
|
|
|
if (StringUtils.isBlank(status)) { // 空和null
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据功能状态不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行功能状态不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("功能状态不能为空"); |
|
|
|
return Result.error("功能状态不能为空"); |
|
|
@ -570,7 +561,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据任务状态错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行任务状态错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("任务状态错误"); |
|
|
|
return Result.error("任务状态错误"); |
|
|
@ -579,7 +570,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(verisonStatus)) { // 空和null
|
|
|
|
if (StringUtils.isBlank(verisonStatus)) { // 空和null
|
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据版本状态不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行版本状态不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("版本状态不能为空"); |
|
|
|
return Result.error("版本状态不能为空"); |
|
|
@ -594,7 +585,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据版本状态错误"); |
|
|
|
message.put("status", "第" + (i + 2) + "行版本状态错误"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("版本状态错误"); |
|
|
|
return Result.error("版本状态错误"); |
|
|
@ -603,7 +594,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(verison)) { |
|
|
|
if (StringUtils.isBlank(verison)) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "第" + (i+1) + "行数据数据版本号不能为空"); |
|
|
|
message.put("status", "第" + (i + 2) + "行版本号不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("版本号不能为空"); |
|
|
|
return Result.error("版本号不能为空"); |
|
|
@ -625,30 +616,12 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F |
|
|
|
return Result.error("导入失败"); |
|
|
|
return Result.error("导入失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("status", "导入失败,请重新检查上传文件内容和格式"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("导入失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
message.put("status", "上传成功"); |
|
|
|
message.put("status", "上传成功"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.OK("导入成功"); |
|
|
|
return Result.OK("导入成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean funCheck(List<String> list) { |
|
|
|
|
|
|
|
for (int i=0;i<list.size();i++){ |
|
|
|
|
|
|
|
if(list.get(i)!=null && list.get(i).length()>0){ |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isSuccessInsert(LoginUser loginUser, Map<String, String> message, List<Functionx> listInsert) { |
|
|
|
private boolean isSuccessInsert(LoginUser loginUser, Map<String, String> message, List<Functionx> listInsert) { |
|
|
|
message.put("status", "导入数据中"); |
|
|
|
message.put("status", "导入数据中"); |
|
|
|
message.put("records", String.valueOf(listInsert.size())); |
|
|
|
message.put("records", String.valueOf(listInsert.size())); |
|
|
|