Commit deee7e0e246b3f9940fd32600baec8e266090fa3

Authored by guzijian
1 parent a00169ae

fix: 可视化大屏-》增加状态判断策略异常等级排 未签 -》 迟到 -》 酒驾

Bsth-admin/src/main/java/com/ruoyi/service/impl/BigViewServiceImpl.java
... ... @@ -50,8 +50,8 @@ public class BigViewServiceImpl implements BigViewService {
50 50 private NowSchedulingCache cache;
51 51  
52 52 @Override
53   - public Integer queryNumberByType(String type,String dateKey) {
54   - Integer x = handleType(type,dateKey);
  53 + public Integer queryNumberByType(String type, String dateKey) {
  54 + Integer x = handleType(type, dateKey);
55 55 if (x != null) return x;
56 56 return 0;
57 57 }
... ... @@ -59,7 +59,7 @@ public class BigViewServiceImpl implements BigViewService {
59 59 @Override
60 60 public List<FleetInfoVo> queryFleetInfoByFleetName(String dateKey) {
61 61 // 从缓存中读取数据,但是调度表中还好包含飞司售人员信息 需要过滤一下 非司售人员nbbm不会存在
62   - String key = dateKey.replaceAll("-","");
  62 + String key = dateKey.replaceAll("-", "");
63 63 Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key);
64 64  
65 65 Map<String, LineInfo> matchMap = transformMapByMacheList(map);
... ... @@ -76,7 +76,7 @@ public class BigViewServiceImpl implements BigViewService {
76 76 @Override
77 77 public SignInfoVo querySignDetails(String date, String jobCode) {
78 78 SignInfoVo vo = null;
79   - Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(date.replaceAll("-",""));
  79 + Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(date.replaceAll("-", ""));
80 80 List<DriverScheduling> list = map.get(jobCode);
81 81 if (CollectionUtil.isNotEmpty(list)) {
82 82 vo = new SignInfoVo();
... ... @@ -100,7 +100,7 @@ public class BigViewServiceImpl implements BigViewService {
100 100 info.setResult(Objects.isNull(scheduling.getRemark()) ? "未签" : scheduling.getRemark());
101 101 vo.getSignInfos().add(info);
102 102 }
103   - vo.setLpName(StringUtils.join(lpNameMap.keySet(),"/"));
  103 + vo.setLpName(StringUtils.join(lpNameMap.keySet(), "/"));
104 104 }
105 105 return vo;
106 106 }
... ... @@ -235,19 +235,32 @@ public class BigViewServiceImpl implements BigViewService {
235 235 * @param driverScheduling
236 236 */
237 237 private void handleMoreStatus(Map<String, LineInfo> matchMap, DriverScheduling scheduling, String nbbm, LineInfo.PersonInfoVo personInfoVo, DriverScheduling driverScheduling) {
  238 + // TODO 判断多异常
238 239 long time = System.currentTimeMillis();
239 240 if (DRIVER_STRING.equals(scheduling.getPosts())) {
240 241 LineInfo.PersonInfoVo driverInfoVo = matchMap.get(nbbm).getDriverInfoVo();
241   - // 第二次签到时间未到不记录状态
242   - if (!Objects.isNull(driverInfoVo) && time - scheduling.getFcsjT() < 0) {
243   - return;
  242 + if (!Objects.isNull(driverInfoVo)) {
  243 + // 第二次签到时间未到不记录状态
  244 + if (time - scheduling.getFcsjT() < 0) {
  245 + return;
  246 + }
  247 + // 如有多异常覆盖策略 异常等级排 未签 -》 迟到 -》 酒驾
  248 + if (driverInfoVo.getSignStatus().compareTo(personInfoVo.getSignStatus()) < 0) {
  249 + return;
  250 + }
244 251 }
245 252 matchMap.get(nbbm).setDriverInfoVo(personInfoVo);
246 253 } else {
247 254 LineInfo.PersonInfoVo saleInfoVo = matchMap.get(nbbm).getSaleInfoVo();
248   - // 第二次签到时间未到不记录状态
249   - if (!Objects.isNull(saleInfoVo) && time - scheduling.getFcsjT() < 0) {
250   - return;
  255 + if (!Objects.isNull(saleInfoVo)) {
  256 + // 第二次签到时间未到不记录状态
  257 + if (time - scheduling.getFcsjT() < 0) {
  258 + return;
  259 + }
  260 + // 如有多异常覆盖策略 异常等级排 未签 -》 迟到 -》 酒驾
  261 + if (saleInfoVo.getSignStatus().compareTo(personInfoVo.getSignStatus()) < 0) {
  262 + return;
  263 + }
251 264 }
252 265 matchMap.get(nbbm).setSaleInfoVo(personInfoVo);
253 266 }
... ... @@ -281,7 +294,7 @@ public class BigViewServiceImpl implements BigViewService {
281 294 }
282 295  
283 296 private Integer handleType(String type, String dateKey) {
284   - String key = dateKey.replaceAll("-","");
  297 + String key = dateKey.replaceAll("-", "");
285 298 Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key);
286 299 Map<String, Object> typeMap = new HashMap<>(map.size());
287 300 switch (type) {
... ...