| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CarryParam; |
| | | import com.zy.asrs.entity.param.TaskOverParam; |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | |
| | | @PostMapping("/outboundTaskSend") |
| | | @Transactional |
| | | public R outboundTaskSend(@RequestHeader String appkey, |
| | | @RequestBody List<WMSAndAGVInterfaceParam> params, |
| | | @RequestBody List<CarryParam> params, |
| | | HttpServletRequest request) { |
| | | auth(appkey, params, request); |
| | | //auth(appkey, params, request); |
| | | List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>(); |
| | | for (WMSAndAGVInterfaceParam param:params){ |
| | | for (CarryParam param:params){ |
| | | |
| | | if (Cools.isEmpty(param)){ |
| | | return R.error("参数为空!"); |
| | | } else if (Cools.isEmpty(param.getTaskNo())){ |
| | | return R.error("任务号为空!"); |
| | | } else if (Cools.isEmpty(param.getTaskType())){ |
| | | } else if (Cools.isEmpty(param.getIoType())){ |
| | | return R.error("任务类型为空!"); |
| | | } else if (Cools.isEmpty(param.getWarehouseId())){ |
| | | return R.error("仓库标识为空!"); |
| | | } |
| | | if (Cools.isEmpty(param.getTaskPriority())){ |
| | | param.setTaskPriority(1); |
| | | } |
| | | if (Cools.isEmpty(param.getSourceLocationCode()) || Cools.isEmpty(param.getTargetLocationCode())){ |
| | | if (Cools.isEmpty(param.getStartPoint()) || Cools.isEmpty(param.getTargetPoint())){ |
| | | return R.error("初始目标或者目标位为空"); |
| | | } |
| | | // if (Cools.isEmpty(param.getContainerCode())){ |
| | |
| | | // } |
| | | // } |
| | | |
| | | LocMast locMast = locMastService.selectByLocNo(param.getSourceLocationCode()); |
| | | LocMast locMast = locMastService.selectByLocNo(param.getStartPoint()); |
| | | if(Cools.isEmpty(locMast)){ |
| | | return R.error("初始库位无法找到"); |
| | | } |
| | | |
| | | Integer ioType = TaskCreateParam.convertParamIoType(param.getTaskType()); |
| | | if(ioType == 2){ |
| | | R r = null; |
| | | |
| | | if(param.getIoType() == 2){ |
| | | //出库任务创建 |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("type_no",2) |
| | | .eq("crn_no",locMast.getCrnNo()) |
| | | .eq("stn_no",param.getTargetLocationCode())); |
| | | .eq("stn_no",param.getTargetPoint())); |
| | | if(Cools.isEmpty(staDesc)){ |
| | | return R.error("出库路劲不存在"); |
| | | } |
| | | param.setTargetLocationCode(staDesc.getStnNo().toString()); |
| | | R r = openService.taskCreate(new TaskCreateParam(param)); |
| | | }else if (ioType == 3){ |
| | | r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo())); |
| | | }else if (param.getIoType() == 3){ |
| | | //移库任务创建 |
| | | |
| | | r = openService.taskCreate(new TaskCreateParam(param,locMast.getCrnNo())); |
| | | } |
| | | |
| | | // if (param.getTaskType().equals("CK") && param.getTargetWharf().contains("J")){ |
| | | // staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | // .eq("crn_no",param.getTaskTunnel()) |
| | | // .eq("type_no",2) |
| | | // .lt("stn_no",200)); |
| | | // }else if (param.getTaskType().equals("CK") && param.getTargetWharf().contains("H")){ |
| | | // staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | // .eq("crn_no",param.getTaskTunnel()) |
| | | // .eq("type_no",2) |
| | | // .lt("stn_no",400) |
| | | // .gt("stn_no",200)); |
| | | // }else { |
| | | // staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | // .eq("crn_no",param.getTaskTunnel()) |
| | | // .eq("type_no",2) |
| | | // .lt("stn_no",500) |
| | | // .ge("stn_no",400)); |
| | | // } |
| | | //param.setTargetLocationCode(staDesc.getStnNo().toString()); |
| | | |
| | | |
| | | R r = openService.taskCreate(new TaskCreateParam(param)); |
| | | |
| | | apiLogService.save("Wms任务下发接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |