| | |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.asrs.utils.CrnOperaUtils; |
| | | import com.zy.core.CrnThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private String wmsUrl; |
| | | @Value("${wms.movePath}") |
| | | private String movePath; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private MainServiceImpl mainService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private CrnOperaUtils crnOperaUtils; |
| | | |
| | | |
| | | @ManagerAuth(memo = "进行中的命令") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式 |
| | | command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | return crnControl(command)?R.ok():R.error(); |
| | | // command.setCommand((short)1); |
| | | |
| | | boolean result = crnOperaUtils.crnPut(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "出库") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式 |
| | | command.setSourcePosX(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosY(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosZ(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosX(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosY(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosZ(param.getLev()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | return crnControl(command)?R.ok():R.error(); |
| | | // command.setCommand((short)1); |
| | | |
| | | boolean result = crnOperaUtils.crnTake(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "库位转移") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式 |
| | | command.setSourcePosZ(param.getSourceRow()); // 源库位排 |
| | | command.setSourcePosX(param.getSourceBay()); // 源库位列 |
| | | command.setSourcePosY(param.getSourceLev()); // 源库位层 |
| | | command.setDestinationPosZ(param.getRow()); // 目标库位排 |
| | | command.setDestinationPosX(param.getBay()); // 目标库位列 |
| | | command.setDestinationPosY(param.getLev()); // 目标库位层 |
| | | command.setCommand((short)1); |
| | | LocMast sourceLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getSourcePosX()) |
| | | .eq("bay1", command.getSourcePosY()).eq("lev1", command.getSourcePosZ())); |
| | | LocMast loc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("row1", command.getDestinationPosX()) |
| | | .eq("bay1", command.getDestinationPosY()).eq("lev1", command.getDestinationPosZ())); |
| | | VersionUtils.locMoveCheckLocType(sourceLoc, loc); |
| | | return crnControl(command)?R.ok():R.error(); |
| | | // command.setCommand((short)1); |
| | | |
| | | boolean result = crnOperaUtils.crnStockMove(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "站到站") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式 |
| | | command.setSourcePosX(param.getSourceStaNo()); // 源库位排 |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 1); // 源库位层 |
| | | command.setDestinationPosX(param.getStaNo()); // 目标库位排 |
| | | command.setDestinationPosY((short) 0); // 目标库位列 |
| | | command.setDestinationPosZ((short) 1); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | |
| | | boolean result = crnOperaUtils.crnSiteMove(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "回原点") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式 |
| | | command.setSourcePosX((short) 0); // 源库位排 |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 0); // 目标库位排 |
| | | command.setDestinationPosY((short) 0); // 目标库位列 |
| | | command.setDestinationPosZ((short) 0); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | |
| | | boolean result = crnOperaUtils.crnBacOrigin(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "反原点") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式 |
| | | command.setSourcePosX((short) 0); // 源库位排 |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 0); // 目标库位排 |
| | | command.setDestinationPosY((short) 22); // 目标库位列 |
| | | command.setDestinationPosZ((short) 1); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | |
| | | boolean result = crnOperaUtils.reverseOrigin(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | // @ManagerAuth(memo = "坐标移动") |
| | |
| | | // if (SystemProperties.WCS_RUNNING_STATUS.get()) { |
| | | // return R.error("wcs系统状态为开启"); |
| | | // } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 1); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.NONE); // 任务模式 |
| | | command.setSourcePosX((short) 0); // 源库位排 |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 0); // 目标库位排 |
| | | command.setDestinationPosY((short) 0); // 目标库位列 |
| | | command.setDestinationPosZ((short) 0); // 目标库位层 |
| | | command.setCommand((short)0); |
| | | return crnControl(command)?R.ok():R.error(); |
| | | boolean result = crnOperaUtils.crnTaskComplete(param.getCrnNo()); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | // @ManagerAuth(memo = "暂停") |
| | |
| | | if (param.getCrnNo() == null) { |
| | | throw new CoolException("请选择堆垛机"); |
| | | } |
| | | CrnCommand command = new CrnCommand(); |
| | | command.setCrnNo(param.getCrnNo()); // 堆垛机编号 |
| | | command.setTaskNo((short) 0); // 工作号 |
| | | command.setAckFinish((short) 0); // 任务完成确认位 |
| | | command.setTaskMode(CrnTaskModeType.NONE); // 任务模式 |
| | | command.setSourcePosX((short) 0); // 源库位排 |
| | | command.setSourcePosY((short) 0); // 源库位列 |
| | | command.setSourcePosZ((short) 0); // 源库位层 |
| | | command.setDestinationPosX((short) 0); // 目标库位排 |
| | | command.setDestinationPosY((short) 0); // 目标库位列 |
| | | command.setDestinationPosZ((short) 0); // 目标库位层 |
| | | return crnControl(command)?R.ok():R.error(); |
| | | |
| | | boolean result = crnOperaUtils.crnClearCommand(param); |
| | | return result ? R.ok() : R.error(); |
| | | } |
| | | |
| | | @ManagerAuth(memo = "手动复位") |