From 4dc8a15cb1f1c7b8a70fce95f3f715b472302a9c Mon Sep 17 00:00:00 2001
From: wangwh <2397901735@qq.com>
Date: Fri, 06 Sep 2024 18:20:26 +0800
Subject: [PATCH] 1、联合处置相关接口 2、查询办理结果接口 3、查询档案信息接口 4、修改督办相关接口等

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseSuperviseService.java |   66 ++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 34 deletions(-)

diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseSuperviseService.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseSuperviseService.java
index 5bd8845..fbebe41 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseSuperviseService.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseSuperviseService.java
@@ -3,6 +3,7 @@
 import cn.huge.base.common.exception.ServiceException;
 import cn.huge.base.common.utils.DateUtils;
 import cn.huge.base.common.utils.IdUtils;
+import cn.huge.module.cases.domain.dto.QuiltUnitDTO;
 import cn.huge.module.client.api.impl.CustClientImpl;
 import cn.huge.module.client.api.impl.SysClientImpl;
 import cn.huge.module.client.api.impl.UtilsClientImpl;
@@ -15,6 +16,7 @@
 import cn.huge.module.sys.dto.FileInfoBaseDTO;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import lombok.extern.slf4j.Slf4j;
@@ -133,23 +135,30 @@
     /**
      * 添加督办
      * @param caseSupervise 实体对象
-     * @param userId 用户信息编号
      */
     public void addCaseSupervise(CaseSupervise caseSupervise, String userId){
         try{
-            // 获取当前登录用户
-            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
-            Date nowDate = DateUtils.getNowDate();
-            caseSupervise.setSupUserId(loginUser.getId());
-            caseSupervise.setSupUserName(loginUser.getTrueName());
-            caseSupervise.setSupTime(nowDate);
-            caseSupervise.setSupStatus(0);
-            caseSupervise.setCreateTime(nowDate);
-            caseSupervise.setUpdateTime(nowDate);
-            //todo 配置时限
+            List<QuiltUnitDTO> quiltUnitDTOList = caseSupervise.getQuiltUnitDTOList();
             Integer timeTerm = sysClient.getTimeLimit("dyh_case_supervise", SyTimeEnum.SY_TIME_03.getIndex());
-            caseSupervise.setReplyTerm(timeTerm);
-            this.save(caseSupervise);
+            List<CaseSupervise> caseSuperviseList = new ArrayList<>();
+            for(QuiltUnitDTO quiltUnitDTO: quiltUnitDTOList){
+                CaseSupervise caseSuperviseNew = new CaseSupervise();
+                BeanUtils.copyProperties(caseSupervise, caseSuperviseNew);
+                // 获取当前登录用户
+                CtUserDTO loginUser = custClient.clientGetUserAll(userId);
+                Date nowDate = DateUtils.getNowDate();
+                caseSuperviseNew.setSupUserId(loginUser.getId());
+                caseSuperviseNew.setSupUserName(loginUser.getTrueName());
+                caseSuperviseNew.setSupTime(nowDate);
+                caseSuperviseNew.setQuiltUnitId(quiltUnitDTO.getQuiltUnitId());
+                caseSuperviseNew.setQuiltUnitName(quiltUnitDTO.getQuiltUnitName());
+                caseSuperviseNew.setSupStatus(0);
+                caseSuperviseNew.setCreateTime(nowDate);
+                caseSuperviseNew.setUpdateTime(nowDate);
+                caseSuperviseNew.setReplyTerm(timeTerm);
+                caseSuperviseList.add(caseSuperviseNew);
+            }
+            this.saveBatch(caseSuperviseList);
         }catch (Exception e){
             log.error("[CaseSuperviseService.saveCaseSupervise]调用失败,异常信息:"+e, e);
             throw new ServiceException("CaseSuperviseService.saveCaseSupervise", e);
@@ -181,41 +190,30 @@
      * 流转办理-督办列表
      * @param caseId 事项Id
      */
-    public Map<String, Object> listCaseSupervise(String caseId){
+    public Page<CaseSupervise> pageCaseSupervise(String caseId, PageRequest page, int supStatus, String userId){
         try{
-            List<CaseSupervise> repliedList = new ArrayList<>();
-            List<CaseSupervise> noReplyList = new ArrayList<>();
-            QueryWrapper<CaseSupervise> caseSuperviseQueryWrapper = new QueryWrapper<>();
-            caseSuperviseQueryWrapper.eq("case_id", caseId);
-            List<CaseSupervise> caseSuperviseList = mapper.selectList(caseSuperviseQueryWrapper);
+            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
+            String quiltUnitId = loginUser.getUnitId();
+            long countSuperviseList = mapper.countCaseSupervise(caseId, page, supStatus, quiltUnitId);
+            List<CaseSupervise> caseSuperviseList = mapper.pageCaseSupervise(caseId, page, supStatus, quiltUnitId);
 
             Map<String, Object>map = new HashMap<>();
+            map.put("mainId", caseId);
             map.put("ownerIds", caseSuperviseList.stream().map(CaseSupervise::getId).collect(Collectors.joining("','")));
             map.put("types", FileOwnerTypeBaseEnum.OWNER_TYPE_506.getIndex());
-            List<FileIdTypeInfoBaseDTO> fileIdTypeInfoBaseDTOList = sysClient.listIdTypeInfoByOwnerIdList(map, caseId);
+            List<FileIdTypeInfoBaseDTO> fileIdTypeInfoBaseDTOList = sysClient.listIdTypeInfoByOwnerIdList(map);
             for(CaseSupervise caseSupervise: caseSuperviseList){
                 for(FileIdTypeInfoBaseDTO fileIdTypeInfoBaseDTO: fileIdTypeInfoBaseDTOList){
                     if(caseSupervise.getId().equals(fileIdTypeInfoBaseDTO.getOwnerId())){
                         caseSupervise.setFileInfoList(fileIdTypeInfoBaseDTO.getFileList());
                     }
                 }
-                if(0 == caseSupervise.getSupStatus()){
-                    noReplyList.add(caseSupervise);
-                }else if(1 == caseSupervise.getSupStatus()){
-                    repliedList.add(caseSupervise);
-                }
             }
-            int count = noReplyList.size();
-            Map<String, Object> result = new HashMap<>();
-            result.put("count", count);
-            result.put("noReplyList", noReplyList);
-            result.put("repliedList", repliedList);
-            return result;
+            return new PageImpl<CaseSupervise>(caseSuperviseList, page, countSuperviseList);
         }catch (Exception e){
-            log.error("[CaseSuperviseService.listCaseSupervise]调用失败,异常信息:"+e, e);
-            throw new ServiceException("CaseSuperviseService.listCaseSupervise", e);
+            log.error("[CaseSuperviseService.pageReplied]调用失败,异常信息:"+e, e);
+            throw new ServiceException("CaseSuperviseService.pageReplied", e);
         }
     }
-
 
 }

--
Gitblit v1.8.0