| | |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | } |
| | | |
| | | param.setTaskNo(Integer.parseInt(taskCode.substring(0, taskCode.indexOf("-")))); |
| | | |
| | | // if (Cools.isEmpty(param.getTimestamp())) { |
| | | // return R.error("RGV任务号[timestamp]不能为空"); |
| | | // } |
| | | boolean taskAgvReport = openService.TaskAgvReport(param); |
| | | if (taskAgvReport){ |
| | | agvBindAndBin(String.valueOf(param.getTaskNo())); |
| | | return R.ok(); |
| | | } |
| | | return R.error("任务号不存在"); |
| | |
| | | } |
| | | } |
| | | if (bindCtnrAndBin) { |
| | | asyncProcessAfterValidation(param); |
| | | return new R(0,"成功"); |
| | | } |
| | | return R.error("库位不存在或无明细"); |
| | | } |
| | | |
| | | @Async |
| | | public void agvBindAndBin(String taskNo) { |
| | | try { |
| | | Thread.sleep(500); |
| | | openService.agvBindAndBin(taskNo); |
| | | } catch (Exception e) { |
| | | log.error("异步处理AGV光栅后续逻辑失败", e); |
| | | } |
| | | } |
| | | |
| | | @Async |
| | | public void asyncProcessAfterValidation(AgvGoTheArnParam param) { |
| | | try { |
| | | Thread.sleep(500); |
| | | openService.agvApplicationPassedTheGrating(param); |
| | | } catch (Exception e) { |
| | | log.error("异步处理AGV光栅后续逻辑失败", e); |
| | | } |
| | | } |
| | | |
| | | } |