From b718daf58eec8845787de29eaeb25489ab0b6652 Mon Sep 17 00:00:00 2001
From: zhouxiantao <1026371446@qq.com>
Date: Sun, 08 Sep 2024 16:03:38 +0800
Subject: [PATCH] 小程序办件进度
---
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 103 insertions(+), 13 deletions(-)
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java
index 7cc943c..4fd77c6 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/service/CaseInfoService.java
@@ -4,15 +4,11 @@
import cn.huge.base.common.utils.DateUtils;
import cn.huge.base.common.utils.IdUtils;
import cn.huge.base.common.utils.ObjectUtils;
-import cn.huge.module.cases.domain.dto.CaseInfoDTO;
+import cn.huge.module.cases.domain.dto.*;
-import cn.huge.module.cases.domain.dto.CaseInfoWeChatDTO;
-import cn.huge.module.cases.domain.dto.CasePersonWechatDTO;
-import cn.huge.module.cases.domain.dto.RegisterSaveDTO;
import cn.huge.module.cases.domain.po.CaseAgent;
import cn.huge.module.cases.domain.po.CaseInfoUnfold;
import cn.huge.module.cases.domain.po.CasePerson;
-import cn.huge.module.client.api.SysClient;
import cn.huge.module.client.api.impl.CustClientImpl;
import cn.huge.module.client.api.impl.SysClientImpl;
import cn.huge.module.client.api.impl.UtilsClientImpl;
@@ -26,10 +22,8 @@
import cn.huge.module.draft.service.CasedraftInfoService;
import cn.huge.module.mediate.dto.WechatBindCaseDTO;
import cn.huge.module.sys.dto.FileIdTypeInfoBaseDTO;
-import cn.huge.module.sys.dto.FileTypeInfoBaseDTO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.google.common.collect.Maps;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -386,9 +380,68 @@
String ids = idList.stream().map(String::valueOf).collect(Collectors.joining("','"));
ids = "'"+ ids + "'";
Map<String, Object> term = new HashMap<>();
+ term.put("mainId", caseId);
term.put("ownerIds", ids);
//查询所有附件
- List<FileIdTypeInfoBaseDTO> fileInfoList = sysClient.listIdTypeInfoByOwnerIdList(term, caseId);
+ List<FileIdTypeInfoBaseDTO> fileInfoList = sysClient.listIdTypeInfoByOwnerIdList(term);
+ for(FileIdTypeInfoBaseDTO fileInfo: fileInfoList){
+ if(caseId.equals(fileInfo.getOwnerId())){
+ caseInfoDTO.setFileInfoList(fileInfo.getFileList());
+ }
+ }
+ for(CasePerson casePerson: casePersonList){
+ //把附件根据编号放入
+ for(FileIdTypeInfoBaseDTO fileInfo: fileInfoList){
+ if(casePerson.getId().equals(fileInfo.getOwnerId())){
+ casePerson.setFileInfoList(fileInfo.getFileList());
+ }
+ }
+ }
+ for(CaseAgent caseAgent: caseAgentList){
+ for(FileIdTypeInfoBaseDTO fileInfo: fileInfoList){
+ if(caseAgent.getId().equals(fileInfo.getOwnerId())){
+ caseAgent.setFileInfoList(fileInfo.getFileList());
+ }
+ }
+ }
+ caseInfoDTO.setPersonList(casePersonList);
+ caseInfoDTO.setAgentList(caseAgentList);
+ }
+ return caseInfoDTO;
+ }
+
+ /**
+ * PC端-查询纠纷信息
+ * @param caseId 纠纷编号
+ * @return CaseInfo 纠纷信息
+ */
+ public CaseInfoDTO getCaseArchivesInfo(String caseId){
+ CaseInfo caseInfo = mapper.selectById(caseId);
+ CaseInfoDTO caseInfoDTO = new CaseInfoDTO();
+ if (ObjectUtils.isNotEmpty(caseInfo)) {
+
+ BeanUtils.copyProperties(caseInfo, caseInfoDTO);
+ //查询所有当事人
+ QueryWrapper<CasePerson> personQueryWrapper = new QueryWrapper<>();
+ personQueryWrapper.eq("case_id", caseId);
+ List<CasePerson> casePersonList = personService.list(personQueryWrapper);
+
+ //查询所有代理人
+ QueryWrapper<CaseAgent> caseAgentQueryWrapper = new QueryWrapper<>();
+ caseAgentQueryWrapper.eq("case_id", caseId);
+ List<CaseAgent> caseAgentList = agentService.list(caseAgentQueryWrapper);
+ List<String> idList = new ArrayList<>();
+
+ idList.add(caseId);
+ idList.addAll(casePersonList.stream().map(CasePerson::getId).collect(Collectors.toList()));
+ idList.addAll(caseAgentList.stream().map(CaseAgent::getId).collect(Collectors.toList()));
+ String ids = idList.stream().map(String::valueOf).collect(Collectors.joining("','"));
+ ids = "'"+ ids + "'";
+ Map<String, Object> term = new HashMap<>();
+ term.put("mainId", caseId);
+ term.put("ownerIds", ids);
+ //查询所有附件
+ List<FileIdTypeInfoBaseDTO> fileInfoList = sysClient.listIdTypeInfoByOwnerIdList(term);
for(FileIdTypeInfoBaseDTO fileInfo: fileInfoList){
if(caseId.equals(fileInfo.getOwnerId())){
caseInfoDTO.setFileInfoList(fileInfo.getFileList());
@@ -492,7 +545,10 @@
caseInfo.setInputWay(CaseBaseConsts.INPUT_WAY_1);
caseInfo.setCreateTime(nowDate);
caseInfo.setUpdateTime(nowDate);
+ caseInfo.setVisitTime(nowDate);
caseInfo.setDeleteStatus(BaseConsts.DELETE_STATUS_0);
+ caseInfo.setProcess(1);
+ caseInfo.setProcessName("来访登记");
//todo case_ref生成、case_title生成
caseInfoUnfold.setId(utilsClient.getNewTimeId());
@@ -644,12 +700,12 @@
}
/**
- * 按条件分页查询
+ * 按条件分页查询-小程序查询
* @param page 分页对象
* @param terms 条件
* @return Page
*/
- public Page<CaseInfoWeChatDTO> pageQueryWechat(String userId,PageRequest page, Map<String, Object> terms){
+ public Page<CaseInfoWeChatDTO> pageQueryWechat(String userId, PageRequest page, Map<String, Object> terms){
List<CaseInfoWeChatDTO> list = new ArrayList<>();
String personType = terms.get("personType")+"";
if(ObjectUtils.isEmpty(personType)){
@@ -675,13 +731,13 @@
for(CaseInfo caseInfo: content){
CaseInfoWeChatDTO caseInfoWeChatDTO = new CaseInfoWeChatDTO();
BeanUtils.copyProperties(caseInfo, caseInfoWeChatDTO);
- if(ObjectUtils.isNotEmpty(caseInfo.getProcess()) && caseInfo.getProcess().equals(1) || caseInfo.getProcess().equals(2)){
+ if(ObjectUtils.isNotEmpty(caseInfo) && caseInfo.getProcess().equals(1) || caseInfo.getProcess().equals(2)){
caseInfoWeChatDTO.setProcessStatus(1);
caseInfoWeChatDTO.setProcessStatusName("待受理");
- }else if(ObjectUtils.isNotEmpty(caseInfo.getProcess()) && caseInfo.getProcess().equals(3) || caseInfo.getProcess().equals(4)){
+ }else if(ObjectUtils.isNotEmpty(caseInfo) && caseInfo.getProcess().equals(3) || caseInfo.getProcess().equals(4)){
caseInfoWeChatDTO.setProcessStatus(2);
caseInfoWeChatDTO.setProcessStatusName("办理中");
- }else if(ObjectUtils.isNotEmpty(caseInfo.getProcess()) && caseInfo.getProcess().equals(5) || caseInfo.getProcess().equals(6)){
+ }else if(ObjectUtils.isNotEmpty(caseInfo) && caseInfo.getProcess().equals(5) || caseInfo.getProcess().equals(6)){
caseInfoWeChatDTO.setProcessStatus(3);
caseInfoWeChatDTO.setProcessStatusName("已结案");
}else{
@@ -711,4 +767,38 @@
}
return new PageImpl<CaseInfoWeChatDTO>(list, page, total);
}
+
+ /**
+ * 按条件分页查询-综合查询
+ * @param page 分页对象
+ * @param terms 条件
+ * @return Page
+ */
+ public Page<CasePageDTO> pageQueryAll(PageRequest page, Map<String, Object> terms){
+ long total = mapper.countTermsAll(terms);
+ List<CasePageDTO> content = mapper.pageTermsAll(page, terms);
+ if(ObjectUtils.isNotEmpty(content)){
+ for (CasePageDTO casePageDTO : content) {
+ QueryWrapper<CasePerson> personWrapper1 = new QueryWrapper<>();
+ personWrapper1.eq("case_id", casePageDTO.getId());
+ List<CasePerson> casePersonList1 = personService.list(personWrapper1);
+ //申请人集合
+ List<CasePersonWeDTO> plaintiffList = new ArrayList<>();
+ //被申请人集合
+ List<CasePersonWeDTO> defendantList = new ArrayList<>();
+ for (CasePerson casePerson : casePersonList1) {
+ CasePersonWeDTO casePersonWechatDTO = new CasePersonWeDTO();
+ BeanUtils.copyProperties(casePerson, casePersonWechatDTO);
+ if(CaseBaseConstsEnum.PERSON_TYPE_1.getIndex().equals(casePerson.getPerType())){
+ plaintiffList.add(casePersonWechatDTO);
+ }else if(CaseBaseConstsEnum.PERSON_TYPE_2.getIndex().equals(casePerson.getPerType())){
+ defendantList.add(casePersonWechatDTO);
+ }
+ }
+ casePageDTO.setDefendantList(defendantList);
+ casePageDTO.setPlaintiffList(plaintiffList);
+ }
+ }
+ return new PageImpl<CasePageDTO>(content, page, total);
+ }
}
--
Gitblit v1.8.0