|  |  |  | 
|---|
|  |  |  | import com.doumee.core.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.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 江蹄蹄 | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformJobService.deleteById(id); | 
|---|
|  |  |  | platformJobService.delete(id); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @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查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(platformJobService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("任务详情") | 
|---|
|  |  |  | @PostMapping("/jobDetail") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:query") | 
|---|
|  |  |  | public ApiResponse<PlatformJob>  jobDetail (@RequestBody JobDetailDTO jobDetailDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | return ApiResponse.success(platformJobService.getDetail(jobDetailDTO)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("任务签到") | 
|---|
|  |  |  | @PostMapping("/signIn") | 
|---|
|  |  |  | public ApiResponse  signIn (@RequestBody SignInDTO signInDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | signInDTO.setLoginUserInfo(getLoginUser(token)); | 
|---|
|  |  |  | platformJobService.signIn(signInDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|