Merge remote-tracking branch 'origin/dev_2307' into dev_2307

dev^2
guilongma 1 year ago
commit 1d4a92cc72
  1. 3
      ant-design-vue-jeecg/src/views/modulex/ModulexList.vue
  2. 111
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/rulex/controller/RulexController.java
  3. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/controller/FieldxController.java
  4. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/fieldx/service/impl/FieldxServiceImpl.java
  5. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/modulex/service/impl/ModulexServiceImpl.java

@ -609,8 +609,7 @@ export default {
'对应功能(必填):填写正确的功能名称',
'对应实体(非必填):填写正确的实体名称',
'对应字段(非必填):填写正确的字段名称',
'顺序号(必填):同功能下不重复,为正整数且与规则编码顺序号相等',
'规则编码(必填):功能编码+顺序号(格式001)',
'顺序号(必填):同功能下不重复,为三位数正整数',
'规则描述(非必填)',
'责任人(非必填):如果有多个值请使用逗号分割',
'任务等级(必填):值:1、2、3、4、5个等级',

@ -310,7 +310,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
if (
StringUtils.isBlank(list.get(i).getRuleNo()) ||
StringUtils.isBlank(list.get(i).getProjectId()) ||
StringUtils.isBlank(list.get(i).getRuleCode()) ||
// StringUtils.isBlank(list.get(i).getRuleCode()) ||
// StringUtils.isBlank() list.get(i).getPmDescribe() == null &&
StringUtils.isBlank(list.get(i).getModuleId()) ||
StringUtils.isBlank(list.get(i).getFunctionId()) ||
@ -501,7 +501,10 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
rulex.setFieldId(fieldx.getId());
}
Double duration = null;
String duration1 = ruleVo.getDuration();
if(!StringUtils.isBlank(duration1)) {
try {
duration = Double.valueOf(duration1);
if (duration < 0) {
message.put("isError", "true");
message.put("closeable", "true");
@ -509,7 +512,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对");
}
duration = Double.valueOf(ruleVo.getDuration());
rulex.setDuration(duration);
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); //手动回滚,这样上层就无需去处理异常了
@ -519,6 +522,7 @@ public class RulexController extends JeecgController<Rulex, IRulexService> {
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,任务时长输入错误,请核对");
}
}
Double d;
String realDuration = ruleVo.getRealDuration();
@ -645,48 +649,57 @@ String workLevel = ruleVo.getWorkLevel();
//规则编码
String ruleCode = ruleVo.getRuleCode();
String functionCode1 = functionx.getFunctionCode();
if (ruleCode == null) {
message.put("isError", "true");
message.put("closeable", "true");
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
}
//截取到功能编码校验(去除后三位)
if (!ruleCode.substring(0, ruleCode.length() - 3).equals(functionCode1)) {
message.put("isError", "true");
message.put("closeable", "true");
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
}
//后三位
String substring = ruleCode.substring(ruleCode.length() - 3);
try {
Integer integer1 = Integer.valueOf(substring);
if (integer1 < 0) {
message.put("isError", "true");
message.put("closeable", "true");
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
}
} catch (NumberFormatException e) {
message.put("isError", "true");
message.put("closeable", "true");
message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
}
rulex.setRuleCode(ruleCode);
// String ruleCode = ruleVo.getRuleCode();
// String functionCode1 = functionx.getFunctionCode();
// if (ruleCode == null) {
// message.put("isError", "true");
// message.put("closeable", "true");
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
// }
// //截取到功能编码校验(去除后三位)
// if (!ruleCode.substring(0, ruleCode.length() - 3).equals(functionCode1)) {
// message.put("isError", "true");
// message.put("closeable", "true");
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
// }
//
// //后三位
// String substring = ruleCode.substring(ruleCode.length() - 3);
// try {
// Integer integer1 = Integer.valueOf(substring);
// if (integer1 < 0) {
// message.put("isError", "true");
// message.put("closeable", "true");
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
// }
// } catch (NumberFormatException e) {
// message.put("isError", "true");
// message.put("closeable", "true");
// message.put("status", "第" + (i + 1) + "条数据,规则编码错误,请核对");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("第" + (i + 1) + "条数据,规则编码错误,请核对");
// }
// rulex.setRuleCode(ruleCode);
//规则序号
// String ruleNo = ruleVo.getRuleNo();
// String c = ruleCode.substring(ruleCode.length() - ruleNo.length());
////三位数整数且与编码后三位相同
// if (!(c.equals(ruleNo) && ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000))) {
// message.put("isError", "true");
// message.put("closeable", "true");
// message.put("status", "第" + (i + 1) + "条数据,规则序号错误,请核对");
// webSocketUtils.sendMessage(loginUser.getId(), message);
// return Result.error("第" + (i + 1) + "条数据,规则序号错误,请核对");
// }
// rulex.setRuleNo(ruleNo);
String ruleNo = ruleVo.getRuleNo();
String c = ruleCode.substring(ruleCode.length() - ruleNo.length());
//三位数整数且与编码后三位相同
if (!(c.equals(ruleNo) && ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000))) {
if(!ruleNo.matches("^[0-9]*[1-9][0-9]*$") && (Integer.valueOf(ruleNo) < 1000)){
message.put("isError", "true");
message.put("closeable", "true");
message.put("status", "第" + (i + 1) + "条数据,规则序号错误,请核对");
@ -694,7 +707,17 @@ String workLevel = ruleVo.getWorkLevel();
return Result.error("第" + (i + 1) + "条数据,规则序号错误,请核对");
}
rulex.setRuleNo(ruleNo);
{
String functionCode1 = functionx.getFunctionCode();
if (ruleNo.length()==1){
ruleNo="00"+ruleNo;
}else if (ruleNo.length()==2){
ruleNo="0"+ruleNo;
}
String ruleCode =functionCode1+ruleNo;
rulex.setRuleCode(ruleCode);
//规则描述
String pmDescribe = ruleVo.getPmDescribe();
@ -765,7 +788,7 @@ String workLevel = ruleVo.getWorkLevel();
rulexList.add(rulex);
}
}
} finally{
finally{
//清理预存表
iRuleVoService.remove(null);
}

@ -689,6 +689,7 @@ public class FieldxController extends JeecgController<Fieldx, IFieldxService> {
message.put("isError", "true");
message.put("status","单元格样式错误,请根据注意事项保证单元格样式正确");
message.put("closeable","true");
fieldxService.remove(null);
webSocketUtils.sendMessage(loginUser.getId(), message);
}
return Result.OK("文件上传成功");

@ -9,10 +9,12 @@ import org.jeecg.modules.fieldx.service.IFieldxService;
import org.jeecg.modules.tablex.entity.Tablex;
import org.jeecg.modules.tablex.service.ITablexService;
import org.jeecg.modules.tablex.ws.WebSocketUtils;
import org.jsoup.helper.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@ -24,7 +26,7 @@ import java.util.Map;
* @Version: V1.0
*/
@Transactional
@Service
public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> implements IFieldxService {
@Autowired
@ -39,11 +41,21 @@ public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> impleme
try {
Thread.sleep(500L);
message.put("uploaded", String.valueOf(i + 1));
this.save(fieldxList.get(i));
Fieldx fieldx=fieldxList.get(i);
this.save(fieldx);
if(!StringUtil.isBlank(fieldx.getAssociateTable())||!StringUtil.isBlank(fieldx.getAssociateField())){
webSocketUtils.sendMessage(loginUser.getId(), message);
continue;
}
Tablex tablex = tablexService.getById(fieldx.getTableId());
tablexService.updateVersion(fieldx.getTableId(), tablex.getVerison() + 1);
tablexService.updateSql(fieldx.getTableId(), fieldxController.createSql(fieldx.getTableId()));
webSocketUtils.sendMessage(loginUser.getId(), message);
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
}
}

@ -668,14 +668,6 @@ 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 = null;
LambdaQueryWrapper<Projectx> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Projectx::getProjectName,projectId);
@ -690,13 +682,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
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);
String pmDescribe = modulexTemplate.getPmDescribe();
if(StringUtils.isBlank(pmDescribe)){
@ -715,7 +700,7 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
modulex.setManagerUsers(null);
}else {
LambdaQueryWrapper<SysUser> sysUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
String[] split = managerUsers.split(",");
String[] split = managerUsers.split("\\s+|,|;|,|、");
List<String> managerUserName= Arrays.stream(split).map(String::valueOf).collect(Collectors.toList());
sysUserLambdaQueryWrapper.in(SysUser::getUsername,managerUserName);
List<SysUser> iSysUserServiceOne = iSysUserService.list(sysUserLambdaQueryWrapper);
@ -734,7 +719,6 @@ public class ModulexServiceImpl extends ServiceImpl<ModulexMapper, Modulex> impl
webSocketUtils.sendMessage(loginUser.getId(), message);
return Result.error("导入失败,责任人信息查询不到");
}
// String strip = org.apache.commons.lang.StringUtils.strip(list.toString(), "[]");
String s = "";
for (int j = 0; j < list.size(); j++) {
s = s + list.get(j);

Loading…
Cancel
Save