| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.TaskStatusType; |
| | | import com.zy.asrs.domain.enums.WorkNoType; |
| | | import com.zy.asrs.entity.StaDesc; |
| | | import com.zy.asrs.mapper.TaskWrkMapper; |
| | | import com.zy.asrs.entity.TaskWrk; |
| | | import com.zy.asrs.mapper.TaskWrkMapper; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.StaDescService; |
| | | import com.zy.asrs.service.TaskWrkService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | throw new CoolException("未接收到起点和终点,不进行派发"); |
| | | } |
| | | startup(taskWrk, userId); |
| | | }else if(taskWrk.getIoType() == 2){ |
| | | } else if (taskWrk.getIoType() == 2) { |
| | | //2.出库 |
| | | stockOut(taskWrk, userId); |
| | | } else if (taskWrk.getIoType() == 3) { |
| | |
| | | crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint())); // 目标库位列 |
| | | crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint())); // 目标库位层 |
| | | crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint())); // 目标库位排 |
| | | crnCommand.setCommand((short)1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand),false)) { |
| | | crnCommand.setCommand((short) 1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand), false)) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | | }else{ |
| | | try{ |
| | | } else { |
| | | try { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("status",taskWrk.getStatus()); |
| | | headParam.put("ioType",taskWrk.getIoType()); |
| | | headParam.put("barcode",taskWrk.getBarcode()); |
| | | headParam.put("taskNo", taskWrk.getTaskNo()); |
| | | headParam.put("status", taskWrk.getStatus()); |
| | | headParam.put("ioType", taskWrk.getIoType()); |
| | | headParam.put("barcode", taskWrk.getBarcode()); |
| | | // headParam.put("reportTime",new Date()); |
| | | String response; |
| | | response = new HttpHandler.Builder() |
| | |
| | | |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | apiLogService.save("wcs派发入库任务上报wms" |
| | | ,wmsUrl+taskStatusFeedbackPath |
| | | ,null |
| | | ,"127.0.0.1" |
| | | ,JSON.toJSONString(headParam) |
| | | ,response |
| | | ,true |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("wcs派发入库任务上报wms失败", taskWrk); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | |
| | | crnCommand.setDestinationPosX(crnStn.getBay().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(crnStn.getLev().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(crnStn.getRow().shortValue()); // 目标库位层 |
| | | crnCommand.setCommand((short)1); |
| | | crnCommand.setCommand((short) 1); |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(5, crnCommand))) { |
| | | log.error("堆垛机命令生成失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | throw new CoolException("堆垛机命令生成失败"); |
| | |
| | | @Override |
| | | public void locMove(TaskWrk taskWrk, Long userId) { |
| | | //库格移载任务派发 |
| | | if (Cools.isEmpty(taskWrk.getTargetPoint())){ |
| | | return; |
| | | } |
| | | if (Cools.isEmpty(taskWrk.getTargetPoint())) { |
| | | return; |
| | | } |
| | | int workNo = commonService.getWorkNo(WorkNoType.OTHER.type);//获取工作号 |
| | | taskWrk.setWrkNo(workNo);//工作号 |
| | | taskWrk.setStatus(TaskStatusType.DISTRIBUTE.id);//派发状态 |