| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 按条件分页查询 |
| | | * 按条件分页查询-小程序查询 |
| | | * @param page 分页对象 |
| | | * @param terms 条件 |
| | | * @return Page |
| | | */ |
| | | public Page<CaseInfoWeChatDTO> pageQueryWechat(String userId,PageRequest page, Map<String, Object> terms){ |
| | | List<CaseInfoWeChatDTO> list = new ArrayList<>(); |
| | | 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)){ |
| | | throw new RuntimeException("请选择人员类型"); |
| | |
| | | } |
| | | List<CasePerson> casePersonList = personService.list(personWrapper); |
| | | if(ObjectUtils.isEmpty(casePersonList)){ |
| | | return new PageImpl<CaseInfoWeChatDTO>(list, page, 0); |
| | | return new PageImpl<CaseInfoWechatDTO>(list, page, 0); |
| | | } |
| | | List<String> ids = casePersonList.stream().map(CasePerson::getCaseId).collect(Collectors.toList()); |
| | | terms.put("idList",ids); |
| | |
| | | List<CaseInfo> content = mapper.pageTerms(page, terms); |
| | | if(ObjectUtils.isNotEmpty(content)){ |
| | | for(CaseInfo caseInfo: content){ |
| | | CaseInfoWeChatDTO caseInfoWeChatDTO = new CaseInfoWeChatDTO(); |
| | | CaseInfoWechatDTO caseInfoWeChatDTO = new CaseInfoWechatDTO(); |
| | | BeanUtils.copyProperties(caseInfo, caseInfoWeChatDTO); |
| | | if(ObjectUtils.isNotEmpty(caseInfo.getProcess()) && caseInfo.getProcess().equals(1) || caseInfo.getProcess().equals(2)){ |
| | | caseInfoWeChatDTO.setProcessStatus(1); |
| | |
| | | list.add(caseInfoWeChatDTO); |
| | | } |
| | | } |
| | | return new PageImpl<CaseInfoWeChatDTO>(list, page, total); |
| | | 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); |
| | | } |
| | | } |