|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.annotations.AppAuth; | 
|---|
|  |  |  | import com.core.common.BaseRes; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //创建任务 | 
|---|
|  |  |  | @AppAuth(memo = "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("入库前下发码盘信息成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @AppAuth(memo = "WMS任务下发") | 
|---|
|  |  |  | @PostMapping("/taskCreate") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public R taskCreate(@RequestHeader String appkey, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //任务取消接口 | 
|---|
|  |  |  | @AppAuth(memo = "WMS取消任务") | 
|---|
|  |  |  | @PostMapping("/taskCancel") | 
|---|
|  |  |  | public R taskCancel(@RequestHeader String appkey, | 
|---|
|  |  |  | @RequestBody WMSAndAGVInterfaceParam param, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 外置输送线wms通知输送线流动,上报时候上报站点即可 | 
|---|
|  |  |  | @AppAuth(memo = "外置输送线wms通知输送线流动") | 
|---|
|  |  |  | @PostMapping("/applyInDevp") | 
|---|
|  |  |  | public R applyInDevp(@RequestHeader String appkey, | 
|---|
|  |  |  | @RequestBody ApplyInDevpDto param, | 
|---|