|
|
@ -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.IProjectxService; |
|
|
|
import org.jeecg.modules.tablex.entity.Tablex; |
|
|
|
import org.jeecg.modules.tablex.entity.Tablex; |
|
|
|
import org.jeecg.modules.tablex.service.ITablexService; |
|
|
|
import org.jeecg.modules.tablex.service.ITablexService; |
|
|
|
|
|
|
|
|
|
|
@ -78,6 +80,10 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IModulexService modulexService; |
|
|
|
private IModulexService modulexService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IProjectxService projectxService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private IFieldxService fieldxService; |
|
|
|
private IFieldxService fieldxService; |
|
|
|
|
|
|
|
|
|
|
@ -337,7 +343,7 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
|
|
|
|
|
|
|
|
message.put("status", "数据预读入"); |
|
|
|
message.put("status", "数据预读入"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
Iterator<TablexVo> iterator = list.iterator(); |
|
|
|
|
|
|
|
for (TablexVo tablexVo : list) { |
|
|
|
for (TablexVo tablexVo : list) { |
|
|
|
//判断当前存入条是否为空值
|
|
|
|
//判断当前存入条是否为空值
|
|
|
|
if (StringUtils.isBlank(tablexVo.getModuleId()) && |
|
|
|
if (StringUtils.isBlank(tablexVo.getModuleId()) && |
|
|
@ -376,18 +382,49 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
List<Tablex> tablexList = new ArrayList<>(); |
|
|
|
List<Tablex> tablexList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < voList.size(); i++) { |
|
|
|
for (int i = 0; i < voList.size(); i++) { |
|
|
|
|
|
|
|
|
|
|
|
Tablex tablex = new Tablex(); |
|
|
|
Tablex tablex = new Tablex(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断对应的项目名称
|
|
|
|
|
|
|
|
String projectId = voList.get(i).getProjectId(); |
|
|
|
|
|
|
|
if (projectId == null || projectId.equals("")){ |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("status", "导入失败,第" + (i + 1) + "条项目名称填写不能为空"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条项目名称填写不能为空"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<Projectx> queryProjectx = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryProjectx.eq(Projectx::getId, projectId); |
|
|
|
|
|
|
|
Projectx projectx = projectxService.getOne(queryProjectx); |
|
|
|
|
|
|
|
if (projectx == null) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("status", "导入失败,第" + (i + 1) + "条项目名称不存在"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条项目名称不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//判断对应模块是否为空,且对应模块是否存在
|
|
|
|
//判断对应模块是否为空,且对应模块是否存在
|
|
|
|
String moduleId = voList.get(i).getModuleId(); |
|
|
|
String moduleId = voList.get(i).getModuleId(); |
|
|
|
if (moduleId == null || moduleId.equals("")) { |
|
|
|
if (moduleId == null || moduleId.equals("")) { |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("isError", "true"); |
|
|
|
message.put("status", "导入失败,对应模块填写不能为空"); |
|
|
|
message.put("status", "导入失败,第" + (i + 1) + "条对应模块填写不能为空"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
message.put("closeable", "true"); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
return Result.error("对应模块填写不能为空"); |
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条对应模块填写不能为空"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<Modulex> queryModulex = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryModulex.eq(Modulex::getProjectId,projectId); |
|
|
|
|
|
|
|
queryModulex.eq(Modulex::getId, moduleId); |
|
|
|
|
|
|
|
Modulex modulex = modulexService.getOne(queryModulex); |
|
|
|
|
|
|
|
if (modulex == null) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("status", "导入失败,第" + (i + 1) + "条对应模块不存在"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条对应模块不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String modulexId = modulex.getId(); |
|
|
|
|
|
|
|
|
|
|
|
//判断实体是否已存在
|
|
|
|
//判断实体是否已存在
|
|
|
|
LambdaQueryWrapper<Tablex> query = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Tablex> query = new LambdaQueryWrapper<>(); |
|
|
@ -401,18 +438,6 @@ public class TablexController extends JeecgController<Tablex, ITablexService> { |
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条的实体已存在"); |
|
|
|
return Result.error("导入失败,第" + (i + 1) + "条的实体已存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Modulex> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.eq(Modulex::getId, moduleId); |
|
|
|
|
|
|
|
Modulex modulex = modulexService.getOne(queryWrapper); |
|
|
|
|
|
|
|
if (modulex == null) { |
|
|
|
|
|
|
|
message.put("isError", "true"); |
|
|
|
|
|
|
|
message.put("status", "导入失败,对应模块填写错误"); |
|
|
|
|
|
|
|
message.put("closeable", "true"); |
|
|
|
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
|
|
|
return Result.error("对应模块填写错误"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String modulexId = modulex.getId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String status = voList.get(i).getStatus(); |
|
|
|
String status = voList.get(i).getStatus(); |
|
|
|
String verisonStatus = voList.get(i).getVerisonStatus(); |
|
|
|
String verisonStatus = voList.get(i).getVerisonStatus(); |
|
|
|
|
|
|
|
|
|
|
|