Преглед на файлове

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

qtz преди 2 години
родител
ревизия
32a0937e84

+ 33
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Целия файл

@@ -263,6 +263,39 @@ public class CaseApplication  extends BaseEntity {
263 263
 
264 264
     private List<Integer> caseStatusList;
265 265
 
266
+    private List<Integer> annexTypeList;
267
+
268
+    private Integer annexType;
269
+
270
+    public Integer getAnnexType() {
271
+        return annexType;
272
+    }
273
+
274
+    public void setAnnexType(Integer annexType) {
275
+        this.annexType = annexType;
276
+    }
277
+
278
+    public List<Integer> getAnnexTypeList() {
279
+        return annexTypeList;
280
+    }
281
+
282
+    public void setAnnexTypeList(List<Integer> annexTypeList) {
283
+        this.annexTypeList = annexTypeList;
284
+    }
285
+
286
+    /**
287
+     * 案件附件列表
288
+     */
289
+    private List<CaseAttach> caseAttachList;
290
+
291
+    public List<CaseAttach> getCaseAttachList() {
292
+        return caseAttachList;
293
+    }
294
+
295
+    public void setCaseAttachList(List<CaseAttach> caseAttachList) {
296
+        this.caseAttachList = caseAttachList;
297
+    }
298
+
266 299
     public List<Integer> getCaseStatusList() {
267 300
         return caseStatusList;
268 301
     }

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java Целия файл

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper;
2 2
 
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
3 4
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
4 5
 
5 6
 import java.util.List;
@@ -8,4 +9,9 @@ public interface CaseAttachMapper {
8 9
     int save(CaseAttach caseAttach);
9 10
 
10 11
     List<CaseAttach> queryAnnexPathByCaseId(Long id);
12
+
13
+    List<CaseAttach> queryCaseAttachList(CaseApplication caseApplication);
14
+
15
+
16
+    int updateCaseAttach(CaseAttach caseAttach);
11 17
 }

+ 40
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Целия файл

@@ -6,14 +6,8 @@ import com.ruoyi.common.utils.DateUtils;
6 6
 import com.ruoyi.common.utils.SmsUtils;
7 7
 import com.ruoyi.common.utils.StringUtils;
8 8
 import com.ruoyi.common.utils.bean.BeanUtils;
9
-import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
10
-import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
11
-import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
12
-import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
13
-import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
14
-import com.ruoyi.wisdomarbitrate.mapper.ArbitratorMapper;
15
-import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
16
-import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
9
+import com.ruoyi.wisdomarbitrate.domain.*;
10
+import com.ruoyi.wisdomarbitrate.mapper.*;
17 11
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
18 12
 import org.springframework.beans.factory.annotation.Autowired;
19 13
 import org.springframework.stereotype.Service;
@@ -42,6 +36,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
42 36
     @Autowired
43 37
     private ArbitrateRecordMapper arbitrateRecordMapper;
44 38
 
39
+    @Autowired
40
+    private CaseAttachMapper caseAttachMapper;
41
+
42
+
43
+
45 44
 
46 45
     @Override
47 46
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
@@ -69,6 +68,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
69 68
             caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
70 69
         }
71 70
 
71
+        List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
72
+        if(caseAttachList!=null&&caseAttachList.size()>0){
73
+            for (CaseAttach caseAttach : caseAttachList){
74
+                caseAttach.setCaseAppliId(caseApplication.getId());
75
+                caseAttachMapper.updateCaseAttach(caseAttach);
76
+            }
77
+
78
+        }
79
+
72 80
         return rows;
73 81
     }
74 82
 
@@ -118,6 +126,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
118 126
         arbitrateRecord.setCaseAppliId(caseApplication.getId());
119 127
         ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
120 128
 
129
+//        CaseAttach caseAttachSelect = new CaseAttach();
130
+//        caseAttachSelect.setCaseAppliId(caseApplication.getId());
131
+//        caseAttachSelect.setAnnexType(2);
132
+
133
+        List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication);
134
+        if (caseAttachList != null && caseAttachList.size() > 0) {
135
+            for (CaseAttach caseAttach : caseAttachList) {
136
+                String annexName = caseAttach.getAnnexName();
137
+                String prefix = "/profile";
138
+                int startIndex = annexName.indexOf(prefix);
139
+                startIndex += prefix.length();
140
+                String annexPath = "/uploadPath" + annexName.substring(startIndex);
141
+                caseAttach.setAnnexPath(annexPath);
142
+                int startIndexnew = annexName.lastIndexOf("/");
143
+                if(startIndexnew!=-1){
144
+                    String annexNamenew  = annexName.substring(startIndexnew+1);
145
+                    caseAttach.setAnnexName(annexNamenew);
146
+                }
147
+
148
+
149
+            }
150
+        }
151
+        caseApplicationselect.setCaseAttachList(caseAttachList);
152
+
121 153
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
122 154
         if(caseAffiliatListeselect!=null){
123 155
             StringBuffer applicantName = new StringBuffer();

+ 7
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Целия файл

@@ -98,11 +98,13 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
98 98
                     .build();
99 99
             int count = caseAttachMapper.save(caseAttach);
100 100
             if (count > 0) {
101
-                //修改案件状态
102
-                CaseApplication caseApplication = new CaseApplication();
103
-                caseApplication.setId(id);
104
-                caseApplication.setCaseStatus(4);
105
-                caseApplicationMapper.submitCaseApplication(caseApplication);
101
+                if(id!=null){
102
+                    //修改案件状态
103
+                    CaseApplication caseApplication = new CaseApplication();
104
+                    caseApplication.setId(id);
105
+                    caseApplication.setCaseStatus(4);
106
+                    caseApplicationMapper.submitCaseApplication(caseApplication);
107
+                }
106 108
                 return AjaxResult.success("上传成功");
107 109
             }
108 110
         } catch (IOException e) {

+ 29
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Целия файл

@@ -22,4 +22,33 @@
22 22
         from case_attach
23 23
         where case_appli_id =#{id}
24 24
     </select>
25
+
26
+    <select id="queryCaseAttachList" resultMap="CaseAttachResult">
27
+        select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
28
+        from case_attach
29
+        <where>
30
+            <if test="id != null ">
31
+                AND case_appli_id = #{id}
32
+            </if>
33
+            <if test="annexType != null ">
34
+                AND annex_type = #{annexType}
35
+            </if>
36
+            <if test="annexTypeList != null and annexTypeList.size() > 0">
37
+                and annex_type in
38
+                <foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
39
+                    #{annexType}
40
+                </foreach>
41
+            </if>
42
+        </where>
43
+    </select>
44
+
45
+    <update id="updateCaseAttach" parameterType="CaseAttach">
46
+        update case_attach
47
+        set
48
+        case_appli_id= #{caseAppliId}
49
+        where annexId = #{annex_id}
50
+    </update>
51
+
52
+
53
+
25 54
 </mapper>