| | |
| | | import com.zy.asrs.domain.param.ApplyInDevpDto; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CrnStatusParam; |
| | | import com.zy.asrs.entity.param.PreStoragePallet; |
| | | import com.zy.asrs.entity.param.TaskCreateParam; |
| | | import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.OpenServiceImpl; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Autowired |
| | | private BasCrnErrorService basCrnErrorService; |
| | | |
| | | // WMS入库前下发码盘信息 |
| | | @PostMapping("/preStoragePallet") |
| | | public R preStoragePallet(@RequestHeader String appkey, @RequestBody PreStoragePallet preStoragePallet, HttpServletRequest request) { |
| | | auth(appkey, preStoragePallet, request); |
| | | if(Cools.isEmpty(preStoragePallet.getSite(),preStoragePallet.getLx(),preStoragePallet.getLev())) { |
| | | return R.error("参数不完整,请检查:" + preStoragePallet); |
| | | } |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | StaProtocol staProtocol = devpThread.getStation().get(preStoragePallet.getSite()); |
| | | if (staProtocol == null) { |
| | | return R.error("站点线程不存在:" + preStoragePallet.getSite()); |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | staProtocol.setMp((short) (preStoragePallet.getLev() > 1 ? 1 : 2)); |
| | | staProtocol.setLev(preStoragePallet.getLev()); |
| | | staProtocol.setLx(OpenServiceImpl.getGzlx(preStoragePallet.getLx())); |
| | | |
| | | boolean offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(3, staProtocol)); |
| | | if(!offer) { |
| | | return R.error("推送队列失败"); |
| | | } |
| | | return R.ok("入库前下发码盘信息成功"); |
| | | } |
| | | |
| | | //创建任务 |
| | | @PostMapping("/taskCreate") |
| | | @Transactional |