Ver código fonte

压缩包导入修改

18792927508 2 anos atrás
pai
commit
1ea9767674

+ 12
- 13
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java Ver arquivo

@@ -92,7 +92,7 @@ public class CaseZipImportImpl {
92 92
     // 申请人角色id
93 93
     private long roleId;
94 94
     private Integer maxCaseNum;
95
-    private Integer maxBatchNumber;
95
+
96 96
 
97 97
 @Transactional
98 98
     public AjaxResult zipImport(MultipartFile file, Long templateId) {
@@ -166,10 +166,18 @@ public class CaseZipImportImpl {
166 166
         if (!directory.isDirectory() || directory.listFiles() == null) {
167 167
             throw new ServiceException("未找到文件夹");
168 168
         }
169
+    Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
170
+    if (maxBatchNumber == null) {
171
+        maxBatchNumber = 1;
172
+
173
+    } else {
174
+        maxBatchNumber = maxBatchNumber + 1;
175
+
176
+    }
169 177
         File[] files = directory.listFiles();
170 178
     CaseZipImportTask caseZipImportTask = null;
171 179
     try {
172
-        caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
180
+        caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber);
173 181
     } catch (Exception e) {
174 182
         return error("导入失败");
175 183
     }
@@ -191,7 +199,7 @@ public class CaseZipImportImpl {
191 199
 
192 200
     }
193 201
     @Transactional
194
-    public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, String> fatchMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser) {
202
+    public CaseApplication buildCaseInfo(File file, Long templateId, List<FatchRule> fatchRuleList, Map<String, List<FatchRule>> fatchRuleMap, Map<String, String> fatchMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, Map<String, Long> deptMap,LoginUser loginUser, Integer maxBatchNumber) {
195 203
         // fileMap<caseId, List<File>>
196 204
         Map<String, String> fileMap = findFile(file, fatchRuleList);
197 205
         if (fileMap != null && fileMap.size()> 0) {
@@ -248,16 +256,7 @@ public class CaseZipImportImpl {
248 256
                 caseApplication.setCaseAppliId(caseApplication.getId());
249 257
 
250 258
                 // 设置批号
251
-                if (caseApplication.getBatchNumber()==null) {
252
-                    maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
253
-                    if (maxBatchNumber == null) {
254
-                        maxBatchNumber = 1;
255
-                        caseApplication.setBatchNumber(maxBatchNumber);
256
-                    } else {
257
-                        maxBatchNumber = maxBatchNumber + 1;
258
-                        caseApplication.setBatchNumber(maxBatchNumber);
259
-                    }
260
-                }
259
+                caseApplication.setBatchNumber(maxBatchNumber);
261 260
                 // 设置编号
262 261
                 String maxCaseNumStr = generateCaseNum();
263 262
                 caseApplication.setCaseNum(maxCaseNumStr);

+ 4
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java Ver arquivo

@@ -32,8 +32,9 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
32 32
     private File[] files;
33 33
     private Map<String, Long> deptMap;
34 34
     private LoginUser loginUser;
35
+    private Integer maxBatchNumber;
35 36
 
36
-    public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List<FatchRule> fatchRuleList, Map<String, String> fatchMap, Map<String, List<FatchRule>> fatchRuleMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, File[] files, Map<String, Long> deptMap, LoginUser loginUser) {
37
+    public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List<FatchRule> fatchRuleList, Map<String, String> fatchMap, Map<String, List<FatchRule>> fatchRuleMap, Map<String, SysUser> userMap, List<SysDictData> dictDataList, File[] files, Map<String, Long> deptMap, LoginUser loginUser,Integer maxBatchNumber) {
37 38
         this.caseZipImportImpl = caseZipImportImpl;
38 39
         this.templateId = templateId;
39 40
         this.fatchRuleList = fatchRuleList;
@@ -44,6 +45,7 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
44 45
         this.files = files;
45 46
         this.deptMap = deptMap;
46 47
         this.loginUser = loginUser;
48
+        this.maxBatchNumber = maxBatchNumber;
47 49
     }
48 50
 
49 51
     @Override
@@ -54,7 +56,7 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
54 56
                 if (file1.isDirectory() && file1.listFiles() != null) {
55 57
 
56 58
                     for (File file2 : file1.listFiles()) {
57
-                        CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser);
59
+                        CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser,maxBatchNumber);
58 60
                         if (caseApplication != null) {
59 61
                             caseApplications.add(caseApplication);
60 62
                         }

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver arquivo

@@ -803,7 +803,7 @@
803 803
     </select>
804 804
 
805 805
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
806
-        select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
806
+        select DISTINCT(c.id) id,0 as pendingStatus,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
807 807
         CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
808 808
         ELSE '无审理方式'
809 809
         END arbitratMethodName,