From 9b540b646aa7171d3d3ba707457b86445dc71dc7 Mon Sep 17 00:00:00 2001
From: liyj <1003249715@qq.com>
Date: Mon, 09 Sep 2024 20:04:23 +0800
Subject: [PATCH] 1、事件流转相关接口优化
---
dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java | 259 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 242 insertions(+), 17 deletions(-)
diff --git a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java
index daf365e..53aeb99 100644
--- a/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java
+++ b/dyh-service/dyh-mediate/src/main/java/cn/huge/module/cases/controller/web/CaseTaskWebController.java
@@ -1,9 +1,12 @@
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;
@@ -12,8 +15,12 @@
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;
@@ -22,6 +29,8 @@
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;
@@ -50,6 +59,8 @@
private CaseReturnService caseReturnService;
@Autowired
private CaseAppearService caseAppearService;
+ @Autowired
+ private SysClientImpl sysClient;
/**
* web端-任务处理页面-初始化tab和按钮
@@ -67,6 +78,54 @@
}
/**
+ * 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 结案申请表单
@@ -75,6 +134,7 @@
@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();
@@ -90,7 +150,8 @@
@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();
}
@@ -105,6 +166,7 @@
@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();
@@ -135,7 +197,15 @@
@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();
}
@@ -202,21 +272,6 @@
}
/**
- * 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 纠纷编号
@@ -231,4 +286,174 @@
}
}
+ /**
+ * web端-查询流程进度
+ * @url {ctx}/api/web/caseTask/getCountList
+ * @return Object
+ */
+ @GetMapping("/getCountList")
+ public Object getCountList(@CurrentUser String userId) {
+ try {
+ return ReturnSucUtils.getRepInfo(service.getCountList(userId));
+ } catch (Exception e) {
+ 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();
+ }
+ }
}
--
Gitblit v1.8.0