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

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

qitz 2 лет назад
Родитель
Сommit
9402f26857

+ 3
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Просмотреть файл

93
      * @param subject  邮件主题
93
      * @param subject  邮件主题
94
      * @param fileList 邮件附件
94
      * @param fileList 邮件附件
95
      */
95
      */
96
-    public  void sendEmil(String to, String message, String subject, List<File> fileList, File file) {
96
+    public  Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file) {
97
         try {
97
         try {
98
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
98
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
99
             MimeBodyPart messageBodyPart = new MimeBodyPart();
99
             MimeBodyPart messageBodyPart = new MimeBodyPart();
160
             Transport.send(msg);
160
             Transport.send(msg);
161
         } catch (Exception e) {
161
         } catch (Exception e) {
162
             e.printStackTrace();
162
             e.printStackTrace();
163
+            return Boolean.FALSE;
163
         }
164
         }
164
-
165
+        return Boolean.TRUE;
165
     }
166
     }
166
 
167
 
167
     /**
168
     /**

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Просмотреть файл

752
     /** 联系地址 */
752
     /** 联系地址 */
753
     @Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
753
     @Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
754
     private String debtorContactAddressAgent;
754
     private String debtorContactAddressAgent;
755
+    /**
756
+     * 申请机构id
757
+     */
758
+    private String applicationOrganId;
759
+
760
+    public String getApplicationOrganId() {
761
+        return applicationOrganId;
762
+    }
763
+
764
+    public void setApplicationOrganId(String applicationOrganId) {
765
+        this.applicationOrganId = applicationOrganId;
766
+    }
755
 
767
 
756
     public int getIdentityType() {
768
     public int getIdentityType() {
757
         return identityType;
769
         return identityType;

+ 16
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java Просмотреть файл

34
     /** 案件编号 */
34
     /** 案件编号 */
35
     private String caseNum;
35
     private String caseNum;
36
 
36
 
37
+
38
+
39
+    /** 发送状态 */
40
+    private Integer sendStatus;
41
+
42
+
43
+
44
+    public Integer getSendStatus() {
45
+        return sendStatus;
46
+    }
47
+
48
+    public void setSendStatus(Integer sendStatus) {
49
+        this.sendStatus = sendStatus;
50
+    }
51
+
52
+
37
     public String getCaseNum() {
53
     public String getCaseNum() {
38
         return caseNum;
54
         return caseNum;
39
     }
55
     }

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

105
                         datas.put("resName", affiliate.getName());
105
                         datas.put("resName", affiliate.getName());
106
                         datas.put("resAddress", affiliate.getResidenAffili());
106
                         datas.put("resAddress", affiliate.getResidenAffili());
107
                         String responSex = affiliate.getResponSex();
107
                         String responSex = affiliate.getResponSex();
108
-                        if (responSex.equals("0")){
109
-                            datas.put("resSex","男");
110
-                        }else{
111
-                            datas.put("resSex","女");
108
+                        if (responSex.equals("0")) {
109
+                            datas.put("resSex", "男");
110
+                        } else {
111
+                            datas.put("resSex", "女");
112
                         }
112
                         }
113
                         Date responBirth = affiliate.getResponBirth();
113
                         Date responBirth = affiliate.getResponBirth();
114
                         if (responBirth != null) {
114
                         if (responBirth != null) {
264
                         String annexName = caseAttach.getAnnexName();
264
                         String annexName = caseAttach.getAnnexName();
265
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
265
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
266
                         if (isImageFile) {
266
                         if (isImageFile) {
267
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
267
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
268
                             System.out.println("路径是===========" + annexPath);
268
                             System.out.println("路径是===========" + annexPath);
269
                             PictureRenderData pictureRenderData = WordUtil
269
                             PictureRenderData pictureRenderData = WordUtil
270
                                     .rebuildImageContent(100, 100, null, annexPath);
270
                                     .rebuildImageContent(100, 100, null, annexPath);
274
                         String annexName = caseAttach.getAnnexName();
274
                         String annexName = caseAttach.getAnnexName();
275
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
275
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
276
                         if (isImageFile) {
276
                         if (isImageFile) {
277
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
277
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
278
                             System.out.println("路径是===========" + annexPath);
278
                             System.out.println("路径是===========" + annexPath);
279
                             PictureRenderData pictureRenderData = WordUtil
279
                             PictureRenderData pictureRenderData = WordUtil
280
                                     .rebuildImageContent(100, 100, null, annexPath);
280
                                     .rebuildImageContent(100, 100, null, annexPath);
326
                     .build();
326
                     .build();
327
             //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
327
             //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
328
             List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
328
             List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
329
-            if (caseAttachList != null && caseAttachList.size()>0) {
329
+            if (caseAttachList != null && caseAttachList.size() > 0) {
330
                 //之前已经生成过了,更新
330
                 //之前已经生成过了,更新
331
                 int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
331
                 int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
332
-            }else {
332
+            } else {
333
                 //之前没生成过,新增
333
                 //之前没生成过,新增
334
                 int i = caseAttachMapper.save(caseAttach);
334
                 int i = caseAttachMapper.save(caseAttach);
335
                 if (i > 0) {
335
                 if (i > 0) {
540
             }
540
             }
541
         }
541
         }
542
         //发送邮件
542
         //发送邮件
543
-        sendCaseEmail(caseApplication1, appEmail, resEmail);
544
-
543
+        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail);
545
         SendMailRecord sendMailRecord = new SendMailRecord();
544
         SendMailRecord sendMailRecord = new SendMailRecord();
546
         sendMailRecord.setCaseId(id);
545
         sendMailRecord.setCaseId(id);
547
         sendMailRecord.setMailAddress(appEmail);
546
         sendMailRecord.setMailAddress(appEmail);
549
         sendMailRecord.setMailName("签署后的裁决书");
548
         sendMailRecord.setMailName("签署后的裁决书");
550
         sendMailRecord.setSendTime(new Date());
549
         sendMailRecord.setSendTime(new Date());
551
         sendMailRecord.setCreateBy(getUsername());
550
         sendMailRecord.setCreateBy(getUsername());
551
+        if (b) {
552
+            sendMailRecord.setSendStatus(1);
553
+        } else {
554
+            sendMailRecord.setSendStatus(0);
555
+        }
552
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
556
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
553
-
554
         SendMailRecord sendMailRecord1 = new SendMailRecord();
557
         SendMailRecord sendMailRecord1 = new SendMailRecord();
555
         sendMailRecord1.setCaseId(id);
558
         sendMailRecord1.setCaseId(id);
556
         sendMailRecord1.setMailAddress(resEmail);
559
         sendMailRecord1.setMailAddress(resEmail);
558
         sendMailRecord1.setMailName("签署后的裁决书");
561
         sendMailRecord1.setMailName("签署后的裁决书");
559
         sendMailRecord1.setSendTime(new Date());
562
         sendMailRecord1.setSendTime(new Date());
560
         sendMailRecord1.setCreateBy(getUsername());
563
         sendMailRecord1.setCreateBy(getUsername());
564
+        if (b) {
565
+            sendMailRecord1.setSendStatus(1);
566
+        } else {
567
+            sendMailRecord1.setSendStatus(0);
568
+        }
561
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
569
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
562
 
570
 
563
         // 新增日志
571
         // 新增日志
573
      * @param appEmail
581
      * @param appEmail
574
      * @param resEmail
582
      * @param resEmail
575
      */
583
      */
576
-    private void sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) {
584
+    private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) {
577
         List<File> fileList = new ArrayList<>();
585
         List<File> fileList = new ArrayList<>();
578
         File file = null;
586
         File file = null;
579
 
587
 
593
         }
601
         }
594
         if (file != null) {
602
         if (file != null) {
595
             try {
603
             try {
596
-                emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
597
-                emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
604
+                Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
605
+                Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
606
+                if (aBoolean && aBoolean1){
607
+                    return Boolean.TRUE;
608
+                }
598
             } catch (Exception e) {
609
             } catch (Exception e) {
599
                 System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
610
                 System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
600
                 System.out.println(e.toString());
611
                 System.out.println(e.toString());
612
+                return Boolean.FALSE;
601
             }
613
             }
602
         }
614
         }
603
-
615
+        return Boolean.FALSE;
604
     }
616
     }
605
 
617
 
606
     @Override
618
     @Override
678
                         datas.put("resName", affiliate.getName());
690
                         datas.put("resName", affiliate.getName());
679
                         datas.put("resAddress", affiliate.getResidenAffili());
691
                         datas.put("resAddress", affiliate.getResidenAffili());
680
                         String responSex = affiliate.getResponSex();
692
                         String responSex = affiliate.getResponSex();
681
-                        if (responSex.equals("0")){
682
-                            datas.put("resSex","男");
683
-                        }else{
684
-                            datas.put("resSex","女");
693
+                        if (responSex.equals("0")) {
694
+                            datas.put("resSex", "男");
695
+                        } else {
696
+                            datas.put("resSex", "女");
685
                         }
697
                         }
686
                         Date responBirth = affiliate.getResponBirth();
698
                         Date responBirth = affiliate.getResponBirth();
687
                         if (responBirth != null) {
699
                         if (responBirth != null) {
838
                         String annexName = caseAttach.getAnnexName();
850
                         String annexName = caseAttach.getAnnexName();
839
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
851
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
840
                         if (isImageFile) {
852
                         if (isImageFile) {
841
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
853
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
842
                             System.out.println("路径是===========" + annexPath);
854
                             System.out.println("路径是===========" + annexPath);
843
                             PictureRenderData pictureRenderData = WordUtil
855
                             PictureRenderData pictureRenderData = WordUtil
844
                                     .rebuildImageContent(100, 100, null, annexPath);
856
                                     .rebuildImageContent(100, 100, null, annexPath);
848
                         String annexName = caseAttach.getAnnexName();
860
                         String annexName = caseAttach.getAnnexName();
849
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
861
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
850
                         if (isImageFile) {
862
                         if (isImageFile) {
851
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
863
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
852
                             System.out.println("路径是===========" + annexPath);
864
                             System.out.println("路径是===========" + annexPath);
853
                             PictureRenderData pictureRenderData = WordUtil
865
                             PictureRenderData pictureRenderData = WordUtil
854
                                     .rebuildImageContent(100, 100, null, annexPath);
866
                                     .rebuildImageContent(100, 100, null, annexPath);

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

155
                 }
155
                 }
156
                 if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
156
                 if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) {
157
                     // 查询角色有关的用户部门
157
                     // 查询角色有关的用户部门
158
-                    caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
158
+                    caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
159
                 }
159
                 }
160
                 if (role.getRoleName().equals("被申请人")) {
160
                 if (role.getRoleName().equals("被申请人")) {
161
                     //
161
                     //

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

126
             <if test="caseNum != null and caseNum != ''">
126
             <if test="caseNum != null and caseNum != ''">
127
                 AND c.case_num = #{caseNum}
127
                 AND c.case_num = #{caseNum}
128
             </if>
128
             </if>
129
+            <if test="nameId != null and nameId != ''">
130
+                AND ca.application_organ_id=#{nameId}  AND ca.identity_type=1
131
+            </if>
129
             <if test="caseStatusList != null and caseStatusList.size() > 0">
132
             <if test="caseStatusList != null and caseStatusList.size() > 0">
130
                 and c.case_status in
133
                 and c.case_status in
131
                 <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
134
                 <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
161
 
164
 
162
             <!--申请人-->
165
             <!--申请人-->
163
             <if test="nameId != null and nameId != ''">
166
             <if test="nameId != null and nameId != ''">
164
-                or ( t.application_organ_id = #{nameId} AND t.identity_type=1
167
+                or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
165
                 and t.case_status in (0,2,17))
168
                 and t.case_status in (0,2,17))
166
 
169
 
167
             </if>
170
             </if>

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

12
         <result property="sendTime"        column="send_time"        />
12
         <result property="sendTime"        column="send_time"        />
13
         <result property="caseId"  column="case_id"  />
13
         <result property="caseId"  column="case_id"  />
14
         <result property="caseNum"  column="case_num"  />
14
         <result property="caseNum"  column="case_num"  />
15
+        <result property="sendStatus"  column="send_status"  />
15
 
16
 
16
     </resultMap>
17
     </resultMap>
17
 
18
 
18
     <select id="selectSendMailRecord" parameterType="SendMailRecord" resultMap="SendMailRecordResult">
19
     <select id="selectSendMailRecord" parameterType="SendMailRecord" resultMap="SendMailRecordResult">
19
         SELECT s.id ,s.mail_name ,s.mail_content ,s.mail_address ,s.send_time ,s.case_id ,s.create_time ,s.create_by ,
20
         SELECT s.id ,s.mail_name ,s.mail_content ,s.mail_address ,s.send_time ,s.case_id ,s.create_time ,s.create_by ,
20
-        s.update_by ,s.update_time ,c.case_num
21
+        s.update_by ,s.update_time , s.send_status ,c.case_num
21
         from send_mail_record s left join case_application c
22
         from send_mail_record s left join case_application c
22
         on s.case_id  = c.id
23
         on s.case_id  = c.id
23
         <where>
24
         <where>
35
         <if test="mailAddress != null and mailAddress != ''">mail_address,</if>
36
         <if test="mailAddress != null and mailAddress != ''">mail_address,</if>
36
         <if test="sendTime != null ">send_time,</if>
37
         <if test="sendTime != null ">send_time,</if>
37
         <if test="caseId != null ">case_id,</if>
38
         <if test="caseId != null ">case_id,</if>
39
+        <if test="sendStatus != null ">send_status,</if>
38
         <if test="createBy != null  and createBy != ''">create_by,</if>
40
         <if test="createBy != null  and createBy != ''">create_by,</if>
39
         create_time
41
         create_time
40
         )values(
42
         )values(
43
         <if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
45
         <if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
44
         <if test="sendTime != null ">#{sendTime},</if>
46
         <if test="sendTime != null ">#{sendTime},</if>
45
         <if test="caseId != null ">#{caseId},</if>
47
         <if test="caseId != null ">#{caseId},</if>
48
+        <if test="sendStatus != null ">#{sendStatus},</if>
46
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
49
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
47
         sysdate()
50
         sysdate()
48
         )
51
         )