发版合并 #363

Merged
wangqiong123 merged 129 commits from dev into pro 2024-06-03 02:26:01 +00:00
3 changed files with 17 additions and 16 deletions
Showing only changes of commit 1ea9767674 - Show all commits
@@ -92,7 +92,7 @@ public class CaseZipImportImpl {
// 申请人角色id
private long roleId;
private Integer maxCaseNum;
private Integer maxBatchNumber;
@Transactional
public AjaxResult zipImport(MultipartFile file, Long templateId) {
@@ -166,10 +166,18 @@ public class CaseZipImportImpl {
if (!directory.isDirectory() || directory.listFiles() == null) {
throw new ServiceException("未找到文件夹");
}
Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
if (maxBatchNumber == null) {
maxBatchNumber = 1;
} else {
maxBatchNumber = maxBatchNumber + 1;
}
File[] files = directory.listFiles();
CaseZipImportTask caseZipImportTask = null;
try {
caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber);
} catch (Exception e) {
return error("导入失败");
}
@@ -191,7 +199,7 @@ public class CaseZipImportImpl {
}
@Transactional
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) {
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) {
// fileMap<caseId, List<File>>
Map<String, String> fileMap = findFile(file, fatchRuleList);
if (fileMap != null && fileMap.size()> 0) {
@@ -248,16 +256,7 @@ public class CaseZipImportImpl {
caseApplication.setCaseAppliId(caseApplication.getId());
// 设置批号
if (caseApplication.getBatchNumber()==null) {
maxBatchNumber = caseApplicationMapper.selectBatchNumberLike();
if (maxBatchNumber == null) {
maxBatchNumber = 1;
caseApplication.setBatchNumber(maxBatchNumber);
} else {
maxBatchNumber = maxBatchNumber + 1;
caseApplication.setBatchNumber(maxBatchNumber);
}
}
caseApplication.setBatchNumber(maxBatchNumber);
// 设置编号
String maxCaseNumStr = generateCaseNum();
caseApplication.setCaseNum(maxCaseNumStr);
@@ -32,8 +32,9 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
private File[] files;
private Map<String, Long> deptMap;
private LoginUser loginUser;
private Integer maxBatchNumber;
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) {
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) {
this.caseZipImportImpl = caseZipImportImpl;
this.templateId = templateId;
this.fatchRuleList = fatchRuleList;
@@ -44,6 +45,7 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
this.files = files;
this.deptMap = deptMap;
this.loginUser = loginUser;
this.maxBatchNumber = maxBatchNumber;
}
@Override
@@ -54,7 +56,7 @@ public class CaseZipImportTask implements Callable<List<CaseApplication>> {
if (file1.isDirectory() && file1.listFiles() != null) {
for (File file2 : file1.listFiles()) {
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser);
CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser,maxBatchNumber);
if (caseApplication != null) {
caseApplications.add(caseApplication);
}
@@ -803,7 +803,7 @@
</select>
<select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
select DISTINCT(c.id) id,0 as pendingStatus,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,