增加app端功能接口
This commit is contained in:
parent
f8f6a51cc4
commit
3ac822acb1
@ -6,6 +6,7 @@ import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.pojo.vos.oa.UpdateTaskAssigneeVO;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.activiti.util.oa.OaFormReportUtil;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -46,7 +47,7 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@RequestBody Map<String, Object> params) {
|
||||
checkParams(params);
|
||||
OaFormReportUtil.checkReportBody(params);
|
||||
oaFormReportService.save(processDefinitionId, formCode, formVersion, params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -68,7 +69,7 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
if (isNeedClaim != 0 && isNeedClaim != 1) {
|
||||
throw new ParamsException("认领参数错误");
|
||||
}
|
||||
checkParams(params);
|
||||
OaFormReportUtil.checkReportBody(params);
|
||||
oaFormReportService.update(taskId, formCode, formVersion, isNeedClaim, uid, params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -140,30 +141,4 @@ public class OaFormReportController extends DefaultBaseController {
|
||||
page.setParams(params);
|
||||
return oaFormReportService.listPage(formCode, formVersion, page);
|
||||
}
|
||||
|
||||
private void checkParams(Map<String, Object> body) {
|
||||
if (body.isEmpty()) {
|
||||
throw new ParamsException("提交内容不能为空");
|
||||
}
|
||||
Object isNextEndEventObj = body.get(IOaFormReportService.KEY_IS_NEXT_END_EVENT);
|
||||
if (isNextEndEventObj == null) {
|
||||
throw new ParamsException("是否结束节点不能为空");
|
||||
}
|
||||
Boolean isNextEndEvent = Boolean.parseBoolean(isNextEndEventObj.toString());
|
||||
Object selectTypeObj = body.get(IOaFormReportService.KEY_SELECT_TYPE);
|
||||
if (selectTypeObj == null) {
|
||||
throw new ParamsException("选择类型不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(selectTypeObj.toString())) {
|
||||
throw new ParamsException("选择类型不能为空");
|
||||
}
|
||||
Object assigneesObj = body.get(IOaFormReportService.KEY_ASSIGNEES);
|
||||
if (assigneesObj == null) {
|
||||
throw new ParamsException("未选择下节点代理人");
|
||||
}
|
||||
List<String> assignees = (List<String>) assigneesObj;
|
||||
if (!isNextEndEvent && assignees.isEmpty()) {
|
||||
throw new ParamsException("未选择下节点代理人");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,149 @@
|
||||
package ink.wgink.module.activiti.controller.app.api.oa;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.pojo.dtos.oa.*;
|
||||
import ink.wgink.module.activiti.service.oa.IOaCcService;
|
||||
import ink.wgink.module.activiti.service.oa.IOaService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: OaController
|
||||
* @Description: Oa管理
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/3/23 09:54
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "oa管理")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/oa")
|
||||
public class OaAppController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IOaService oaService;
|
||||
@Autowired
|
||||
private IOaCcService oaCcService;
|
||||
|
||||
@ApiOperation(value = "流程定义分页列表", notes = "流程定义分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage-procdef")
|
||||
public SuccessResultList<List<OaProcdefDTO>> listPageProcdef(@RequestHeader("token") String token, ListPage page) {
|
||||
return oaService.listPageProcdef(page.getPage(), page.getRows());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的任务(待办)列表", notes = "我的任务(待办)列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@GetMapping("list-task-of-mine")
|
||||
public List<OaTaskDTO> listTaskOfMine(@RequestHeader("token") String token) {
|
||||
return oaService.listTaskOfMine(token);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "我的任务(待办)分页列表", notes = "我的任务(待办)分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-task-of-mine")
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(@RequestHeader("token") String token, ListPage page) {
|
||||
return oaService.listPageTaskOfMine(token, page.getPage(), page.getRows());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的任务(待办)总数", notes = "我的任务(待办)总数接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@GetMapping("count-task-of-mine")
|
||||
public SuccessResultData<Long> countTaskOfMine(@RequestHeader("token") String token) {
|
||||
Long count = oaService.countTaskOfMine(token);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的历史任务(已办)列表", notes = "我的历史任务(已办)列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@GetMapping("list-history-task-of-mine")
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskOfMine(@RequestHeader("token") String token) {
|
||||
return oaService.listHistoryTaskOfMine(token);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "我的历史任务(已办)分页列表", notes = "我的历史任务(已办)分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-history-task-of-mine")
|
||||
public SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(@RequestHeader("token") String token, ListPage page) {
|
||||
return oaService.listPageHistoryTaskOfMine(token, page.getPage(), page.getRows());
|
||||
}
|
||||
|
||||
@GetMapping("list-process-log/process-instance-id/{processInstanceId}")
|
||||
public List<OaProcessLogDTO> listProcessLog(@PathVariable("processInstanceId") String processInstanceId) {
|
||||
return oaService.listProcessLog(processInstanceId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待阅分页列表", notes = "我的待阅分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-unread-of-mine")
|
||||
public SuccessResultList<List<OaCcDTO>> listPageUnReadOfMine(@RequestHeader("token") String token, ListPage page) {
|
||||
Map<String, Object> requestParams = requestParams();
|
||||
requestParams.put("sort", "gmtCreate");
|
||||
requestParams.put("order", "desc");
|
||||
page.setParams(requestParams);
|
||||
return oaCcService.listPageOfMineByIsRead(token, 0, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的已阅分页列表", notes = "我的已阅分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
})
|
||||
@GetMapping("listpage-read-of-mine")
|
||||
public SuccessResultList<List<OaCcDTO>> listPageReadOfMine(@RequestHeader("token") String token, ListPage page) {
|
||||
Map<String, Object> requestParams = requestParams();
|
||||
requestParams.put("sort", "gmtModified");
|
||||
requestParams.put("order", "desc");
|
||||
page.setParams(requestParams);
|
||||
return oaCcService.listPageOfMineByIsRead(token, 1, page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的待阅总数", notes = "我的待阅总数接口")
|
||||
@GetMapping("count-unread-of-mine")
|
||||
public SuccessResultData<Integer> countUnReadOfMine(@RequestHeader("token") String token) {
|
||||
Integer count = oaCcService.countReadOfMine(token, 0);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "我的已读总数", notes = "我的已读总数接口")
|
||||
@GetMapping("count-read-of-mine")
|
||||
public SuccessResultData<Integer> countReadOfMine(@RequestHeader("token") String token) {
|
||||
Integer count = oaCcService.countReadOfMine(token, 1);
|
||||
return new SuccessResultData<>(count);
|
||||
}
|
||||
|
||||
}
|
@ -4,6 +4,7 @@ import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import ink.wgink.module.activiti.util.oa.OaFormReportUtil;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -11,6 +12,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -45,7 +47,7 @@ public class OaFormReportAppController extends DefaultBaseController {
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@RequestBody Map<String, Object> params) {
|
||||
checkParams(params);
|
||||
OaFormReportUtil.checkReportBody(params);
|
||||
oaFormReportService.saveByToken(token, processDefinitionId, formCode, formVersion, params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -69,35 +71,55 @@ public class OaFormReportAppController extends DefaultBaseController {
|
||||
if (isNeedClaim != 0 && isNeedClaim != 1) {
|
||||
throw new ParamsException("认领参数错误");
|
||||
}
|
||||
checkParams(params);
|
||||
OaFormReportUtil.checkReportBody(params);
|
||||
oaFormReportService.updateByToken(token, taskId, formCode, formVersion, isNeedClaim, uid, params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询表单", notes = "更新表单接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "formCode", value = "表单编码", paramType = "path"),
|
||||
@ApiImplicitParam(name = "formVersion", value = "表单版本", paramType = "path"),
|
||||
@ApiImplicitParam(name = "uid", value = "表单主键", paramType = "path")
|
||||
})
|
||||
@GetMapping("get/code/{formCode}/version/{formVersion}/uid/{uid}")
|
||||
public Map<String, Object> get(@PathVariable("formCode") String formCode, @PathVariable("formVersion") Integer formVersion, @PathVariable("uid") String uid) {
|
||||
public Map<String, Object> get(@RequestHeader("token") String token,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@PathVariable("uid") String uid) {
|
||||
return oaFormReportService.get(formCode, formVersion, uid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "表单列表", notes = "表单列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "formCode", value = "表单编码", paramType = "path"),
|
||||
@ApiImplicitParam(name = "formVersion", value = "表单版本", paramType = "path"),
|
||||
@ApiImplicitParam(name = "uid", value = "表单主键", paramType = "path")
|
||||
})
|
||||
@GetMapping("list/code/{formCode}/version/{formVersion}")
|
||||
public List<Map<String, Object>> list(@PathVariable("formCode") String formCode, @PathVariable("formVersion") Integer formVersion) {
|
||||
public List<Map<String, Object>> list(@RequestHeader("token") String token,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return oaFormReportService.list(formCode, formVersion, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "表单分页列表", notes = "表单分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
@ApiImplicitParam(name = "formCode", value = "表单编码", paramType = "path"),
|
||||
@ApiImplicitParam(name = "formVersion", value = "表单版本", paramType = "path"),
|
||||
@ApiImplicitParam(name = "uid", value = "表单主键", paramType = "path")
|
||||
})
|
||||
@GetMapping("listpage/code/{formCode}/version/{formVersion}")
|
||||
public SuccessResultList<List<Map<String, Object>>> listPage(@PathVariable("formCode") String formCode, @PathVariable("formVersion") Integer formVersion, ListPage page) {
|
||||
public SuccessResultList<List<Map<String, Object>>> listPage(@RequestHeader("token") String token,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return oaFormReportService.listPage(formCode, formVersion, page);
|
||||
}
|
||||
|
||||
private void checkParams(Map<String, Object> body) {
|
||||
if (body.isEmpty()) {
|
||||
throw new ParamsException("提交内容不能为空");
|
||||
}
|
||||
for (Map.Entry<String, Object> kv : body.entrySet()) {
|
||||
String key = kv.getKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,9 +6,7 @@ import ink.wgink.module.activiti.service.oa.IOaFormReportRouteService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -30,33 +28,36 @@ public class OaFormReportAppRouteController extends DefaultBaseController {
|
||||
private IOaFormReportRouteService oaFormReportRouteService;
|
||||
|
||||
@GetMapping("save/definition-id/{processDefinitionId}/code/{formCode}/version/{formVersion}")
|
||||
public void get(@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
public void get(@RequestParam("token") String token,
|
||||
@PathVariable("processDefinitionId") String processDefinitionId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
oaFormReportRouteService.save(processDefinitionId, formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
oaFormReportRouteService.appSave(token, processDefinitionId, formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
@GetMapping("update/task-id/{taskId}/code/{formCode}/version/{formVersion}/is-need-claim/{isNeedClaim}")
|
||||
public void update(@PathVariable("taskId") String taskId,
|
||||
public void update(@RequestHeader("token") String token,
|
||||
@PathVariable("taskId") String taskId,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
@PathVariable("isNeedClaim") Integer isNeedClaim,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
oaFormReportRouteService.update(taskId, formCode, formVersion, isNeedClaim, httpSession, httpServletRequest, httpServletResponse);
|
||||
oaFormReportRouteService.appUpdate(token, taskId, formCode, formVersion, isNeedClaim, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
@GetMapping("show/code/{formCode}/version/{formVersion}")
|
||||
public void show(@PathVariable("formCode") String formCode,
|
||||
public void show(@RequestHeader("token") String token,
|
||||
@PathVariable("formCode") String formCode,
|
||||
@PathVariable("formVersion") Integer formVersion,
|
||||
HttpSession httpSession,
|
||||
HttpServletRequest httpServletRequest,
|
||||
HttpServletResponse httpServletResponse) {
|
||||
oaFormReportRouteService.show(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
oaFormReportRouteService.appShow(token, formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -103,11 +103,50 @@ public interface IOaCcService {
|
||||
SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(Integer isRead, ListPage page);
|
||||
|
||||
/**
|
||||
* 我的
|
||||
* 我的抄送列表
|
||||
*
|
||||
* @param token
|
||||
* @param isRead
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(String token, Integer isRead, ListPage page);
|
||||
|
||||
/**
|
||||
* 用户抄送列表
|
||||
*
|
||||
* @param userId
|
||||
* @param isRead
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaCcDTO>> listPageByUserIdAndIsRead(String userId, Integer isRead, ListPage page);
|
||||
|
||||
/**
|
||||
* 我的已读未读总量
|
||||
*
|
||||
* @param isRead
|
||||
* @return
|
||||
*/
|
||||
Integer countReadOfMine(int isRead);
|
||||
|
||||
/**
|
||||
* 我的已读未读总量
|
||||
*
|
||||
* @param token
|
||||
* @param isRead
|
||||
* @return
|
||||
*/
|
||||
Integer countReadOfMine(String token, int isRead);
|
||||
|
||||
/**
|
||||
* 用户已读未读列表
|
||||
*
|
||||
* @param userId
|
||||
* @param isRead
|
||||
* @return
|
||||
*/
|
||||
Integer countReadByUserId(String userId, int isRead);
|
||||
|
||||
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ public interface IOaFormReportRouteService {
|
||||
/**
|
||||
* APP新增页面
|
||||
*
|
||||
* @param token
|
||||
* @param processDefinitionId
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
@ -84,11 +85,12 @@ public interface IOaFormReportRouteService {
|
||||
* @param httpServletRequest
|
||||
* @param httpServletResponse
|
||||
*/
|
||||
void appSave(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
void appSave(String token, String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
/**
|
||||
* APP修改页面
|
||||
*
|
||||
* @param token
|
||||
* @param taskId
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
@ -97,18 +99,18 @@ public interface IOaFormReportRouteService {
|
||||
* @param httpServletRequest
|
||||
* @param httpServletResponse
|
||||
*/
|
||||
void appUpdate(String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
void appUpdate(String token, String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
/**
|
||||
* APP展示页面
|
||||
*
|
||||
* @param token
|
||||
* @param formCode
|
||||
* @param formVersion
|
||||
* @param httpSession
|
||||
* @param httpServletRequest
|
||||
* @param httpServletResponse
|
||||
*/
|
||||
void appShow(String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
void appShow(String token, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,22 @@ public interface IOaService {
|
||||
*/
|
||||
List<OaTaskDTO> listTaskOfMine();
|
||||
|
||||
/**
|
||||
* 我的任务(待办)
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
List<OaTaskDTO> listTaskOfMine(String token);
|
||||
|
||||
/**
|
||||
* 用户的任务(待办)
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<OaTaskDTO> listTaskByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 我的任务(待办)总数
|
||||
*
|
||||
@ -47,6 +63,22 @@ public interface IOaService {
|
||||
*/
|
||||
Long countTaskOfMine();
|
||||
|
||||
/**
|
||||
* 我的任务(待办)总数
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
Long countTaskOfMine(String token);
|
||||
|
||||
/**
|
||||
* 用户的任务(待办)总数
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
Long countTaskByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 我的任务(待办)分页列表
|
||||
*
|
||||
@ -56,6 +88,26 @@ public interface IOaService {
|
||||
*/
|
||||
SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(int page, int rows);
|
||||
|
||||
/**
|
||||
* 我的任务(待办)分页列表
|
||||
*
|
||||
* @param token
|
||||
* @param page
|
||||
* @param rows
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(String token, int page, int rows);
|
||||
|
||||
/**
|
||||
* 用户的任务(待办)分页列表
|
||||
*
|
||||
* @param userId
|
||||
* @param page
|
||||
* @param rows
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaTaskDTO>> listPageTaskByUserId(String userId, int page, int rows);
|
||||
|
||||
/**
|
||||
* 我的历史(已办)列表
|
||||
*
|
||||
@ -63,6 +115,22 @@ public interface IOaService {
|
||||
*/
|
||||
List<OaHistoryTaskDTO> listHistoryTaskOfMine();
|
||||
|
||||
/**
|
||||
* 我的历史(已办)列表
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
List<OaHistoryTaskDTO> listHistoryTaskOfMine(String token);
|
||||
|
||||
/**
|
||||
* 用户(已办)列表
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<OaHistoryTaskDTO> listHistoryTaskByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 我的历史(已办)分页列表
|
||||
*
|
||||
@ -72,6 +140,26 @@ public interface IOaService {
|
||||
*/
|
||||
SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(int page, int rows);
|
||||
|
||||
/**
|
||||
* 我的历史(已办)分页列表
|
||||
*
|
||||
* @param token
|
||||
* @param page
|
||||
* @param rows
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(String token, int page, int rows);
|
||||
|
||||
/**
|
||||
* 用户历史(已办)分页列表
|
||||
*
|
||||
* @param userId
|
||||
* @param page
|
||||
* @param rows
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskByUserId(String userId, int page, int rows);
|
||||
|
||||
/**
|
||||
* 流程日志
|
||||
*
|
||||
|
@ -139,6 +139,17 @@ public class OaCcServiceImpl extends DefaultBaseService implements IOaCcService
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(Integer isRead, ListPage page) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return listPageByUserIdAndIsRead(userId, isRead, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPageOfMineByIsRead(String token, Integer isRead, ListPage page) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return listPageByUserIdAndIsRead(userId, isRead, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaCcDTO>> listPageByUserIdAndIsRead(String userId, Integer isRead, ListPage page) {
|
||||
page.getParams().put("userId", userId);
|
||||
page.getParams().put("isRead", isRead);
|
||||
return listPage(page);
|
||||
@ -147,6 +158,17 @@ public class OaCcServiceImpl extends DefaultBaseService implements IOaCcService
|
||||
@Override
|
||||
public Integer countReadOfMine(int isRead) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return countReadByUserId(userId, isRead);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countReadOfMine(String token, int isRead) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return countReadByUserId(userId, isRead);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer countReadByUserId(String userId, int isRead) {
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("userId", userId);
|
||||
params.put("isRead", isRead);
|
||||
|
@ -20,7 +20,9 @@ import ink.wgink.module.form.service.design.IFormFieldService;
|
||||
import ink.wgink.module.form.service.design.IFormService;
|
||||
import ink.wgink.module.form.service.report.IFormReportRouteService;
|
||||
import ink.wgink.module.form.service.report.IFormReportService;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
import ink.wgink.pojo.bos.UserInfoBO;
|
||||
import ink.wgink.pojo.dtos.department.DepartmentSimpleDTO;
|
||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||
import org.activiti.bpmn.model.FlowNode;
|
||||
import org.activiti.bpmn.model.SequenceFlow;
|
||||
@ -86,71 +88,19 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
|
||||
@Override
|
||||
public void save(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
model.put("processDefinitionId", processDefinitionId);
|
||||
model.put("formType", FormTypeEnum.OA.getValue());
|
||||
|
||||
LOG.debug("查询流程部署ID");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
|
||||
String deploymentId = processDefinition.getDeploymentId();
|
||||
|
||||
LOG.debug("发起流程,查询第一个用户任务");
|
||||
UserTask firstUserTask = activitiModelService.getFirstUserTaskByProcessDefinitionId(processDefinitionId);
|
||||
LOG.debug("发起流程,查询第一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, firstUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
setPageFields(deploymentId, firstUserTask, model);
|
||||
setPageFormButtonsAndHistoryUserTasks(deploymentId, null, null, firstUserTask, model);
|
||||
Map<String, Object> model = getSaveModel(processDefinitionId);
|
||||
setPageCurrentUser(model);
|
||||
formReportRouteService.save(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (task == null) {
|
||||
throw new SearchException("任务不存在");
|
||||
}
|
||||
|
||||
LOG.debug("查询流程部署ID");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
|
||||
String deploymentId = processDefinition.getDeploymentId();
|
||||
|
||||
LOG.debug("获取下一个用户任务");
|
||||
FlowNode flowNode = activitiModelService.getFlowNodeByNodeIdAndProcessDefinitionId(task.getTaskDefinitionKey(), task.getProcessDefinitionId());
|
||||
UserTask currentUserTask = (UserTask) flowNode;
|
||||
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
model.put("formType", FormTypeEnum.OA.getValue());
|
||||
model.put("taskId", taskId);
|
||||
model.put("processInstanceId", task.getProcessInstanceId());
|
||||
model.put("isNeedClaim", isNeedClaim);
|
||||
LOG.debug("查询下一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, currentUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
setPageFields(deploymentId, currentUserTask, model);
|
||||
setPageFormButtonsAndHistoryUserTasks(deploymentId, task.getId(), task.getProcessInstanceId(), currentUserTask, model);
|
||||
Map<String, Object> model = getUpdateModel(taskId, isNeedClaim);
|
||||
setPageCurrentUser(model);
|
||||
// 设置代理人
|
||||
formReportRouteService.update(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置页面当前用户
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
private void setPageCurrentUser(Map<String, Object> model) {
|
||||
CurrentUserVO currentUserVO = new CurrentUserVO();
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
currentUserVO.setUserId(currentUser.getUserId());
|
||||
currentUserVO.setUserName(currentUser.getUserName());
|
||||
currentUserVO.setDepartments(currentUser.getDepartments());
|
||||
model.put("currentUser", JSONObject.toJSONString(currentUserVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
@ -177,6 +127,32 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
formReportRouteService.showPage(reportForm, formCode, formPO.getPrintPageCode(), httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRead(String formCode, Integer formVersion, String ccId, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
oaCcService.updateRead(ccId, 1);
|
||||
show(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appSave(String token, String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getSaveModel(processDefinitionId);
|
||||
setAppPageCurrentUser(token, model);
|
||||
formReportRouteService.appSave(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appUpdate(String token, String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getUpdateModel(taskId, isNeedClaim);
|
||||
setAppPageCurrentUser(token, model);
|
||||
formReportRouteService.appUpdate(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appShow(String token, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
formReportRouteService.appShow(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置签批
|
||||
*
|
||||
@ -193,6 +169,8 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置会签
|
||||
*
|
||||
@ -228,31 +206,98 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRead(String formCode, Integer formVersion, String ccId, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
oaCcService.updateRead(ccId, 1);
|
||||
show(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse);
|
||||
/**
|
||||
* 设置页面当前用户
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
private void setPageCurrentUser(Map<String, Object> model) {
|
||||
CurrentUserVO currentUserVO = new CurrentUserVO();
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
currentUserVO.setUserId(currentUser.getUserId());
|
||||
currentUserVO.setUserName(currentUser.getUserName());
|
||||
currentUserVO.setDepartments(currentUser.getDepartments());
|
||||
model.put("currentUser", JSONObject.toJSONString(currentUserVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appSave(String processDefinitionId, String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
/**
|
||||
* 设置APP页面当前用户
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
private void setAppPageCurrentUser(String token, Map<String, Object> model) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
CurrentUserVO currentUserVO = new CurrentUserVO();
|
||||
currentUserVO.setUserId(appTokenUser.getId());
|
||||
currentUserVO.setUserName(appTokenUser.getName());
|
||||
currentUserVO.setDepartments(appTokenUser.getDepartments().stream().map(appTokenUserDepartment -> {
|
||||
DepartmentSimpleDTO departmentSimpleDTO = new DepartmentSimpleDTO();
|
||||
departmentSimpleDTO.setDepartmentId(appTokenUserDepartment.getDepartmentId());
|
||||
departmentSimpleDTO.setDepartmentName(appTokenUserDepartment.getDepartmentName());
|
||||
return departmentSimpleDTO;
|
||||
}).collect(Collectors.toList()));
|
||||
model.put("currentUser", JSONObject.toJSONString(currentUserVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增页面Model
|
||||
*
|
||||
* @param processDefinitionId
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> getSaveModel(String processDefinitionId) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
model.put("processDefinitionId", processDefinitionId);
|
||||
formReportRouteService.appSave(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
model.put("formType", FormTypeEnum.OA.getValue());
|
||||
|
||||
LOG.debug("查询流程部署ID");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
|
||||
String deploymentId = processDefinition.getDeploymentId();
|
||||
|
||||
LOG.debug("发起流程,查询第一个用户任务");
|
||||
UserTask firstUserTask = activitiModelService.getFirstUserTaskByProcessDefinitionId(processDefinitionId);
|
||||
LOG.debug("发起流程,查询第一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, firstUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
setPageFields(deploymentId, firstUserTask, model);
|
||||
setPageFormButtonsAndHistoryUserTasks(deploymentId, null, null, firstUserTask, model);
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appUpdate(String taskId, String formCode, Integer formVersion, Integer isNeedClaim, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
/**
|
||||
* 编辑页面Model
|
||||
*
|
||||
* @param taskId
|
||||
* @param isNeedClaim
|
||||
* @return
|
||||
*/
|
||||
private Map<String, Object> getUpdateModel(String taskId, Integer isNeedClaim) {
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (task == null) {
|
||||
throw new SearchException("任务不存在");
|
||||
}
|
||||
|
||||
LOG.debug("查询流程部署ID");
|
||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(task.getProcessDefinitionId()).singleResult();
|
||||
String deploymentId = processDefinition.getDeploymentId();
|
||||
|
||||
LOG.debug("获取下一个用户任务");
|
||||
FlowNode flowNode = activitiModelService.getFlowNodeByNodeIdAndProcessDefinitionId(task.getTaskDefinitionKey(), task.getProcessDefinitionId());
|
||||
UserTask currentUserTask = (UserTask) flowNode;
|
||||
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
model.put("formType", FormTypeEnum.OA.getValue());
|
||||
model.put("taskId", taskId);
|
||||
model.put("processInstanceId", task.getProcessInstanceId());
|
||||
model.put("isNeedClaim", isNeedClaim);
|
||||
formReportRouteService.appUpdate(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
}
|
||||
LOG.debug("查询下一个用户任务后直连用户任务列表");
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = listConfirmAssignee(deploymentId, currentUserTask);
|
||||
model.put("confirmAssignees", JSON.toJSONString(confirmAssigneeVOs));
|
||||
|
||||
@Override
|
||||
public void appShow(String formCode, Integer formVersion, HttpSession httpSession, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||
Map<String, Object> model = getHashMap(10);
|
||||
formReportRouteService.appShow(formCode, formVersion, httpSession, httpServletRequest, httpServletResponse, model);
|
||||
setPageFields(deploymentId, currentUserTask, model);
|
||||
setPageFormButtonsAndHistoryUserTasks(deploymentId, task.getId(), task.getProcessInstanceId(), currentUserTask, model);
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -356,14 +401,6 @@ public class OaFormReportRouteServiceImpl extends DefaultBaseService implements
|
||||
LOG.debug("2.发起流程,查询第一个用户任务后直连用户任务列表的流入序列流");
|
||||
// 序列流的数量决定了提交按钮的数量,名字决定了提交按钮的名称,没有名称默认
|
||||
List<SequenceFlow> sequenceFlows = activitiModelService.listOutgoingSequenceFlowToNotGateway(currentUserTask);
|
||||
|
||||
// 当下个用户任务节点列表为空并且指向用户任务的输出流为空时,表示下个节点为结束节点
|
||||
// if(nextUserTasks.isEmpty() && sequenceFlows.isEmpty()) {
|
||||
// ConfirmAssigneeVO confirmAssigneeVO = new ConfirmAssigneeVO();
|
||||
// confirmAssigneeVO.setNextEndEvent(true);
|
||||
// return;
|
||||
// }
|
||||
|
||||
LOG.debug("3.遍历后续的用户列表");
|
||||
// 按照流入序列流进行区分,页面上体现出为按钮中对应的不同的代理人列表
|
||||
List<ConfirmAssigneeVO> confirmAssigneeVOs = new ArrayList<>();
|
||||
|
@ -132,6 +132,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
@Override
|
||||
public List<OaTaskDTO> listTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return listTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaTaskDTO> listTaskOfMine(String token) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return listTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaTaskDTO> listTaskByUserId(String userId) {
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
List<Task> tasks = taskQuery.includeProcessVariables().list();
|
||||
return listOaTask(tasks);
|
||||
@ -140,6 +151,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
@Override
|
||||
public Long countTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return countTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countTaskOfMine(String token) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return countTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countTaskByUserId(String userId) {
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
return taskQuery.count();
|
||||
}
|
||||
@ -147,6 +169,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
@Override
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(int page, int rows) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return listPageTaskByUserId(userId, page, rows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskOfMine(String token, int page, int rows) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return listPageTaskByUserId(userId, page, rows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaTaskDTO>> listPageTaskByUserId(String userId, int page, int rows) {
|
||||
TaskQuery taskQuery = taskService.createTaskQuery().taskCandidateOrAssigned(userId);
|
||||
List<Task> tasks = taskQuery.includeProcessVariables().orderByTaskCreateTime().desc().listPage(page - 1, rows);
|
||||
List<OaTaskDTO> oaTaskDTOs = listOaTask(tasks);
|
||||
@ -208,6 +241,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
@Override
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskOfMine() {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return listHistoryTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskOfMine(String token) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return listHistoryTaskByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaHistoryTaskDTO> listHistoryTaskByUserId(String userId) {
|
||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(userId);
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.includeProcessVariables().finished().list();
|
||||
return listOaHistoryTask(historicTaskInstances);
|
||||
@ -216,6 +260,17 @@ public class OaServiceImpl extends DefaultBaseService implements IOaService {
|
||||
@Override
|
||||
public SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(int page, int rows) {
|
||||
String userId = securityComponent.getCurrentUser().getUserId();
|
||||
return listPageHistoryTaskByUserId(userId, page, rows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskOfMine(String token, int page, int rows) {
|
||||
String userId = getAppTokenUser(token).getId();
|
||||
return listPageHistoryTaskByUserId(userId, page, rows);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<OaHistoryTaskDTO>> listPageHistoryTaskByUserId(String userId, int page, int rows) {
|
||||
HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery().taskAssignee(userId);
|
||||
List<HistoricTaskInstance> historicTaskInstances = historicTaskInstanceQuery.includeProcessVariables().finished().orderByHistoricTaskInstanceEndTime().desc().listPage(page - 1, rows);
|
||||
List<OaHistoryTaskDTO> oaHistoryTaskDTOs = listOaHistoryTask(historicTaskInstances);
|
||||
|
@ -0,0 +1,50 @@
|
||||
package ink.wgink.module.activiti.util.oa;
|
||||
|
||||
import ink.wgink.exceptions.ParamsException;
|
||||
import ink.wgink.module.activiti.service.oa.IOaFormReportService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: OaUtils
|
||||
* @Description:
|
||||
* @Author: wanggeng
|
||||
* @Date: 2022/5/16 17:17
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class OaFormReportUtil {
|
||||
|
||||
/**
|
||||
* 检查上报主题
|
||||
*
|
||||
* @param body
|
||||
*/
|
||||
public static void checkReportBody(Map<String, Object> body) {
|
||||
if (body.isEmpty()) {
|
||||
throw new ParamsException("提交内容不能为空");
|
||||
}
|
||||
Object isNextEndEventObj = body.get(IOaFormReportService.KEY_IS_NEXT_END_EVENT);
|
||||
if (isNextEndEventObj == null) {
|
||||
throw new ParamsException("是否结束节点不能为空");
|
||||
}
|
||||
Boolean isNextEndEvent = Boolean.parseBoolean(isNextEndEventObj.toString());
|
||||
Object selectTypeObj = body.get(IOaFormReportService.KEY_SELECT_TYPE);
|
||||
if (selectTypeObj == null) {
|
||||
throw new ParamsException("选择类型不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(selectTypeObj.toString())) {
|
||||
throw new ParamsException("选择类型不能为空");
|
||||
}
|
||||
Object assigneesObj = body.get(IOaFormReportService.KEY_ASSIGNEES);
|
||||
if (assigneesObj == null) {
|
||||
throw new ParamsException("未选择下节点代理人");
|
||||
}
|
||||
List<String> assignees = (List<String>) assigneesObj;
|
||||
if (!isNextEndEvent && assignees.isEmpty()) {
|
||||
throw new ParamsException("未选择下节点代理人");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user