Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25f44dfe7a | ||
|
|
72c1c0f393 | ||
|
|
e2a66f7cd5 |
@ -0,0 +1,21 @@
|
|||||||
|
package org.springblade.zhaocai.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ZcProcessTaskQueryVO {
|
||||||
|
/**
|
||||||
|
* 关键字
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
/**
|
||||||
|
* 流程Key
|
||||||
|
*/
|
||||||
|
private String processId;
|
||||||
|
|
||||||
|
private String userCode;
|
||||||
|
}
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
package org.springblade.zhaocai.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ZcProcessTaskVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 实例code
|
||||||
|
*/
|
||||||
|
private String instanceCode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名称
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String tCreateUser;
|
||||||
|
/**
|
||||||
|
* 创建人编号
|
||||||
|
*/
|
||||||
|
private String tCreateUserAccount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 到达时间
|
||||||
|
*/
|
||||||
|
private Date tArrivalTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交时间
|
||||||
|
*/
|
||||||
|
private Date tSubmitTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前审批节点
|
||||||
|
*/
|
||||||
|
private String currentApprovalNode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批表单地址
|
||||||
|
*/
|
||||||
|
private String approvalFormUrl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String processKey = "assign_task";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点key
|
||||||
|
*/
|
||||||
|
private String stepKey;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阅知状态(待阅、已阅)
|
||||||
|
*/
|
||||||
|
private String pendingSubStatus;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package org.springblade.zhaocai.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class zcInitiateProcessVO {
|
||||||
|
/**
|
||||||
|
* 流程名
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
/**
|
||||||
|
* 流程id
|
||||||
|
*/
|
||||||
|
private String processId;
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package org.springblade.zhaocai.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.*;
|
||||||
|
import org.springblade.zhaocai.service.IZcProcessService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/zcProcess")
|
||||||
|
public class ZcProcessController {
|
||||||
|
@Autowired
|
||||||
|
private IZcProcessService zcProcessService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起模块
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/initiateProcess")
|
||||||
|
public R initiateProcess()
|
||||||
|
{
|
||||||
|
List<zcInitiateProcessVO> list=zcProcessService.initiateProcess();
|
||||||
|
return R.data(list);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取待办列表
|
||||||
|
*
|
||||||
|
* @param ZcProcessTaskQueryVO
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getPageList")
|
||||||
|
public R getTodoPageList(ZcProcessTaskQueryVO ZcProcessTaskQueryVO,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<ZcProcessTaskVO> page = new Page<ZcProcessTaskVO>(pageNo, pageSize);
|
||||||
|
page = zcProcessService.selectPageList(ZcProcessTaskQueryVO, page);
|
||||||
|
return R.data(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已办列表
|
||||||
|
*
|
||||||
|
* @param ZcProcessTaskQueryVO
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getDonePageList")
|
||||||
|
public R getDonePageList(ZcProcessTaskQueryVO ZcProcessTaskQueryVO,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<ZcProcessTaskVO> page = new Page<ZcProcessTaskVO>(pageNo, pageSize);
|
||||||
|
page = zcProcessService.selectDonePageList(ZcProcessTaskQueryVO, page);
|
||||||
|
return R.data(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已申请列表
|
||||||
|
*
|
||||||
|
* @param ZcProcessTaskQueryVO
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getAppliedPageList")
|
||||||
|
public R getAppliedPageList(ZcProcessTaskQueryVO ZcProcessTaskQueryVO,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<ZcProcessTaskVO> page = new Page<ZcProcessTaskVO>(pageNo, pageSize);
|
||||||
|
page = zcProcessService.selectAppliedPageList(ZcProcessTaskQueryVO, page);
|
||||||
|
return R.data(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package org.springblade.zhaocai.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.ZcProcessTaskQueryVO;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.ZcProcessTaskVO;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.zcInitiateProcessVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ZcProcessMapper extends BaseMapper<ZcProcessTaskQueryVO> {
|
||||||
|
|
||||||
|
@Select("select process_name as processName,process_id as processId from ctp_proclass_link where system_code='zhaocai' and class_id='9999999999999999999'")
|
||||||
|
List<zcInitiateProcessVO> initiateProcess();
|
||||||
|
/**
|
||||||
|
* 查询待办任务
|
||||||
|
* @param zcProcessQueryTask
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectPageList(Page<ZcProcessTaskVO> page, @Param("ZcProcessTaskQueryVO") ZcProcessTaskQueryVO zcProcessQueryTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已办任务列表
|
||||||
|
* @param zcProcessQueryTask
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectDonePageList(Page<ZcProcessTaskVO> page,@Param("ZcProcessTaskQueryVO")ZcProcessTaskQueryVO zcProcessQueryTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已申请列表
|
||||||
|
* @param zcProcessQueryTask
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectAppliedPageList(Page<ZcProcessTaskVO> page,@Param("ZcProcessTaskQueryVO")ZcProcessTaskQueryVO zcProcessQueryTask);
|
||||||
|
}
|
||||||
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.springblade.zhaocai.mapper.ZcProcessMapper">
|
||||||
|
|
||||||
|
<!--我的代办-->
|
||||||
|
<select id="selectPageList" resultType="org.springblade.zhaocai.pojo.vo.ZcProcessTaskVO">
|
||||||
|
SELECT
|
||||||
|
ct.cid as id,
|
||||||
|
ci.status,
|
||||||
|
ct.pending_step_name as currentApprovalNode,
|
||||||
|
ci.instance_code as instanceCode,
|
||||||
|
ci.initiator_name as tCreateUser,
|
||||||
|
ci.initiator as tCreateUserAccount,
|
||||||
|
ct.pending_code as taskId,
|
||||||
|
ct.pending_step_key as stepKey,
|
||||||
|
ct.pending_start_Time as tArrivalTime,
|
||||||
|
ct.pending_sub_status as pendingSubStatus,
|
||||||
|
(select ac.deal_time from t_elcap_approval_comment ac where ac.instance_code = ci.instance_code order by ac.deal_time desc limit 1) as tArrivalTime
|
||||||
|
FROM ctp_task ct
|
||||||
|
LEFT JOIN ctp_instance ci ON ci.instance_code = ct.pending_instance_code
|
||||||
|
left join ctp_initiate cinit on cinit.process_key = ci.process_code
|
||||||
|
left join ctp_proclass_link cpl on cpl.process_id = cinit.initiate_id
|
||||||
|
WHERE
|
||||||
|
cpl.system_code = 'zhaocai'
|
||||||
|
and ct.pending_user_code = #{zcProcessQueryTask.userCode}
|
||||||
|
and ct.pending_status = '0'
|
||||||
|
AND ct.`pending_type` in ('0','1','10')
|
||||||
|
order by ct.pending_start_time desc
|
||||||
|
</select>
|
||||||
|
<!-- 我的已办-->
|
||||||
|
<select id="selectDonePageList" resultType="org.springblade.zhaocai.pojo.vo.ZcProcessTaskVO">
|
||||||
|
SELECT
|
||||||
|
CURRENT_STEP.current_pending_user_name AS currentApprovalUser,
|
||||||
|
t.pending_start_time AS tSubmitTime,
|
||||||
|
t.pending_code AS taskId,
|
||||||
|
i.`status`,
|
||||||
|
CURRENT_STEP.current_pending_step_key AS currentApprovalNode,
|
||||||
|
t.pending_step_name AS doneApprovalNode,
|
||||||
|
t.pending_step_key AS stepKey,
|
||||||
|
-- CURRENT_STEP.step_key AS stepKey,
|
||||||
|
i.instance_code AS instanceCode,
|
||||||
|
i.initiator_name AS tCreateUser,
|
||||||
|
i.start_time AS tCreateTime
|
||||||
|
FROM
|
||||||
|
ctp_instance i
|
||||||
|
left join ctp_initiate cinit on cinit.process_key = i.process_code
|
||||||
|
left join ctp_proclass_link cpl on cpl.process_id = cinit.initiate_id
|
||||||
|
LEFT JOIN ctp_task t ON t.pending_instance_code = i.instance_code
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
pending_instance_code,
|
||||||
|
MAX(pending_step_name) AS current_pending_step_key,
|
||||||
|
pending_step_key AS step_key,
|
||||||
|
GROUP_CONCAT(pending_user_name SEPARATOR ',') AS current_pending_user_name
|
||||||
|
FROM
|
||||||
|
ctp_task
|
||||||
|
WHERE
|
||||||
|
pending_step_type IN ('0', '1')
|
||||||
|
AND pending_type IN ('0', '1', '10')
|
||||||
|
AND pending_status = '0'
|
||||||
|
GROUP BY
|
||||||
|
pending_step_key,
|
||||||
|
pending_instance_code
|
||||||
|
) AS CURRENT_STEP ON CURRENT_STEP.pending_instance_code = t.pending_instance_code
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
t.pending_user_code = #{zcProcessQueryTask.userCode}
|
||||||
|
AND t.pending_status = '1'
|
||||||
|
AND t.pending_type IN ('0', '1', '2', '10')
|
||||||
|
AND t.pending_step_type != '0'
|
||||||
|
AND cpl.system_code = 'zhaocai'
|
||||||
|
|
||||||
|
order by t.pending_start_time desc
|
||||||
|
</select>
|
||||||
|
<!-- 已申请-->
|
||||||
|
<select id="selectAppliedPageList" resultType="org.springblade.zhaocai.pojo.vo.ZcProcessTaskVO">
|
||||||
|
SELECT
|
||||||
|
instance.STATUS AS STATUS,
|
||||||
|
instance.instance_code AS instanceCode,
|
||||||
|
instance.initiator_name AS tCreateUser,
|
||||||
|
instance.start_time AS tCreateTime,
|
||||||
|
TASKS_IN_PROGRESS.taskId AS taskId,
|
||||||
|
TASKS_IN_PROGRESS.step_key AS stepKey,
|
||||||
|
|
||||||
|
CASE
|
||||||
|
WHEN instance.STATUS = 1 THEN
|
||||||
|
instance.current_step
|
||||||
|
ELSE
|
||||||
|
TASKS_IN_PROGRESS.pending_step_name
|
||||||
|
END AS currentApprovalNode,
|
||||||
|
|
||||||
|
TASKS_IN_PROGRESS.pending_user_name AS currentApprovalUser
|
||||||
|
FROM
|
||||||
|
ctp_instance AS instance
|
||||||
|
left join ctp_initiate cinit on cinit.process_key = instance.process_code
|
||||||
|
left join ctp_proclass_link cpl on cpl.process_id = cinit.initiate_id
|
||||||
|
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
pending_instance_code,
|
||||||
|
MAX(pending_step_name) AS pending_step_name,
|
||||||
|
MAX(pending_code) AS taskId,
|
||||||
|
pending_step_key AS step_key,
|
||||||
|
GROUP_CONCAT(pending_user_name SEPARATOR ',') AS pending_user_name
|
||||||
|
FROM
|
||||||
|
ctp_task
|
||||||
|
WHERE
|
||||||
|
pending_step_type IN ('0', '1')
|
||||||
|
AND pending_type IN ('0', '1', '10')
|
||||||
|
AND pending_status = '0'
|
||||||
|
GROUP BY
|
||||||
|
pending_step_key,
|
||||||
|
pending_instance_code
|
||||||
|
) AS TASKS_IN_PROGRESS
|
||||||
|
ON TASKS_IN_PROGRESS.pending_instance_code = instance.instance_code
|
||||||
|
|
||||||
|
WHERE
|
||||||
|
cpl.system_code = 'zhaocai'
|
||||||
|
AND initiator = #{zcProcessQueryTask.userCode}
|
||||||
|
|
||||||
|
order by instance.start_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package org.springblade.zhaocai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IZcProcessService extends IService<ZcProcessTaskQueryVO> {
|
||||||
|
|
||||||
|
List<zcInitiateProcessVO> initiateProcess();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询待办列表
|
||||||
|
* @param zcProcessTask
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectPageList(ZcProcessTaskQueryVO zcProcessTask, Page<ZcProcessTaskVO> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已办列表
|
||||||
|
* @param zcProcessTask
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectDonePageList(ZcProcessTaskQueryVO zcProcessTask, Page<ZcProcessTaskVO> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询已申请列表
|
||||||
|
* @param zcProcessTask
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<ZcProcessTaskVO> selectAppliedPageList(ZcProcessTaskQueryVO zcProcessTask, Page<ZcProcessTaskVO> page);
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package org.springblade.zhaocai.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springblade.core.secure.BladeUser;
|
||||||
|
import org.springblade.core.secure.utils.AuthUtil;
|
||||||
|
import org.springblade.zhaocai.mapper.ZcProcessMapper;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.ZcProcessTaskQueryVO;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.ZcProcessTaskVO;
|
||||||
|
import org.springblade.zhaocai.pojo.vo.zcInitiateProcessVO;
|
||||||
|
import org.springblade.zhaocai.service.IZcProcessService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@DS("flow-db")
|
||||||
|
public class ZcProcessServiceImpl extends ServiceImpl<ZcProcessMapper, ZcProcessTaskQueryVO> implements IZcProcessService {
|
||||||
|
@Autowired
|
||||||
|
private ZcProcessMapper zcProcessMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<zcInitiateProcessVO> initiateProcess() {
|
||||||
|
return zcProcessMapper.initiateProcess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ZcProcessTaskVO> selectPageList(ZcProcessTaskQueryVO zcProcessQueryTask, Page<ZcProcessTaskVO> page) {
|
||||||
|
BladeUser user = AuthUtil.getUser();
|
||||||
|
//System.out.println("user=====>" + JSONObject.toJSONString(user));
|
||||||
|
if(user != null){
|
||||||
|
zcProcessQueryTask.setUserCode(user.getAccount());
|
||||||
|
}
|
||||||
|
return zcProcessMapper.selectPageList(page,zcProcessQueryTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ZcProcessTaskVO> selectDonePageList(ZcProcessTaskQueryVO zcProcessQueryTask, Page<ZcProcessTaskVO> page) {
|
||||||
|
BladeUser user = AuthUtil.getUser();
|
||||||
|
//System.out.println("user=====>" + JSONObject.toJSONString(user));
|
||||||
|
if(user != null){
|
||||||
|
zcProcessQueryTask.setUserCode(user.getAccount());
|
||||||
|
}
|
||||||
|
return zcProcessMapper.selectDonePageList(page,zcProcessQueryTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ZcProcessTaskVO> selectAppliedPageList(ZcProcessTaskQueryVO zcProcessQueryTask, Page<ZcProcessTaskVO> page) {
|
||||||
|
BladeUser user = AuthUtil.getUser();
|
||||||
|
//System.out.println("user=====>" + JSONObject.toJSONString(user));
|
||||||
|
if(user != null){
|
||||||
|
zcProcessQueryTask.setUserCode(user.getAccount());
|
||||||
|
}
|
||||||
|
return zcProcessMapper.selectAppliedPageList(page,zcProcessQueryTask);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user