Pārlūkot izejas kodu

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 gadus atpakaļ
vecāks
revīzija
63de4daf2a

+ 23
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Parādīt failu

@@ -2,8 +2,10 @@ package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5
+import com.alipay.api.internal.util.file.IOUtils;
5 6
 import com.ruoyi.common.annotation.Anonymous;
6 7
 import com.ruoyi.common.annotation.Log;
8
+import com.ruoyi.common.constant.FileTransformation;
7 9
 import com.ruoyi.common.core.controller.BaseController;
8 10
 import com.ruoyi.common.core.domain.AjaxResult;
9 11
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -11,6 +13,7 @@ import com.ruoyi.common.enums.BusinessType;
11 13
 import com.ruoyi.common.exception.EsignDemoException;
12 14
 import com.ruoyi.common.exception.ServiceException;
13 15
 import com.ruoyi.common.utils.WxAppletNotifyUtils;
16
+import com.ruoyi.util.FileUtil;
14 17
 import com.ruoyi.wisdomarbitrate.domain.*;
15 18
 import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
16 19
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
@@ -25,6 +28,10 @@ import org.springframework.web.multipart.MultipartFile;
25 28
 
26 29
 import javax.servlet.http.HttpServletRequest;
27 30
 import javax.servlet.http.HttpServletResponse;
31
+import java.io.IOException;
32
+import java.io.InputStream;
33
+import java.net.URL;
34
+import java.net.URLEncoder;
28 35
 import java.util.List;
29 36
 
30 37
 
@@ -184,8 +191,22 @@ public class CaseApplicationController extends BaseController {
184 191
      */
185 192
     @PostMapping("/importTemplate")
186 193
     public void importTemplate(HttpServletResponse response) {
187
-        ExcelUtil<CaseApplication> util = new ExcelUtil<CaseApplication>(CaseApplication.class);
188
-        util.importTemplateExcel(response, "立案申请数据");
194
+        // 读取文件
195
+        try {
196
+            InputStream fileInputStream = new URL("http://121.40.189.20:8000/API/uploadPath/template/案件导入模板.xlsx").openStream();
197
+            response.setHeader("content-type", "application/octet-stream");
198
+            response.setContentType("application/octet-stream");
199
+            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("案件导入模板.xlsx","UTF-8"));
200
+                        byte[] buffer = new byte[1024];
201
+            int length;
202
+            while ((length = fileInputStream.read(buffer)) > 0) {
203
+                response.getOutputStream().write(buffer, 0, length);
204
+            }
205
+
206
+        } catch (IOException e) {
207
+            throw new RuntimeException(e);
208
+        }
209
+
189 210
     }
190 211
 
191 212
     @Log(title = "立案信息导入", businessType = BusinessType.IMPORT)

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Parādīt failu

@@ -248,7 +248,7 @@ public class SysUserServiceImpl implements ISysUserService {
248 248
         if (deptId != null) {
249 249
             SysDept dept = sysDeptMapper.selectDeptById(deptId);
250 250
             Integer deptType = dept.getDeptType();
251
-            if (deptType.intValue() == 1) {
251
+            if (deptType!=null && deptType.intValue() == 1) {
252 252
                 SysPost sysPost = postMapper.selectPostByPostCode("jbr");
253 253
                 Long postId = sysPost.getPostId();
254 254
                 if (postIds.length > 0) {

+ 35
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Parādīt failu

@@ -524,6 +524,22 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
524 524
         if (caseApplication1 == null) {
525 525
             return AjaxResult.error("未查询到相关案件");
526 526
         }
527
+        List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
528
+        if (caseAttachList != null && caseAttachList.size() > 0) {
529
+            for (CaseAttach caseAttach : caseAttachList) {
530
+                if (caseAttach.getAnnexType() == 3) {
531
+                    String annexName = caseAttach.getAnnexName();
532
+                    String prefix = "/profile/upload/";
533
+                    int startIndex = prefix.length();
534
+                    String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
535
+                   File file = new File(path);
536
+                   if(!file.exists()){
537
+                       return AjaxResult.error("未生成裁决书");
538
+                   }
539
+
540
+                }
541
+            }
542
+        }
527 543
         //修改案件状态
528 544
         caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
529 545
         caseApplicationMapper.submitCaseApplication(caseApplication1);
@@ -545,7 +561,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
545 561
             }
546 562
         }
547 563
         //发送邮件
548
-        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail);
564
+        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList);
549 565
         SendMailRecord sendMailRecord = new SendMailRecord();
550 566
         sendMailRecord.setCaseId(id);
551 567
         sendMailRecord.setMailAddress(appEmail);
@@ -575,11 +591,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
575 591
                 for (CaseAffiliate affiliate : caseAffiliates) {
576 592
 
577 593
                     request.setPhone(affiliate.getContactTelphone());
578
-                    if(affiliate.getIdentityType() == 1) {
579
-                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
580
-                    }else {
581
-                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
582
-                    }
594
+//                    if(affiliate.getIdentityType() == 1) {
595
+//                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
596
+//                    }else {
597
+//                        request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
598
+//                    }
599
+                    request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum()});
583 600
                     Boolean aBoolean = SmsUtils.sendSms(request);
584 601
 
585 602
                        // 保存短信发送记录
@@ -589,14 +606,16 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
589 606
                         smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
590 607
                         smsSendRecord.setPhone(request.getPhone());
591 608
                         smsSendRecord.setSendTime(new Date());
592
-                        // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达至{3}邮箱,请知晓,如非本人操作,请忽略本短信。
593
-                        if(affiliate.getIdentityType() == 1) {
594
-                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
595
-                        }else {
596
-                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
597
-                        }
609
+//                        // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。
610
+//                        if(affiliate.getIdentityType() == 1) {
611
+//                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
612
+//                        }else {
613
+//                            smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
614
+//                        }
615
+                    smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。");
598 616
 
599
-                        smsSendRecord.setCreateBy(getUsername());
617
+
618
+                    smsSendRecord.setCreateBy(getUsername());
600 619
                         if (aBoolean) {
601 620
                             smsSendRecord.setSendStatus(1);
602 621
                         } else {
@@ -627,11 +646,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
627 646
      * @param appEmail
628 647
      * @param resEmail
629 648
      */
630
-    private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) {
649
+    private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail,  List<CaseAttach> caseAttachList) {
631 650
         List<File> fileList = new ArrayList<>();
632 651
         File file = null;
633
-
634
-        List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
635 652
         if (caseAttachList != null && caseAttachList.size() > 0) {
636 653
             for (CaseAttach caseAttach : caseAttachList) {
637 654
                 if (caseAttach.getAnnexType() == 3) {
@@ -645,7 +662,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
645 662
                 }
646 663
             }
647 664
         }
648
-        if (file != null) {
665
+
666
+        if (file != null && file.exists()) {
649 667
             try {
650 668
                 Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
651 669
                 Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);

+ 19
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Parādīt failu

@@ -183,8 +183,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
183 183
                 }
184 184
                 if (role.getRoleName().equals("代理人")) {
185 185
                     // 查询角色有关的用户部门
186
-                         List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
187
-                         caseApplication.setAgentDeptIds(agentDeptIds);
186
+                        // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
187
+                    List<Long> agentDeptIds = new ArrayList<>();
188
+                    agentDeptIds.add(sysUser.getDeptId());
189
+                    caseApplication.setAgentDeptIds(agentDeptIds);
188 190
                 }
189 191
             }
190 192
 
@@ -246,6 +248,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
246 248
                 //
247 249
                 caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
248 250
             }
251
+            if (role.getRoleName().equals("代理人")) {
252
+                // 查询角色有关的用户部门
253
+                // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
254
+                List<Long> agentDeptIds = new ArrayList<>();
255
+                agentDeptIds.add(sysUser.getDeptId());
256
+                caseApplication.setAgentDeptIds(agentDeptIds);
257
+            }
249 258
         }
250 259
 
251 260
 
@@ -1389,7 +1398,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1389 1398
         }
1390 1399
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
1391 1400
             failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
1392
-        } else if (validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
1401
+        } else if (!validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
1393 1402
             failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
1394 1403
         }
1395 1404
         String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
@@ -1419,7 +1428,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1419 1428
         }
1420 1429
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
1421 1430
             failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
1422
-        } else if (validateIdCard(caseApplication.getDebtorIdentityNum())) {
1431
+        } else if (!validateIdCard(caseApplication.getDebtorIdentityNum())) {
1423 1432
             failureMsg.append("【被申请人主体信息-身份证号】不合法;");
1424 1433
         }
1425 1434
         String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
@@ -1456,7 +1465,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1456 1465
         }
1457 1466
         if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) {
1458 1467
             failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;");
1459
-        } else if (!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()) {
1468
+        } else if(!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()){
1460 1469
 
1461 1470
             failureMsg.append("【被申请人主体信息-邮箱】字段不合法;");
1462 1471
         }
@@ -1562,7 +1571,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1562 1571
         }
1563 1572
         if (StrUtil.isEmpty(caseApplication.getEmail())) {
1564 1573
             failureMsg.append("【申请人主体信息-邮箱】字段不能为空;");
1565
-        } else if (!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()) {
1574
+        } else if(!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()){
1566 1575
 
1567 1576
             failureMsg.append("【申请人主体信息-邮箱】字段不合法;");
1568 1577
         }
@@ -2669,7 +2678,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2669 2678
 
2670 2679
                     // 新增预约会议表
2671 2680
                     ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
2672
-                            reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(), 1);
2681
+                            reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
2673 2682
                     reservedConferenceMapper.insert(conference);
2674 2683
                     return AjaxResult.success("预约会议成功");
2675 2684
 
@@ -2697,7 +2706,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2697 2706
         String roomId = generateRoomId();
2698 2707
         // 新增预约会议表
2699 2708
         ReservedConference conference = new ReservedConference(caseId, roomId,
2700
-                null, null, 0);
2709
+                null, null,0);
2701 2710
         reservedConferenceMapper.insert(conference);
2702 2711
         return roomId;
2703 2712
     }
@@ -2711,7 +2720,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2711 2720
         // 查询最大房间号
2712 2721
         Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
2713 2722
 
2714
-        if (null == maxRoomId || maxRoomId > 999999) {
2723
+        if (null == maxRoomId || maxRoomId >999999) {
2715 2724
             return "000001";
2716 2725
         } else {
2717 2726
             return String.format("%06d", maxRoomId);
@@ -2759,7 +2768,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2759 2768
     @Override
2760 2769
     public AjaxResult deleteRoom(String roomId) {
2761 2770
 
2762
-        return AjaxResult.success(reservedConferenceMapper.deleteByRoomId(roomId));
2771
+        return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
2763 2772
     }
2764 2773
 }
2765 2774
 

+ 10
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Parādīt failu

@@ -283,6 +283,16 @@
283 283
              or   ( t.identity_type=1 and t.case_status =#{financeStatus})
284 284
 
285 285
             </if>
286
+            <!--代理人-->
287
+            <if test="agentDeptIds != null and agentDeptIds.size()>0">
288
+                or (
289
+                t.application_organ_id in
290
+                <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
291
+                </foreach>
292
+                AND t.identity_type=1
293
+                and t.case_status in (0,9))
294
+
295
+            </if>
286 296
         </where>
287 297
         ) t1
288 298
     </select>