From c16a867c943e25a25d64f02fb95e755ef1a7c9f9 Mon Sep 17 00:00:00 2001
From: liyj <15602261488@163.com>
Date: Mon, 30 Sep 2024 18:03:25 +0800
Subject: [PATCH] 1、审核过程中申请记录的申请时间和申请人无法查看 2、审核联合处置申请在申请部门已办结后会报错,且无法继续审核 3、案件不予受理后在已办中无记录 4、上报的案件上级部门回退后下级部门接收不到 5、广州市综治中心纠纷依然可以选择上报,且点击上报后报错

---
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/impl/CustClientImpl.java               |   22 +++++++++++
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java                |   19 ++++++++-
 dyh-service/dyh-base/src/main/java/cn/huge/module/mediate/constant/AuditBaseConsts.java                |    3 +
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseTaskMapper.xml           |    2 -
 dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/client/CtUnitClientController.java |   23 +++++++++++
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/CustClient.java                        |   11 +++++
 dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/domain/po/CaseAssistApply.java              |    2 
 7 files changed, 74 insertions(+), 8 deletions(-)

diff --git a/dyh-service/dyh-base/src/main/java/cn/huge/module/mediate/constant/AuditBaseConsts.java b/dyh-service/dyh-base/src/main/java/cn/huge/module/mediate/constant/AuditBaseConsts.java
index 5c25dab..8685f6d 100644
--- a/dyh-service/dyh-base/src/main/java/cn/huge/module/mediate/constant/AuditBaseConsts.java
+++ b/dyh-service/dyh-base/src/main/java/cn/huge/module/mediate/constant/AuditBaseConsts.java
@@ -11,10 +11,11 @@
 public class AuditBaseConsts {
 
     /**
-     * 通用审核状态,0:未审核,1:已审核
+     * 通用审核状态,0:未审核,1:已审核,2:异常结束
      */
     public static final int AUDIT_STATUS_0 = 0;
     public static final int AUDIT_STATUS_1 = 1;
+    public static final int AUDIT_STATUS_2 = 2;
 }
 /**
  * -------------------_ooOoo_-------------------
diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/client/CtUnitClientController.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/client/CtUnitClientController.java
index 11a3b5e..cf3f1ab 100644
--- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/client/CtUnitClientController.java
+++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/client/CtUnitClientController.java
@@ -141,4 +141,27 @@
             return ReturnFailUtils.getRepInfo();
         }
     }
+
+    /**
+     * 查询用户所在的单位信息
+     * @url {ctx}/api/client/ctUnit/getUnitByUserId
+     * @param userId 用户编号
+     * @return Object
+     */
+    @GetMapping("/getUnitByUserId")
+    public Object getUnitByUserId(@RequestParam(value = "userId") String userId) {
+        try {
+            CtUser ctUser = ctUserService.getById(userId);
+            CtUnit ctUnit = service.getById(ctUser.getUnitId());
+            if (ObjectUtils.isNotEmpty(ctUnit)){
+                CtUnitDTO ctUnitDTO = new CtUnitDTO();
+                BeanUtils.copyProperties(ctUnit, ctUnitDTO);
+                return ReturnSucUtils.getRepInfo(ctUnitDTO);
+            }else {
+                return ReturnFailUtils.getRepInfo("查询组织不存在!");
+            }
+        } catch (Exception e) {
+            return ReturnFailUtils.getRepInfo();
+        }
+    }
 }
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseTaskMapper.xml b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseTaskMapper.xml
index b0d8ccd..763d357 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseTaskMapper.xml
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/dao/mapper/xml/CaseTaskMapper.xml
@@ -547,7 +547,6 @@
         (t1.node_id = 'ZJ_DSL' or  t1.node_id = 'QJ_DSL' or  t1.node_id = 'SJ_DSL' or  t1.node_id = 'DSL')
         and t2.delete_status = 0
         and t1.sign_status != 1
-        and (t1.handle_result != 3 or t1.handle_result is null)
         and t1.status = #{terms.status}
         <include refid="myTaskSl-where-part"/>
     </select>
@@ -564,7 +563,6 @@
         (t1.node_id = 'ZJ_DSL' or t1.node_id = 'QJ_DSL' or t1.node_id = 'SJ_DSL' or t1.node_id = 'DSL')
         and t2.delete_status = 0
         and t1.sign_status != 1
-        and (t1.handle_result != 3 or t1.handle_result is null)
         and t1.status = #{terms.status}
         <include refid="myTaskSl-where-part"/>
         <if test="page.sort != null">
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/domain/po/CaseAssistApply.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/domain/po/CaseAssistApply.java
index 355cce6..d98f656 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/domain/po/CaseAssistApply.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/domain/po/CaseAssistApply.java
@@ -84,7 +84,7 @@
     private Date applyTime;
 
     /**
-    * 申请状态,0:待审核,1:已审核
+    * 申请状态,0:待审核,1:已审核,2:异常结束
     */
     @TableField(value = "apply_status")
     private Integer applyStatus;
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java
index abfbbee..eba423c 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseTaskService.java
@@ -317,8 +317,11 @@
                         sl.setName("自行受理");
                         buttonList.add(sl);
                         buttonList.add(jb);
-                        buttonList.add(sb);
                         buttonList.add(bysl);
+                        CtUnitDTO ctUnitDTO = custClient.getUnitByUserId(userId);
+                        if (UserBaseConsts.UNIT_GRADE_1 != ctUnitDTO.getUnitGrade()) {
+                            buttonList.add(sb);
+                        }
 
                         // 额外单独给详情跳转查看
                         daxx.setName("详情");
@@ -2052,6 +2055,15 @@
                 caseInfoUnfoldPO.setUpdateTime(nowDate);
                 caseInfoUnfoldService.updateCaseInfoUnfold(caseInfoUnfoldPO);
             }
+            // 查询联合处置申请单,全部结束申请单
+            QueryWrapper<CaseAssistApply> caseAssistApplyQueryWrapper = new QueryWrapper<>();
+            caseAssistApplyQueryWrapper.eq("case_id", jasqCaseTask.getCaseId()).eq("apply_status", AuditBaseConsts.AUDIT_STATUS_0);
+            List<CaseAssistApply> caseAssistApplyList = caseAssistApplyService.list(caseAssistApplyQueryWrapper);
+            for (CaseAssistApply caseAssistApply: caseAssistApplyList){
+                caseAssistApply.setApplyStatus(AuditBaseConsts.AUDIT_STATUS_2);
+                caseAssistApply.setUpdateTime(nowDate);
+                caseAssistApplyService.updateCaseAssistApply(caseAssistApply);
+            }
             // 查询配合部门的任务,全部结束流程
             List<CaseTask> assistCaseTaskList = this.listAssistTasking(jasqCaseTask.getCaseId());
             for (CaseTask assistCaseTask: assistCaseTaskList){
@@ -2726,8 +2738,9 @@
                 dfphCaseTask.setCaseTaskType(CaseTaskConsts.CASE_TASK_TYPE_1);
                 // 受理任务,任务候选执行者类型是上一步骤选择
                 dfphCaseTask.setCandeType(CaseTaskConsts.CANDE_TYPE_1);
-                dfphCaseTask.setCandeUnitId(caseAppear.getAppearUnitId());
-                dfphCaseTask.setCandeUnitName(caseAppear.getAppearUnitName());
+                CaseAppear caseAppearBO = caseAppearService.getById(caseAppear.getId());
+                dfphCaseTask.setCandeUnitId(caseAppearBO.getAppearUnitId());
+                dfphCaseTask.setCandeUnitName(caseAppearBO.getAppearUnitName());
                 // 受理后的任务,不需要签收
                 dfphCaseTask.setSignStatus(CaseTaskConsts.SIGN_STATUS_0);
                 dfphCaseTask.setStatus(CaseTaskConsts.TASK_STATUS_1);
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/CustClient.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/CustClient.java
index 90b4b6d..99b5d6a 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/CustClient.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/CustClient.java
@@ -58,7 +58,7 @@
 
     /**
      * 根据id查询组织信息
-     * @url {ctx}/api/client/ctUnit/getById
+     * @url {ctx}/api/client/ctUnit/getUnitById
      * @param unitId 组织编号
      * @return Object
      */
@@ -74,4 +74,13 @@
     @GetMapping("/api/client/ctUnit/getParentZzzxUnit")
     ReturnBO getParentZzzxUnit(@RequestParam(value = "unitId")  String unitId);
 
+    /**
+     * 查询用户所在的单位信息
+     * @url {ctx}/api/client/ctUnit/getUnitByUserId
+     * @param userId 用户编号
+     * @return Object
+     */
+    @GetMapping("/api/client/ctUnit/getUnitByUserId")
+    ReturnBO getUnitByUserId(@RequestParam("userId") String userId);
+
 }
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/impl/CustClientImpl.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/impl/CustClientImpl.java
index 1b708f4..80592ee 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/impl/CustClientImpl.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/client/api/impl/CustClientImpl.java
@@ -172,4 +172,26 @@
             throw new ServiceException("CustClientImpl.getParentZzzxUnit", e);
         }
     }
+
+    /**
+     * 查询用户所在的单位信息
+     * @url {ctx}/api/client/ctUnit/getUnitByUserId
+     * @param userId 用户编号
+     * @return Object
+     */
+    public CtUnitDTO getUnitByUserId(String userId){
+        try{
+            ReturnBO returnBo = custClient.getUnitByUserId(userId);
+            if (ReturnConsts.OK == returnBo.getCode()){
+                CtUnitDTO ctUnitDTO = objectMapper.convertValue(returnBo.getData(), CtUnitDTO.class);
+                return ctUnitDTO;
+            }else{
+                log.error("Client外服务接口[CustClientImpl.getUnitByUserId]请求异常:" + returnBo.getMsg(), returnBo.getMsg());
+                throw new ClientException("CustClientImpl.getUnitByUserId", returnBo.getMsg());
+            }
+        }catch (Exception e){
+            log.error("service方法[CustClientImpl.getUnitByUserId]调用异常:"+e, e);
+            throw new ServiceException("CustClientImpl.getUnitByUserId", e);
+        }
+    }
 }

--
Gitblit v1.8.0