|
|
@@ -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);
|