删除导入前校验中文名称英文名重复,有问题

dev^2
guilongma 1 year ago
parent d21c877583
commit a63d094450
  1. 22
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/functionx/service/impl/FunctionXTestServiceImpl.java

@ -168,18 +168,18 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
LambdaQueryWrapper<FunctionxTest> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(username != null, FunctionxTest::getCreatName, username);
List<FunctionxTest> list = this.list(queryWrapper);
int isSaveTestSuccess = saveTest(listVo);
if (isSaveTestSuccess != -1){
this.remove(queryWrapper);
message.put("isError", "true");
message.put("status", "第" + (isSaveTestSuccess+1) + "行中文名或英文名有重复");
message.put("closeable", "true");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("中文名或英文名有重复");
}
List<FunctionxTest> list = this.list(queryWrapper);
// if (isSaveTestSuccess != -1){
// this.remove(queryWrapper);
// message.put("isError", "true");
// message.put("status", "第" + (isSaveTestSuccess+1) + "行中文名或英文名有重复");
// message.put("closeable", "true");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("中文名或英文名有重复");
// }
message.put("status", "数据校验");
webSocketUtils.sendMessage(loginUser.getId(), message);
@ -669,7 +669,7 @@ public class FunctionXTestServiceImpl extends ServiceImpl<FunctionxTestMapper, F
return Result.OK("导入成功");
}
@Transactional
int saveTest(List<FunctionxTest> listVo) {
for (int i = 0; i < listVo.size(); i++) {
try {

Loading…
Cancel
Save