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

+ 1
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java Просмотреть файл

41
     @Anonymous
41
     @Anonymous
42
     @GetMapping("/selectPCEIDtokenStatus")
42
     @GetMapping("/selectPCEIDtokenStatus")
43
     public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) {
43
     public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) {
44
-        JSONObject tokenResult = identityAuthenticationService.selectPCEIDtokenStatus(eidToken);
45
-        return success(tokenResult);
44
+        return identityAuthenticationService.selectPCEIDtokenStatus(eidToken);
46
     }
45
     }
47
 
46
 
48
     /**
47
     /**

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

250
      * @return
250
      * @return
251
      */
251
      */
252
     @GetMapping("/listMediator")
252
     @GetMapping("/listMediator")
253
-    public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = false) Long caseAppliId) {
253
+    public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = true) Long caseAppliId) {
254
         return caseApplicationService.listMediator(caseAppliId);
254
         return caseApplicationService.listMediator(caseAppliId);
255
     }
255
     }
256
     /**
256
     /**
310
      */
310
      */
311
     @PostMapping("/mediation")
311
     @PostMapping("/mediation")
312
     public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
312
     public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
313
-        if (req.getCaseFlowId() == null || req.getId() == null || req.getMediaResult()==null) {
313
+        if (req.getCaseFlowId() == null || req.getId() == null ) {
314
             return error("参数校验失败");
314
             return error("参数校验失败");
315
         }
315
         }
316
 
316
 

+ 1
- 1
ruoyi-admin/src/main/resources/application.yml Просмотреть файл

175
 #  小程序端人脸核身商户id
175
 #  小程序端人脸核身商户id
176
   merchantId: 0NSJ2309281116194321
176
   merchantId: 0NSJ2309281116194321
177
 #  pc端人脸核身商户id
177
 #  pc端人脸核身商户id
178
-  pcMerchantId: 0NSJ2309281116194321
178
+  pcMerchantId: 0NSJ2404231626029804
179
   privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
179
   privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
180
 # 腾讯云即时通信相关配置
180
 # 腾讯云即时通信相关配置
181
 imConfig:
181
 imConfig:

+ 6
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Просмотреть файл

84
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
84
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
85
     private Date endTime;
85
     private Date endTime;
86
     /**
86
     /**
87
-     * 是否申请操作人,0-否,1-是
87
+     * 是否申请操作人签名按钮权限,0-否,1-是
88
      */
88
      */
89
     private Integer appOperatorFlag;
89
     private Integer appOperatorFlag;
90
     /**
90
     /**
91
-     * 是否被申请操作人,0-否,1-是
91
+     * 是否被申请操作人签名按钮权限,0-否,1-是
92
      */
92
      */
93
     private Integer resOperatorFlag;
93
     private Integer resOperatorFlag;
94
     /**
94
     /**
99
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
99
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
100
      */
100
      */
101
     private Integer mediationFileFlag=0;
101
     private Integer mediationFileFlag=0;
102
+    /**
103
+     * 是否申请人被申请人签收按钮权限,0-否,1-是
104
+     */
105
+    private Integer signFlag=0;
102
 
106
 
103
 }
107
 }

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

36
      * H5轮询获取EIDtoken状态
36
      * H5轮询获取EIDtoken状态
37
      * @return
37
      * @return
38
      */
38
      */
39
-    JSONObject selectPCEIDtokenStatus(String eidToken);
39
+    AjaxResult selectPCEIDtokenStatus(String eidToken);
40
 }
40
 }

+ 56
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java Просмотреть файл

231
     }
231
     }
232
 
232
 
233
     @Override
233
     @Override
234
-    public JSONObject selectPCEIDtokenStatus(String eidToken) {
234
+    public AjaxResult selectPCEIDtokenStatus(String eidToken) {
235
         // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
235
         // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
236
         // todo E证通审核过后将PC端的机器id在YML文件中改掉
236
         // todo E证通审核过后将PC端的机器id在YML文件中改掉
237
         JSONObject objJSON = null;
237
         JSONObject objJSON = null;
238
+        IdentityAuthentication authentication = new IdentityAuthentication();
239
+
238
         try {
240
         try {
239
             Credential cred = new Credential(credentialSecretId, credentialSecretKey);
241
             Credential cred = new Credential(credentialSecretId, credentialSecretKey);
240
             // 实例化一个http选项,可选的,没有特殊需求可以跳过
242
             // 实例化一个http选项,可选的,没有特殊需求可以跳过
254
             String s = GetEidResultResponse.toJsonString(resp);
256
             String s = GetEidResultResponse.toJsonString(resp);
255
             if(StrUtil.isNotEmpty(s)) {
257
             if(StrUtil.isNotEmpty(s)) {
256
                 objJSON = JSON.parseObject(s);
258
                 objJSON = JSON.parseObject(s);
259
+                JSONObject text = objJSON.getJSONObject("Text");
260
+                if (text != null) {
261
+                    Integer comparestatus = text.getInteger("Comparestatus");
262
+                    if (comparestatus != null && comparestatus == 0) {
263
+                        JSONObject eidInfo = objJSON.getJSONObject("EidInfo");
264
+                        if (eidInfo != null) {
265
+                            String desKey = eidInfo.getString("DesKey");
266
+                            String userInfo = eidInfo.getString("UserInfo");
267
+                            //1.解密用户的信息
268
+                            JSONObject info = DecodeUserInfo(desKey, userInfo);
269
+                            if (info != null) {
270
+                                String idcardno = info.getString("idnum");
271
+                                String name = info.getString("name");
272
+                                //2.在用户认证表中插入用户认证记录
273
+                                //  LoginUser loginUser = SecurityUtils.getLoginUser();
274
+
275
+                                /**
276
+                                 * 用户名
277
+                                 * 用户名id
278
+                                 * 姓名
279
+                                 * 身份证号
280
+                                 * 认证时间
281
+                                 * 认证状态0表示成功
282
+                                 * 请求id
283
+                                 */
284
+                                // authentication.setUserName(loginUser.getUsername());
285
+                                //  authentication.setUserId(loginUser.getUserId());
286
+
287
+                                authentication.setIdentityNo(idcardno);
288
+                                // 查询认证表是否已存在该身份证信息的认证,不存在则新增,存在不处理
289
+                                IdentityAuthentication identityAuthentication = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
290
+                                if(identityAuthentication!=null) {
291
+                                    return AjaxResult.success(identityAuthentication);
292
+                                }
293
+                                authentication.setName(name);
294
+                                authentication.setCertificationTime(new Date());
295
+                                authentication.setCertificationStatus(0);
296
+                                authentication.setCreateBy(name);
297
+                                //  authentication.setCreateBy(loginUser.getUsername());
298
+                                try {
299
+                                    identityAuthenticationMapper.insertIdentityAuthentication(authentication);
300
+                                    authentication.setId(authentication.getId());
301
+                                } catch (Exception e) {
302
+                                    System.out.println("认证记录新增失败");
303
+                                }
304
+                            }
305
+
306
+                        }
307
+                    }
308
+                }
309
+                return AjaxResult.success(authentication);
257
             }
310
             }
258
         } catch (TencentCloudSDKException e) {
311
         } catch (TencentCloudSDKException e) {
259
-            throw new ServiceException("获取E证通Token状态失败");
312
+            return AjaxResult.error(e.getMessage());
260
         }
313
         }
261
-        return objJSON;
314
+        return AjaxResult.error("认证失败");
262
     }
315
     }
263
 
316
 
264
 
317
 

+ 81
- 38
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Просмотреть файл

316
                                         vo.setAppOperatorFlag(0);
316
                                         vo.setAppOperatorFlag(0);
317
                                     }
317
                                     }
318
                                 }
318
                                 }
319
+                                // 签收按钮权限
320
+                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
321
+                                    vo.setSignFlag(1);
322
+                                }
319
 
323
 
320
                             }
324
                             }
321
                             if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
325
                             if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
322
-                                // 申请人操作人
326
+                                // 申请人操作人
323
                                 if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
327
                                 if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
324
                                     vo.setResOperatorFlag(1);
328
                                     vo.setResOperatorFlag(1);
325
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
329
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
329
                                         vo.setResOperatorFlag(0);
333
                                         vo.setResOperatorFlag(0);
330
                                     }
334
                                     }
331
                                 }
335
                                 }
332
-
336
+                                // 签收按钮权限
337
+                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
338
+                                    vo.setSignFlag(1);
339
+                                }
333
                             }
340
                             }
334
                         }
341
                         }
335
                     if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) {
342
                     if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) {
387
                     ){
394
                     ){
388
                        vo.setOtherFlag(1);
395
                        vo.setOtherFlag(1);
389
                     }
396
                     }
390
-                    if(role.getRoleName().equals("法律顾问")){
397
+                    if(role.getRoleName().equals("法律顾问") && mediatorSort!=null && sendSort!=null
398
+                            && null!=flowNameMap.get(vo.getCaseStatusName())
399
+                            && flowNameMap.get(vo.getCaseStatusName())>mediatorSort
400
+                            && flowNameMap.get(vo.getCaseStatusName())<=sendSort){
391
                         // 顾问可以上传下载调解书
401
                         // 顾问可以上传下载调解书
392
                         vo.setMediationFileFlag(1);
402
                         vo.setMediationFileFlag(1);
393
                     }
403
                     }
1363
 
1373
 
1364
                         }
1374
                         }
1365
                     }
1375
                     }
1366
-
1376
+                    if(StrUtil.isNotEmpty(applicant.getIdCard())){
1377
+                        setBirthByIdentityNum(applicant);
1378
+                    }
1367
                     affiliateVO.setApplicant(applicantList);
1379
                     affiliateVO.setApplicant(applicantList);
1368
 
1380
 
1369
                     // 如果身份证不为空,设置生日和性别
1381
                     // 如果身份证不为空,设置生日和性别
1727
     @Override
1739
     @Override
1728
     @Transactional
1740
     @Transactional
1729
     public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) {
1741
     public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) {
1742
+        if(StrUtil.isEmpty(affiliate.getEmail())){
1743
+            return;
1744
+        }
1730
         boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null);
1745
         boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null);
1731
 
1746
 
1732
         SendMailRecord sendMailRecord = new SendMailRecord();
1747
         SendMailRecord sendMailRecord = new SendMailRecord();
1897
         if (CollectionUtil.isNotEmpty(caseApplicationList)) {
1912
         if (CollectionUtil.isNotEmpty(caseApplicationList)) {
1898
              caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
1913
              caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
1899
         }
1914
         }
1900
-        if(caseAppliId!=null) {
1901
             // 查询该用户是否是操作人,是申请操作人还是被申请操作人
1915
             // 查询该用户是否是操作人,是申请操作人还是被申请操作人
1902
             List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId);
1916
             List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId);
1903
             if(CollectionUtil.isEmpty(affiliates)){
1917
             if(CollectionUtil.isEmpty(affiliates)){
1904
                 return AjaxResult.error("未找到案件相关人员");
1918
                 return AjaxResult.error("未找到案件相关人员");
1905
             }
1919
             }
1920
+        List<Long> affiliateUserIds=new ArrayList<>();
1906
             // 根据案件id和用户id查询已选择的调解员进行回显
1921
             // 根据案件id和用户id查询已选择的调解员进行回显
1907
             Example example = new Example(MsCaseMediator.class);
1922
             Example example = new Example(MsCaseMediator.class);
1908
             Example.Criteria criteria = example.createCriteria();
1923
             Example.Criteria criteria = example.createCriteria();
1909
             LoginUser loginUser = SecurityUtils.getLoginUser();
1924
             LoginUser loginUser = SecurityUtils.getLoginUser();
1910
             for (MsCaseAffiliate affiliate : affiliates) {
1925
             for (MsCaseAffiliate affiliate : affiliates) {
1911
-                if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){
1926
+                if(affiliate.getUserId()==null ){
1927
+                    continue;
1928
+                }
1929
+                affiliateUserIds.add(affiliate.getUserId());
1930
+                if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
1912
                     if( affiliate.getRoleType()==null){
1931
                     if( affiliate.getRoleType()==null){
1913
                         continue;
1932
                         continue;
1914
                     }
1933
                     }
1917
                         criteria.andEqualTo("type", YesOrNoEnum.NO.getCode());
1936
                         criteria.andEqualTo("type", YesOrNoEnum.NO.getCode());
1918
                     }
1937
                     }
1919
                     if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){
1938
                     if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){
1920
-                        // 申请人
1939
+                        // 申请人
1921
                         criteria.andEqualTo("type", YesOrNoEnum.YES.getCode());
1940
                         criteria.andEqualTo("type", YesOrNoEnum.YES.getCode());
1922
                     }
1941
                     }
1923
                 }
1942
                 }
1926
             // 已选择的调解员
1945
             // 已选择的调解员
1927
             List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example);
1946
             List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example);
1928
             selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
1947
             selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
1929
-        }
1948
+
1930
 
1949
 
1931
         for (SysUser user : users) {
1950
         for (SysUser user : users) {
1951
+            if(affiliateUserIds.contains(user.getUserId())){
1952
+                continue;
1953
+            }
1932
             MediatorVO mediatorVO = new MediatorVO();
1954
             MediatorVO mediatorVO = new MediatorVO();
1933
             mediatorVO.setMediatorId(user.getUserId());
1955
             mediatorVO.setMediatorId(user.getUserId());
1934
             mediatorVO.setMediatorName(user.getNickName());
1956
             mediatorVO.setMediatorName(user.getNickName());
2079
                         if (caseMap.containsKey(userId)) {
2101
                         if (caseMap.containsKey(userId)) {
2080
                             List<MsCaseApplication> applications = caseMap.get(userId);
2102
                             List<MsCaseApplication> applications = caseMap.get(userId);
2081
                             // 已办案件
2103
                             // 已办案件
2082
-                            long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
2104
+                            long count = applications.stream().filter(caseApplication -> caseApplication.getCaseStatusName().equals("结束")).count();
2083
                             if(count>=maxCount){
2105
                             if(count>=maxCount){
2084
                                 maxCount=count;
2106
                                 maxCount=count;
2085
                                 application.setMediatorId(userId);
2107
                                 application.setMediatorId(userId);
2135
      */
2157
      */
2136
     @Transactional
2158
     @Transactional
2137
     public void verifyMediator(MsCaseApplication application,BookingVO vo) {
2159
     public void verifyMediator(MsCaseApplication application,BookingVO vo) {
2160
+        Long userId = SecurityUtils.getUserId();
2161
+        final List<MsCaseAffiliate>[] affiliates = new List[]{new ArrayList<>()};
2162
+        ExecutorService executor = ThreadUtil.createThreadPool();
2163
+        CompletableFuture<MsCaseApplication> cf1 = CompletableFuture.supplyAsync(() -> {
2138
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
2164
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
2139
         if (currentFlow == null) {
2165
         if (currentFlow == null) {
2140
             throw new ServiceException("未找到当前流程节点");
2166
             throw new ServiceException("未找到当前流程节点");
2145
         }
2171
         }
2146
 
2172
 
2147
         if(vo.getMediatorId()!=null) {
2173
         if(vo.getMediatorId()!=null) {
2148
-            //   setMediatorAndDate(application,vo);
2149
             application.setMediatorId(vo.getMediatorId());
2174
             application.setMediatorId(vo.getMediatorId());
2150
             application.setMediatorName(vo.getMediatorName());
2175
             application.setMediatorName(vo.getMediatorName());
2151
         }
2176
         }
2160
         if (caseApplication == null) {
2185
         if (caseApplication == null) {
2161
             throw new ServiceException("未找到案件");
2186
             throw new ServiceException("未找到案件");
2162
         }
2187
         }
2188
+
2189
+         affiliates[0] = selectAffliatesByCaseId(caseApplication.getId());
2190
+        if(CollectionUtil.isEmpty(affiliates[0])){
2191
+            throw new ServiceException("未找到案件相关人员");
2192
+        }
2193
+        // 新增日志
2194
+        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "",userId);
2163
         caseApplication.setHearDate(application.getHearDate());
2195
         caseApplication.setHearDate(application.getHearDate());
2164
-        ExecutorService executor = ThreadUtil.createThreadPool();
2165
-        CompletableFuture.runAsync(() -> {
2166
-                    // 发送开庭短信
2167
-                    if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
2168
-                        List<MsCaseAffiliate> affiliates = selectAffliatesByCaseId(caseApplication.getId());
2196
+        return caseApplication;
2197
+        });
2198
+        if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
2199
+            cf1.thenAcceptAsync((result) -> {
2200
+                // 申请人发送开庭日期短信
2201
+                sendHearDateSms(result, affiliates[0]);
2202
+
2203
+            }, executor);
2204
+            cf1.thenAcceptAsync((result) -> {
2205
+                // 发送开庭短信
2206
+                if (CollectionUtil.isNotEmpty(vo.getHerDates())) {
2207
+
2208
+                    // 调解员发送开庭短信
2209
+                    sendMeditorHearDateSms(result, vo);
2169
 
2210
 
2170
-                        // 申请人发送开庭日期短信
2171
-                        sendHearDateSms(caseApplication, affiliates);
2172
-                        // 调解员发送开庭短信
2173
-                        sendMeditorHearDateSms(caseApplication,vo);
2211
+                }
2212
+            }, executor);
2213
+        }
2174
 
2214
 
2175
-                                           }
2176
-                }, executor);
2177
 
2215
 
2178
-        // 新增日志
2179
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
2180
 
2216
 
2181
     }
2217
     }
2182
 
2218
 
2241
             List<String> resPhones=new ArrayList<>();
2277
             List<String> resPhones=new ArrayList<>();
2242
             List<String> appEmails=new ArrayList<>();
2278
             List<String> appEmails=new ArrayList<>();
2243
             List<String> resEmails=new ArrayList<>();
2279
             List<String> resEmails=new ArrayList<>();
2280
+            ExecutorService executor = ThreadUtil.createThreadPool();
2244
 
2281
 
2245
             for (MsCaseAffiliate affiliate : affiliates) {
2282
             for (MsCaseAffiliate affiliate : affiliates) {
2246
-
2283
+                CompletableFuture.runAsync(() -> {
2247
                     // 申请人
2284
                     // 申请人
2248
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
2285
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
2249
                         // 获取短信链接uuid
2286
                         // 获取短信链接uuid
2256
                             SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2293
                             SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2257
                                     new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2294
                                     new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2258
 
2295
 
2259
-                        } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2296
+                        } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2260
                             appEmails.add(affiliate.getEmail());
2297
                             appEmails.add(affiliate.getEmail());
2261
                             // 发送邮件
2298
                             // 发送邮件
2262
                             caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2299
                             caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2263
 
2300
 
2264
                         }
2301
                         }
2265
-                        continue;
2266
                     }
2302
                     }
2267
                     // 被申请人
2303
                     // 被申请人
2268
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
2304
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
2276
                                 SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2312
                                 SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2277
                                         new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2313
                                         new String[]{application.getCaseNum(),application.getHearDate(),"authId="+roomUuid});
2278
 
2314
 
2279
-                            } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2315
+                            } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2280
                                 resEmails.add(affiliate.getEmail());
2316
                                 resEmails.add(affiliate.getEmail());
2281
                                 // 发送邮件
2317
                                 // 发送邮件
2282
                                 caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2318
                                 caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2283
 
2319
 
2284
                             }
2320
                             }
2285
 
2321
 
2286
-                    }
2322
+                    }}, executor);
2287
             }
2323
             }
2288
         }else {
2324
         }else {
2289
             // 申请人/被申通知,  线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2325
             // 申请人/被申通知,  线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
2322
                         SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(),
2358
                         SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(),
2323
                                 applicantNotice.getTemplateParamSet());
2359
                                 applicantNotice.getTemplateParamSet());
2324
 
2360
 
2325
-                    } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2361
+                    } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!appEmails.contains(affiliate.getEmail())) {
2326
                         appEmails.add(affiliate.getEmail());
2362
                         appEmails.add(affiliate.getEmail());
2327
                         // 发送邮件
2363
                         // 发送邮件
2328
                         caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent());
2364
                         caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent());
2340
                         SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(),
2376
                         SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(),
2341
                                 resNotice.getTemplateParamSet());
2377
                                 resNotice.getTemplateParamSet());
2342
 
2378
 
2343
-                    } else if(StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2379
+                    } else if(StrUtil.isEmpty(affiliate.getPhone()) && StrUtil.isNotEmpty(affiliate.getEmail())&&!resEmails.contains(affiliate.getEmail())){
2344
                         resEmails.add(affiliate.getEmail());
2380
                         resEmails.add(affiliate.getEmail());
2345
                         // 发送邮件
2381
                         // 发送邮件
2346
                         caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent());
2382
                         caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent());
2485
             return AjaxResult.error("未找到案件");
2521
             return AjaxResult.error("未找到案件");
2486
         }
2522
         }
2487
         req.setSealFlag(application.getSealFlag());
2523
         req.setSealFlag(application.getSealFlag());
2524
+
2488
         if (StrUtil.isEmpty(application.getMediationMethod())) {
2525
         if (StrUtil.isEmpty(application.getMediationMethod())) {
2489
             return AjaxResult.error("未选择调解方式");
2526
             return AjaxResult.error("未选择调解方式");
2490
         }
2527
         }
2528
+
2491
         // 查询当前流程节点
2529
         // 查询当前流程节点
2492
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
2530
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
2493
         if (currentFlow == null) {
2531
         if (currentFlow == null) {
2505
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2543
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2506
             throw new ServiceException("未找到案件操作人员");
2544
             throw new ServiceException("未找到案件操作人员");
2507
         }
2545
         }
2508
-        // 调解结果
2509
-        Integer mediaResult = req.getMediaResult();
2510
-        if (mediaResult == null) {
2511
-            return AjaxResult.error("请选择调解结果");
2512
-        }
2546
+
2513
         if (application.getMediationMethod().equals("1")) {
2547
         if (application.getMediationMethod().equals("1")) {
2548
+            Integer mediaResult = application.getMediaResult();
2549
+            if (mediaResult == null) {
2550
+                return AjaxResult.error("请选择调解结果");
2551
+            }
2514
             // 线上调解
2552
             // 线上调解
2515
             List<MsCaseAttach> attachList = req.getAttachList();
2553
             List<MsCaseAttach> attachList = req.getAttachList();
2516
             if (CollectionUtil.isNotEmpty(attachList)) {
2554
             if (CollectionUtil.isNotEmpty(attachList)) {
3037
                 }
3075
                 }
3038
             }
3076
             }
3039
         } else {
3077
         } else {
3078
+            Integer mediaResult=req.getMediaResult();
3079
+            if(mediaResult==null){
3080
+                return AjaxResult.error("请选择调解结果");
3081
+            }
3040
             // 线下调解
3082
             // 线下调解
3041
             List<MsCaseAttach> attachList = req.getAttachList();
3083
             List<MsCaseAttach> attachList = req.getAttachList();
3042
             if (CollectionUtil.isEmpty(attachList)) {
3084
             if (CollectionUtil.isEmpty(attachList)) {
3168
         AjaxResult result = caseApplicationService.generateApplication(req);
3210
         AjaxResult result = caseApplicationService.generateApplication(req);
3169
         // 修改案件结果
3211
         // 修改案件结果
3170
         application.setMediaResult(req.getMediaResult());
3212
         application.setMediaResult(req.getMediaResult());
3213
+        application.setSealFlag(req.getSealFlag());
3171
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
3214
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
3172
         return AjaxResult.success();
3215
         return AjaxResult.success();
3173
     }
3216
     }
3501
                         caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3544
                         caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3502
                     }
3545
                     }
3503
                 }
3546
                 }
3504
-                caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
3505
-                msCaseAttachMapper.save(caseAttach);
3506
-                }
3507
 
3547
 
3548
+                }
3549
+            caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
3550
+            msCaseAttachMapper.save(caseAttach);
3508
 
3551
 
3509
         }
3552
         }
3510
 
3553
 

+ 27
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java Просмотреть файл

28
      * @param caseNode 案件节点,不能为空
28
      * @param caseNode 案件节点,不能为空
29
      * @param notes 备注
29
      * @param notes 备注
30
      */
30
      */
31
-    public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes  ){
31
+    public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes ){
32
         MsCaseLogRecord operLog = new MsCaseLogRecord();
32
         MsCaseLogRecord operLog = new MsCaseLogRecord();
33
-        // 获取当前的用户
34
-        LoginUser loginUser = SecurityUtils.getLoginUser();
33
+        LoginUser loginUser=null;
34
+        try {
35
+            loginUser = SecurityUtils.getLoginUser();
36
+        } catch (Exception e) {
37
+            loginUser=null;
38
+        }
35
         if(loginUser!=null) {
39
         if(loginUser!=null) {
36
             SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
40
             SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
37
             operLog.setCreateBy(sysUser.getUserName());
41
             operLog.setCreateBy(sysUser.getUserName());
49
         operLog.setCreateTime(new Date());
53
         operLog.setCreateTime(new Date());
50
         caseLogRecordMapper.insert(operLog);
54
         caseLogRecordMapper.insert(operLog);
51
     }
55
     }
56
+    /**
57
+     * 新增案件日志
58
+     * @param caseAppliId 案件id,不能为空
59
+     * @param caseNode 案件节点,不能为空
60
+     * @param notes 备注
61
+     */
62
+    public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode,String caseStatusName, String notes,Long userId  ){
63
+        if(userId==null)
64
+            return;
65
+        MsCaseLogRecord operLog = new MsCaseLogRecord();
66
+        SysUser sysUser = userMapper.selectUserById(userId);
67
+        operLog.setCreateBy(sysUser.getUserName());
68
+        operLog.setCreateNickName(sysUser.getNickName());
69
+        operLog.setCaseStatusName(caseStatusName);
70
+        operLog.setCaseAppliId(caseAppliId);
71
+        operLog.setCaseNode(caseNode);
72
+        operLog.setNotes(notes);
73
+        operLog.setCreateTime(new Date());
74
+        caseLogRecordMapper.insert(operLog);
75
+    }
52
 }
76
 }