| | |
| | | |
| | | 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.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.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 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; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | |
| | | |
| | | @Autowired |
| | | private PlatformJobService platformJobService; |
| | | @Autowired |
| | | private WmsService wmsService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("新建") |
| | |
| | | @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("获取当前用户的最近一条待签到的作业信息") |
| | | @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("批量删除") |
| | |
| | | @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:updateTotalNum") |
| | | public ApiResponse updateTotalNum(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | | 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") |
| | | public ApiResponse dealJobFinish (@RequestBody List<Integer> list, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | platformJobService.dealJobFinish(list,getLoginUser(token)); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | } |