Explorar el Código

实现立案申请上传附件功能

qitz hace 2 años
padre
commit
e97418f979

+ 33
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Ver fichero

263
 
263
 
264
     private List<Integer> caseStatusList;
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
     public List<Integer> getCaseStatusList() {
299
     public List<Integer> getCaseStatusList() {
267
         return caseStatusList;
300
         return caseStatusList;
268
     }
301
     }

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java Ver fichero

1
 package com.ruoyi.wisdomarbitrate.mapper;
1
 package com.ruoyi.wisdomarbitrate.mapper;
2
 
2
 
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
3
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
4
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
4
 
5
 
5
 import java.util.List;
6
 import java.util.List;
8
     int save(CaseAttach caseAttach);
9
     int save(CaseAttach caseAttach);
9
 
10
 
10
     List<CaseAttach> queryAnnexPathByCaseId(Long id);
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 Ver fichero

6
 import com.ruoyi.common.utils.SmsUtils;
6
 import com.ruoyi.common.utils.SmsUtils;
7
 import com.ruoyi.common.utils.StringUtils;
7
 import com.ruoyi.common.utils.StringUtils;
8
 import com.ruoyi.common.utils.bean.BeanUtils;
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
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
11
 import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
18
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.stereotype.Service;
13
 import org.springframework.stereotype.Service;
42
     @Autowired
36
     @Autowired
43
     private ArbitrateRecordMapper arbitrateRecordMapper;
37
     private ArbitrateRecordMapper arbitrateRecordMapper;
44
 
38
 
39
+    @Autowired
40
+    private CaseAttachMapper caseAttachMapper;
41
+
42
+
43
+
45
 
44
 
46
     @Override
45
     @Override
47
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
46
     public List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication) {
69
             caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
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
         return rows;
80
         return rows;
73
     }
81
     }
74
 
82
 
118
         arbitrateRecord.setCaseAppliId(caseApplication.getId());
126
         arbitrateRecord.setCaseAppliId(caseApplication.getId());
119
         ArbitrateRecord arbitrateRecordselect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
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
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
153
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
122
         if(caseAffiliatListeselect!=null){
154
         if(caseAffiliatListeselect!=null){
123
             StringBuffer applicantName = new StringBuffer();
155
             StringBuffer applicantName = new StringBuffer();

+ 7
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Ver fichero

98
                     .build();
98
                     .build();
99
             int count = caseAttachMapper.save(caseAttach);
99
             int count = caseAttachMapper.save(caseAttach);
100
             if (count > 0) {
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
                 return AjaxResult.success("上传成功");
108
                 return AjaxResult.success("上传成功");
107
             }
109
             }
108
         } catch (IOException e) {
110
         } catch (IOException e) {

+ 29
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml Ver fichero

22
         from case_attach
22
         from case_attach
23
         where case_appli_id =#{id}
23
         where case_appli_id =#{id}
24
     </select>
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
 </mapper>
54
 </mapper>