| | |
| | | package com.zy.acs.manager.core.constant; |
| | | |
| | | import com.zy.acs.manager.manager.entity.Loc; |
| | | import com.zy.acs.manager.manager.entity.Sta; |
| | | import com.zy.acs.manager.manager.entity.Task; |
| | | import com.zy.acs.manager.manager.service.LocService; |
| | | import com.zy.acs.manager.manager.service.StaService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private StaService staService; |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | |
| | | return null; |
| | | } |
| | | Loc oriLoc = null; |
| | | Sta oriSta = null; |
| | | Loc destLoc = null; |
| | | Sta destSta = null; |
| | | if (null != task.getOriLoc()) { |
| | | oriLoc = locService.getById(task.getOriLoc()); |
| | | return this.getAgvNosByRow(oriLoc.getRow()); |
| | | } |
| | | if (null != task.getOriSta()) { |
| | | oriSta = staService.getById(task.getOriSta()); |
| | | return this.getAgvNosByStaNo(oriSta.getStaNo()); |
| | | } |
| | | if (null != task.getDestLoc()) { |
| | | destLoc = locService.getById(task.getDestLoc()); |
| | | return this.getAgvNosByRow(destLoc.getRow()); |
| | | } |
| | | if (null != task.getDestSta()) { |
| | | destSta = staService.getById(task.getDestSta()); |
| | | return this.getAgvNosByStaNo(destSta.getStaNo()); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | public List<String> getAgvNosByStaNo(String staNo) { |
| | | if (StaGroupConstant.FAR_LEFT_STA_ROW_LIST.contains(staNo)) { |
| | | return AgvGroupConstant.FIRST_AGV_GROUP; |
| | | } |
| | | if (StaGroupConstant.LEFT_STA_ROW_LIST.contains(staNo)) { |
| | | return AgvGroupConstant.SECOND_AGV_GROUP; |
| | | } |
| | | if (StaGroupConstant.MIDDLE_STA_ROW_LIST.contains(staNo)) { |
| | | return AgvGroupConstant.THIRD_AGV_GROUP; |
| | | } |
| | | if (StaGroupConstant.RIGHT_STA_ROW_LIST.contains(staNo)) { |
| | | return AgvGroupConstant.FOURTH_AGV_GROUP; |
| | | } |
| | | if (StaGroupConstant.FAR_RIGHT_STA_ROW_LIST.contains(staNo)) { |
| | | return AgvGroupConstant.FIFTH_AGV_GROUP; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public List<String> getAreaCodeListByAgvNo(String agvNo) { |
| | | List<String> areaCodeList = new ArrayList<>(); |
| | | if (null == agvNo) { |