diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index b514c80..14b2cf6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -419,4 +419,8 @@ public class CaseApplication extends BaseEntity { private Integer pendingStatus; /** e签宝流程id */ private String signFlowId; + /** + * 登录用户名 + */ + private String userName; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 0ecd151..16d3c2a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -12,7 +12,6 @@ import java.util.List; public interface CaseApplicationMapper { List selectCaseApplicationList(CaseApplication caseApplication); - List selectCaseApplicationList1(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index c9cb2bc..11da1f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -40,6 +40,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; +import tk.mybatis.mapper.entity.Example; + import java.io.*; import java.math.BigDecimal; import java.math.RoundingMode; @@ -138,6 +140,68 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 被申请人字段校验 private static final String[] dectborAffiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress", "residenAffili","responSex","responBirth","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; + /** + * 案件列表查询 + * + * @param req + * @return + */ +// public List list(CaseApplication req) { +// // 查询的案件状态 +// List caseStatusList=new ArrayList<>(); +// // 根据用户查询角色 +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// // 根据id查询用户 +// SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); +// List roles = sysUser.getRoles(); +// req.setUserName(sysUser.getUserName()); +// if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { +// startPage(); +// List list = caseApplicationMapper.list(req, null,null); +// // 设置申请人被申请人及签名按钮限 +// // setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles); +// return list; +// } +// if(CollectionUtil.isEmpty(roles) ){ +// throw new RuntimeException("用户未分配角色,请联系管理员"); +// } +// List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); +// +// // 流程名称分组 +// Map flowNameMap = allCaseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getCaseStatusName, MsCaseFlow::getSort, (k1, k2) -> k2)); +// +// // 是否查询所有 +// boolean isSelectAll = false; +// +// for (SysRole role : roles) { +// if(StrUtil.isNotEmpty(role.getRoleName())){ +// if(StrUtil.contains(role.getRoleName(),"财务") +// ||StrUtil.contains(role.getRoleName(),"法律顾问") +// ||StrUtil.contains(role.getRoleName(),"部门长") +// ){ +// isSelectAll=true; +// roleIds=null; +// } +// if(StrUtil.equals(role.getRoleName(),"调解员")) { +// req.setMediatorId(String.valueOf(sysUser.getUserId())); +// } +// } +// } +// if(!isSelectAll){ +// req.setUserId(String.valueOf(loginUser.getUserId())); +// } +// if(req.getMediationMethod()!=null){ +// // 查询视频审理 +// req.setCaseFlowId(9); +// } +// startPage(); +// +// // 查询案件列表 +// List list = caseApplicationMapper.list(req, caseFlowIds,roleIds); +// // 设置申请人被申请人及签名按钮限 +// // setAfflicate(flowNameMap,list,loginUser.getUserId(),roles); +// return list; +// } /** * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 @@ -261,7 +325,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 // return caseApplicationMapper.selectCaseApplicationList(caseApplication); - List caseApplications = caseApplicationMapper.selectCaseApplicationList1(caseApplication); + List caseApplications = caseApplicationMapper.selectCaseApplicationList(caseApplication); if(caseApplications!=null&&caseApplications.size()>0){ for(CaseApplication caseApplicationsel : caseApplications){ Integer caseStatus = caseApplicationsel.getCaseStatus(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 1295540..2c568b0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -41,6 +41,7 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -97,17 +98,14 @@ public class CaseZipImportImpl { @Transactional public AjaxResult zipImport(MultipartFile file, Long templateId) { UUID uuid = UUID.randomUUID(); - // todo + String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + uuid + "/"; -// String targetPath = "D:/home/ruoyi/uploadPath/upload/unzipFile/"+uuid+ "/"; File zipFile = null; InputStream ins = null; try { ins = file.getInputStream(); //上传的压缩包保存的路径 - // todo String savePath = "/home/ruoyi/uploadPath/upload/zipFile/"; -// String savePath = "D:/home/ruoyi/uploadPath/upload/zipFile/"; String saveName = uuid + "_" + file.getOriginalFilename(); zipFile = new File(savePath + saveName); inputChangeToFile(ins, zipFile); @@ -121,7 +119,6 @@ public class CaseZipImportImpl { throw new ServiceException("解压失败"); } // 查询抓取规则 - // todo 批次需要再上传压缩包时用户填写 List fatchRuleList = fatchRuleMapper.listByTemplateId(templateId); if (CollectionUtil.isEmpty(fatchRuleList)) { throw new ServiceException("未设置抓取规则"); @@ -166,18 +163,19 @@ public class CaseZipImportImpl { if (!directory.isDirectory() || directory.listFiles() == null) { throw new ServiceException("未找到文件夹"); } - Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if (maxBatchNumber == null) { - maxBatchNumber = 1; + Integer batchNumber = caseApplicationMapper.selectBatchNumberLike(); + AtomicInteger maxBatchNumber = new AtomicInteger(); + if (batchNumber == null) { + maxBatchNumber.set(1); } else { - maxBatchNumber = maxBatchNumber + 1; + maxBatchNumber.set(batchNumber+1); } - File[] files = directory.listFiles(); + File[] files = directory.listFiles(); CaseZipImportTask caseZipImportTask = null; try { - caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber); + caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber.get()); } catch (Exception e) { return error("导入失败"); } @@ -298,44 +296,7 @@ public class CaseZipImportImpl { // Function, Integer> function = userMapper::batchSave; // execList.add(new MultipleThreadListParam(function, addUsers)); // } -// if (CollectionUtil.isNotEmpty(userRoleList)) { -// Function, Integer> function = userRoleMapper::batchUserRole; -// execList.add(new MultipleThreadListParam(function, userRoleList)); -// -// } -// if (CollectionUtil.isNotEmpty(sysDepts)) { -// Function, Integer> function = sysDeptMapper::batchSave; -// execList.add(new MultipleThreadListParam(function, sysDepts)); -// -// } -// if (CollectionUtil.isNotEmpty(caseApplications)) { -// Function, Integer> function = caseApplicationMapper::batchSave; -// execList.add(new MultipleThreadListParam(function, caseApplications)); -// Function, Integer> functionLog = caseApplicationLogMapper::batchSave; -// execList.add(new MultipleThreadListParam(functionLog, caseApplications)); -// -// } -// if (CollectionUtil.isNotEmpty(caseAffiliates)) { -// Function, Integer> function = caseAffiliateMapper::batchCaseAffiliate; -// execList.add(new MultipleThreadListParam(function, caseAffiliates)); -// Function, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate; -// execList.add(new MultipleThreadListParam(functionLog, caseAffiliates)); -// } -// if (CollectionUtil.isNotEmpty(caseAttachs)) { -// Function, Integer> function = caseAttachMapper::batchSave; -// execList.add(new MultipleThreadListParam(function, caseAttachs)); -// Function, Integer> functionLog = caseAttachLogMapper::batchSave; -// execList.add(new MultipleThreadListParam(functionLog, caseAttachs)); -// } -// if (CollectionUtil.isNotEmpty(columnValueList)) { -// Function, Integer> function = columnValueMapper::batchSave; -// execList.add(new MultipleThreadListParam(function, columnValueList)); -// Function, Integer> functionLog = columnValueLogMapper::batchSave; -// execList.add(new MultipleThreadListParam(functionLog, columnValueList)); -// } -// if (CollectionUtil.isNotEmpty(execList)) { -// MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()])); -// } + // 多线程执行 ThreadPoolUtil.execute(() -> { try { @@ -414,6 +375,7 @@ public class CaseZipImportImpl { for (Map.Entry entry : andConvertPDF.entrySet()) { if(entry.getKey().contains(mapKey)){ fileURL=entry.getValue(); + break; } } if (StrUtil.isEmpty(fileURL)) { @@ -808,8 +770,8 @@ public class CaseZipImportImpl { dept.setOrderNum(1); dept.setStatus("0"); dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); + // dept.setCreateBy(getUsername()); + // dept.setUpdateBy(getUsername()); dept.setDeptId(Long.valueOf(IdWorkerUtil.getId())); sysDepts.add(dept); deptMap.put(dept.getDeptName(), dept.getDeptId()); @@ -897,7 +859,7 @@ public class CaseZipImportImpl { smsSendRecord.setSendTime(new Date()); String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); + // smsSendRecord.setCreateBy(getUsername()); smsSendRecords.add(smsSendRecord); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java index b64d55d..4aff732 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java @@ -181,6 +181,7 @@ public class OCRUtils { // 开始为空结束不为空 int endContIndex = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder()); if (endContIndex != -1) { + // todo String substring = text.substring(0, endContIndex); fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 08861cf..637ba5d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -58,7 +58,7 @@ - select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method, t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims, t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable, @@ -547,115 +547,7 @@ order by c.create_time desc,c.case_num desc - - 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 '无审理方式' @@ -860,7 +752,7 @@ order by c.case_num desc - SELECT DISTINCT c.batch_number ,c.arbitrat_method ,c.arbitrator_name , c.arbitrator_id ,a.identity_type ,a.name ,a.application_organ_id as applicationOrganId, a.application_organ_name as applicantName, @@ -879,7 +771,7 @@ order by c.batch_number desc - SELECT DISTINCT t1.batch_number ,t1.arbitrat_method ,t1.arbitrator_name , t1.arbitrator_id ,t1.identity_type ,t1.name ,t1.applicationOrganId , t1.applicantName,t1.arbitratMethodName @@ -1039,7 +931,7 @@ - select count(1) from case_application c @@ -1047,7 +939,7 @@ - + insert into case_application( id , case_name , @@ -1195,7 +1087,7 @@ ; - + update case_application case_subject_amount = #{caseSubjectAmount}, @@ -1238,7 +1130,7 @@ where id = #{id} - + update case_application case_status = #{caseStatus}, @@ -1290,7 +1182,7 @@ update case_application set version = #{version} where id = #{id} - + delete from case_application where id = #{id} @@ -1316,7 +1208,7 @@ ; - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' @@ -1394,7 +1286,7 @@ - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式'