| | |
| | | package cn.huge.module.cases.service; |
| | | |
| | | import cn.huge.base.common.dto.SelectTermDTO; |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | 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.consts.CaseTaskConsts; |
| | | import cn.huge.module.cases.domain.po.CaseAssistApply; |
| | | import cn.huge.module.cases.domain.dto.TransactResultDTO; |
| | | import cn.huge.module.cases.domain.po.CaseAssistInfo; |
| | | import cn.huge.module.cases.domain.po.CaseTask; |
| | | 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.cases.dao.mapper.CaseInfoUnfoldMapper; |
| | | import cn.huge.module.cases.domain.po.CaseInfoUnfold; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import cn.huge.module.mediate.constant.AuditBaseConstsEnum; |
| | | import cn.huge.module.mediate.constant.CaseBaseConsts; |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Maps; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.el.stream.Stream; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @title: 纠纷信息扩展表业务逻辑处理 |
| | |
| | | |
| | | @Autowired |
| | | private SysClientImpl sysClient; |
| | | |
| | | @Autowired |
| | | private CaseTaskService caseTaskService; |
| | | |
| | | @Autowired |
| | | private CaseAssistInfoService caseAssistInfoService; |
| | | |
| | | /** |
| | | * 更新对象 |
| | |
| | | |
| | | /** |
| | | * PC端-选择经办人 |
| | | * @param caseId 对象 |
| | | * @param caseId 纠纷编号 |
| | | * @param caseTaskId 办理反馈任务编号 |
| | | * @param userId 条件 |
| | | */ |
| | | public void choosePrincipal(String caseId, String userId){ |
| | | public void choosePrincipal(String caseId, String caseTaskId, String userId){ |
| | | try{ |
| | | // 获取当前登录用户 |
| | | CtUserDTO loginUser = custClient.clientGetUserAll(userId); |
| | | CaseInfoUnfold CaseInfoUnfold = new CaseInfoUnfold(); |
| | | CaseInfoUnfold.setId(caseId); |
| | | CaseInfoUnfold.setMediatorId(loginUser.getId()); |
| | | CaseInfoUnfold.setMediator(loginUser.getTrueName()); |
| | | CaseInfoUnfold.setMediatorMobile(loginUser.getMobile()); |
| | | mapper.updateCaseInfoUnfold(CaseInfoUnfold); |
| | | Date nowDate = DateUtils.getNowDate(); |
| | | // 获取经办人信息 |
| | | CtUserDTO ctUserDTO = custClient.clientGetUser(userId); |
| | | CaseTask caseTask = caseTaskService.getById(caseTaskId); |
| | | // 承办部门,更新扩展表 |
| | | if (CaseTaskConsts.CASE_TASK_TYPE_1 == caseTask.getCaseTaskType()) { |
| | | CaseInfoUnfold CaseInfoUnfold = new CaseInfoUnfold(); |
| | | CaseInfoUnfold.setId(caseId); |
| | | CaseInfoUnfold.setMediatorId(ctUserDTO.getId()); |
| | | CaseInfoUnfold.setMediator(ctUserDTO.getTrueName()); |
| | | CaseInfoUnfold.setMediatorMobile(ctUserDTO.getMobile()); |
| | | CaseInfoUnfold.setUpdateTime(nowDate); |
| | | mapper.updateCaseInfoUnfold(CaseInfoUnfold); |
| | | }else { |
| | | // 配合部门,更新联合处置信息表 |
| | | CaseAssistInfo caseAssistInfo = caseAssistInfoService.getByCaseTaskId(caseTaskId); |
| | | caseAssistInfo.setAssistUserId(ctUserDTO.getId()); |
| | | caseAssistInfo.setAssistUserName(ctUserDTO.getTrueName()); |
| | | caseAssistInfo.setUpdateTime(nowDate); |
| | | caseAssistInfoService.updateCaseAssistInfo(caseAssistInfo); |
| | | |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("[CaseInfoUnfoldService.choosePrincipal]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("CaseInfoUnfoldService.choosePrincipal", e); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 联合处置申请-查询组织 |
| | | * @param caseId |
| | | * @return |
| | | */ |
| | | public List<SelectTermDTO> superviceUnitChoose(String caseId) { |
| | | try { |
| | | CaseInfoUnfold caseInfoUnfold = getById(caseId); |
| | | List<String> unitIdList = new ArrayList<>(); |
| | | unitIdList.add(caseInfoUnfold.getMediateUnitId()); |
| | | if(StringUtils.isNotBlank(caseInfoUnfold.getAssistUnitId())){ |
| | | unitIdList.addAll(Arrays.stream(caseInfoUnfold.getAssistUnitId().split(",")).map(String::valueOf).collect(Collectors.toList())); |
| | | } |
| | | List<SelectTermDTO> selectTermDTOList = new ArrayList<>(); |
| | | for (String unitId : unitIdList) { |
| | | CtUnitDTO ctUnitDTO = custClient.getUnitById(unitId); |
| | | SelectTermDTO unitSelectTerm = new SelectTermDTO(); |
| | | unitSelectTerm.setValue(ctUnitDTO.getId()); |
| | | unitSelectTerm.setLabel(ctUnitDTO.getUnitName()); |
| | | unitSelectTerm.setParentId(ctUnitDTO.getParentId()); |
| | | unitSelectTerm.setCheckable(true); |
| | | selectTermDTOList.add(unitSelectTerm); |
| | | } |
| | | return selectTermDTOList; |
| | | }catch (Exception e){ |
| | | log.error("[CaseInfoUnfoldService.superviceUnitChoose] 调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("CaseInfoUnfoldService.superviceUnitChoose", e); |
| | | } |
| | | } |
| | | } |