| | |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.param.ToOutStaParam; |
| | | import com.zy.asrs.entity.RcsReporterTask; |
| | | import com.zy.asrs.entity.RcsReturn; |
| | | import com.zy.asrs.service.RcsService; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.SlaveType; |
| | |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | public class OpenController { |
| | | @Autowired |
| | | private RcsService rcsService; |
| | | |
| | | @RequestMapping("/open/toOutSta") |
| | | public R toOutSta(@RequestBody ToOutStaParam param) { |
| | | log.info("toOutSta:{}",param); |
| | | Integer sourceStaNo = param.getSourceStaNo(); |
| | | SiemensDevpThread siemensDevpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if(siemensDevpThread == null) { |
| | |
| | | |
| | | staProtocol.setWorkNo(param.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(param.getStaNo().shortValue()); |
| | | staProtocol.setPalletSize((short) 1); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); |
| | | log.info("发生成功:{}",result); |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | // 反馈任务执行结果 |
| | | @PostMapping("/api/robot/reporter/task") |
| | | public RcsReturn reporterTask(@RequestBody RcsReporterTask param){ |
| | | |
| | | return rcsService.reporterTask(param); |
| | | } |
| | | |
| | | } |