*
lsh
2024-10-23 bedcf032da67df5e9b7c6a7d24a4f23114409f8f
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -9,6 +9,7 @@
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.SortTheExecutionOfTheCarUtil;
import com.zy.asrs.utils.TimeCalculatorUtils;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.*;
@@ -88,6 +89,9 @@
            Integer rgvNo = SortTheExecutionOfTheCarUtil.LatelyAndGreaterThan(rgvPositionList, sitePosition);
            List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<BasCircularShuttle>().orderBy("rgv_id", true));
            if (basCircularShuttleList.get(0).getRgvNo().equals(rgvNo)){
                return;
            }
            int[][] ints = new int[basCircularShuttleList.size()][2];
            for (BasCircularShuttle basCircularShuttle : basCircularShuttleList){
@@ -166,6 +170,15 @@
     */
    public synchronized void DevpTaskNoRun() {
        try{
            List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 1L).orderBy("modi_time",true));
            if (wrkMasts.isEmpty()){
                return;
            }
            long differenceInSeconds = TimeCalculatorUtils.differenceInSeconds(wrkMasts.get(0).getModiTime(), new Date());
            if (differenceInSeconds<=5){
                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();
@@ -191,12 +204,14 @@
            List<WrkMast> wrkMastlistA = new ArrayList<>();
            List<WrkMast> wrkMastlistB = new ArrayList<>();
            for (BasDevpPosition basDevpPosition : basDevpPositionsListUN){
                WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("sta_no", basDevpPosition.getDevNo()).eq("wrk_sts",1L));
                if (!Cools.isEmpty(wrkMast)){
                    if (SortTheExecutionOfTheCarUtil.devpNoSortbj(basDevpPositionsListUN,wrkMast.getSourceStaNo(),wrkMast.getStaNo())){
                        wrkMastlistA.add(wrkMast);
                    } else {
                        wrkMastlistB.add(wrkMast);
                List<WrkMast> wrkMastList = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("sta_no", basDevpPosition.getDevNo()).eq("wrk_sts", 1L).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);
                        }
                    }
                }
            }