Explorar o código

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

yangyj hai 1 ano
pai
achega
3592ed42a7

+ 8 - 19
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -539,12 +539,8 @@
             (CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
             if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
             (CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
-            (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
-
-            (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
-
+            atc.node_name as node_name ,
+            ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
             from m_archive_tree_contract atc
             WHERE is_deleted =0 and project_id = #{projectId}
             and (id = #{ownerUnit} or FIND_IN_SET(#{ownerUnit},ancestors))
@@ -557,10 +553,8 @@
             (CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
             if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
             (CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
-            (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
-            (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
+            atc.node_name as node_name ,
+            ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
             from m_archive_tree_contract atc
             WHERE is_deleted =0 and project_id = #{projectId}
             and  (id = #{supervisorUnit} or FIND_IN_SET(#{supervisorUnit},ancestors))
@@ -573,10 +567,8 @@
             (CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
             if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
             (CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
-            (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), '卷)')) as node_name,
-            (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-            and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
+            atc.node_name as node_name ,
+            ( select count(1) from u_archives_auto where is_apply = 1 and is_deleted = 0 and node_id = atc.id ) as total
             from m_archive_tree_contract atc
             WHERE is_deleted =0 and project_id = #{projectId}
             and  (id = #{buildUnit} or FIND_IN_SET(#{buildUnit},ancestors))
@@ -587,11 +579,8 @@
         select id,parent_id,
                (CASE when LENGTH(expert_id) > 0 then 0 else 1 end) as isSelect,
                if((select COUNT(1) from m_archive_tree_contract WHERE is_deleted = 0 and parent_id = atc.id) > 0,true,false) as isChildren,
---                (CASE when LENGTH(expert_id) > 0 then concat('该目录已分属', atc.expert_name , '专家') else '' end) as nodeInfo,
-               (concat(atc.node_name,'(', (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-                and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))), ')')) as node_name,
-               (select COUNT(1) from u_archives_auto  WHERE  is_apply = 1 and is_deleted=0 and node_id in (select id from m_archive_tree_contract where is_deleted = 0 and project_id = #{projectId}
-                and (id = atc.id or FIND_IN_SET(atc.id,ancestors)))) as total
+               atc.node_name as node_name ,
+               ( select count(1) from u_archives_auto where project_id = #{projectId} and is_apply = 1 and is_deleted = 0) as total
         from m_archive_tree_contract atc
         WHERE atc.parent_id = 0 and atc.is_deleted = 0 and project_id =#{projectId}
     </select>

+ 12 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ArchiveTreeContractServiceImpl.java

@@ -1364,6 +1364,8 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 		 */
 		//获取首节点
 		InspectTreeVO firstNode = baseMapper.getFirstNode(projectId);
+		String firstName = firstNode.getNodeName()+"("+firstNode.getTotal()+")";
+		firstNode.setTotal(0);
 		//获取三个单位节点
 		List<ArchiveTreeContract> unitFirstNode = baseMapper.getUnitFirstNode(firstNode.getId());
 		Map<String, Long> unitMap = unitFirstNode.stream().collect(Collectors.toMap(l -> l.getTreeCode(), l -> l.getId()));
@@ -1389,6 +1391,7 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 		twoTreeVO.setList(list);
 		List<InspectTreeVO> list2 = new ArrayList<>();
 		gatherSortNode(list,list2);
+		list.get(0).setNodeName(firstName);
 		//查看当前档案是否分配过其他专家
 		if (list.size() > 1){
 			throw new ServiceException("节点信息错误");
@@ -1476,17 +1479,24 @@ public class ArchiveTreeContractServiceImpl extends BaseServiceImpl<ArchiveTreeC
 	}
 
 	//递归方法
-	private void gatherSortNode(List<InspectTreeVO>list, List<InspectTreeVO> list2){
+	private int gatherSortNode(List<InspectTreeVO>list, List<InspectTreeVO> list2){
+		int i = 0;
 		for (InspectTreeVO vo : list) {
 			if (vo.getChildren().size() == 0){
+				vo.setNodeName(vo.getNodeName()+"("+vo.getTotal()+"卷)");
 				if (vo.getTotal() > 0) {
 					list2.add(vo);
+					i += vo.getTotal();
 				}
 				continue;
 			}else {
-				gatherSortNode(vo.getChildren(), list2);
+				int node = gatherSortNode(vo.getChildren(), list2);
+				vo.setTotal(node);
+				i += node;
+				vo.setNodeName(vo.getNodeName()+"("+vo.getTotal()+"卷)");
 			}
 		}
+		return i;
 	}
 
 	/**

+ 11 - 11
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@@ -182,11 +182,11 @@ public class UserController {
     @PostMapping("/submit2")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "新增2", notes = "传入UserDTO")
-  //  @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
+    //  @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
     public R submitTow(@Valid @RequestBody UserDTO user) {
         CacheUtil.clear(USER_CACHE);
         // 为第三方系统
-        if(user.getSysId().equals("30")){
+        if (ObjectUtil.isNotEmpty(user.getSysId()) && user.getSysId().equals("30")) {
             user.setUserType("1,2,3");
             user.setPassword("123456");
             user.setPlaintextPassword("123456");
@@ -195,7 +195,7 @@ public class UserController {
             user.setStatus(1);
             user.setSysType(2);
             List<SaveUserInfoByProjectDTO> projectAndUserList = new ArrayList<>();
-            SaveUserInfoByProjectDTO data= new SaveUserInfoByProjectDTO();
+            SaveUserInfoByProjectDTO data = new SaveUserInfoByProjectDTO();
             data.setContractId("1714919227250950146");
             data.setProjectId("1612329251049537537");
             data.setRoleId("1537248158277914626");
@@ -452,9 +452,9 @@ public class UserController {
     @PostMapping("/loginByToken")
     @ApiOperationSupport(order = 20)
     @ApiOperation(value = "token验证加密", notes = "token验证登录")
-    public R loginByToken(String  token) {
-      //  this.loginByToken2(token);
-        token = "bearer "+token;
+    public R loginByToken(String token) {
+        //  this.loginByToken2(token);
+        token = "bearer " + token;
         HttpClient httpClient = HttpClientBuilder.create().build();
         HttpGet httpPost = new HttpGet("http://47.110.251.215:8090/blade-auth/oauth/user-info");
         httpPost.setHeader("Authorization", token); //这个需要 client:
@@ -470,11 +470,11 @@ public class UserController {
                 outputStream.write(buffer, 0, index);
             }
             JSONObject jsonObject = JSON.parseObject(outputStream.toString());
-            if(jsonObject!=null && ObjectUtil.isNotEmpty(jsonObject)){
+            if (jsonObject != null && ObjectUtil.isNotEmpty(jsonObject)) {
                 JSONObject data = jsonObject.getJSONObject("data");
                 String name = data.getString("name");
                 return this.loginByToken2(name);
-            }else{
+            } else {
                 return R.fail("token解析用户失败");
             }
         } catch (IOException e) {
@@ -501,10 +501,10 @@ public class UserController {
             if (userInfo == null) {
                 return R.fail("用户名或密码错误");
             }
-            String tenId =userInfo.getTenantId();
+            String tenId = userInfo.getTenantId();
             String pass = userInfo.getPlaintextPassword();
-            String md5Pass =MD5Utils.md5Hex(pass,"UTF-8");
-            System.out.println("密码"+ md5Pass);
+            String md5Pass = MD5Utils.md5Hex(pass, "UTF-8");
+            System.out.println("密码" + md5Pass);
 
             HttpClient httpClient = HttpClientBuilder.create().build();
             HttpPost httpPost = new HttpPost("http://47.110.251.215:8090/blade-auth/oauth/token");

+ 2 - 2
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/WbsTreeController.java

@@ -94,8 +94,8 @@ public class WbsTreeController extends BladeController {
      * @date 2024年1月6日10:28:01
      */
     @PostMapping("/informationWriteQuery/page")
-    @ApiOperationSupport(order = 4)
-    @ApiOperation(value = "分页")
+    @ApiOperationSupport(order = 2)
+    @ApiOperation(value = "资料查询分页")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "size", value = "当前页条数", required = true),
             @ApiImplicitParam(name = "current", value = "当前页", required = true),

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

@@ -1322,7 +1322,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
         }
         long endTime = System.currentTimeMillis();
         long executionTime = endTime - startTime;
-        _logger.info("合同段 " + node.getContractId() + " 获取当前资料缓存 执行时间:" + executionTime + " ms");
+        _logger.info("合同段 " + node.getContractId() + " 获取当前资料 执行时间:" + executionTime + " ms");
 
         if (result.size() != 0) {
             Map<String, List<Task>> taskMaps = new HashMap<>();