| | |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.service.AgvCommonService; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private AgvWrkDetlService agvWrkDetlService; |
| | | @Autowired |
| | | AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | // public ReturnT<String> start(AgvLocMast agvLocMast) { |
| | | // // locType 1. 自动, 2. 手动 |
| | |
| | | floor = "F2"; |
| | | } |
| | | List<AgvWrkMast> agvWrkMasts = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>().eq("io_type", 109).like("source_loc_no", floor).or().eq("io_type", 113)); |
| | | if (agvWrkMasts.size() >= 5) { |
| | | //log.error("暂停回流"); |
| | | return FAIL; |
| | | //throw new CoolException("暂停回流"); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "RETURN_6_MAX")); |
| | | if (config == null && !Cools.isEmpty(config.getValue())) { |
| | | if (agvWrkMasts.size() >= Integer.parseInt(config.getValue())) { |
| | | return FAIL; |
| | | } |
| | | } else { |
| | | if (agvWrkMasts.size() >= 5) { |
| | | return FAIL; |
| | | } |
| | | } |
| | | //检索空闲可入接驳位 没有空闲可入接驳位 直接找库位 |
| | | AgvBasDevp devpNo = agvCommonService.getDevpNo(6, agvLocMast.getFloor(), "Y", "Y"); |
| | |
| | | ioType = 109; |
| | | } else { |
| | | //检索库位,选择合适的库位 |
| | | locMast = agvCommonService.getLocNo(6, 1, true, true); |
| | | locMast = agvCommonService.getLocByFloorAndLev1(6, 1, 2); |
| | | locNo = locMast.getLocNo(); |
| | | wrkSts = 201L; |
| | | ioType = 109; |
| | | } |
| | | |
| | | if (locMast == null) { |
| | | throw new CoolException("没有可用的库位"); |
| | | } |
| | | //生成工作档 |
| | | AgvWrkMast mast = new AgvWrkMast(); |
| | | //工作状态 |