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

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

@@ -41,8 +41,7 @@ public class IdentityAuthenticationController extends BaseController {
41 41
     @Anonymous
42 42
     @GetMapping("/selectPCEIDtokenStatus")
43 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,7 +250,7 @@ public class MsCaseApplicationController extends BaseController {
250 250
      * @return
251 251
      */
252 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 254
         return caseApplicationService.listMediator(caseAppliId);
255 255
     }
256 256
     /**
@@ -310,7 +310,7 @@ public class MsCaseApplicationController extends BaseController {
310 310
      */
311 311
     @PostMapping("/mediation")
312 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 314
             return error("参数校验失败");
315 315
         }
316 316
 

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

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

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

@@ -84,11 +84,11 @@ public class MsCaseApplicationVO extends MsCaseApplication {
84 84
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
85 85
     private Date endTime;
86 86
     /**
87
-     * 是否申请操作人,0-否,1-是
87
+     * 是否申请操作人签名按钮权限,0-否,1-是
88 88
      */
89 89
     private Integer appOperatorFlag;
90 90
     /**
91
-     * 是否被申请操作人,0-否,1-是
91
+     * 是否被申请操作人签名按钮权限,0-否,1-是
92 92
      */
93 93
     private Integer resOperatorFlag;
94 94
     /**
@@ -99,5 +99,9 @@ public class MsCaseApplicationVO extends MsCaseApplication {
99 99
      * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
100 100
      */
101 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,5 +36,5 @@ public interface IdentityAuthenticationService {
36 36
      * H5轮询获取EIDtoken状态
37 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,10 +231,12 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
231 231
     }
232 232
 
233 233
     @Override
234
-    public JSONObject selectPCEIDtokenStatus(String eidToken) {
234
+    public AjaxResult selectPCEIDtokenStatus(String eidToken) {
235 235
         // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
236 236
         // todo E证通审核过后将PC端的机器id在YML文件中改掉
237 237
         JSONObject objJSON = null;
238
+        IdentityAuthentication authentication = new IdentityAuthentication();
239
+
238 240
         try {
239 241
             Credential cred = new Credential(credentialSecretId, credentialSecretKey);
240 242
             // 实例化一个http选项,可选的,没有特殊需求可以跳过
@@ -254,11 +256,62 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
254 256
             String s = GetEidResultResponse.toJsonString(resp);
255 257
             if(StrUtil.isNotEmpty(s)) {
256 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 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,10 +316,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
316 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 325
                             if (vo.getResOperatorFlag() == null && (affiliate.getRoleType() == 3 || affiliate.getRoleType() == 4)) {
322
-                                // 申请人操作人
326
+                                // 申请人操作人
323 327
                                 if(Objects.equals(affiliate.getUserId(), loginUserId) &&!vo.getCaseStatusName().equals("待签名")){
324 328
                                     vo.setResOperatorFlag(1);
325 329
                                 }else if(vo.getCaseStatusName().equals("待签名")) {
@@ -329,7 +333,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
329 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 342
                     if(affiliate.getOrganizeFlag()==null || affiliate.getOrganizeFlag()!=1) {
@@ -387,7 +394,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
387 394
                     ){
388 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 402
                         vo.setMediationFileFlag(1);
393 403
                     }
@@ -1363,7 +1373,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1363 1373
 
1364 1374
                         }
1365 1375
                     }
1366
-
1376
+                    if(StrUtil.isNotEmpty(applicant.getIdCard())){
1377
+                        setBirthByIdentityNum(applicant);
1378
+                    }
1367 1379
                     affiliateVO.setApplicant(applicantList);
1368 1380
 
1369 1381
                     // 如果身份证不为空,设置生日和性别
@@ -1727,6 +1739,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1727 1739
     @Override
1728 1740
     @Transactional
1729 1741
     public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent) {
1742
+        if(StrUtil.isEmpty(affiliate.getEmail())){
1743
+            return;
1744
+        }
1730 1745
         boolean emailFlag = emailOutUtil.sendMessage(affiliate.getEmail(), subject, sendContent, null, null);
1731 1746
 
1732 1747
         SendMailRecord sendMailRecord = new SendMailRecord();
@@ -1897,18 +1912,22 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1897 1912
         if (CollectionUtil.isNotEmpty(caseApplicationList)) {
1898 1913
              caseMap = caseApplicationList.stream().collect(Collectors.groupingBy(MsCaseApplication::getMediatorId, Collectors.toList()));
1899 1914
         }
1900
-        if(caseAppliId!=null) {
1901 1915
             // 查询该用户是否是操作人,是申请操作人还是被申请操作人
1902 1916
             List<MsCaseAffiliate> affiliates = msCaseAffiliateMapper.selectByCaseId(caseAppliId);
1903 1917
             if(CollectionUtil.isEmpty(affiliates)){
1904 1918
                 return AjaxResult.error("未找到案件相关人员");
1905 1919
             }
1920
+        List<Long> affiliateUserIds=new ArrayList<>();
1906 1921
             // 根据案件id和用户id查询已选择的调解员进行回显
1907 1922
             Example example = new Example(MsCaseMediator.class);
1908 1923
             Example.Criteria criteria = example.createCriteria();
1909 1924
             LoginUser loginUser = SecurityUtils.getLoginUser();
1910 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 1931
                     if( affiliate.getRoleType()==null){
1913 1932
                         continue;
1914 1933
                     }
@@ -1917,7 +1936,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1917 1936
                         criteria.andEqualTo("type", YesOrNoEnum.NO.getCode());
1918 1937
                     }
1919 1938
                     if(affiliate.getRoleType()==3|| affiliate.getRoleType()==4){
1920
-                        // 申请人
1939
+                        // 申请人
1921 1940
                         criteria.andEqualTo("type", YesOrNoEnum.YES.getCode());
1922 1941
                     }
1923 1942
                 }
@@ -1926,9 +1945,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1926 1945
             // 已选择的调解员
1927 1946
             List<MsCaseMediator> selectedMediators = msCaseMediatorMapper.selectByExample(example);
1928 1947
             selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
1929
-        }
1948
+
1930 1949
 
1931 1950
         for (SysUser user : users) {
1951
+            if(affiliateUserIds.contains(user.getUserId())){
1952
+                continue;
1953
+            }
1932 1954
             MediatorVO mediatorVO = new MediatorVO();
1933 1955
             mediatorVO.setMediatorId(user.getUserId());
1934 1956
             mediatorVO.setMediatorName(user.getNickName());
@@ -2079,7 +2101,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2079 2101
                         if (caseMap.containsKey(userId)) {
2080 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 2105
                             if(count>=maxCount){
2084 2106
                                 maxCount=count;
2085 2107
                                 application.setMediatorId(userId);
@@ -2135,6 +2157,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2135 2157
      */
2136 2158
     @Transactional
2137 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 2164
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
2139 2165
         if (currentFlow == null) {
2140 2166
             throw new ServiceException("未找到当前流程节点");
@@ -2145,7 +2171,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2145 2171
         }
2146 2172
 
2147 2173
         if(vo.getMediatorId()!=null) {
2148
-            //   setMediatorAndDate(application,vo);
2149 2174
             application.setMediatorId(vo.getMediatorId());
2150 2175
             application.setMediatorName(vo.getMediatorName());
2151 2176
         }
@@ -2160,23 +2185,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2160 2185
         if (caseApplication == null) {
2161 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 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,9 +2277,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2241 2277
             List<String> resPhones=new ArrayList<>();
2242 2278
             List<String> appEmails=new ArrayList<>();
2243 2279
             List<String> resEmails=new ArrayList<>();
2280
+            ExecutorService executor = ThreadUtil.createThreadPool();
2244 2281
 
2245 2282
             for (MsCaseAffiliate affiliate : affiliates) {
2246
-
2283
+                CompletableFuture.runAsync(() -> {
2247 2284
                     // 申请人
2248 2285
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
2249 2286
                         // 获取短信链接uuid
@@ -2256,13 +2293,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2256 2293
                             SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2257 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 2297
                             appEmails.add(affiliate.getEmail());
2261 2298
                             // 发送邮件
2262 2299
                             caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2263 2300
 
2264 2301
                         }
2265
-                        continue;
2266 2302
                     }
2267 2303
                     // 被申请人
2268 2304
                     if (affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))) {
@@ -2276,14 +2312,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2276 2312
                                 SmsUtils.sendSms(application,"2130103", affiliate.getPhone(),
2277 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 2316
                                 resEmails.add(affiliate.getEmail());
2281 2317
                                 // 发送邮件
2282 2318
                                 caseApplicationService.sendEmail(application, affiliate, "开庭日期通知", content);
2283 2319
 
2284 2320
                             }
2285 2321
 
2286
-                    }
2322
+                    }}, executor);
2287 2323
             }
2288 2324
         }else {
2289 2325
             // 申请人/被申通知,  线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
@@ -2322,7 +2358,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2322 2358
                         SmsUtils.sendSms(application, applicantNotice.getTemplateId(), affiliate.getPhone(),
2323 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 2362
                         appEmails.add(affiliate.getEmail());
2327 2363
                         // 发送邮件
2328 2364
                         caseApplicationService.sendEmail(application, affiliate, applicantNotice.getSubject(), applicantNotice.getContent());
@@ -2340,7 +2376,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2340 2376
                         SmsUtils.sendSms(application, resNotice.getTemplateId(), affiliate.getPhone(),
2341 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 2380
                         resEmails.add(affiliate.getEmail());
2345 2381
                         // 发送邮件
2346 2382
                         caseApplicationService.sendEmail(application, affiliate, resNotice.getSubject(), resNotice.getContent());
@@ -2485,9 +2521,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2485 2521
             return AjaxResult.error("未找到案件");
2486 2522
         }
2487 2523
         req.setSealFlag(application.getSealFlag());
2524
+
2488 2525
         if (StrUtil.isEmpty(application.getMediationMethod())) {
2489 2526
             return AjaxResult.error("未选择调解方式");
2490 2527
         }
2528
+
2491 2529
         // 查询当前流程节点
2492 2530
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(req.getCaseFlowId());
2493 2531
         if (currentFlow == null) {
@@ -2505,12 +2543,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2505 2543
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2506 2544
             throw new ServiceException("未找到案件操作人员");
2507 2545
         }
2508
-        // 调解结果
2509
-        Integer mediaResult = req.getMediaResult();
2510
-        if (mediaResult == null) {
2511
-            return AjaxResult.error("请选择调解结果");
2512
-        }
2546
+
2513 2547
         if (application.getMediationMethod().equals("1")) {
2548
+            Integer mediaResult = application.getMediaResult();
2549
+            if (mediaResult == null) {
2550
+                return AjaxResult.error("请选择调解结果");
2551
+            }
2514 2552
             // 线上调解
2515 2553
             List<MsCaseAttach> attachList = req.getAttachList();
2516 2554
             if (CollectionUtil.isNotEmpty(attachList)) {
@@ -3037,6 +3075,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3037 3075
                 }
3038 3076
             }
3039 3077
         } else {
3078
+            Integer mediaResult=req.getMediaResult();
3079
+            if(mediaResult==null){
3080
+                return AjaxResult.error("请选择调解结果");
3081
+            }
3040 3082
             // 线下调解
3041 3083
             List<MsCaseAttach> attachList = req.getAttachList();
3042 3084
             if (CollectionUtil.isEmpty(attachList)) {
@@ -3168,6 +3210,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3168 3210
         AjaxResult result = caseApplicationService.generateApplication(req);
3169 3211
         // 修改案件结果
3170 3212
         application.setMediaResult(req.getMediaResult());
3213
+        application.setSealFlag(req.getSealFlag());
3171 3214
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
3172 3215
         return AjaxResult.success();
3173 3216
     }
@@ -3501,10 +3544,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3501 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,10 +28,14 @@ public class CaseLogUtils
28 28
      * @param caseNode 案件节点,不能为空
29 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 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 39
         if(loginUser!=null) {
36 40
             SysUser sysUser = userMapper.selectUserById(loginUser.getUserId());
37 41
             operLog.setCreateBy(sysUser.getUserName());
@@ -49,4 +53,24 @@ public class CaseLogUtils
49 53
         operLog.setCreateTime(new Date());
50 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
 }