Procházet zdrojové kódy

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

hejinbo před 2 roky
rodič
revize
ce64d7f203

+ 36
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/SendMailRecordController.java Zobrazit soubor

@@ -0,0 +1,36 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.page.TableDataInfo;
5
+import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
6
+import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
7
+import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.web.bind.annotation.GetMapping;
10
+import org.springframework.web.bind.annotation.RequestMapping;
11
+import org.springframework.web.bind.annotation.RestController;
12
+
13
+import java.util.List;
14
+
15
+@RestController
16
+@RequestMapping("/sendMailRecord")
17
+public class SendMailRecordController  extends BaseController {
18
+    @Autowired
19
+    private ISendMailRecordService sendMailRecordService;
20
+
21
+    /**
22
+     * 查询发送邮件记录列表
23
+     */
24
+    @GetMapping("/list")
25
+    public TableDataInfo list(SendMailRecord sendMailRecord)
26
+    {
27
+        startPage();
28
+        List<SendMailRecord> list = sendMailRecordService.selectSendMailRecordList(sendMailRecord);
29
+        return getDataTable(list);
30
+    }
31
+
32
+
33
+
34
+
35
+
36
+}

+ 99
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SendMailRecord.java Zobrazit soubor

@@ -0,0 +1,99 @@
1
+package com.ruoyi.wisdomarbitrate.domain;
2
+
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import com.ruoyi.common.annotation.Excel;
5
+import com.ruoyi.common.core.domain.BaseEntity;
6
+
7
+import java.util.Date;
8
+
9
+public class SendMailRecord   extends BaseEntity {
10
+    private static final long serialVersionUID = 1L;
11
+
12
+    private Long id;
13
+    /** 案件申请id */
14
+    private Long caseId;
15
+
16
+    /**
17
+     * 邮件名称
18
+     */
19
+    private String mailName;
20
+    /**
21
+     * 邮件内容
22
+     */
23
+    private String mailContent;
24
+    /**
25
+     * 邮件地址
26
+     */
27
+    private String mailAddress;
28
+    /**
29
+     * 发送时间
30
+     */
31
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
32
+    private Date sendTime;
33
+
34
+    /** 案件编号 */
35
+    private String caseNum;
36
+
37
+    public String getCaseNum() {
38
+        return caseNum;
39
+    }
40
+
41
+    public void setCaseNum(String caseNum) {
42
+        this.caseNum = caseNum;
43
+    }
44
+
45
+    public Long getId() {
46
+        return id;
47
+    }
48
+
49
+    public void setId(Long id) {
50
+        this.id = id;
51
+    }
52
+
53
+    public Long getCaseId() {
54
+        return caseId;
55
+    }
56
+
57
+    public void setCaseId(Long caseId) {
58
+        this.caseId = caseId;
59
+    }
60
+
61
+    public String getMailName() {
62
+        return mailName;
63
+    }
64
+
65
+    public void setMailName(String mailName) {
66
+        this.mailName = mailName;
67
+    }
68
+
69
+    public String getMailContent() {
70
+        return mailContent;
71
+    }
72
+
73
+    public void setMailContent(String mailContent) {
74
+        this.mailContent = mailContent;
75
+    }
76
+
77
+    public String getMailAddress() {
78
+        return mailAddress;
79
+    }
80
+
81
+    public void setMailAddress(String mailAddress) {
82
+        this.mailAddress = mailAddress;
83
+    }
84
+
85
+    public Date getSendTime() {
86
+        return sendTime;
87
+    }
88
+
89
+    public void setSendTime(Date sendTime) {
90
+        this.sendTime = sendTime;
91
+    }
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+}

+ 15
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SendMailRecordMapper.java Zobrazit soubor

@@ -0,0 +1,15 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
4
+import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
5
+
6
+import java.util.List;
7
+
8
+public interface SendMailRecordMapper {
9
+    int saveSendMailRecord(SendMailRecord sendMailRecord);
10
+
11
+    List<SendMailRecord>  selectSendMailRecord(SendMailRecord sendMailRecord);
12
+
13
+
14
+
15
+}

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ISendMailRecordService.java Zobrazit soubor

@@ -0,0 +1,11 @@
1
+package com.ruoyi.wisdomarbitrate.service;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
4
+
5
+import java.util.List;
6
+
7
+public interface ISendMailRecordService {
8
+
9
+
10
+    List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord);
11
+}

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Zobrazit soubor

@@ -34,6 +34,8 @@ import java.text.SimpleDateFormat;
34 34
 import java.time.LocalDate;
35 35
 import java.util.*;
36 36
 
37
+import static com.ruoyi.common.utils.SecurityUtils.getUsername;
38
+
37 39
 @Service
38 40
 @Slf4j
39 41
 public class AdjudicationServiceImpl implements IAdjudicationService {
@@ -56,6 +58,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
56 58
     @Autowired
57 59
     private RedisCache redisCache;
58 60
 
61
+    @Autowired
62
+    private SendMailRecordMapper sendMailRecordMapper;
63
+
59 64
     @Override
60 65
     @Transactional
61 66
     public AjaxResult createDocument(CaseApplication caseApplication) {
@@ -336,10 +341,28 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
336 341
             if (appEmail != null) {
337 342
                 emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
338 343
                         , "hjbjava@163.com", javaMailSender);
344
+
345
+                SendMailRecord sendMailRecord = new SendMailRecord();
346
+                sendMailRecord.setCaseId(id);
347
+                sendMailRecord.setMailAddress(appEmail);
348
+                sendMailRecord.setMailContent("您的裁决书已送达,详情请查阅附件");
349
+                sendMailRecord.setMailName("案件裁决书");
350
+                sendMailRecord.setSendTime(new Date());
351
+                sendMailRecord.setCreateBy(getUsername());
352
+                sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
339 353
             }
340 354
             if (resEmail != null) {
341 355
                 emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
342 356
                         , "hjbjava@163.com", javaMailSender);
357
+
358
+                SendMailRecord sendMailRecord = new SendMailRecord();
359
+                sendMailRecord.setCaseId(id);
360
+                sendMailRecord.setMailAddress(resEmail);
361
+                sendMailRecord.setMailContent("您的裁决书已送达,详情请查阅附件");
362
+                sendMailRecord.setMailName("案件裁决书");
363
+                sendMailRecord.setSendTime(new Date());
364
+                sendMailRecord.setCreateBy(getUsername());
365
+                sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
343 366
             }
344 367
             //修改案件状态
345 368
             caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
@@ -361,6 +384,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
361 384
                     }
362 385
                 }
363 386
             }
387
+
364 388
             return AjaxResult.success("仲裁文书送达成功");
365 389
         } catch (MailSendException e) {
366 390
             return AjaxResult.error("发送失败,请检查文件路径");

+ 26
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/SendMailRecordServiceImpl.java Zobrazit soubor

@@ -0,0 +1,26 @@
1
+package com.ruoyi.wisdomarbitrate.service.impl;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
4
+import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
5
+import com.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper;
6
+import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+
10
+import java.util.List;
11
+
12
+@Service
13
+public class SendMailRecordServiceImpl implements ISendMailRecordService {
14
+    @Autowired
15
+    private SendMailRecordMapper sendMailRecordMapper;
16
+
17
+
18
+    @Override
19
+    public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
20
+        List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
21
+        return records;
22
+    }
23
+
24
+
25
+
26
+}

+ 57
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml Zobrazit soubor

@@ -0,0 +1,57 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper">
6
+
7
+    <resultMap type="SendMailRecord" id="SendMailRecordResult">
8
+        <id     property="id"       column="id"      />
9
+        <result property="mailName"       column="mail_name"      />
10
+        <result property="mailContent"     column="mail_content"    />
11
+        <result property="mailAddress"     column="mail_address"    />
12
+        <result property="sendTime"        column="send_time"        />
13
+        <result property="caseId"  column="case_id"  />
14
+        <result property="caseNum"  column="case_num"  />
15
+
16
+    </resultMap>
17
+
18
+    <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
+        s.update_by ,s.update_time ,c.case_num
21
+        from send_mail_record s left join case_application c
22
+        on s.case_id  = c.id
23
+        <where>
24
+            <if test="caseNum != null and caseNum != ''">
25
+                AND c.case_num = #{caseNum}
26
+            </if>
27
+        </where>
28
+    </select>
29
+
30
+    <insert id="saveSendMailRecord">
31
+        insert into send_mail_record(
32
+        <if test="mailName != null and mailName != ''">mail_name,</if>
33
+        <if test="mailContent != null and mailContent != ''">mail_content,</if>
34
+        <if test="mailAddress != null and mailAddress != ''">mail_address,</if>
35
+        <if test="sendTime != null ">send_time,</if>
36
+        <if test="caseId != null ">case_id,</if>
37
+        <if test="createBy != null  and createBy != ''">create_by,</if>
38
+        create_time
39
+        )values(
40
+        <if test="mailName != null and mailName != ''">#{mailName},</if>
41
+        <if test="mailContent != null and mailContent != ''">#{mailContent},</if>
42
+        <if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
43
+        <if test="sendTime != null ">#{sendTime},</if>
44
+        <if test="caseId != null ">#{caseId},</if>
45
+        <if test="createBy != null  and createBy != ''">#{createBy},</if>
46
+        sysdate()
47
+        )
48
+    </insert>
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+</mapper>