待办相关后台代码以及实体模型
This commit is contained in:
parent
e2a66f7cd5
commit
72c1c0f393
@ -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,35 @@
|
|||||||
|
package org.springblade.zhaocai.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
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