| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.*; |
| | |
| | | auth(appkey, params, request); |
| | | // List<WMSAndAGVInterfaceParam> params1 =new ArrayList<>(); |
| | | for (CarryParam param:params){ |
| | | param.updateIoTyoe(param.getIoType());//中航下发 1:出库,2:移库 3:入库 ====转换为====> 1:入库,2:出库,3:移库 |
| | | param.updateLocNo(); |
| | | if (Cools.isEmpty(param)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "参数为空,params:"+JSON.toJSONString(params)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("参数为空!"); |
| | | } else if (Cools.isEmpty(param.getTaskNo())){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "任务号为空,taskNo:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("任务号为空!"); |
| | | } else if (Cools.isEmpty(param.getIoType())){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "任务类型为空,ioType:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("任务类型为空!"); |
| | | } |
| | | if (Cools.isEmpty(param.getStartPoint()) || Cools.isEmpty(param.getTargetPoint())){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "初始目标或者目标位为空,Point:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("初始目标或者目标位为空"); |
| | | } |
| | | |
| | | param.updateIoTyoe(param.getIoType());//中航下发 1:出库,2:移库 3:入库 ====转换为====> 1:入库,2:出库,3:移库 |
| | | param.updateLocNo(); |
| | | // if (Cools.isEmpty(param.getContainerCode())){ |
| | | // return R.error("容器编码(托盘码)为空!"); |
| | | // } |
| | |
| | | } |
| | | LocMast locMast = locMastService.selectByLocNo(locNo); |
| | | if(Cools.isEmpty(locMast)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "初始库位无法找到,locNo:"+JSON.toJSONString(locNo)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("初始库位无法找到"); |
| | | } |
| | | |
| | |
| | | .eq("crn_no",locMast.getCrnNo()) |
| | | .eq("stn_no",param.getStartPoint())); |
| | | if(Cools.isEmpty(staDesc)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "入库路劲不存在,param:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("入库路劲不存在"); |
| | | } |
| | | r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getCrnStn())); |
| | |
| | | .eq("crn_no",locMast.getCrnNo()) |
| | | .eq("stn_no",param.getTargetPoint())); |
| | | if(Cools.isEmpty(staDesc)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "出库路劲不存在,param:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("出库路劲不存在"); |
| | | } |
| | | r = openService.taskCreate(new TaskCreateParam(param,staDesc.getCrnNo(),staDesc.getStnNo())); |
| | | }else if (param.getIoType() == 3){ |
| | | LocMast locMast2 = locMastService.selectByLocNo(param.getTargetPoint()); |
| | | if(Cools.isEmpty(locMast2)){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "目标库位无法找到,locNo:"+JSON.toJSONString(param.getTargetPoint())); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("目标库位无法找到"); |
| | | } |
| | | if (!locMast2.getCrnNo().equals(locMast.getCrnNo())){ |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("wms", 1, "起始库位与目标库位不再同一巷道,param:"+JSON.toJSONString(param)); |
| | | } catch (Exception e2){ |
| | | // log.error("e2:"+e2.getMessage()); |
| | | } |
| | | return R.error("起始库位与目标库位不再同一巷道"); |
| | | } |
| | | //移库任务创建 |