package com.whyc.controller; import com.github.pagehelper.PageInfo; import com.whyc.dto.Response; import com.whyc.pojo.DocUser; import com.whyc.pojo.WorksheetMain; import com.whyc.service.WorksheetMainService; import com.whyc.util.ActionUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; @RestController @RequestMapping("worksheetMain") @Api(tags = "工作流") public class WorksheetMainController { @Autowired private WorksheetMainService service; @PostMapping("submit") @ApiOperation("产品图纸及bom提交") public Response submit(@RequestBody WorksheetMain main){ DocUser user = ActionUtil.getUser(); boolean res = service.submit(main,user); if(res) { return new Response().set(1,true, "提交完成"); }else{ return new Response().set(1,false,"角色无法提交图纸"); } } @GetMapping("statusStatistic") @ApiOperation("获取工作流-各角色用户对应的工作台数据分类统计") public Response> getStatusStatistic(){ DocUser user = ActionUtil.getUser(); Map map = service.getStatusStatistic(user); return new Response>().set(1,map); } /* ======待处理/已处理/属于自己-审批中/已驳回/已审批====== //属于自己-审批中/已驳回/已审批 //待处理/已处理 */ @GetMapping("approvingListPage") @ApiOperation("查看分页-审批中") public Response> getApprovingListPage(@RequestParam int pageNum,@RequestParam int pageSize){ DocUser user = ActionUtil.getUser(); return service.getApprovingListPage(user,pageNum,pageSize); } @GetMapping("rejectedListPage") @ApiOperation("查看分页-已驳回") public Response> getRejectedListPage(@RequestParam int pageNum,@RequestParam int pageSize){ DocUser user = ActionUtil.getUser(); return service.getRejectedListPage(user,pageNum,pageSize); } @GetMapping("approvedListPage") @ApiOperation("查看分页-已审批") public Response> getApprovedListPage(@RequestParam int pageNum, @RequestParam int pageSize){ DocUser user = ActionUtil.getUser(); return service.getApprovedListPage(user,pageNum,pageSize); } @GetMapping("handlingListPage") @ApiOperation("查看分页-待处理") public Response> getHandlingListPage(@RequestParam int pageNum, @RequestParam int pageSize){ DocUser user = ActionUtil.getUser(); return service.getHandlingListPage(user,pageNum,pageSize); } @GetMapping("handledListPage") @ApiOperation("查看分页-已处理") public Response> getHandledListPage(@RequestParam int pageNum, @RequestParam int pageSize){ DocUser user = ActionUtil.getUser(); return service.getHandledListPage(user,pageNum,pageSize); } @GetMapping("linkInfo") @ApiOperation("获取工作流-单个审核流程完整信息流") public Response getLinkList(@RequestParam int id){ WorksheetMain main = service.getLinkList(id); return new Response().set(1,main); } @PostMapping("info") @ApiOperation("查询工作流的标题及描述") public Response getInfo(@RequestParam int id){ WorksheetMain main = service.getInfo(id); return new Response().set(1,main); } }