| | |
| | | package cn.huge.module.cases.controller.web; |
| | | |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.base.config.CurrentUser; |
| | | import cn.huge.module.cases.domain.dto.AcceptTaskDTO; |
| | | import cn.huge.module.cases.domain.dto.AssignTaskDTO; |
| | | import cn.huge.module.cases.domain.dto.SignTaskDTO; |
| | | import cn.huge.module.cases.domain.po.CaseAppear; |
| | | import cn.huge.module.cases.domain.po.CaseReturn; |
| | | import cn.huge.module.cases.domain.po.CaseTask; |
| | |
| | | import cn.huge.module.cases.service.CaseReturnService; |
| | | import cn.huge.module.cases.service.CaseTaskService; |
| | | import cn.huge.module.cases.service.CaseWindupApplyService; |
| | | import cn.huge.module.client.api.SysClient; |
| | | import cn.huge.module.client.api.impl.SysClientImpl; |
| | | import cn.huge.module.sys.dto.FileIdTypeInfoBaseDTO; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | |
| | | private CaseReturnService caseReturnService; |
| | | @Autowired |
| | | private CaseAppearService caseAppearService; |
| | | @Autowired |
| | | private SysClientImpl sysClient; |
| | | |
| | | /** |
| | | * web端-任务处理页面-初始化tab和按钮 |
| | |
| | | } |
| | | |
| | | /** |
| | | * web端-交办 |
| | | * @url {ctx}/api/web/caseTask/assign |
| | | * @param assignTaskDTO 交办表单 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/assign") |
| | | public Object assign(@RequestBody AssignTaskDTO assignTaskDTO, @CurrentUser String userId) { |
| | | try { |
| | | service.webAssign(assignTaskDTO, userId); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-签收 |
| | | * @url {ctx}/api/web/caseTask/sign |
| | | * @param signTaskDTO 签收表单 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/sign") |
| | | public Object sign(@RequestBody SignTaskDTO signTaskDTO, @CurrentUser String userId) { |
| | | try { |
| | | service.webSign(signTaskDTO, userId); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-受理 |
| | | * @url {ctx}/api/web/caseTask/accept |
| | | * @param acceptTaskDTO 受理表单 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/accept") |
| | | public Object accept(@RequestBody AcceptTaskDTO acceptTaskDTO, @CurrentUser String userId) { |
| | | try { |
| | | service.webAccept(acceptTaskDTO, userId); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-结案申请 |
| | | * @url {ctx}/api/web/caseTask/windupApply |
| | | * @param caseWindupApply 结案申请表单 |
| | |
| | | @PostMapping("/windupApply") |
| | | public Object windupApply(@RequestBody CaseWindupApply caseWindupApply, @CurrentUser String userId) { |
| | | try { |
| | | service.webWindupApply(caseWindupApply, userId); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | @GetMapping("/getWindupApplyInfo") |
| | | public Object getWindupApplyInfo(@RequestParam(value = "caseTaskId") String caseTaskId, @CurrentUser String userId) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(caseWindupApplyService.getByCaseTaskId(caseTaskId)); |
| | | CaseWindupApply caseWindupApply = caseWindupApplyService.getByCaseTaskId(caseTaskId); |
| | | return ReturnSucUtils.getRepInfo(caseWindupApply); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | |
| | | @PostMapping("/windupAudit") |
| | | public Object windupAudit(@RequestBody CaseWindupApply caseWindupApply, @CurrentUser String userId) { |
| | | try { |
| | | service.webWindupAudit(caseWindupApply, userId); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | @GetMapping("/getReturnApplyInfo") |
| | | public Object getReturnApplyInfo(@RequestParam(value = "caseTaskId") String caseTaskId, @CurrentUser String userId) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(caseReturnService.getByCaseTaskId(caseTaskId)); |
| | | CaseReturn caseReturn = caseReturnService.getByCaseTaskId(caseTaskId); |
| | | Map<String, Object> term = new HashMap<>(); |
| | | term.put("mainId", caseReturn.getCaseId()); |
| | | term.put("ownerIds", caseReturn.getId()); |
| | | List<FileIdTypeInfoBaseDTO> fileInfoList = sysClient.listIdTypeInfoByOwnerIdList(term); |
| | | if(CollectionUtils.isNotEmpty(fileInfoList)){ |
| | | caseReturn.setFileInfoList(fileInfoList.get(0).getFileList().get(0).getFileList()); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(caseReturn); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * web端-交办 |
| | | * @url {ctx}/api/web/caseTask/assign |
| | | * @param assignTaskDTO 交办表单 |
| | | * @return Object |
| | | */ |
| | | @PostMapping("/assign") |
| | | public Object assign(@RequestBody AssignTaskDTO assignTaskDTO, @CurrentUser String userId) { |
| | | try { |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-查询流程进度 |
| | | * @url {ctx}/api/web/caseTask/listCaseFlow |
| | | * @param caseId 纠纷编号 |
| | |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-工作台-查询待办任务-分派任务 |
| | | * @url {ctx}/api/web/caseTask/pageMyTaskFp |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param status 状态,1:待分派,2:已分派 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageMyTaskFp") |
| | | public Object pageMyTaskFp(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "status") int status, @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 流程/分派时间区间 |
| | | String timeStart = request.getParameter("timeStart"); |
| | | String timeEnd = request.getParameter("timeEnd"); |
| | | if(StringUtils.isNotBlank(timeStart) && StringUtils.isNotBlank(timeEnd)) { |
| | | terms.put("timeStart", timeStart); |
| | | terms.put("timeEnd", timeEnd); |
| | | } |
| | | // 查询申请方/被申请方关键词 |
| | | String partyName = request.getParameter("partyName"); |
| | | if (StringUtils.isNotBlank(partyName)){ |
| | | terms.put("partyName", partyName); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-工作台-查询待办任务-签收任务 |
| | | * @url {ctx}/api/web/caseTask/pageMyTaskQs |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param status 状态,1:待签收,2:已签收 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageMyTaskQs") |
| | | public Object pageMyTaskQs(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "status") int status, @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 流程/签收时间区间 |
| | | String timeStart = request.getParameter("timeStart"); |
| | | String timeEnd = request.getParameter("timeEnd"); |
| | | if(StringUtils.isNotBlank(timeStart) && StringUtils.isNotBlank(timeEnd)) { |
| | | terms.put("timeStart", timeStart); |
| | | terms.put("timeEnd", timeEnd); |
| | | } |
| | | // 查询申请方/被申请方关键词 |
| | | String partyName = request.getParameter("partyName"); |
| | | if (StringUtils.isNotBlank(partyName)){ |
| | | terms.put("partyName", partyName); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-工作台-查询待办任务-受理任务 |
| | | * @url {ctx}/api/web/caseTask/pageMyTaskSl |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param status 状态,1:待受理,2:已受理 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageMyTaskSl") |
| | | public Object pageMyTaskSl(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "status") int status, @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 流程/受理时间区间 |
| | | String timeStart = request.getParameter("timeStart"); |
| | | String timeEnd = request.getParameter("timeEnd"); |
| | | if(StringUtils.isNotBlank(timeStart) && StringUtils.isNotBlank(timeEnd)) { |
| | | terms.put("timeStart", timeStart); |
| | | terms.put("timeEnd", timeEnd); |
| | | } |
| | | // 查询申请方/被申请方关键词 |
| | | String partyName = request.getParameter("partyName"); |
| | | if (StringUtils.isNotBlank(partyName)){ |
| | | terms.put("partyName", partyName); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-工作台-查询待办任务-办理任务 |
| | | * @url {ctx}/api/web/caseTask/pageMyTaskBl |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param status 状态,1:办理中,2:结案申请,3:已结案 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageMyTaskBl") |
| | | public Object pageMyTaskBl(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "status") int status, @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 流程/结案申请/结案时间区间 |
| | | String timeStart = request.getParameter("timeStart"); |
| | | String timeEnd = request.getParameter("timeEnd"); |
| | | if(StringUtils.isNotBlank(timeStart) && StringUtils.isNotBlank(timeEnd)) { |
| | | terms.put("timeStart", timeStart); |
| | | terms.put("timeEnd", timeEnd); |
| | | } |
| | | // 查询申请方/被申请方关键词 |
| | | String partyName = request.getParameter("partyName"); |
| | | if (StringUtils.isNotBlank(partyName)){ |
| | | terms.put("partyName", partyName); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * web端-工作台-查询待办任务-审核任务 |
| | | * @url {ctx}/api/web/caseTask/pageMyTaskSh |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @param status 状态,1:待审核,2:已审核 |
| | | * @param type 审核类型,1:回退审核,2:上报审核,3:结案审核,4:联合处置审核 |
| | | * @return |
| | | */ |
| | | @GetMapping("/pageMyTaskSh") |
| | | public Object pageMyTaskSh(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size, |
| | | @RequestParam(value = "status") int status, @RequestParam(value = "type") int type, |
| | | @CurrentUser String userId) { |
| | | try { |
| | | Map<String, Object> terms = Maps.newHashMap(); |
| | | // 回退/上报/结案申请/联合处置申请/审核时间区间 |
| | | String timeStart = request.getParameter("timeStart"); |
| | | String timeEnd = request.getParameter("timeEnd"); |
| | | if(StringUtils.isNotBlank(timeStart) && StringUtils.isNotBlank(timeEnd)) { |
| | | terms.put("timeStart", timeStart); |
| | | terms.put("timeEnd", timeEnd); |
| | | } |
| | | // 查询申请方/被申请方关键词 |
| | | String partyName = request.getParameter("partyName"); |
| | | if (StringUtils.isNotBlank(partyName)){ |
| | | terms.put("partyName", partyName); |
| | | } |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | } |