|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.config.annotation.LoginNoRequired; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformJob; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.JobDetailDTO; | 
|---|
|  |  |  | import com.doumee.dao.web.reqeust.SignInDTO; | 
|---|
|  |  |  | import com.doumee.service.business.PlatformJobService; | 
|---|
|  |  |  | import com.doumee.service.business.third.WmsService; | 
|---|
|  |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
|---|
|  |  |  | 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.HttpServletResponse; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private PlatformJobService platformJobService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private WmsService wmsService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreventRepeat | 
|---|
|  |  |  | @ApiOperation("新建") | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取当前用户的最近一条待签到的作业信息") | 
|---|
|  |  |  | @GetMapping("/getLastWaitJob") | 
|---|
|  |  |  | @LoginNoRequired | 
|---|
|  |  |  | public ApiResponse<PlatformJob> getLastWaitJob(@RequestParam String uuid,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success( platformJobService.getLastWaitJob(uuid,this.getLoginUser(token))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("批量删除") | 
|---|
|  |  |  | @GetMapping("/delete/batch") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:delete") | 
|---|
|  |  |  | public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformJobService.deleteByIdInBatch(this.getIdList(ids)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("批量更新wms合同总运输量") | 
|---|
|  |  |  | @GetMapping("/updateTotalNum") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:update") | 
|---|
|  |  |  | public ApiResponse updateTotalNum(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | wmsService.computjobTotalNum(this.getIdList(ids)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return ApiResponse.success(platformJobService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("导出Excel") | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<PlatformJob> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | ExcelExporter.build(PlatformJob.class).export(platformJobService.findPage(pageWrap).getRecords(), "月台调度作业信息表", response); | 
|---|
|  |  |  | List<PlatformJob> platformJobList = platformJobService.findPage(pageWrap).getRecords(); | 
|---|
|  |  |  | if(CollectionUtils.isNotEmpty(platformJobList)){ | 
|---|
|  |  |  | for (PlatformJob platformJob:platformJobList) { | 
|---|
|  |  |  | platformJob.setJobForm(Constants.ZERO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(PlatformJob.class).export(platformJobList, "安泰物流作业任务", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|