|  |  |  | 
|---|
|  |  |  | 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.dao.business.vo.PlatformJobExportVo; | 
|---|
|  |  |  | 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.service.business.PlatformJobService; | 
|---|
|  |  |  | import com.doumee.service.business.third.WmsService; | 
|---|
|  |  |  | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; | 
|---|
|  |  |  | import com.mchange.v2.beans.BeansUtils; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.models.auth.In; | 
|---|
|  |  |  | import org.springframework.beans.BeanUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformJobService.delete(id); | 
|---|
|  |  |  | platformJobService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("批量更新wms合同总运输量") | 
|---|
|  |  |  | @GetMapping("/updateTotalNum") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:update") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:updateTotalNum") | 
|---|
|  |  |  | public ApiResponse updateTotalNum(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | wmsService.computjobTotalNum(this.getIdList(ids)); | 
|---|
|  |  |  | List<Integer>  idList =this.getIdList(ids); | 
|---|
|  |  |  | if(idList == null || idList.size()==0){ | 
|---|
|  |  |  | idList = new ArrayList<>(); | 
|---|
|  |  |  | PlatformJob param = new PlatformJob(); | 
|---|
|  |  |  | param.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | param.setOrigin(Constants.ONE); | 
|---|
|  |  |  | List<PlatformJob> list= platformJobService.findList(param); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for(PlatformJob j :list){ | 
|---|
|  |  |  | idList.add(j.getId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | wmsService.computjobTotalNum(idList); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | platformJob.setJobForm(Constants.ZERO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(PlatformJob.class).export(platformJobList, "安泰物流作业任务", response); | 
|---|
|  |  |  | if(Constants.equalsInteger(pageWrap.getModel().getJobType(),1)){ | 
|---|
|  |  |  | List<PlatformJobExportVo> exportVoList  =new ArrayList<>(); | 
|---|
|  |  |  | if(platformJobList!=null){ | 
|---|
|  |  |  | for(PlatformJob job : platformJobList){ | 
|---|
|  |  |  | PlatformJobExportVo t = new PlatformJobExportVo(); | 
|---|
|  |  |  | BeanUtils.copyProperties(job,t); | 
|---|
|  |  |  | exportVoList.add(t); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(PlatformJobExportVo.class).export(exportVoList, "预约入园作业记录", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | ExcelExporter.build(PlatformJob.class).export(platformJobList, "安泰物流作业任务", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("根据ID查询") | 
|---|
|  |  |  | 
|---|
|  |  |  | platformJobService.signIn(signInDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("手动完成作业") | 
|---|
|  |  |  | @PostMapping("/dealJobFinish") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:update") | 
|---|
|  |  |  | public ApiResponse  dealJobFinish (@RequestBody List<Integer> list, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformJobService.dealJobFinish(list,getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("更换月台分组") | 
|---|
|  |  |  | @PostMapping("/changPlatformGroup") | 
|---|
|  |  |  | @CloudRequiredPermission("business:platformjob:update") | 
|---|
|  |  |  | public ApiResponse  changPlatformGroup (@RequestBody PlatformJob param, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ | 
|---|
|  |  |  | platformJobService.changPlatformGroup(param,getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|