Преглед изворни кода

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

qitz пре 2 година
родитељ
комит
9402f26857

+ 3
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Прегледај датотеку

@@ -93,7 +93,7 @@ public class EmailOutUtil {
93 93
      * @param subject  邮件主题
94 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 97
         try {
98 98
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
99 99
             MimeBodyPart messageBodyPart = new MimeBodyPart();
@@ -160,8 +160,9 @@ public class EmailOutUtil {
160 160
             Transport.send(msg);
161 161
         } catch (Exception e) {
162 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,6 +752,18 @@ public class CaseApplication  extends BaseEntity {
752 752
     /** 联系地址 */
753 753
     @Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
754 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 768
     public int getIdentityType() {
757 769
         return identityType;

+ 16
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java Прегледај датотеку

@@ -34,6 +34,22 @@ public class SendMailRecord   extends BaseEntity {
34 34
     /** 案件编号 */
35 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 53
     public String getCaseNum() {
38 54
         return caseNum;
39 55
     }

+ 33
- 21
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Прегледај датотеку

@@ -105,10 +105,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
105 105
                         datas.put("resName", affiliate.getName());
106 106
                         datas.put("resAddress", affiliate.getResidenAffili());
107 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 113
                         Date responBirth = affiliate.getResponBirth();
114 114
                         if (responBirth != null) {
@@ -264,7 +264,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
264 264
                         String annexName = caseAttach.getAnnexName();
265 265
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
266 266
                         if (isImageFile) {
267
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
267
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
268 268
                             System.out.println("路径是===========" + annexPath);
269 269
                             PictureRenderData pictureRenderData = WordUtil
270 270
                                     .rebuildImageContent(100, 100, null, annexPath);
@@ -274,7 +274,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
274 274
                         String annexName = caseAttach.getAnnexName();
275 275
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
276 276
                         if (isImageFile) {
277
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
277
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
278 278
                             System.out.println("路径是===========" + annexPath);
279 279
                             PictureRenderData pictureRenderData = WordUtil
280 280
                                     .rebuildImageContent(100, 100, null, annexPath);
@@ -326,10 +326,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
326 326
                     .build();
327 327
             //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
328 328
             List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
329
-            if (caseAttachList != null && caseAttachList.size()>0) {
329
+            if (caseAttachList != null && caseAttachList.size() > 0) {
330 330
                 //之前已经生成过了,更新
331 331
                 int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
332
-            }else {
332
+            } else {
333 333
                 //之前没生成过,新增
334 334
                 int i = caseAttachMapper.save(caseAttach);
335 335
                 if (i > 0) {
@@ -540,8 +540,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
540 540
             }
541 541
         }
542 542
         //发送邮件
543
-        sendCaseEmail(caseApplication1, appEmail, resEmail);
544
-
543
+        boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail);
545 544
         SendMailRecord sendMailRecord = new SendMailRecord();
546 545
         sendMailRecord.setCaseId(id);
547 546
         sendMailRecord.setMailAddress(appEmail);
@@ -549,8 +548,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
549 548
         sendMailRecord.setMailName("签署后的裁决书");
550 549
         sendMailRecord.setSendTime(new Date());
551 550
         sendMailRecord.setCreateBy(getUsername());
551
+        if (b) {
552
+            sendMailRecord.setSendStatus(1);
553
+        } else {
554
+            sendMailRecord.setSendStatus(0);
555
+        }
552 556
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
553
-
554 557
         SendMailRecord sendMailRecord1 = new SendMailRecord();
555 558
         sendMailRecord1.setCaseId(id);
556 559
         sendMailRecord1.setMailAddress(resEmail);
@@ -558,6 +561,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
558 561
         sendMailRecord1.setMailName("签署后的裁决书");
559 562
         sendMailRecord1.setSendTime(new Date());
560 563
         sendMailRecord1.setCreateBy(getUsername());
564
+        if (b) {
565
+            sendMailRecord1.setSendStatus(1);
566
+        } else {
567
+            sendMailRecord1.setSendStatus(0);
568
+        }
561 569
         sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
562 570
 
563 571
         // 新增日志
@@ -573,7 +581,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
573 581
      * @param appEmail
574 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 585
         List<File> fileList = new ArrayList<>();
578 586
         File file = null;
579 587
 
@@ -593,14 +601,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
593 601
         }
594 602
         if (file != null) {
595 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 609
             } catch (Exception e) {
599 610
                 System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
600 611
                 System.out.println(e.toString());
612
+                return Boolean.FALSE;
601 613
             }
602 614
         }
603
-
615
+        return Boolean.FALSE;
604 616
     }
605 617
 
606 618
     @Override
@@ -678,10 +690,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
678 690
                         datas.put("resName", affiliate.getName());
679 691
                         datas.put("resAddress", affiliate.getResidenAffili());
680 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 698
                         Date responBirth = affiliate.getResponBirth();
687 699
                         if (responBirth != null) {
@@ -838,7 +850,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
838 850
                         String annexName = caseAttach.getAnnexName();
839 851
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
840 852
                         if (isImageFile) {
841
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
853
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
842 854
                             System.out.println("路径是===========" + annexPath);
843 855
                             PictureRenderData pictureRenderData = WordUtil
844 856
                                     .rebuildImageContent(100, 100, null, annexPath);
@@ -848,7 +860,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
848 860
                         String annexName = caseAttach.getAnnexName();
849 861
                         boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName);
850 862
                         if (isImageFile) {
851
-                            String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath();
863
+                            String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath();
852 864
                             System.out.println("路径是===========" + annexPath);
853 865
                             PictureRenderData pictureRenderData = WordUtil
854 866
                                     .rebuildImageContent(100, 100, null, annexPath);

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Прегледај датотеку

@@ -155,7 +155,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
155 155
                 }
156 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 160
                 if (role.getRoleName().equals("被申请人")) {
161 161
                     //

+ 4
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Прегледај датотеку

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

+ 4
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml Прегледај датотеку

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