liuyc vor 2 Jahren
Ursprung
Commit
98e4224d48

+ 24 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/ArchiveFileController.java

@@ -13,6 +13,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
+import org.springblade.business.entity.MessageWarning;
 import org.springblade.business.entity.Task;
 import org.springblade.business.entity.Task;
 import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.MessageWarningClient;
@@ -199,6 +200,16 @@ public class ArchiveFileController extends BladeController {
 								0
 								0
 						));
 						));
 
 
+						//通过WebSocket推送数量条数
+						if (ObjectUtil.isNotEmpty(archiveFile.getProjectId()) && ObjectUtil.isNotEmpty(archiveFile.getContractId()) && ObjectUtil.isNotEmpty(archiveFile.getCreateUser())) {
+							Map<String, String> stringMap = iTaskService.getTaskCount(archiveFile.getProjectId(), archiveFile.getContractId(), archiveFile.getCreateUser().toString());
+							try {
+								webSocket.sendMessageByUserId(archiveFile.getCreateUser().toString(), JSON.toJSONString(stringMap));
+							} catch (IOException e) {
+								e.printStackTrace();
+							}
+						}
+
 						//保存操作记录
 						//保存操作记录
 						JSONObject json = new JSONObject();
 						JSONObject json = new JSONObject();
 						json.put("operationObjIds", Func.toStrList(archiveFile.getId().toString()));
 						json.put("operationObjIds", Func.toStrList(archiveFile.getId().toString()));
@@ -223,8 +234,20 @@ public class ArchiveFileController extends BladeController {
 								));
 								));
 							}
 							}
 							if(messageList.size() > 0){
 							if(messageList.size() > 0){
-								//内部通过WebSocket推送数量条数
 								this.messageWarningClient.savePushUserMessageWarning(messageList);
 								this.messageWarningClient.savePushUserMessageWarning(messageList);
+
+								//通过WebSocket推送数量条数
+								for (MessageWarning messageWarning : messageList) {
+									if (ObjectUtil.isNotEmpty(messageWarning.getProjectId()) && ObjectUtil.isNotEmpty(messageWarning.getContractId()) && ObjectUtil.isNotEmpty(messageWarning.getPushUser())) {
+										Map<String, String> stringMap = iTaskService.getTaskCount(messageWarning.getProjectId().toString(), messageWarning.getContractId().toString(), messageWarning.getPushUser().toString());
+										try {
+											webSocket.sendMessageByUserId(messageWarning.getPushUser().toString(), JSON.toJSONString(stringMap));
+										} catch (IOException e) {
+											e.printStackTrace();
+										}
+									}
+								}
+
 							}
 							}
 						}
 						}
 					}catch (Exception e){
 					}catch (Exception e){

+ 24 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -13,10 +13,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
-import org.springblade.business.entity.ContractLog;
-import org.springblade.business.entity.ContractLogWbs;
-import org.springblade.business.entity.Task;
-import org.springblade.business.entity.TaskParallel;
+import org.springblade.business.entity.*;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.TaskClient;
 import org.springblade.business.feign.TaskClient;
@@ -371,6 +368,16 @@ public class ContractLogController extends BladeController {
                                 0
                                 0
                         ));
                         ));
 
 
+                        //通过WebSocket推送数量条数
+                        if (ObjectUtil.isNotEmpty(contractLog.getProjectId()) && ObjectUtil.isNotEmpty(contractLog.getContractId()) && ObjectUtil.isNotEmpty(contractLog.getCreateUser())) {
+                            Map<String, String> stringMap = iTaskService.getTaskCount(contractLog.getProjectId().toString(), contractLog.getContractId().toString(), contractLog.getCreateUser().toString());
+                            try {
+                                webSocket.sendMessageByUserId(contractLog.getCreateUser().toString(), JSON.toJSONString(stringMap));
+                            } catch (IOException e) {
+                                e.printStackTrace();
+                            }
+                        }
+
                         //保存操作记录
                         //保存操作记录
                         JSONObject json = new JSONObject();
                         JSONObject json = new JSONObject();
                         json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
                         json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
@@ -409,8 +416,20 @@ public class ContractLogController extends BladeController {
                             }
                             }
                         }
                         }
                         if (messageList.size() > 0) {
                         if (messageList.size() > 0) {
-                            //通过WebSocket推送数量条数
                             this.messageWarningClient.savePushUserMessageWarning(messageList);
                             this.messageWarningClient.savePushUserMessageWarning(messageList);
+
+                            //通过WebSocket推送数量条数
+                            for (MessageWarning messageWarning : messageList) {
+                                if (ObjectUtil.isNotEmpty(messageWarning.getProjectId()) && ObjectUtil.isNotEmpty(messageWarning.getContractId()) && ObjectUtil.isNotEmpty(messageWarning.getPushUser())) {
+                                    Map<String, String> stringMap = iTaskService.getTaskCount(messageWarning.getProjectId().toString(), messageWarning.getContractId().toString(), messageWarning.getPushUser().toString());
+                                    try {
+                                        webSocket.sendMessageByUserId(messageWarning.getPushUser().toString(), JSON.toJSONString(stringMap));
+                                    } catch (IOException e) {
+                                        e.printStackTrace();
+                                    }
+                                }
+                            }
+
                         }
                         }
                     }
                     }
                 } catch (Exception e) {
                 } catch (Exception e) {

+ 23 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -798,7 +798,6 @@ public class InformationWriteQueryController extends BladeController {
                                             contractName = contract.getContractName();
                                             contractName = contract.getContractName();
                                         }
                                         }
 
 
-
                                         //保存通知记录
                                         //保存通知记录
                                         this.messageWarningClient.savePushUserMessageWarning(
                                         this.messageWarningClient.savePushUserMessageWarning(
                                                 new MessageWarningVO(
                                                 new MessageWarningVO(
@@ -813,6 +812,17 @@ public class InformationWriteQueryController extends BladeController {
                                                         //默认未读
                                                         //默认未读
                                                         0
                                                         0
                                                 ));
                                                 ));
+
+                                        //通过WebSocket推送数量条数
+                                        if (ObjectUtil.isNotEmpty(query.getProjectId()) && ObjectUtil.isNotEmpty(query.getContractId()) && ObjectUtil.isNotEmpty(strs[0])) {
+                                            Map<String, String> stringMap = iTaskService.getTaskCount(query.getProjectId().toString(), query.getContractId().toString(), strs[0]);
+                                            try {
+                                                webSocket.sendMessageByUserId(strs[0], JSON.toJSONString(stringMap));
+                                            } catch (IOException e) {
+                                                e.printStackTrace();
+                                            }
+                                        }
+
                                     } catch (Exception e) {
                                     } catch (Exception e) {
                                         e.printStackTrace();
                                         e.printStackTrace();
                                     }
                                     }
@@ -839,8 +849,19 @@ public class InformationWriteQueryController extends BladeController {
                                     ));
                                     ));
                                 }
                                 }
                                 if (messageList.size() > 0) {
                                 if (messageList.size() > 0) {
-                                    //内部通过WebSocket推送数量条数
                                     this.messageWarningClient.savePushUserMessageWarning(messageList);
                                     this.messageWarningClient.savePushUserMessageWarning(messageList);
+
+                                    //通过WebSocket推送数量条数
+                                    for (MessageWarning messageWarning : messageList) {
+                                        if (ObjectUtil.isNotEmpty(messageWarning.getProjectId()) && ObjectUtil.isNotEmpty(messageWarning.getContractId()) && ObjectUtil.isNotEmpty(messageWarning.getPushUser())) {
+                                            Map<String, String> stringMap = iTaskService.getTaskCount(messageWarning.getProjectId().toString(), messageWarning.getContractId().toString(), messageWarning.getPushUser().toString());
+                                            try {
+                                                webSocket.sendMessageByUserId(messageWarning.getPushUser().toString(), JSON.toJSONString(stringMap));
+                                            } catch (IOException e) {
+                                                e.printStackTrace();
+                                            }
+                                        }
+                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }

+ 0 - 48
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/MessageWarningServiceImpl.java

@@ -16,32 +16,17 @@
  */
  */
 package org.springblade.business.service.impl;
 package org.springblade.business.service.impl;
 
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import lombok.AllArgsConstructor;
 import org.springblade.business.entity.MessageWarning;
 import org.springblade.business.entity.MessageWarning;
-import org.springblade.business.entity.Task;
-import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.mapper.MessageWarningMapper;
 import org.springblade.business.mapper.MessageWarningMapper;
 import org.springblade.business.service.IMessageWarningService;
 import org.springblade.business.service.IMessageWarningService;
-import org.springblade.business.service.ITaskParallelService;
-import org.springblade.business.service.ITaskService;
-import org.springblade.business.socket.WebSocket;
 import org.springblade.business.vo.MessageWarningVO;
 import org.springblade.business.vo.MessageWarningVO;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.mp.base.BaseServiceImpl;
-import org.springblade.core.tool.utils.ObjectUtil;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
 
 
 /**
 /**
  * 服务实现类
  * 服务实现类
@@ -52,31 +37,9 @@ import java.util.stream.Collectors;
 @Service
 @Service
 public class MessageWarningServiceImpl extends BaseServiceImpl<MessageWarningMapper, MessageWarning> implements IMessageWarningService {
 public class MessageWarningServiceImpl extends BaseServiceImpl<MessageWarningMapper, MessageWarning> implements IMessageWarningService {
 
 
-    //@Lazy解决循环注入问题
-    @Lazy
-    @Autowired
-    private ITaskService iTaskService;
-
-    @Lazy
-    @Autowired
-    private WebSocket webSocket;
-
     @Override
     @Override
     public void savePushUserMessageWarning(List<MessageWarningVO> vos) {
     public void savePushUserMessageWarning(List<MessageWarningVO> vos) {
         List<MessageWarning> saveList = JSONArray.parseArray(JSONObject.toJSONString(vos), MessageWarning.class);
         List<MessageWarning> saveList = JSONArray.parseArray(JSONObject.toJSONString(vos), MessageWarning.class);
-
-        //通过WebSocket推送数量条数
-        for (MessageWarning messageWarning : saveList) {
-            if (ObjectUtil.isNotEmpty(messageWarning.getProjectId()) && ObjectUtil.isNotEmpty(messageWarning.getContractId()) && ObjectUtil.isNotEmpty(messageWarning.getPushUser())) {
-                Map<String, String> stringMap = iTaskService.getTaskCount(messageWarning.getProjectId().toString(), messageWarning.getContractId().toString(), messageWarning.getPushUser().toString());
-                try {
-                    webSocket.sendMessageByUserId(messageWarning.getPushUser().toString(), JSON.toJSONString(stringMap));
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
         this.saveBatch(saveList);
         this.saveBatch(saveList);
     }
     }
 
 
@@ -84,17 +47,6 @@ public class MessageWarningServiceImpl extends BaseServiceImpl<MessageWarningMap
     public void savePushUserMessageWarning(MessageWarningVO vo) {
     public void savePushUserMessageWarning(MessageWarningVO vo) {
         MessageWarning messageWarning = new MessageWarning();
         MessageWarning messageWarning = new MessageWarning();
         BeanUtils.copyProperties(vo, messageWarning);
         BeanUtils.copyProperties(vo, messageWarning);
-
-        //通过WebSocket推送数量条数
-        if (ObjectUtil.isNotEmpty(messageWarning.getProjectId()) && ObjectUtil.isNotEmpty(messageWarning.getContractId()) && ObjectUtil.isNotEmpty(messageWarning.getPushUser())) {
-            Map<String, String> stringMap = iTaskService.getTaskCount(messageWarning.getProjectId().toString(), messageWarning.getContractId().toString(), messageWarning.getPushUser().toString());
-            try {
-                webSocket.sendMessageByUserId(messageWarning.getPushUser().toString(), JSON.toJSONString(stringMap));
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
         this.baseMapper.insert(messageWarning);
         this.baseMapper.insert(messageWarning);
     }
     }
 
 

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeController.java

@@ -92,7 +92,7 @@ public class ArchiveTreeController extends BladeController {
     @ApiOperation(value = "逻辑删除", notes = "传入id")
     @ApiOperation(value = "逻辑删除", notes = "传入id")
     public R remove(@ApiParam(value = "id", required = true) @RequestParam String id) {
     public R remove(@ApiParam(value = "id", required = true) @RequestParam String id) {
         List<ArchiveTree> archiveTrees = archiveTreeService.selectByParentIdOrId(id);
         List<ArchiveTree> archiveTrees = archiveTreeService.selectByParentIdOrId(id);
-        archiveTrees.stream().forEach(archiveTree -> {
+        archiveTrees.forEach(archiveTree -> {
             if (archiveTree.getParentId() == Long.parseLong(id)) {
             if (archiveTree.getParentId() == Long.parseLong(id)) {
                 throw new ServiceException("当前节点下存在子节点,删除失败");
                 throw new ServiceException("当前节点下存在子节点,删除失败");
             }
             }

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsInfoController.java

@@ -132,10 +132,10 @@ public class WbsInfoController extends BladeController {
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        /*List<WbsTree> list = wbsTreeService.findByWbsTreeNode(ids);
+        List<WbsTree> list = wbsTreeService.findByWbsTreeNode(ids);
         if (list.size() > 0) {
         if (list.size() > 0) {
             return R.fail("当前模板根节点下有子节点,删除失败");
             return R.fail("当前模板根节点下有子节点,删除失败");
-        }*/
+        }
         Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query()
         Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query()
                 .lambda()
                 .lambda()
                 .eq(WbsTreePrivate::getWbsId, ids)
                 .eq(WbsTreePrivate::getWbsId, ids)

+ 6 - 7
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java

@@ -138,10 +138,10 @@ public class WbsTreeController extends BladeController {
     @ApiOperationSupport(order = 5)
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "逻辑删除", notes = "传入节点id")
     @ApiOperation(value = "逻辑删除", notes = "传入节点id")
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String id) {
-        /*List<WbsTree> wbsTreeList = wbsTreeService.selectByWbsId(id);
+        List<WbsTree> wbsTreeList = wbsTreeService.selectByWbsId(id);
         if (wbsTreeList.size() > 0) {
         if (wbsTreeList.size() > 0) {
             throw new ServiceException("当前节点下存在子节点或表单,删除失败");
             throw new ServiceException("当前节点下存在子节点或表单,删除失败");
-        }*/
+        }
         Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
         Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getStatus, 1)
                 .eq(WbsTreePrivate::getStatus, 1)
                 .eq(WbsTreePrivate::getId, id)
                 .eq(WbsTreePrivate::getId, id)
@@ -176,16 +176,16 @@ public class WbsTreeController extends BladeController {
     @ApiImplicitParam(name = "id", value = "表单id", required = true)
     @ApiImplicitParam(name = "id", value = "表单id", required = true)
     public R removeTableById(@RequestParam("id") String id) {
     public R removeTableById(@RequestParam("id") String id) {
         if (StringUtils.isNotEmpty(id)) {
         if (StringUtils.isNotEmpty(id)) {
-            /*List<WbsFormElementVO> wbsFormElements = wbsTreeService.selectFormElements(id);
+            List<WbsFormElementVO> wbsFormElements = wbsTreeService.selectFormElements(id,null); //此处nodeId为后续其他开发加的,不知道有什么用,所以传null
             if (wbsFormElements.size() > 0) {
             if (wbsFormElements.size() > 0) {
                 throw new ServiceException("该表单中存在元素,删除失败");
                 throw new ServiceException("该表单中存在元素,删除失败");
-            }*/
-            /*Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
+            }
+            Long wbsTreePrivates = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
                     .eq(WbsTreePrivate::getStatus, 1)
                     .eq(WbsTreePrivate::getStatus, 1)
                     .eq(WbsTreePrivate::getId, id));
                     .eq(WbsTreePrivate::getId, id));
             if (wbsTreePrivates > 0L) {
             if (wbsTreePrivates > 0L) {
                 throw new ServiceException("该表单已被项目引用,删除失败");
                 throw new ServiceException("该表单已被项目引用,删除失败");
-            }*/
+            }
             if (wbsTreeService.removeTableById(id)) {
             if (wbsTreeService.removeTableById(id)) {
                 return R.success("删除成功");
                 return R.success("删除成功");
             }
             }
@@ -332,7 +332,6 @@ public class WbsTreeController extends BladeController {
     @ApiOperation(value = "批量修改节点下元素表基本信息", notes = "传入List<WbsTree>")
     @ApiOperation(value = "批量修改节点下元素表基本信息", notes = "传入List<WbsTree>")
     @RequestMapping(value = "/update-batch-node-tableInfo", method = RequestMethod.POST)
     @RequestMapping(value = "/update-batch-node-tableInfo", method = RequestMethod.POST)
     public R updateBatchNodeTableInfo(@RequestBody List<WbsTree> WbsTrees) {
     public R updateBatchNodeTableInfo(@RequestBody List<WbsTree> WbsTrees) {
-        //
         return R.status(wbsTreeService.updateBatchById(WbsTrees));
         return R.status(wbsTreeService.updateBatchById(WbsTrees));
     }
     }
 
 

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -264,14 +264,14 @@ public class WbsTreePrivateController extends BladeController {
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pKeyId)
                 .eq(WbsTreePrivate::getPKeyId, pKeyId)
                 .eq(WbsTreePrivate::getStatus, 1));
                 .eq(WbsTreePrivate::getStatus, 1));
-        /*Long wbsTreePrivate1 = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
+        Long wbsTreePrivate1 = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getParentId, wbsTreePrivate.getId())
                 .eq(WbsTreePrivate::getParentId, wbsTreePrivate.getId())
                 .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
                 .eq(WbsTreePrivate::getProjectId, wbsTreePrivate.getProjectId())
                 .eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId())
                 .eq(WbsTreePrivate::getWbsId, wbsTreePrivate.getWbsId())
                 .eq(WbsTreePrivate::getStatus, 1));
                 .eq(WbsTreePrivate::getStatus, 1));
         if (wbsTreePrivate1 > 0L) {
         if (wbsTreePrivate1 > 0L) {
             throw new ServiceException("当前节点下存在子节点或表单,删除失败");
             throw new ServiceException("当前节点下存在子节点或表单,删除失败");
-        }*/
+        }
         Long wbsTreeContracts = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda()
         Long wbsTreeContracts = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getStatus, 1)
                 .eq(WbsTreeContract::getStatus, 1)
                 .eq(WbsTreeContract::getId, wbsTreePrivate.getId())
                 .eq(WbsTreeContract::getId, wbsTreePrivate.getId())
@@ -328,14 +328,14 @@ public class WbsTreePrivateController extends BladeController {
     public R removeTableByCondition(@RequestParam("id") String id,
     public R removeTableByCondition(@RequestParam("id") String id,
                                     @RequestParam("wbsId") String wbsId,
                                     @RequestParam("wbsId") String wbsId,
                                     @RequestParam("projectId") String projectId) {
                                     @RequestParam("projectId") String projectId) {
-        /*Long wbsTreeContracts = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda()
+        Long wbsTreeContracts = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getProjectId, projectId)
                 .eq(WbsTreeContract::getProjectId, projectId)
                 .eq(WbsTreeContract::getWbsId, wbsId)
                 .eq(WbsTreeContract::getWbsId, wbsId)
                 .eq(WbsTreeContract::getId, id)
                 .eq(WbsTreeContract::getId, id)
         );
         );
         if (wbsTreeContracts > 0L) {
         if (wbsTreeContracts > 0L) {
             throw new ServiceException("当前表单被合同段引用中,删除失败");
             throw new ServiceException("当前表单被合同段引用中,删除失败");
-        }*/
+        }
         boolean result = wbsTreePrivateService.removeTableByCondition(id, wbsId, projectId);
         boolean result = wbsTreePrivateService.removeTableByCondition(id, wbsId, projectId);
         if (result) {
         if (result) {
             return R.success("删除成功");
             return R.success("删除成功");

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java

@@ -37,6 +37,7 @@ import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
 import java.util.List;
 import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
 @Service
 @Service
@@ -666,7 +667,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
             nodeIds.add("-1234569");
             nodeIds.add("-1234569");
         }
         }
 
 
-        if (nodeIds.size() <= 0) {
+        if (Objects.requireNonNull(nodeIds).size() == 0) {
             throw new ServiceException("请至少选择一个节点进行新增操作");
             throw new ServiceException("请至少选择一个节点进行新增操作");
         } else {
         } else {
             if (formElementDTO.getElementList().size() <= 0) {
             if (formElementDTO.getElementList().size() <= 0) {
@@ -687,7 +688,7 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
                     }
                     }
                 }
                 }
 
 
-                // 实体信息表验证  如果实体表的名称 和数据表名称相同  则试用同一张表否则新建
+                //实体信息表验证,如果实体表的名称和数据表名称相同,则用同一张表否则新建
                 //初始化
                 //初始化
                 String newTableName = "m_" + DateUtil.time() + "_" + SnowFlakeUtil.getId();
                 String newTableName = "m_" + DateUtil.time() + "_" + SnowFlakeUtil.getId();
                 TableInfo tableInfo = tableInfoMapper.selectByTabEnName(formElementDTO.getNodeName());
                 TableInfo tableInfo = tableInfoMapper.selectByTabEnName(formElementDTO.getNodeName());

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -1245,7 +1245,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
             wbsPrivate.setFillRate(tableInfo.getFillRate());
             wbsPrivate.setFillRate(tableInfo.getFillRate());
             wbsPrivate.setProjectId(projectId);
             wbsPrivate.setProjectId(projectId);
             wbsPrivate.setType(10);//带过来的元素信息
             wbsPrivate.setType(10);//带过来的元素信息
-            wbsPrivate.setParentId(-10l);
+            wbsPrivate.setParentId(-10L);
             wbsTreePrivateMapper.insert(wbsPrivate);
             wbsTreePrivateMapper.insert(wbsPrivate);
            /* }else{
            /* }else{
                 return R.success("没有查到主库信息");
                 return R.success("没有查到主库信息");

+ 0 - 4
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -623,10 +623,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                 } else {
                 } else {
                     replace = user.getRoleId().replace("," + roleId, "");
                     replace = user.getRoleId().replace("," + roleId, "");
                 }
                 }
-                /*
-                如果当前用户不同合同段引用相同角色,还存在至少一个正在使用的项目合同段角色,那么就保留User对应的RoleId
-                例如:一个用户项目合同1、合同2下都使用administrator角色,那么删除合同2的administrator角色,对应UserRoleId字段保留administrator角色
-                */
                 //查询当前项目不同合同段中删除的角色是否存在多条引用同种角色,RoleId相同
                 //查询当前项目不同合同段中删除的角色是否存在多条引用同种角色,RoleId相同
                 List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectClient.searchUserInfoAndProject(id, roleId);
                 List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectClient.searchUserInfoAndProject(id, roleId);
                 if (list.size() >= 2) {
                 if (list.size() >= 2) {