Просмотр исходного кода

审核仲裁方式改为单个操作

18792927508 2 лет назад
Родитель
Сommit
d4871f4a2f

+ 5
- 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseArbitrateController.java Просмотреть файл

22
 
22
 
23
     /**
23
     /**
24
      * 审核仲裁方式
24
      * 审核仲裁方式
25
-     * @param batchCaseApplication
26
-     * @param batchCaseApplication   1同意,0拒绝
25
+     * @param caseApplication
26
+     * @param opinion   1同意,0拒绝
27
      * @return
27
      * @return
28
      */
28
      */
29
     @PutMapping("/method")
29
     @PutMapping("/method")
30
 //    @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')")
30
 //    @PreAuthorize("@ss.hasPermi('caseManagement:list:checkarbitrationway')")
31
-    public AjaxResult examineArbitrateMethod(@RequestBody BatchCaseApplication batchCaseApplication){
32
-        if(CollectionUtil.isEmpty(batchCaseApplication.getIds())|| batchCaseApplication.getOpinion()==null){
33
-            return error("参数校验失败");
34
-        }
35
-        return caseArbitrateService.examineArbitrateMethod(batchCaseApplication.getIds(),batchCaseApplication.getOpinion());
31
+    public AjaxResult examineArbitrateMethod(@Validated @RequestBody CaseApplication caseApplication
32
+            , Integer opinion){
33
+        return caseArbitrateService.examineArbitrateMethod(caseApplication,opinion);
36
     }
34
     }
37
 
35
 
38
     /**
36
     /**

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseArbitrateService.java Просмотреть файл

12
 
12
 
13
     AjaxResult writtenHear(ArbitrateRecord arbitrateRecord);
13
     AjaxResult writtenHear(ArbitrateRecord arbitrateRecord);
14
 
14
 
15
-    AjaxResult examineArbitrateMethod(List<Long> ids, Integer opinion);
15
+    AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion);
16
 }
16
 }

+ 68
- 57
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Просмотреть файл

39
 
39
 
40
     @Override
40
     @Override
41
     @Transactional
41
     @Transactional
42
-    public AjaxResult examineArbitrateMethod(List<Long> ids, Integer opinion) {
43
-        // 批量查询案件信息组装成map
44
-        List<CaseApplication> caseApplicationList = caseApplicationMapper.listCaseApplicationByIds(ids);
45
-        if (CollectionUtil.isEmpty(caseApplicationList)) {
42
+    public AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion) {
43
+        //查询案件详细信息
44
+        CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
45
+        if (caseApplication1 == null) {
46
             return AjaxResult.success();
46
             return AjaxResult.success();
47
         }
47
         }
48
-        Map<Long, CaseApplication> caseApplicationMap = caseApplicationList.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2));
49
-
50
-        //发送短信通知
51
-        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
52
-
53
-        for (Long id : ids) {
54
-
55
-            CaseApplication caseApplication = new CaseApplication();
56
-            caseApplication.setId(id);
57
-            //查询案件详细信息
58
-            CaseApplication caseApplicationById = caseApplicationMap.get(id);
59
-            if (caseApplicationById == null) {
60
-                continue;
61
-            }
62
-            // 获取该案件仲裁方式
63
-            Integer arbitratMethod = caseApplicationById.getArbitratMethod();
64
-            if(arbitratMethod!=null) {
65
-                String caseNum = caseApplicationById.getCaseNum();
66
-                // 日志节点的状态
67
-                int caseLogStatus;
68
-                if (opinion == 0) {   //拒绝
69
-                    if (arbitratMethod == 2) {
70
-                        caseApplicationById.setArbitratMethod(1);  // 更改仲裁方式
71
-                        //修改案件状态为待开庭审理
48
+        Integer arbitratMethod = caseApplication1.getArbitratMethod();
49
+        if(arbitratMethod==null) {
50
+            return AjaxResult.error("请先指定仲裁方式");
51
+        }
52
+            String caseNum = caseApplication1.getCaseNum();
53
+            if (opinion == 0) {   //拒绝
54
+                if (arbitratMethod == 2) {
55
+                    caseApplication1.setArbitratMethod(1);  // 更改仲裁方式
56
+                    //修改案件状态为待开庭审理
72
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
57
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
73
-                        //修改案件状态为待修改开庭时间
74
-                        caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
75
-                        // 新增日志
76
-                        caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
77
-
78
-                    } else {
79
-                        caseApplicationById.setArbitratMethod(2);
80
-                        //修改案件状态为待书面审理
81
-                        caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
82
-                        caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
58
+                    //修改案件状态为待修改开庭时间
59
+                    caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
60
+                    // 新增日志
61
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
83
 
62
 
84
-                    }
85
                 } else {
63
                 } else {
86
-                    if (arbitratMethod == 2) {
87
-                        //修改案件状态为待书面审理
88
-                        caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
89
-                        caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
64
+                    caseApplication1.setArbitratMethod(2);
65
+                    //修改案件状态为待书面审理
66
+                    caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
67
+                    // 新增日志
68
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
90
 
69
 
91
-                    } else {
92
-                        //修改案件状态为待开庭审理
70
+                }
71
+            } else {
72
+                if (arbitratMethod == 2) {
73
+                    //修改案件状态为待书面审理
74
+                    caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
75
+                    // 新增日志
76
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
77
+
78
+                } else {
79
+                    //修改案件状态为待开庭审理
93
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
80
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
94
-                        //修改案件状态为待修改开庭时间
95
-                        caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
96
-                        caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
81
+                    //修改案件状态为待修改开庭时间
82
+                    caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
83
+                    // 新增日志
84
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
97
 
85
 
86
+                }
87
+            }
88
+            int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
89
+            if (i > 0) {
90
+                String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
91
+                //发送短信通知
92
+                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
98
 
93
 
94
+                CaseAffiliate caseAffiliate = new CaseAffiliate();
95
+                caseAffiliate.setCaseAppliId(caseApplication1.getId());
96
+                List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);            //获取案件关联人信息
97
+                if (caseAffiliates != null && caseAffiliates.size() > 0) {
98
+                    for (CaseAffiliate affiliate : caseAffiliates) {
99
+                        //获取身份类型
100
+                        int identityType = affiliate.getIdentityType();
101
+                        if (identityType == 1) {    //申请人
102
+                            request.setTemplateId("1931000");
103
+                            request.setPhone(affiliate.getContactTelphone());
104
+                            // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
105
+                            // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
106
+                            String name = affiliate.getName();
107
+                            request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
108
+                            SmsUtils.sendSms(request);
109
+                        } else {       //被申请人
110
+                            request.setTemplateId("1928006");
111
+                            request.setPhone(affiliate.getContactTelphone());
112
+                            // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
113
+                            String name = affiliate.getName();
114
+                            request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
115
+                            SmsUtils.sendSms(request);
116
+                        }
99
                     }
117
                     }
100
                 }
118
                 }
101
-                // 更改案件状态
102
-                int i = caseApplicationMapper.submitCaseApplication(caseApplicationById);
103
-                if (i > 0) {
104
-                    // 新增日志
105
-                    CaseLogUtils.insertCaseLog(caseApplication.getId(), caseLogStatus, "");
106
-                    // 发送短信
107
-                    sendArbitratMethodMes(caseApplicationById, request, caseNum);
108
-                }
119
+
120
+                return AjaxResult.success("审核成功");
109
             }
121
             }
110
-        }
111
         return AjaxResult.success();
122
         return AjaxResult.success();
112
     }
123
     }
113
 
124
 

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Просмотреть файл

111
             </if>
111
             </if>
112
             <!--法律顾问-->
112
             <!--法律顾问-->
113
             <if test="deptIds != null and deptIds.size() > 0">
113
             <if test="deptIds != null and deptIds.size() > 0">
114
-                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17)
114
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)
115
                 and t.application_organ_id in
115
                 and t.application_organ_id in
116
                 <foreach item="item" collection="deptIds" open="(" separator="," close=")">
116
                 <foreach item="item" collection="deptIds" open="(" separator="," close=")">
117
                     #{item}
117
                     #{item}
198
             </if>
198
             </if>
199
             <!--法律顾问-->
199
             <!--法律顾问-->
200
             <if test="deptIds != null and deptIds.size() > 0">
200
             <if test="deptIds != null and deptIds.size() > 0">
201
-                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17)
201
+                or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17,31)
202
                 and t.application_organ_id in
202
                 and t.application_organ_id in
203
                 <foreach item="item" collection="deptIds" open="(" separator="," close=")">
203
                 <foreach item="item" collection="deptIds" open="(" separator="," close=")">
204
                     #{item}
204
                     #{item}