Parcourir la source

邮箱相关修改

18792927508 il y a 2 ans
Parent
révision
bbb2776610

+ 44
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Voir le fichier

@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.CaseApplicationConstants;
8 8
 import com.ruoyi.common.core.domain.AjaxResult;
9 9
 import com.ruoyi.common.core.redis.RedisCache;
10 10
 import com.ruoyi.common.utils.DateUtils;
11
+import com.ruoyi.common.utils.SmsUtils;
11 12
 import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
12 13
 import com.ruoyi.wisdomarbitrate.mapper.*;
13 14
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
@@ -66,6 +67,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
66 67
     private RedisCache redisCache;
67 68
     @Autowired
68 69
     private SendMailRecordMapper sendMailRecordMapper;
70
+    @Autowired
71
+    private SmsRecordMapper smsRecordMapper;
69 72
 
70 73
     @Override
71 74
     @Transactional
@@ -565,6 +568,47 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
565 568
         sendMailRecord1.setCreateBy(getUsername());
566 569
         if (b) {
567 570
             sendMailRecord1.setSendStatus(1);
571
+            // 发送短信
572
+            if(CollectionUtil.isNotEmpty(caseAffiliates)) {
573
+                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
574
+                request.setTemplateId("1990362");
575
+                for (CaseAffiliate affiliate : caseAffiliates) {
576
+
577
+                    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
+                    }
583
+                    Boolean aBoolean = SmsUtils.sendSms(request);
584
+
585
+                       // 保存短信发送记录
586
+                        SmsSendRecord smsSendRecord = new SmsSendRecord();
587
+                        smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
588
+
589
+                        smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
590
+                        smsSendRecord.setPhone(request.getPhone());
591
+                        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
+                        }
598
+
599
+                        smsSendRecord.setCreateBy(getUsername());
600
+                        if (aBoolean) {
601
+                            smsSendRecord.setSendStatus(1);
602
+                        } else {
603
+                            smsSendRecord.setSendStatus(0);
604
+                        }
605
+                        smsRecordMapper.saveSmsSendRecord(smsSendRecord);
606
+
607
+
608
+                }
609
+
610
+            }
611
+
568 612
         } else {
569 613
             sendMailRecord1.setSendStatus(0);
570 614
         }

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Voir le fichier

@@ -30,14 +30,14 @@
30 30
         <result property="residenAffili"    column="residen_affili"   />
31 31
         <result property="appliAgentTitle"    column="appli_agent_title"   />
32 32
         <result property="userId"    column="user_id"   />
33
-
33
+        <result property="email"     column="email"    />
34 34
     </resultMap>
35 35
 
36 36
     <select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
37 37
         select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
38 38
         c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
39 39
         c.comp_legal_person,c.comp_legalper_post,c.respon_sex,c.respon_birth,
40
-        c.residen_affili,c.appli_agent_title,
40
+        c.residen_affili,c.appli_agent_title,c.email,
41 41
         c.track_num,c.application_organ_id,c.application_organ_name,s.user_id
42 42
         from case_affiliate c
43 43
         left join sys_user s on c.identity_num=s.id_card