Selaa lähdekoodia

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into hjb

hejinbo 2 vuotta sitten
vanhempi
commit
736b189473

+ 23
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Näytä tiedosto

2
 
2
 
3
 import cn.hutool.core.collection.CollectionUtil;
3
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.util.StrUtil;
4
 import cn.hutool.core.util.StrUtil;
5
+import com.alipay.api.internal.util.file.IOUtils;
5
 import com.ruoyi.common.annotation.Anonymous;
6
 import com.ruoyi.common.annotation.Anonymous;
6
 import com.ruoyi.common.annotation.Log;
7
 import com.ruoyi.common.annotation.Log;
8
+import com.ruoyi.common.constant.FileTransformation;
7
 import com.ruoyi.common.core.controller.BaseController;
9
 import com.ruoyi.common.core.controller.BaseController;
8
 import com.ruoyi.common.core.domain.AjaxResult;
10
 import com.ruoyi.common.core.domain.AjaxResult;
9
 import com.ruoyi.common.core.page.TableDataInfo;
11
 import com.ruoyi.common.core.page.TableDataInfo;
11
 import com.ruoyi.common.exception.EsignDemoException;
13
 import com.ruoyi.common.exception.EsignDemoException;
12
 import com.ruoyi.common.exception.ServiceException;
14
 import com.ruoyi.common.exception.ServiceException;
13
 import com.ruoyi.common.utils.WxAppletNotifyUtils;
15
 import com.ruoyi.common.utils.WxAppletNotifyUtils;
16
+import com.ruoyi.util.FileUtil;
14
 import com.ruoyi.wisdomarbitrate.domain.*;
17
 import com.ruoyi.wisdomarbitrate.domain.*;
15
 import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
18
 import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO;
16
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
19
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
25
 
28
 
26
 import javax.servlet.http.HttpServletRequest;
29
 import javax.servlet.http.HttpServletRequest;
27
 import javax.servlet.http.HttpServletResponse;
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
 import java.util.List;
35
 import java.util.List;
29
 
36
 
30
 
37
 
184
      */
191
      */
185
     @PostMapping("/importTemplate")
192
     @PostMapping("/importTemplate")
186
     public void importTemplate(HttpServletResponse response) {
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
     @Log(title = "立案信息导入", businessType = BusinessType.IMPORT)
212
     @Log(title = "立案信息导入", businessType = BusinessType.IMPORT)

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Näytä tiedosto

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

+ 35
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Näytä tiedosto

524
         if (caseApplication1 == null) {
524
         if (caseApplication1 == null) {
525
             return AjaxResult.error("未查询到相关案件");
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
         caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
544
         caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
529
         caseApplicationMapper.submitCaseApplication(caseApplication1);
545
         caseApplicationMapper.submitCaseApplication(caseApplication1);
545
             }
561
             }
546
         }
562
         }
547
         //发送邮件
563
         //发送邮件
548
-        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail);
564
+        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList);
549
         SendMailRecord sendMailRecord = new SendMailRecord();
565
         SendMailRecord sendMailRecord = new SendMailRecord();
550
         sendMailRecord.setCaseId(id);
566
         sendMailRecord.setCaseId(id);
551
         sendMailRecord.setMailAddress(appEmail);
567
         sendMailRecord.setMailAddress(appEmail);
575
                 for (CaseAffiliate affiliate : caseAffiliates) {
591
                 for (CaseAffiliate affiliate : caseAffiliates) {
576
 
592
 
577
                     request.setPhone(affiliate.getContactTelphone());
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
                     Boolean aBoolean = SmsUtils.sendSms(request);
600
                     Boolean aBoolean = SmsUtils.sendSms(request);
584
 
601
 
585
                        // 保存短信发送记录
602
                        // 保存短信发送记录
589
                         smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
606
                         smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
590
                         smsSendRecord.setPhone(request.getPhone());
607
                         smsSendRecord.setPhone(request.getPhone());
591
                         smsSendRecord.setSendTime(new Date());
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
                         if (aBoolean) {
619
                         if (aBoolean) {
601
                             smsSendRecord.setSendStatus(1);
620
                             smsSendRecord.setSendStatus(1);
602
                         } else {
621
                         } else {
627
      * @param appEmail
646
      * @param appEmail
628
      * @param resEmail
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
         List<File> fileList = new ArrayList<>();
650
         List<File> fileList = new ArrayList<>();
632
         File file = null;
651
         File file = null;
633
-
634
-        List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
635
         if (caseAttachList != null && caseAttachList.size() > 0) {
652
         if (caseAttachList != null && caseAttachList.size() > 0) {
636
             for (CaseAttach caseAttach : caseAttachList) {
653
             for (CaseAttach caseAttach : caseAttachList) {
637
                 if (caseAttach.getAnnexType() == 3) {
654
                 if (caseAttach.getAnnexType() == 3) {
645
                 }
662
                 }
646
             }
663
             }
647
         }
664
         }
648
-        if (file != null) {
665
+
666
+        if (file != null && file.exists()) {
649
             try {
667
             try {
650
                 Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
668
                 Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
651
                 Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
669
                 Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);

+ 19
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Näytä tiedosto

183
                 }
183
                 }
184
                 if (role.getRoleName().equals("代理人")) {
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
                 //
248
                 //
247
                 caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
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
         }
1398
         }
1390
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
1399
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
1391
             failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
1400
             failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
1392
-        } else if (validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
1401
+        } else if (!validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
1393
             failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
1402
             failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
1394
         }
1403
         }
1395
         String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
1404
         String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
1419
         }
1428
         }
1420
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
1429
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
1421
             failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
1430
             failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
1422
-        } else if (validateIdCard(caseApplication.getDebtorIdentityNum())) {
1431
+        } else if (!validateIdCard(caseApplication.getDebtorIdentityNum())) {
1423
             failureMsg.append("【被申请人主体信息-身份证号】不合法;");
1432
             failureMsg.append("【被申请人主体信息-身份证号】不合法;");
1424
         }
1433
         }
1425
         String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
1434
         String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
1456
         }
1465
         }
1457
         if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) {
1466
         if (StrUtil.isEmpty(caseApplication.getDebtorEmail())) {
1458
             failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;");
1467
             failureMsg.append("【被申请人主体信息-邮箱】字段不能为空;");
1459
-        } else if (!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()) {
1468
+        } else if(!EMAIL_PATTERN.matcher(caseApplication.getDebtorEmail()).matches()){
1460
 
1469
 
1461
             failureMsg.append("【被申请人主体信息-邮箱】字段不合法;");
1470
             failureMsg.append("【被申请人主体信息-邮箱】字段不合法;");
1462
         }
1471
         }
1562
         }
1571
         }
1563
         if (StrUtil.isEmpty(caseApplication.getEmail())) {
1572
         if (StrUtil.isEmpty(caseApplication.getEmail())) {
1564
             failureMsg.append("【申请人主体信息-邮箱】字段不能为空;");
1573
             failureMsg.append("【申请人主体信息-邮箱】字段不能为空;");
1565
-        } else if (!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()) {
1574
+        } else if(!EMAIL_PATTERN.matcher(caseApplication.getEmail()).matches()){
1566
 
1575
 
1567
             failureMsg.append("【申请人主体信息-邮箱】字段不合法;");
1576
             failureMsg.append("【申请人主体信息-邮箱】字段不合法;");
1568
         }
1577
         }
2671
 
2680
 
2672
                     // 新增预约会议表
2681
                     // 新增预约会议表
2673
                     ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
2682
                     ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
2674
-                            reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(), 1);
2683
+                            reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
2675
                     reservedConferenceMapper.insert(conference);
2684
                     reservedConferenceMapper.insert(conference);
2676
                     return AjaxResult.success("预约会议成功");
2685
                     return AjaxResult.success("预约会议成功");
2677
 
2686
 
2699
         String roomId = generateRoomId();
2708
         String roomId = generateRoomId();
2700
         // 新增预约会议表
2709
         // 新增预约会议表
2701
         ReservedConference conference = new ReservedConference(caseId, roomId,
2710
         ReservedConference conference = new ReservedConference(caseId, roomId,
2702
-                null, null, 0);
2711
+                null, null,0);
2703
         reservedConferenceMapper.insert(conference);
2712
         reservedConferenceMapper.insert(conference);
2704
         return roomId;
2713
         return roomId;
2705
     }
2714
     }
2713
         // 查询最大房间号
2722
         // 查询最大房间号
2714
         Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
2723
         Integer maxRoomId = caseApplicationMapper.selectMaxRoomId();
2715
 
2724
 
2716
-        if (null == maxRoomId || maxRoomId > 999999) {
2725
+        if (null == maxRoomId || maxRoomId >999999) {
2717
             return "000001";
2726
             return "000001";
2718
         } else {
2727
         } else {
2719
             return String.format("%06d", maxRoomId);
2728
             return String.format("%06d", maxRoomId);
2761
     @Override
2770
     @Override
2762
     public AjaxResult deleteRoom(String roomId) {
2771
     public AjaxResult deleteRoom(String roomId) {
2763
 
2772
 
2764
-        return AjaxResult.success(reservedConferenceMapper.deleteByRoomId(roomId));
2773
+        return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
2765
     }
2774
     }
2766
 }
2775
 }
2767
 
2776
 

+ 10
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Näytä tiedosto

283
              or   ( t.identity_type=1 and t.case_status =#{financeStatus})
283
              or   ( t.identity_type=1 and t.case_status =#{financeStatus})
284
 
284
 
285
             </if>
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
         </where>
296
         </where>
287
         ) t1
297
         ) t1
288
     </select>
298
     </select>