| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasAgvLocNo; |
| | | import com.zy.asrs.entity.BasAgvMast; |
| | | import com.zy.asrs.entity.BasArmMast; |
| | | import com.zy.asrs.entity.result.OrderDetlValueResultUtil; |
| | | import com.zy.asrs.service.BasAgvLocNoService; |
| | | import com.zy.asrs.service.BasDevpErrorLogService; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | /* |
| | | * Created by Monkey D. Luffy on 2025.09.09 |
| | |
| | | @Data |
| | | public class AgvTaskAssignmentParam { |
| | | |
| | | private String id; |
| | | private String reqCode; |
| | | private String taskCode; |
| | | private String taskTyp = "cs"; |
| | | private String ctnrTyp = "1"; |
| | | private ArrayList<PositionCodePathClass> positionCodePath = new ArrayList<PositionCodePathClass>(); |
| | | |
| | | public AgvTaskAssignmentParam() {} |
| | | |
| | | public AgvTaskAssignmentParam(String id) { |
| | | this.id = id; |
| | | @Data |
| | | public static class PositionCodePathClass { |
| | | private String positionCode; |
| | | private String type = "05";//放置位 |
| | | } |
| | | |
| | | public AgvTaskAssignmentParam(int id) { |
| | | this.id = String.valueOf(id); |
| | | public AgvTaskAssignmentParam() { |
| | | |
| | | } |
| | | public AgvTaskAssignmentParam(BasAgvMast basAgvMast) { |
| | | switch (basAgvMast.getIoType()){ |
| | | case 0: |
| | | getAgvTaskAssignmentParam0(basAgvMast); |
| | | return; |
| | | case 1: |
| | | getAgvTaskAssignmentParam1(basAgvMast); |
| | | return; |
| | | case 2: |
| | | getAgvTaskAssignmentParam2(basAgvMast); |
| | | return; |
| | | case 3: |
| | | getAgvTaskAssignmentParam3(basAgvMast); |
| | | return; |
| | | default: |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | public void getAgvTaskAssignmentParam0(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo()+"-"+basAgvMast.getTimestamp(); |
| | | |
| | | SnowflakeIdWorker snowflakeIdWorker = SpringUtils.getBean(SnowflakeIdWorker.class); |
| | | long nextId = snowflakeIdWorker.nextId(); |
| | | this.taskCode = String.valueOf(nextId); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam1(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getSourceLocNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam2(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou= basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("loc_no", basAgvMast.getLocNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | public void getAgvTaskAssignmentParam3(BasAgvMast basAgvMast) { |
| | | BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class); |
| | | |
| | | this.reqCode = basAgvMast.getTaskNo().toString(); |
| | | this.taskCode = basAgvMast.getTimestamp().toString(); |
| | | PositionCodePathClass positionCodePathClassSou = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoSou = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getSourceStaNo())); |
| | | positionCodePathClassSou.setPositionCode(basAgvLocNoSou.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassSou); |
| | | PositionCodePathClass positionCodePathClassEnd = new PositionCodePathClass(); |
| | | BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo())); |
| | | positionCodePathClassEnd.setPositionCode(basAgvLocNoEnd.getAgvLocNo()); |
| | | this.positionCodePath.add(positionCodePathClassEnd); |
| | | |
| | | } |
| | | } |