更新工单待处理,已处理,已归档,已撤销 按条件查询筛选分页
| | |
| | | MAIN_STATUS_DEAL_1("T1处理中",3), |
| | | MAIN_STATUS_DEAL_2("T2处理中",4), |
| | | MAIN_STATUS_FINISH("归档",5), |
| | | MAIN_STATUS_CANCEL("撤销",6), |
| | | |
| | | /**处理类型*/ |
| | | TYPE_DISPATCH("派发",0), |
| | |
| | | STATUS_WAIT_FOR_REPLY("待回复",3), |
| | | STATUS_DEAL_WITH_REPLY("处理回复",4), |
| | | STATUS_FINISH("完成",5), |
| | | STATUS_WAIT_FOR_APPROVE("待审批",6) |
| | | STATUS_WAIT_FOR_APPROVE("待审批",6), |
| | | STATUS_CANCEL("已撤销",7) |
| | | |
| | | ; |
| | | |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.WorkflowMain; |
| | | import com.whyc.service.WorkflowMainService; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private WorkflowMainService mainService; |
| | | |
| | | @GetMapping("pendList") |
| | | @ApiOperation(value = "待处理工单") |
| | | public Response<List<WorkflowMain>> getPendList(){ |
| | | @PostMapping("workflowMainList") |
| | | @ApiOperation(value = "查询各状态工单列表",notes = "待处理:type=0,已处理:type=1,已归档:type=2") |
| | | public Response<PageInfo<WorkflowMain>> getWorkflowMainList(@RequestBody WorkflowMain main,@RequestParam Integer type, @RequestParam Integer pageNum, @RequestParam Integer pageSize){ |
| | | Long userId = ActionUtil.getUser().getUId(); |
| | | return new Response<List<WorkflowMain>>().set(1,mainService.getPendingWorkflowList(userId)); |
| | | } |
| | | |
| | | @GetMapping("handledList") |
| | | @ApiOperation(value = "已处理工单") |
| | | public Response<List<WorkflowMain>> getHandledList(){ |
| | | Long userId = ActionUtil.getUser().getUId(); |
| | | return new Response<List<WorkflowMain>>().set(1,mainService.getHandledList(userId)); |
| | | } |
| | | |
| | | @GetMapping("finishList") |
| | | @ApiOperation(value = "已归档工单") |
| | | public Response<List<WorkflowMain>> getFinishList(){ |
| | | Long userId = ActionUtil.getUser().getUId(); |
| | | return new Response<List<WorkflowMain>>().set(1,mainService.getFinishList(userId)); |
| | | return new Response<PageInfo<WorkflowMain>>().set(1,mainService.getPendingWorkflowList(userId,type,pageNum,pageSize,main)); |
| | | } |
| | | |
| | | } |
| | |
| | | public interface WorkflowMainMapper extends CustomMapper<WorkflowMain>{ |
| | | List<WorkflowMain> getWorkflowAlarmList(Long userId); |
| | | |
| | | List<WorkflowMain> getPendingWorkflowList(Long userId); |
| | | List<WorkflowMain> getPendingWorkflowList(Long userId,Integer type,WorkflowMain main); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.mapper.WorkflowLinkMapper; |
| | | import com.whyc.mapper.WorkflowMainMapper; |
| | | import com.whyc.pojo.WorkflowAlarm; |
| | |
| | | mapper.insertBatchSomeColumn(workflowMainList); |
| | | } |
| | | |
| | | public List<WorkflowMain> getPendingWorkflowList(Long userId) { |
| | | //获取系统生成,待处理的工单 |
| | | List<WorkflowMain> workflowAlarmList = mapper.getWorkflowAlarmList(userId); |
| | | //获取正在工单节点表中待处理的工单 |
| | | List<WorkflowMain> workflowList = mapper.getPendingWorkflowList(userId); |
| | | public PageInfo<WorkflowMain> getPendingWorkflowList(Long userId,Integer type,Integer pageNum,Integer pageSize,WorkflowMain main) { |
| | | PageHelper.startPage(pageNum,pageSize,true); |
| | | //获取系统生成,待处理的工单,获取正在工单节点表中待处理的工单 |
| | | List<WorkflowMain> workflowList = mapper.getPendingWorkflowList(userId,type,main); |
| | | PageInfo<WorkflowMain> pageInfo = new PageInfo<>(workflowList); |
| | | |
| | | workflowList.addAll(workflowAlarmList); |
| | | return workflowList; |
| | | return pageInfo; |
| | | } |
| | | |
| | | public List<WorkflowMain> getHandledList(Long userId) { |
| | | return null; |
| | | } |
| | | |
| | | public List<WorkflowMain> getFinishList(Long userId) { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | where main.alarm_order_id = alarm.id and create_user_id = #{userId} |
| | | </select> |
| | | <select id="getPendingWorkflowList" resultType="com.whyc.pojo.WorkflowMain"> |
| | | SELECT |
| | | main.* |
| | | FROM |
| | | web_site.tb_workflow_main main, |
| | | web_site.tb_workflow_link link |
| | | WHERE link.main_id = main.id |
| | | and link.status = 0 |
| | | and deal_user_id = #{userId} |
| | | <choose> |
| | | <!--待处理--> |
| | | <when test="type==0"> |
| | | ( |
| | | SELECT * FROM web_site.tb_workflow_main where status = 2 |
| | | <if test="main.title!=null"> and title like concat('%',#{main.title},'%')</if> |
| | | and create_user_id = #{userId} |
| | | ) |
| | | union |
| | | ( |
| | | SELECT |
| | | main.* |
| | | FROM |
| | | web_site.tb_workflow_main main, |
| | | web_site.tb_workflow_link link |
| | | WHERE link.main_id = main.id |
| | | and link.status in (0,1,2,3,4) |
| | | and deal_user_id = #{userId} |
| | | ) |
| | | </when> |
| | | <!--已处理--> |
| | | <when test="type==1"> |
| | | SELECT |
| | | main.* |
| | | FROM |
| | | web_site.tb_workflow_main main, |
| | | web_site.tb_workflow_link link |
| | | WHERE link.main_id = main.id |
| | | and link.status in (5,6) |
| | | and deal_user_id = #{userId} |
| | | <if test="main.title!=null"> and title like concat('%',#{main.title},'%')</if> |
| | | </when> |
| | | <!--已归档--> |
| | | <when test="type==2"> |
| | | SELECT * FROM web_site.tb_workflow_main where status = 2 |
| | | <if test="main.title!=null"> and title like concat('%',#{main.title},'%')</if> |
| | | and create_user_id = #{userId}; |
| | | </when> |
| | | <!--已撤销--> |
| | | <otherwise> |
| | | SELECT * FROM web_site.tb_workflow_main where status = 6 |
| | | <if test="main.title!=null"> and title like concat('%',#{main.title},'%')</if> |
| | | and create_user_id = #{userId}; |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | </mapper> |