瀏覽代碼

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 年之前
父節點
當前提交
183b0ecd2c

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java 查看文件

18
      * 案件申请id
18
      * 案件申请id
19
      */
19
      */
20
     private Long caseAppliId;
20
     private Long caseAppliId;
21
+    /**
22
+     * 案件记录id
23
+     */
24
+    private Long caseAppliLogId;
21
     /**
25
     /**
22
      * 附件名称
26
      * 附件名称
23
      */
27
      */

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java 查看文件

35
      * @param affiliateLogList
35
      * @param affiliateLogList
36
      */
36
      */
37
     void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
37
     void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
38
+
39
+    /**
40
+     * 根据案件id删除
41
+     * @param caseId
42
+     */
43
+    void deleteByCaseId(@Param("caseAppliId") Long caseId);
38
 }
44
 }

+ 30
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachLogMapper.java 查看文件

1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+@Mapper
11
+public interface CaseAttachLogMapper {
12
+    int save(CaseAttach caseAttach);
13
+
14
+    List<CaseAttach>  queryAnnexPathByCaseId(Long id);
15
+
16
+    List<CaseAttach> queryCaseAttachList(CaseApplication caseApplication);
17
+
18
+
19
+    int updateCaseAttach(CaseAttach caseAttach);
20
+
21
+    int updateCaseAttachBycaseid(CaseAttach caseAttach);
22
+
23
+    int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24
+
25
+    List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
+
27
+    CaseAttach queryAnnexById(Integer annexId);
28
+
29
+
30
+}

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java 查看文件

25
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
25
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
 
26
 
27
     CaseAttach queryAnnexById(Integer annexId);
27
     CaseAttach queryAnnexById(Integer annexId);
28
+
29
+    /**
30
+     * 根据案件id和附件类型删除
31
+     * @param caseAppliId
32
+     * @param annexType
33
+     */
34
+    void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
28
 }
35
 }

+ 40
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java 查看文件

9
 import com.ruoyi.common.utils.SmsUtils;
9
 import com.ruoyi.common.utils.SmsUtils;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
11
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
11
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
12
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
12
 import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
13
 import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
13
 import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
14
 import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
14
 import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
15
 import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
42
     @Autowired
43
     @Autowired
43
     private CaseAffiliateMapper caseAffiliateMapper;
44
     private CaseAffiliateMapper caseAffiliateMapper;
44
     @Autowired
45
     @Autowired
46
+    private CaseAttachMapper caseAttachMapper;
47
+    @Autowired
48
+    private CaseAttachLogMapper caseAttachLogMapper;
49
+    @Autowired
45
     private SmsRecordMapper smsRecordMapper;
50
     private SmsRecordMapper smsRecordMapper;
46
     @Override
51
     @Override
47
     public int insert(CaseApplication caseApplicationLog) {
52
     public int insert(CaseApplication caseApplicationLog) {
123
 
128
 
124
                 // 更新相关人员主表
129
                 // 更新相关人员主表
125
                 if(CollectionUtil.isNotEmpty(affiliateLogList)){
130
                 if(CollectionUtil.isNotEmpty(affiliateLogList)){
131
+                    caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
126
                     for (CaseAffiliate caseAffiliate : affiliateLogList) {
132
                     for (CaseAffiliate caseAffiliate : affiliateLogList) {
127
-                       caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
133
+                        caseAffiliate.setCaseAppliId(vo.getCaseId());
134
+
135
+                    }
136
+                    caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
137
+                }
138
+                // // 根据caseLogId查询案件记录附件表
139
+                CaseApplication caseApplication = new CaseApplication();
140
+                caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
141
+                caseApplication.setAnnexType(2);
142
+                List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
143
+                // 更新记录附件表
144
+                if(CollectionUtil.isNotEmpty(attachLogList)){
145
+                    caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
146
+                    for (CaseAttach caseAttach : attachLogList) {
147
+                        caseAttach.setCaseAppliId(vo.getCaseId());
148
+                        caseAttachMapper.save(caseAttach);
128
                     }
149
                     }
129
                 }
150
                 }
130
              //   caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
151
              //   caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
330
         // 根据caseLogId查询相关人员表
351
         // 根据caseLogId查询相关人员表
331
         List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
352
         List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
332
 
353
 
354
+
333
         // 更新案件主表
355
         // 更新案件主表
334
         caseApplicationMapper.updataCaseApplication(caseApplicationLog);
356
         caseApplicationMapper.updataCaseApplication(caseApplicationLog);
335
 
357
 
336
         // 更新相关人员主表
358
         // 更新相关人员主表
337
         if(CollectionUtil.isNotEmpty(affiliateLogList)){
359
         if(CollectionUtil.isNotEmpty(affiliateLogList)){
360
+            caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
338
             for (CaseAffiliate caseAffiliate : affiliateLogList) {
361
             for (CaseAffiliate caseAffiliate : affiliateLogList) {
339
-                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
362
+                caseAffiliate.setCaseAppliId(vo.getCaseId());
363
+
364
+            }
365
+            caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
366
+        }
367
+        // // 根据caseLogId查询案件记录附件表
368
+        CaseApplication caseApplication = new CaseApplication();
369
+        caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
370
+        caseApplication.setAnnexType(2);
371
+        List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
372
+        // 更新记录附件表
373
+        if(CollectionUtil.isNotEmpty(attachLogList)){
374
+            caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
375
+            for (CaseAttach caseAttach : attachLogList) {
376
+                caseAttach.setCaseAppliId(vo.getCaseId());
377
+                caseAttachMapper.save(caseAttach);
340
             }
378
             }
341
         }
379
         }
342
        // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
380
        // caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);

+ 19
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 查看文件

116
     private CaseApplicationLogMapper caseApplicationLogMapper;
116
     private CaseApplicationLogMapper caseApplicationLogMapper;
117
     @Autowired
117
     @Autowired
118
     private CaseAffiliateLogMapper caseAffiliateLogMapper;
118
     private CaseAffiliateLogMapper caseAffiliateLogMapper;
119
+    @Autowired
120
+    private CaseAttachLogMapper caseAttachLogMapper;
119
 
121
 
120
     // 手机号正则
122
     // 手机号正则
121
     private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
123
     private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
1072
 
1074
 
1073
         }
1075
         }
1074
         List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
1076
         List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
1075
-        if (caseAttachList != null && caseAttachList.size() > 0) {
1077
+        // 立案申请状态直接修改主表信息
1078
+            if (caseAttachList != null && caseAttachList.size() > 0
1079
+                    && caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
1076
             for (CaseAttach caseAttach : caseAttachList) {
1080
             for (CaseAttach caseAttach : caseAttachList) {
1077
                 caseAttach.setCaseAppliId(caseApplication.getId());
1081
                 caseAttach.setCaseAppliId(caseApplication.getId());
1078
                 caseAttachMapper.updateCaseAttach(caseAttach);
1082
                 caseAttachMapper.updateCaseAttach(caseAttach);
1094
         ThreadPoolUtil.execute(() -> {
1098
         ThreadPoolUtil.execute(() -> {
1095
             caseApplication.setCaseAppliId(caseApplication.getId());
1099
             caseApplication.setCaseAppliId(caseApplication.getId());
1096
             int insertRow = caseApplicationLogMapper.insert(caseApplication);
1100
             int insertRow = caseApplicationLogMapper.insert(caseApplication);
1097
-            if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
1098
-                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1099
-                // 插入案件日志人员相关表
1100
-                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1101
+            if (insertRow != 0 ) {
1102
+                if( CollectionUtil.isNotEmpty(caseAffiliates)) {
1103
+                    caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1104
+                    // 插入案件日志人员相关表
1105
+                    caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1106
+                }
1107
+                if(CollectionUtil.isNotEmpty(caseAttachList)) {
1108
+                    // 插入日志附件表
1109
+                    for (CaseAttach caseAttach : caseAttachList) {
1110
+                        caseAttach.setCaseAppliLogId(caseApplication.getId());
1111
+                        caseAttachLogMapper.updateCaseAttach(caseAttach);
1112
+                    }
1113
+
1114
+                }
1101
             }
1115
             }
1102
         });
1116
         });
1103
 
1117
 

+ 3
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml 查看文件

150
             #{item}
150
             #{item}
151
         </foreach>
151
         </foreach>
152
     </delete>
152
     </delete>
153
+    <delete id="deleteByCaseId">
154
+        delete from case_affiliate where case_appli_id = #{caseAppliId}
155
+    </delete>
153
 
156
 
154
 
157
 
155
 </mapper>
158
 </mapper>

+ 101
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachLogMapper.xml 查看文件

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.CaseAttachLogMapper">
6
+    <resultMap type="CaseAttach" id="CaseAttachResult">
7
+        <id     property="annexId"       column="annex_id"      />
8
+        <result property="caseAppliId"       column="case_appli_id"      />
9
+        <result property="annexName"     column="annex_name"    />
10
+        <result property="annexPath"     column="annex_path"    />
11
+        <result property="annexType"     column="annex_type"    />
12
+        <result property="note"     column="note"    />
13
+        <result property="userId"     column="use_id"    />
14
+        <result property="userName"     column="use_account"    />
15
+        <result property="sealStatus"     column="seal_status"    />
16
+        <result property="caseAppliLogId"     column="case_appli_log_id"    />
17
+    </resultMap>
18
+    <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
19
+        INSERT INTO case_attach_log (case_appli_log_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
20
+        VALUES (#{caseAppliLogId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
21
+    </insert>
22
+    <delete id="deleteByFileIds">
23
+        delete from case_attach_log
24
+        where annex_id in
25
+        <foreach collection="ids" item="id" open="(" separator="," close=")">
26
+            #{id}
27
+        </foreach>
28
+    </delete>
29
+
30
+    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
31
+        select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
32
+        from case_attach_log
33
+        where case_appli_log_id =#{id}
34
+    </select>
35
+
36
+    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
37
+        select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
38
+        from case_attach_log
39
+        <where>
40
+            <if test="caseAppliLogId != null ">
41
+                AND case_appli_log_id = #{caseAppliLogId}
42
+            </if>
43
+            <if test="annexType != null ">
44
+                AND annex_type = #{annexType}
45
+            </if>
46
+        </where>
47
+    </select>
48
+
49
+    <select id="queryCaseAttachList" resultMap="CaseAttachResult">
50
+        select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
51
+        from case_attach_log
52
+        <where>
53
+            <if test="caseLogId != null ">
54
+                AND case_appli_log_id = #{caseLogId}
55
+            </if>
56
+            <if test="annexType != null ">
57
+                AND annex_type = #{annexType}
58
+            </if>
59
+            <if test="annexTypeList != null and annexTypeList.size() > 0">
60
+                and annex_type in
61
+                <foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
62
+                    #{annexType}
63
+                </foreach>
64
+            </if>
65
+        </where>
66
+    </select>
67
+    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
68
+        select case_appli_log_id caseAppliLogId,annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
69
+        from case_attach_log
70
+        <where>
71
+            <if test="annexId != null ">
72
+                AND annex_id = #{annexId}
73
+            </if>
74
+        </where>
75
+    </select>
76
+
77
+    <update id="updateCaseAttach" parameterType="CaseAttach">
78
+        update case_attach_log
79
+        set
80
+            case_appli_log_id= #{caseAppliLogId}
81
+        where annex_id = #{annexId}
82
+    </update>
83
+
84
+    <update id="updateCaseAttachBycaseid" parameterType="CaseAttach" >
85
+        update case_attach_log
86
+        <set>
87
+            <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
88
+            <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
89
+        </set>
90
+        <where>
91
+            <if test="caseAppliId != null ">
92
+                AND case_appli_log_id  = #{caseAppliLogId}
93
+            </if>
94
+            <if test="annexType != null ">
95
+                AND annex_type  = #{annexType}
96
+            </if>
97
+        </where>
98
+    </update>
99
+
100
+
101
+</mapper>

+ 5
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml 查看文件

25
             #{id}
25
             #{id}
26
         </foreach>
26
         </foreach>
27
     </delete>
27
     </delete>
28
+    <delete id="deleteByCasedIdAndType">
29
+        delete from case_attach
30
+        where case_appli_id = #{caseAppliId}
31
+        and annex_type = #{annexType}
32
+    </delete>
28
 
33
 
29
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
34
     <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
30
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
35
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account