| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.BasCircularShuttle; |
| | | import com.zy.asrs.entity.BasDevpPosition; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.entity.BasSte; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.core.DevpThread; |
| | | import com.zy.core.News; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.BasCircularShuttleService; |
| | | import com.zy.asrs.service.BasDevpPositionService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.SortTheExecutionOfTheCarUtil; |
| | | import com.zy.asrs.utils.TimeCalculatorUtils; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | | import com.zy.core.enums.*; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.enums.RgvModeType; |
| | | import com.zy.core.enums.RgvStatusType; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.SteSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.SteCommand; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.model.protocol.SteProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import com.zy.core.thread.SteThread; |
| | | import com.zy.system.entity.license.LicenseVerify; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 立体仓库WCS系统主流程业务 |
| | | * Created by vincent on 2020/8/6 |
| | | * Created by IX on 2024/10/01 |
| | | */ |
| | | @Slf4j |
| | | @Service("mainService") |
| | |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private BasRgvServiceImpl basRgvService; |
| | | @Autowired |
| | | private BasDevpPositionService basDevpPositionService; |
| | | @Autowired |
| | | private BasCircularShuttleService basCircularShuttleService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | |
| | | @Value("${constant-parameters.perimeter}") |
| | | private Long perimeter; |
| | | @Value("${constant-parameters.proportion}") |
| | | private Long proportion; |
| | | @Value("${constant-parameters.acceleration}") |
| | | private Long acceleration; |
| | | @Value("${constant-parameters.rgvCount}") |
| | | private Long rgvCount; |
| | | @Value("${constant-parameters.rgvDate}") |
| | | private Double rgvDate; |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | | @Value("${wms.reportOutPath}") |
| | | private String wmsOutPath; |
| | | @Value("${wms.reportSwitch}") |
| | | private boolean reportSwitch; |
| | | @Value("${wms.reportSwitchAuto}") |
| | | private boolean reportSwitchAuto; |
| | | |
| | | /* |
| | | * 验证许可证是否有效 |
| | | * */ |
| | | public synchronized boolean licenseVerify() { |
| | | try{ |
| | | // if (true) { |
| | | // return true; |
| | | // } |
| | | return new LicenseVerify().verify(); |
| | | } catch (Exception e){ |
| | | log.info("许可证验证失败!!异常:{}",e.getMessage()); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 站点任务检测 下发小车取放任务 |
| | | * 站点任务检测 更新小车位置信息 |
| | | */ |
| | | public synchronized void updateStePositionNearby() { |
| | | try { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 2L)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position", true)); |
| | | if (basDevpPositions.isEmpty()) { |
| | | log.error("获取所有站点信息异常"); |
| | | return; |
| | | } |
| | | List<Integer> siteList = SortTheExecutionOfTheCarUtil.WrkMastExtractSites(wrkMasts); |
| | | List<Integer> devpList = SortTheExecutionOfTheCarUtil.BasDevpPositionExtractSites(basDevpPositions); |
| | | Integer siteNo = SortTheExecutionOfTheCarUtil.ObtainDenseAreasFirstPlace(siteList, devpList); |
| | | if (siteNo == null) { |
| | | log.error("就近密集原则获取站点失败"); |
| | | return; |
| | | } |
| | | Long sitePosition = 0L; |
| | | for (BasDevpPosition basDevpPosition : basDevpPositions) { |
| | | if (basDevpPosition.getDevNo().equals(siteNo)) { |
| | | sitePosition = basDevpPosition.getPlcPosition(); |
| | | } |
| | | } |
| | | List<List<Long>> rgvPositionList = new ArrayList<>(); |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | List<Long> rgvPosition = new ArrayList<>(); |
| | | rgvPosition.add(rgvProtocol.getRgvNo().longValue()); |
| | | rgvPosition.add(rgvProtocol.getRgvPos()); |
| | | rgvPositionList.add(rgvPosition); |
| | | } |
| | | Integer rgvNo = SortTheExecutionOfTheCarUtil.LatelyAndGreaterThan(rgvPositionList, sitePosition, perimeter); |
| | | if (rgvNo == -1) { |
| | | log.info("更新小车排序信息异常={}", rgvNo); |
| | | return; |
| | | } |
| | | List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().eq("status", 0).orderBy("rgv_id", true)); |
| | | if (basCircularShuttleList.get(0).getRgvNo().equals(rgvNo)) { |
| | | return; |
| | | } |
| | | |
| | | int[][] ints = new int[basCircularShuttleList.size()][2]; |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) { |
| | | ints[basCircularShuttle.getRgvNo() - 1] = new int[]{basCircularShuttle.getRgvNo(), basCircularShuttle.getRgvId()}; |
| | | } |
| | | // String[] oldList = new String[ints.length]; |
| | | // for (int[] rgv : ints){ |
| | | // oldList[rgv[0]-1] = Arrays.toString(rgv); |
| | | // } |
| | | int[][] rgvList = SortTheExecutionOfTheCarUtil.ReorderSteId(ints, rgvNo); |
| | | // String[] newList = new String[rgvList.length]; |
| | | // for (int[] rgv : rgvList){ |
| | | // newList[rgv[0]-1] = Arrays.toString(rgv); |
| | | // } |
| | | |
| | | // log.info("更新小车排序信息:原始小车号rgvNo={},小车重新排序信息={},小车原始排序信息={}",rgvNo,Arrays.toString(newList),Arrays.toString(oldList)); |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) { |
| | | int[] rgv = rgvList[basCircularShuttle.getRgvNo() - 1]; |
| | | basCircularShuttle.setRgvId(rgv[1]); |
| | | basCircularShuttleService.updateById(basCircularShuttle); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("自动更新小车排序信息失败,异常:" + e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 站点任务检测 更新小车位置信息 |
| | | */ |
| | | public synchronized void updateStePosition() { |
| | | try { |
| | | boolean sign = false; |
| | | Integer rgvNo = 0; |
| | | List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().orderBy("rgv_id", true)); |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) { |
| | | if (basCircularShuttle.getStatus() != 0){ |
| | | sign = true; |
| | | continue; |
| | | } |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basCircularShuttle.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | sign = true; |
| | | } else if (rgvProtocol.modeType != RgvModeType.AUTO || (rgvProtocol.getStatusType() != RgvStatusType.IDLE && rgvProtocol.getStatusType() != RgvStatusType.ROAM)) { |
| | | sign = true; |
| | | } else { |
| | | rgvNo = basCircularShuttle.getRgvNo(); |
| | | break; |
| | | } |
| | | } |
| | | if (sign && rgvNo != 0) { |
| | | int[][] ints = new int[basCircularShuttleList.size()][2]; |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) { |
| | | ints[basCircularShuttle.getRgvNo() - 1] = new int[]{basCircularShuttle.getRgvNo(), basCircularShuttle.getRgvId()}; |
| | | } |
| | | // String[] oldList = new String[ints.length]; |
| | | // for (int[] rgv : ints){ |
| | | // oldList[rgv[0]-1] = Arrays.toString(rgv); |
| | | // } |
| | | int[][] rgvList = SortTheExecutionOfTheCarUtil.ReorderSteId(ints, rgvNo); |
| | | // String[] newList = new String[rgvList.length]; |
| | | // for (int[] rgv : rgvList){ |
| | | // newList[rgv[0]-1] = Arrays.toString(rgv); |
| | | // } |
| | | |
| | | // log.info("更新小车排序信息:原始小车号rgvNo={},小车重新排序信息={},小车原始排序信息={}",rgvNo,Arrays.toString(newList),Arrays.toString(oldList)); |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList) { |
| | | int[] rgv = rgvList[basCircularShuttle.getRgvNo() - 1]; |
| | | basCircularShuttle.setRgvId(rgv[1]); |
| | | basCircularShuttleService.updateById(basCircularShuttle); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("自动更新小车排序信息失败,异常:" + e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 站点任务检测 下发小车取放任务 |
| | | */ |
| | | public synchronized void DevpTaskNoRun() { |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | // 遍历空板入库口 |
| | | for (DevpSlave.Sta sta : devp.getInSta()) { |
| | | // 获取空板入库站信息 |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(sta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | try { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("rgv_no", 0).orderBy("modi_time", true)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | long differenceInSeconds = TimeCalculatorUtils.differenceInMilliseconds(wrkMasts.get(0).getModiTime(), new Date()); |
| | | if (differenceInSeconds <= 100) { |
| | | return; |
| | | } |
| | | |
| | | BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_id", 1)); |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basCircularShuttle.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | return; |
| | | } |
| | | List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position", true)); |
| | | Integer devNo = SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPositions, rgvProtocol.getRgvPos(), perimeter); |
| | | BasDevpPosition[] basDevpPositionsList = SortTheExecutionOfTheCarUtil.devpNoSort(basDevpPositions, devNo); |
| | | BasDevpPosition[] basDevpPositionsListUN = SortTheExecutionOfTheCarUtil.devpNoSortUN(basDevpPositionsList); |
| | | List<List<WrkMast>> wrkMastLists = getWrkMastLists(basDevpPositionsListUN); |
| | | //下发任务 |
| | | taskDown(wrkMastLists); |
| | | } catch (Exception e) { |
| | | log.error("自动下发小车取放任务失败,异常:" + e); |
| | | } |
| | | } |
| | | |
| | | //获取小车取放任务列表失败 |
| | | public synchronized List<List<WrkMast>> getWrkMastLists(BasDevpPosition[] basDevpPositionsListUN) { |
| | | List<List<WrkMast>> wrkMastLists = new ArrayList<>(); |
| | | try { |
| | | List<WrkMast> wrkMastlistA = new ArrayList<>(); |
| | | List<WrkMast> wrkMastlistB = new ArrayList<>(); |
| | | for (BasDevpPosition basDevpPosition : basDevpPositionsListUN) { |
| | | List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("sta_no", basDevpPosition.getDevNo()).eq("rgv_no", 0).orderBy("modi_time", true)); |
| | | for (WrkMast wrkMast : wrkMastList) { |
| | | if (!Cools.isEmpty(wrkMast)) { |
| | | if (SortTheExecutionOfTheCarUtil.devpNoSortbj(basDevpPositionsListUN, wrkMast.getSourceStaNo(), wrkMast.getStaNo())) { |
| | | wrkMastlistA.add(wrkMast); |
| | | } else { |
| | | wrkMastlistB.add(wrkMast); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | wrkMastLists.add(wrkMastlistA); |
| | | wrkMastLists.add(wrkMastlistB); |
| | | return wrkMastLists; |
| | | } catch (Exception e) { |
| | | log.error("获取小车取放任务列表失败,异常:" + e); |
| | | return wrkMastLists; |
| | | } |
| | | } |
| | | |
| | | public synchronized void taskDown(List<List<WrkMast>> wrkMastLists) { |
| | | long rgvId = 0; |
| | | runRgv: |
| | | for (List<WrkMast> wrkMastList : wrkMastLists) { |
| | | for (WrkMast wrkMast : wrkMastList) { |
| | | while (rgvId <= rgvCount) { |
| | | rgvId++; |
| | | // log.info("存在任务,RGV号={},任务数据={}", rgvId, JSON.toJSON(wrkMast)); |
| | | if (rgvId > rgvCount) { |
| | | break runRgv; |
| | | } |
| | | BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_id", rgvId)); |
| | | if (basCircularShuttle.getStatus() != 0){ |
| | | continue ; |
| | | } |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basCircularShuttle.getRgvNo()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("rgv_no", rgvProtocol.getRgvNo())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | | } |
| | | if (rgvProtocol.modeType == RgvModeType.AUTO |
| | | && (rgvProtocol.getStatusType() == RgvStatusType.IDLE || rgvProtocol.getStatusType() == RgvStatusType.ROAM) |
| | | && rgvProtocol.getTaskNo1() == 0 |
| | | && rgvProtocol.getAlarm() == 0) { |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.ROAM) { |
| | | double finalVelocity = 0.0; // 最终速度 (m/s) |
| | | double distance = (Math.pow(finalVelocity, 2) - Math.pow(rgvProtocol.instantaneousSpeed / 60, 2)) / (2 * acceleration); |
| | | BasDevpPosition basDevpPosition = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("dev_no", wrkMast.getSourceStaNo())); |
| | | if ((distance * proportion + (rgvProtocol.instantaneousSpeed / 60) * proportion * rgvDate) > (SortTheExecutionOfTheCarUtil.LatelyAndLessThan(basDevpPosition.getPlcPosition(), rgvProtocol.getRgvPos(), perimeter) )) { |
| | | // List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<BasDevpPosition>().orderBy("plc_position", true)); |
| | | // if (basDevpPositions.isEmpty()) { |
| | | // log.error("获取所有站点信息异常,RGV任务下发失败,请联系管理员!!!"); |
| | | // break runRgv; |
| | | // } |
| | | // List<Integer> devpList = SortTheExecutionOfTheCarUtil.BasDevpPositionExtractSites(basDevpPositions); |
| | | // |
| | | // if (!SortTheExecutionOfTheCarUtil.calculateShortestDistanceDirection(devpList,rgvProtocol.getEndStaM(),wrkMast.getSourceStaNo())){ |
| | | continue; |
| | | // } |
| | | } |
| | | } |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setRgvNo(rgvProtocol.getRgvNo()); |
| | | rgvCommand.setAckFinish1((short) 0); // 工位1任务完成确认位 |
| | | rgvCommand.setTaskNo1(wrkMast.getWrkNo().shortValue()); |
| | | rgvCommand.setTaskMode1(RgvTaskModeType.FETCH_PUT); // 工位1任务模式: 取放货 |
| | | rgvCommand.setSourceStaNo1(wrkMast.getRgvSstaNo().shortValue()); //工位1起点 |
| | | rgvCommand.setDestinationStaNo1(wrkMast.getRgvDstaNo().shortValue()); //工位1目标站点 |
| | | rgvCommand.setCommand((short) 1); //工位1任务确认 |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvProtocol.getRgvNo(), new Task(2, rgvCommand))) { |
| | | // |
| | | log.error("RGV命令下发失败,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | break runRgv; |
| | | } |
| | | log.info("RGV命令下发成功,RGV号={},任务数据={}", rgvId, JSON.toJSON(rgvCommand)); |
| | | |
| | | wrkMast.setRgvNo(rgvProtocol.getRgvNo()); |
| | | wrkMast.setAppeTime(new Date()); |
| | | try { |
| | | wrkMastService.updateById(wrkMast); |
| | | break; |
| | | } catch (Exception e) { |
| | | log.error("更新小车任务失败,任务号:" + wrkMast.getWrkNo()); |
| | | } |
| | | break runRgv; |
| | | } else { |
| | | break runRgv; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | public synchronized void loopSteCharge() { |
| | | for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | BasRgv basRgv = basRgvService.selectById(rgv.getId()); |
| | | if (Cools.isEmpty(rgvProtocol, basRgv)) { continue; } |
| | | try { |
| | | // 在线 空闲 无作业标记 不在充电 |
| | | if (rgvProtocol.getMode() == 0 |
| | | || !rgvProtocol.statusType.equals(RgvStatusType.IDLE) |
| | | || basRgv.getPakMk().equals("Y") |
| | | // || steProtocol.getChargeStatus() == 1 |
| | | ) { |
| | | //任务完成 |
| | | public synchronized void rgvCompleteWrkMastSta(int[] autoZ) { |
| | | try { |
| | | for (RgvSlave rgvSlave : slaveProperties.getRgv()) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId()); |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol == null) { |
| | | continue; |
| | | } |
| | | } catch (Exception e) { |
| | | News.error("fail", e); |
| | | BasRgv basRgv = basRgvService.selectById(rgvSlave.getId()); |
| | | if (basRgv == null) { |
| | | log.error("{}号RGV尚未在数据库进行维护!", rgvSlave.getId()); |
| | | continue; |
| | | } |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.WAITING) { |
| | | log.info("{}号小车等待wcs确认,状态{},参数{}", rgvProtocol.getRgvNo(), rgvProtocol.getStatusType(), rgvProtocol); |
| | | } |
| | | // 只有当RGV等待WCS确认、自动 |
| | | if (rgvProtocol.getStatusType() == RgvStatusType.WAITING |
| | | && rgvProtocol.getModeType() == RgvModeType.AUTO |
| | | && rgvProtocol.getTaskNo1() != 0 |
| | | ) { |
| | | log.info("{}号小车等待wcs确认,状态{},参数{}",rgvProtocol.getRgvNo(),rgvProtocol.getStatusType(),rgvProtocol); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", rgvProtocol.getTaskNo1().longValue())); |
| | | if (Cools.isEmpty(wrkMast) && (wrkMast.getWrkSts() == 2 || wrkMast.getWrkSts() == 15) && (wrkMast.getRgvNo() == 0 || wrkMast.getRgvNo() > 10)) { |
| | | log.error("未查到小车执行任务或者执行任务状态不符合!" + rgvProtocol.getTaskNo1()); |
| | | continue; |
| | | } |
| | | boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo()); |
| | | if (!rgvComplete) { |
| | | log.error("小车复位失败,小车号{}!", rgvProtocol.getRgvNo()); |
| | | break; |
| | | } |
| | | wrkMast.setRgvNo(10+rgvProtocol.getRgvNo()); |
| | | Date now = new Date(); |
| | | wrkMast.setModiTime(now); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("小车复位线程报错!" + e); |
| | | } |
| | | } |
| | | |
| | | /* |
| | | * 小车复位 |
| | | * */ |
| | | public synchronized boolean rgvComplete(Integer rgvNo) { |
| | | try { |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | if (!MessageQueue.offer(SlaveType.Rgv, rgvNo, new Task(3, new RgvCommand()))) { |
| | | log.error("RGV命令下发失败,RGV号={}", rgvNo); |
| | | return false; |
| | | } else { |
| | | log.info("RGV命令下发成功,RGV号={}", rgvNo); |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("RGV命令下发失败,RGV号={}。异常:" + e, rgvNo); |
| | | return false; |
| | | } |
| | | } |
| | | } |