package com.newfiber.api.pc.controller.zhz; import com.newfiber.api.core.annotation.SysLog; import com.newfiber.api.core.commons.PageRequestObject; import com.newfiber.api.core.commons.PageResultObject; import com.newfiber.api.core.commons.ResultCode; import com.newfiber.api.core.commons.ResultObj; import com.newfiber.api.pc.dto.SupAllotDTO; import com.newfiber.api.pc.model.meet.AcceptAllot; import com.newfiber.api.pc.service.AllocService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; /** * 调度管理(资源分配) * @Author:zhz * @CreateDate:2020/12/1 13:49 * @Description: */ @RestController @RequestMapping("/allot") @Api(value = "AllotController",tags = "调度管理") public class AllotController { @Autowired private AllocService allocService; @PostMapping("/allotOperation") @ApiOperation("调度物资") @SysLog(actionType = "3",value = "调度物资") public ResultObj allotOperation(@RequestBody SupAllotDTO supAllotDTO, HttpServletRequest request){ String userNo = request.getHeader("userNo"); allocService.alloc(supAllotDTO,userNo); return ResultObj.ok(); } @PostMapping("/acceptSup") @ApiOperation("接收调度物资") @SysLog(actionType = "3",value = "接收调度物资") public ResultObj acceptSup(@RequestParam("allotId")Integer allotId, HttpServletRequest request){ allocService.acceptSup(allotId,request); return ResultObj.ok(); } @PostMapping("/viewInfo") @ApiOperation("查看调度详情") @SysLog(actionType = "4",value = "查看调度详情") public ResultObj<AcceptAllot> viewInfo(@RequestParam("allotId")Integer allotId){ return new ResultObj(ResultCode.OK,allocService.viewInfo(allotId)); } @PostMapping("/serchAllot") @ApiOperation("查询自己的调度信息(管理员可以查询全部)") @SysLog(actionType = "4",value = "查询自己的调度信息(管理员可以查询全部)") public ResultObj<PageResultObject<AcceptAllot>> serchAllot(@RequestBody PageRequestObject<Integer> page,HttpServletRequest request){ return new ResultObj<PageResultObject<AcceptAllot>>(ResultCode.OK,allocService.serchAllot(page,request)); } @PostMapping("/serchAcceptList") @ApiOperation("查询需要当前用户接收的调度列表-分页条件查询(调度状态)") @SysLog(actionType = "4",value = "查询需要当前用户接收的调度列表-分页条件查询(调度状态)") public ResultObj<PageResultObject<AcceptAllot>> serchAcceptList(@RequestBody PageRequestObject<Integer> page,HttpServletRequest request){ return new ResultObj<PageResultObject<AcceptAllot>>(ResultCode.OK,allocService.serchAcceptList(page,request)); } }