|  |  | 
 |  |  | package com.zy.asrs.utils; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
 |  |  | import com.core.common.SpringUtils; | 
 |  |  | import com.zy.asrs.entity.BasDevpPosition; | 
 |  |  | import com.zy.asrs.entity.TaskWrk; | 
 |  |  | import com.zy.asrs.entity.WrkMast; | 
 |  |  | import com.zy.core.enums.RouteCollectCountType; | 
 |  |  | import com.zy.core.model.RgvSlave; | 
 |  |  | import com.zy.system.service.UserService; | 
 |  |  |  | 
 |  |  | import java.util.ArrayList; | 
 |  |  | import java.util.Collections; | 
 |  |  | 
 |  |  |     //检测是否在范围 | 
 |  |  |     public static boolean CheckIfItIsWithinTheRange(List<Integer> staNoList, Long staNoNowPos, List<BasDevpPosition> basDevpPositionList, boolean itSmall) { | 
 |  |  |         List<Integer> siteList = new ArrayList<>(); | 
 |  |  |         Long maxOrMin = 0L; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Integer[] rangeList = new Integer[staNoList.size()]; | 
 |  |  | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (itSmall) { | 
 |  |  |             return staNoNowPos <= rangeList[rangeList.length - 1]; | 
 |  |  |             for (BasDevpPosition basDevpPosition : basDevpPositionList) { | 
 |  |  |                 if (basDevpPosition.getDevNo().equals(rangeList[rangeList.length - 1])) { | 
 |  |  |                     maxOrMin = basDevpPosition.getPlcPosition(); | 
 |  |  |                     break; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             if (maxOrMin == 0){ | 
 |  |  |                 return false; | 
 |  |  |             } | 
 |  |  |             return staNoNowPos <= maxOrMin+50; | 
 |  |  |         } | 
 |  |  |         return staNoNowPos >= rangeList[0]; | 
 |  |  |         for (BasDevpPosition basDevpPosition : basDevpPositionList) { | 
 |  |  |             if (basDevpPosition.getDevNo().equals(rangeList[0])) { | 
 |  |  |                 maxOrMin = basDevpPosition.getPlcPosition(); | 
 |  |  |                 break; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if (maxOrMin == 0){ | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |         return staNoNowPos >= maxOrMin-50; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static long absoluteDifference(Long a, Long b) { |