瀏覽代碼

bug相关

liuyc 2 年之前
父節點
當前提交
bb9bd3c87c

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

@@ -505,8 +505,8 @@ public class InformationWriteQueryController extends BladeController {
     public R<String> queryNodeStatus(@RequestParam String primaryKeyId, @RequestParam String classify) {
         //记录状态
         String status = "1";
-        //查询填报状态
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).ne(InformationQuery::getType, 3));
+        //查询填报状态,type=1资料填报
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1));
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -561,8 +561,8 @@ public class InformationWriteQueryController extends BladeController {
     public R<String> queryNodeStatusTrial(@RequestParam String classify, @RequestParam String id) {
         //记录状态
         String status = "1";
-        //查询填报状态
-        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).ne(InformationQuery::getType, 3));
+        //查询填报状态,type=2试验
+        InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2));
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -489,7 +489,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                             this.integrationMethod(vor, linkTasks);
                         }
                         //设置上报批次
-                        //vor.setReportNumber(String.valueOf(tasks.get(0).getBatch()));
+                        vor.setReportNumber(String.valueOf(tasks.get(0).getBatch()));
                     }
                 }
 

+ 31 - 30
blade-service/blade-business/src/main/java/org/springblade/business/socket/WebSocket.java

@@ -5,7 +5,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.springblade.business.service.ITaskService;
-import org.springblade.core.secure.utils.AuthUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import cn.hutool.core.util.StrUtil;
@@ -54,8 +53,8 @@ public class WebSocket {
         this.userId = userId;
         //加入map
         webSocketMap.put(userId, this);
-        addOnlineCount();           //在线数加1
-        logger.info("用户{}连接成功,当前在线人数为{}", userId, getOnlineCount());
+        addOnlineCount();//在线数加1
+        logger.info("用户:{}连接成功,当前在线人数为{}人", userId, getOnlineCount());
         try {
             sendMessage(String.valueOf(this.session.getQueryString()));
         } catch (IOException e) {
@@ -69,7 +68,7 @@ public class WebSocket {
         webSocketMap.remove(userId);
         webSocketMessageMap.remove(userId);
         subOnlineCount(); //在线数减1
-        logger.info("用户{}关闭连接!当前在线人数为{}", userId, getOnlineCount());
+        logger.info("用户{}关闭连接!当前在线人数为{}", userId, getOnlineCount());
     }
 
     /**
@@ -79,34 +78,36 @@ public class WebSocket {
      */
     @OnMessage
     public void onMessage(String message, Session session) {
-        webSocketMessageMap.put(userId, message);
-        logger.info("来自客户端用户:{} 消息:{}", userId, message);
-
-        String projectId = "";
-        String contractId = "";
-        if (message.contains(",")) {
-            projectId = message.split(",")[0];
-            contractId = message.split(",")[1];
-        } else {
-            //后管处理userId
-            userId = AuthUtil.getUserId().toString();
-            //userId = "1123598821738675201";
-        }
+        if (StringUtils.isNotEmpty(userId)) {
+            webSocketMessageMap.put(userId, message);
+            String projectId = "";
+            String contractId = "";
+            if (message.contains(",")) {
+                logger.info("来自客户端用户:{} 消息:{}", userId, message);
+                projectId = message.split(",")[0];
+                contractId = message.split(",")[1];
+            } else {
+                logger.info("来自后管用户:{} 消息:{}", userId, message);
+                userId = message;
+            }
 
-        Map<String, String> stringMap;
-        if (StringUtils.isNotEmpty(projectId) && StringUtils.isNotEmpty(contractId) && StringUtils.isNotEmpty(userId)) {
-            //客户端
-            stringMap = iTaskService.getTaskCount(projectId, contractId, userId);
-        } else {
-            //后管
-            stringMap = iTaskService.getTaskCount(null, null, userId);
-        }
+            Map<String, String> stringMap;
+            if (StringUtils.isNotEmpty(projectId) && StringUtils.isNotEmpty(contractId)) {
+                //客户端
+                stringMap = iTaskService.getTaskCount(projectId, contractId, userId);
+            } else {
+                //后管
+                stringMap = iTaskService.getTaskCount(null, null, userId);
+            }
 
-        //客户端切换项目合同段、后管推送消息
-        try {
-            webSocketMap.get(userId).sendMessage(JSON.toJSONString(stringMap));
-        } catch (IOException e) {
-            e.printStackTrace();
+            try {
+                webSocketMap.get(userId).sendMessage(JSON.toJSONString(stringMap));
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+        } else {
+            logger.info("未获取到用户信息,接收消息失败");
         }
     }
 

+ 10 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ProjectInfoController.java

@@ -19,6 +19,8 @@ import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.*;
 import org.springblade.manager.vo.*;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springblade.manager.entity.ProjectInfo;
@@ -40,6 +42,7 @@ public class ProjectInfoController extends BladeController {
     private final IWbsTreePrivateService wbsTreePrivateService;
     private final IContractInfoService iContractInfoService;
     private final SaveUserInfoByProjectService saveUserInfoByProjectService;
+    private final JdbcTemplate jdbcTemplate;
 
     /**
      * 详情
@@ -142,16 +145,17 @@ public class ProjectInfoController extends BladeController {
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-        List<ContractInfo> infos = iContractInfoService.findContractInProject(ids);
-        if (infos.size() > 0) {
+        String sql = "select id from m_contract_info where is_deleted = 0 and p_id = " + ids;
+        List<ContractInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ContractInfo.class));
+        if (query.size() > 0) {
             return R.fail("当前项目有合同段,删除失败");
         }
-        List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateService.findWbsTreePrivate(ids);
-        if (wbsTreePrivates.size() > 0) {
+        Long count1 = wbsTreePrivateService.findWbsTreePrivate(ids);
+        if (count1 > 0) {
             return R.fail("当前项目存在WBS私有树,删除失败");
         }
-        List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectService.selectList(ids);
-        if (list.size() > 0) {
+        Long count2 = saveUserInfoByProjectService.selectList(ids);
+        if (count2 > 0) {
             return R.fail("当前项目被用户关联中,删除失败");
         }
         return R.status(projectInfoService.deleteLogic(Func.toLongList(ids)));

+ 6 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ProjectInfoMapper.xml

@@ -56,9 +56,12 @@
     <select id="queryProjectUserAmount" resultMap="projectUserAmount">
         select
             mpi.project_alias,
-            (select count(id) end from m_project_assignment_user where project_id = mpi.id and role_id in(select id from blade_role where id = '1537247986361782274' or parent_id = '1537247986361782274')) as contractor,
-            (select count(id) end from m_project_assignment_user where project_id = mpi.id and role_id in(select id from blade_role where id = '1537246384519335938' or parent_id = '1537246384519335938')) as supervision,
-            (select count(id) end from m_project_assignment_user where project_id = mpi.id and role_id in(select id from blade_role where id = '1537246243393589249' or parent_id = '1537246243393589249')) as owner
+            (select count(1) end from m_project_assignment_user where is_deleted = 0 and project_id = mpi.id and role_id in
+                (select id from blade_role where is_deleted = 0 and (id = '1537247986361782274' or parent_id = '1537247986361782274' ))) as contractor,
+            (select count(1) end from m_project_assignment_user where is_deleted = 0 and project_id = mpi.id and role_id in
+                (select id from blade_role where is_deleted = 0 and (id = '1537246384519335938' or parent_id = '1537246384519335938'))) as supervision,
+            (select count(1) end from m_project_assignment_user where is_deleted = 0 and project_id = mpi.id and role_id in
+                (select id from blade_role where is_deleted = 0 and (id = '1537246243393589249' or parent_id = '1537246243393589249'))) as owner
         from
             m_project_info as mpi
     </select>

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

@@ -38,7 +38,7 @@ public interface IWbsTreePrivateService extends BaseService<WbsTreePrivate> {
 
     int deleteLogicBypKeyId(String pKeyId);
 
-    List<WbsTreePrivate> findWbsTreePrivate(String ids);
+    Long findWbsTreePrivate(String ids);
 
     boolean updateBatchByPid(List<WbsTreePrivateDTO3> wbsTreePrivates);
 

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

@@ -15,7 +15,7 @@ public interface SaveUserInfoByProjectService extends BaseService<SaveUserInfoBy
 
     List<SaveUserInfoByProjectDTO> queryProjectBusinessUser(Long projectId, Long contractId);
 
-    List<SaveUserInfoByProjectDTO> selectList(String ids);
+    Long selectList(String ids);
 
     boolean deleteBatchByIdsList(List<Long> idsList);
 

+ 3 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1047,9 +1047,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
-
-        //String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        String file_path = "C:\\Users\\泓创开发\\Desktop";//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        //String file_path = "C:\\Users\\泓创开发\\Desktop";
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1331,7 +1330,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
-        //String file_path = "/Users/hongchuangyanfa/Desktop/";//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        //String file_path = "/Users/hongchuangyanfa/Desktop/";
         // 获取有权限的节点信息
         List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
         List<String> data = new ArrayList<>();

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

@@ -45,8 +45,8 @@ public class SaveUserInfoByProjectServiceImpl extends BaseServiceImpl<SaveUserIn
     }
 
     @Override
-    public List<SaveUserInfoByProjectDTO> selectList(String ids) {
-        return baseMapper.selectList(Wrappers.<SaveUserInfoByProjectDTO>query().lambda().eq(SaveUserInfoByProjectDTO::getProjectId, ids));
+    public Long selectList(String ids) {
+        return baseMapper.selectCount(Wrappers.<SaveUserInfoByProjectDTO>query().lambda().eq(SaveUserInfoByProjectDTO::getProjectId, ids));
     }
 
     @Override

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

@@ -260,8 +260,8 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
     }
 
     @Override
-    public List<WbsTreePrivate> findWbsTreePrivate(String ids) {
-        return baseMapper.selectList(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getProjectId, ids));
+    public Long findWbsTreePrivate(String ids) {
+        return baseMapper.selectCount(Wrappers.<WbsTreePrivate>query().lambda().eq(WbsTreePrivate::getProjectId, ids));
     }
 
     @Override