个人任务部分修改

This commit is contained in:
yinjinlu-pc\尹金路 2023-06-10 15:27:41 +08:00
parent ab462319a1
commit 037783d2ba
5 changed files with 43 additions and 39 deletions

View File

@ -31,10 +31,10 @@ public class UserTaskController extends BaseController {
*/
@ApiOperation("查询待处理的任务和单据(分页)")
@GetMapping("/listTodo")
public TableDataInfo listTodoList(Long userId)
public TableDataInfo listTodoList(String userName)
{
startPage();
List<UserTask> list = userTaskService.listTodoList(userId);
List<UserTask> list = userTaskService.listTodoList(userName);
return getDataTable(list);
}
@ -45,10 +45,10 @@ public class UserTaskController extends BaseController {
*/
@ApiOperation("查询已处理的任务和单据(分页)")
@GetMapping("/listFinished")
public TableDataInfo listFinishedList(Long userId)
public TableDataInfo listFinishedList(String userName)
{
startPage();
List<UserTask> list = userTaskService.listFinishedList(userId);
List<UserTask> list = userTaskService.listFinishedList(userName);
return getDataTable(list);
}

View File

@ -6,8 +6,8 @@ import java.util.List;
public interface UserTaskMapper {
public List<UserTask> listTodoList(Long userId);
public List<UserTask> listTodoList(String userName);
public List<UserTask> listFinishedList(Long userId);
public List<UserTask> listFinishedList(String userName);
}

View File

@ -6,8 +6,8 @@ import java.util.List;
public interface IUserTaskService {
public List<UserTask> listTodoList(Long userId);
public List<UserTask> listTodoList(String usesrName);
public List<UserTask> listFinishedList(Long userId);
public List<UserTask> listFinishedList(String usesrName);
}

View File

@ -15,12 +15,12 @@ public class UserTaskServiceImpl implements IUserTaskService {
private UserTaskMapper userTaskMapper;
@Override
public List<UserTask> listTodoList(Long userId) {
return userTaskMapper.listTodoList(userId);
public List<UserTask> listTodoList(String userName) {
return userTaskMapper.listTodoList(userName);
}
@Override
public List<UserTask> listFinishedList(Long userId) {
return userTaskMapper.listFinishedList(userId);
public List<UserTask> listFinishedList(String userName) {
return userTaskMapper.listFinishedList(userName);
}
}

View File

@ -9,124 +9,128 @@
<result property="taskCode" column="task_code" />
<result property="taskName" column="task_name" />
<result property="status" column="status" />
<result property="taskType" column="taskType" />
<result property="taskType" column="task_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<select id="listTodoList" parameterType="Long" resultMap="UserTaskResult">
select *
<select id="listTodoList" parameterType="String" resultMap="UserTaskResult">
select task_type,task_code,task_name,t.`status`,su.nick_name as create_by,su.create_time
from (
select 'ITEMRECPT' as task_type, recpt_id as task_id,recpt_code as task_code,recpt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_item_recpt wir
where wir.`status` = 'PREPARE'
and wir.create_by = #{userId}
and wir.create_by = #{userName}
union
select 'WM_RTVENDOR' as task_type, wrv.rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_vendor wrv
where wrv.`status` ='PREPARE'
and wrv.create_by = #{userId}
and wrv.create_by = #{userName}
union
select 'ISSUE' as task_type, issue_id as task_id,issue_code as issue_code, issue_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_issue_header wih
where wih.`status` ='PREPARE'
and wih.create_by = #{userId}
and wih.create_by = #{userName}
union
select 'RTISSUE' as task_type, rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_issue wri
where wri.`status` ='PREPARE'
AND wri.create_by = #{userId}
AND wri.create_by = #{userName}
union
select 'PRODUCTRECPT' as task_type, wpr.recpt_id as task_id,recpt_code as task_code, recpt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_product_recpt wpr
where wpr.`status` ='PREPARE'
and wpr.create_by = #{userId}
and wpr.create_by = #{userName}
union
select 'PRODUCTSALSE' as task_type, wps.salse_id as task_id,salse_code as task_code, salse_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_product_salse wps
where wps.`status` ='PREPARE'
and wps.create_by = #{userId}
and wps.create_by = #{userName}
union
select 'RTSALSE' as task_type,wrs.rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_salse wrs
where wrs.`status` ='PREPARE'
and wrs.create_by = #{userId}
and wrs.create_by = #{userName}
union
select 'TRANSFER' as task_type,wt.transfer_id as task_id,wt.transfer_code as task_code, wt.transfer_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_transfer wt
where wt.`status` ='PREPARE'
and wt.create_by = #{userId}
and wt.create_by = #{userName}
union
select 'STOCKTAKING' as task_type,wst.taking_id as task_id,wst.taking_code as task_code,wst.taking_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_stock_taking wst
where wst.`status` ='PREPARE'
and wst.create_by = #{userId}
and wst.create_by = #{userName}
union
select 'FEEDBACK' as task_type,pf.record_id as task_id,feedback_code as task_code,'报工单' as task_name,`status`,create_by,create_time,update_by,update_time
from pro_feedback pf
where pf.`status`='PREPARE'
and pf.create_by = #{userId}
and pf.create_by = #{userName}
) t
order by create_time, desc
left join sys_user su
on t.create_by = su.user_name
order by create_time, task_type desc
</select>
<select id="listFinishedList" parameterType="Long" resultMap="UserTaskResult">
select *
<select id="listFinishedList" parameterType="String" resultMap="UserTaskResult">
select task_type,task_code,task_name,t.`status`,su.nick_name as create_by,su.create_time
from (
select 'ITEMRECPT' as task_type, recpt_id as task_id,recpt_code as task_code,recpt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_item_recpt wir
where wir.`status` != 'PREPARE'
and wir.create_by = #{userId}
and wir.create_by = #{userName}
union
select 'WM_RTVENDOR' as task_type, wrv.rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_vendor wrv
where wrv.`status` !='PREPARE'
and wrv.create_by = #{userId}
and wrv.create_by = #{userName}
union
select 'ISSUE' as task_type, issue_id as task_id,issue_code as issue_code, issue_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_issue_header wih
where wih.`status` !='PREPARE'
and wih.create_by = #{userId}
and wih.create_by = #{userName}
union
select 'RTISSUE' as task_type, rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_issue wri
where wri.`status` !='PREPARE'
AND wri.create_by = #{userId}
AND wri.create_by = #{userName}
union
select 'PRODUCTRECPT' as task_type, wpr.recpt_id as task_id,recpt_code as task_code, recpt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_product_recpt wpr
where wpr.`status` !='PREPARE'
and wpr.create_by = #{userId}
and wpr.create_by = #{userName}
union
select 'PRODUCTSALSE' as task_type, wps.salse_id as task_id,salse_code as task_code, salse_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_product_salse wps
where wps.`status` !='PREPARE'
and wps.create_by = #{userId}
and wps.create_by = #{userName}
union
select 'RTSALSE' as task_type,wrs.rt_id as task_id,rt_code as task_code, rt_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_rt_salse wrs
where wrs.`status` !='PREPARE'
and wrs.create_by = #{userId}
and wrs.create_by = #{userName}
union
select 'TRANSFER' as task_type,wt.transfer_id as task_id,wt.transfer_code as task_code, wt.transfer_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_transfer wt
where wt.`status` !='PREPARE'
and wt.create_by = #{userId}
and wt.create_by = #{userName}
union
select 'STOCKTAKING' as task_type,wst.taking_id as task_id,wst.taking_code as task_code,wst.taking_name as task_name,`status`,create_by,create_time,update_by,update_time
from wm_stock_taking wst
where wst.`status` !='PREPARE'
and wst.create_by = #{userId}
and wst.create_by = #{userName}
union
select 'FEEDBACK' as task_type,pf.record_id as task_id,feedback_code as task_code,'报工单' as task_name,`status`,create_by,create_time,update_by,update_time
from pro_feedback pf
where pf.`status` !='PREPARE'
and pf.create_by = #{userId}
and pf.create_by = #{userName}
) t
order by create_time, desc
left join sys_user su
on t.create_by = su.user_name
order by create_time, task_type desc
</select>
</mapper>