Commit 9210d972333160c934bb806d0bf013b9ae0880c7

Authored by guzijian
1 parent deee7e0e

fix: 可视化大屏-》新增应签未签 -》解决签到地址返回有问题bug

Bsth-admin/src/main/java/com/ruoyi/controller/BigViewController.java
@@ -3,6 +3,7 @@ package com.ruoyi.controller; @@ -3,6 +3,7 @@ package com.ruoyi.controller;
3 import com.ruoyi.common.global.Result; 3 import com.ruoyi.common.global.Result;
4 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; 4 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo;
5 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; 5 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo;
  6 +import com.ruoyi.pojo.vo.bigViewVo.SignNumberVo;
6 import com.ruoyi.service.BigViewService; 7 import com.ruoyi.service.BigViewService;
7 import io.swagger.annotations.Api; 8 import io.swagger.annotations.Api;
8 import io.swagger.annotations.ApiOperation; 9 import io.swagger.annotations.ApiOperation;
@@ -32,7 +33,7 @@ public class BigViewController { @@ -32,7 +33,7 @@ public class BigViewController {
32 */ 33 */
33 @ApiOperation("根据类型获取数值") 34 @ApiOperation("根据类型获取数值")
34 @GetMapping("/queryNumberByType") 35 @GetMapping("/queryNumberByType")
35 - public Result<Integer> queryNumberByType(@RequestParam("type") String type,@RequestParam("dateKey")String dateKey){ 36 + public Result<SignNumberVo> queryNumberByType(@RequestParam("type") String type, @RequestParam("dateKey")String dateKey){
36 return Result.OK(bigViewService.queryNumberByType(type,dateKey)); 37 return Result.OK(bigViewService.queryNumberByType(type,dateKey));
37 } 38 }
38 39
Bsth-admin/src/main/java/com/ruoyi/pojo/vo/bigViewVo/SignNumberVo.java 0 → 100644
  1 +package com.ruoyi.pojo.vo.bigViewVo;
  2 +
  3 +import lombok.Data;
  4 +
  5 +/**
  6 + * 应签未签
  7 + * @author 20412
  8 + */
  9 +@Data
  10 +public class SignNumberVo {
  11 + private String title;
  12 + private Integer nowNumber;
  13 + private Integer allNumber;
  14 +}
Bsth-admin/src/main/java/com/ruoyi/service/BigViewService.java
@@ -2,6 +2,7 @@ package com.ruoyi.service; @@ -2,6 +2,7 @@ package com.ruoyi.service;
2 2
3 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; 3 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo;
4 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; 4 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo;
  5 +import com.ruoyi.pojo.vo.bigViewVo.SignNumberVo;
5 6
6 import java.util.List; 7 import java.util.List;
7 8
@@ -17,7 +18,7 @@ public interface BigViewService { @@ -17,7 +18,7 @@ public interface BigViewService {
17 * @param dateKey 18 * @param dateKey
18 * @return Integer 19 * @return Integer
19 */ 20 */
20 - Integer queryNumberByType(String type,String dateKey); 21 + SignNumberVo queryNumberByType(String type, String dateKey);
21 22
22 /** 23 /**
23 * 获取车队信息 24 * 获取车队信息
Bsth-admin/src/main/java/com/ruoyi/service/SchedulingService.java
@@ -119,6 +119,7 @@ public class SchedulingService { @@ -119,6 +119,7 @@ public class SchedulingService {
119 } 119 }
120 120
121 String remark = getRemark(dto, signIn, globalIndex.getIndex()); 121 String remark = getRemark(dto, signIn, globalIndex.getIndex());
  122 + signIn.setRemark(remark);
122 // 更新最新的签到记录判断是否需要更新考勤 123 // 更新最新的签到记录判断是否需要更新考勤
123 // 记录为空直接插入记录 124 // 记录为空直接插入记录
124 if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { 125 if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) {
@@ -150,7 +151,7 @@ public class SchedulingService { @@ -150,7 +151,7 @@ public class SchedulingService {
150 sb.append(DELAY); 151 sb.append(DELAY);
151 } 152 }
152 // 在规定时间就还原remark 153 // 在规定时间就还原remark
153 - }else { 154 + } else {
154 sb.append(signIn.getRemark()); 155 sb.append(signIn.getRemark());
155 } 156 }
156 if (SIGN_ALCOHOL_EX_NUM.equals(signIn.getExType())) { 157 if (SIGN_ALCOHOL_EX_NUM.equals(signIn.getExType())) {
Bsth-admin/src/main/java/com/ruoyi/service/impl/BigViewServiceImpl.java
@@ -11,9 +11,9 @@ import com.ruoyi.pojo.response.SignInResponseVo; @@ -11,9 +11,9 @@ import com.ruoyi.pojo.response.SignInResponseVo;
11 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo; 11 import com.ruoyi.pojo.vo.bigViewVo.FleetInfoVo;
12 import com.ruoyi.pojo.vo.bigViewVo.LineInfo; 12 import com.ruoyi.pojo.vo.bigViewVo.LineInfo;
13 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo; 13 import com.ruoyi.pojo.vo.bigViewVo.SignInfoVo;
  14 +import com.ruoyi.pojo.vo.bigViewVo.SignNumberVo;
14 import com.ruoyi.service.BigViewService; 15 import com.ruoyi.service.BigViewService;
15 import com.ruoyi.service.ThreadJobService; 16 import com.ruoyi.service.ThreadJobService;
16 -import com.ruoyi.utils.ConstDateUtil;  
17 import org.slf4j.Logger; 17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory; 18 import org.slf4j.LoggerFactory;
19 import org.springframework.beans.factory.annotation.Autowired; 19 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,12 +50,12 @@ public class BigViewServiceImpl implements BigViewService { @@ -50,12 +50,12 @@ public class BigViewServiceImpl implements BigViewService {
50 private NowSchedulingCache cache; 50 private NowSchedulingCache cache;
51 51
52 @Override 52 @Override
53 - public Integer queryNumberByType(String type, String dateKey) {  
54 - Integer x = handleType(type, dateKey);  
55 - if (x != null) return x;  
56 - return 0; 53 + public SignNumberVo queryNumberByType(String type, String dateKey) {
  54 + SignNumberVo x = handleType(type, dateKey);
  55 + return x;
57 } 56 }
58 57
  58 +
59 @Override 59 @Override
60 public List<FleetInfoVo> queryFleetInfoByFleetName(String dateKey) { 60 public List<FleetInfoVo> queryFleetInfoByFleetName(String dateKey) {
61 // 从缓存中读取数据,但是调度表中还好包含飞司售人员信息 需要过滤一下 非司售人员nbbm不会存在 61 // 从缓存中读取数据,但是调度表中还好包含飞司售人员信息 需要过滤一下 非司售人员nbbm不会存在
@@ -93,8 +93,8 @@ public class BigViewServiceImpl implements BigViewService { @@ -93,8 +93,8 @@ public class BigViewServiceImpl implements BigViewService {
93 info.setPlanDate(new Date(scheduling.getFcsjT())); 93 info.setPlanDate(new Date(scheduling.getFcsjT()));
94 info.setSignDate(scheduling.getSignTime()); 94 info.setSignDate(scheduling.getSignTime());
95 for (SignInResponseVo sign : signInList) { 95 for (SignInResponseVo sign : signInList) {
96 - if (sign.getId().equals(scheduling.getId())) {  
97 - info.setAddress(sign.getAddress()); 96 + if (sign.getId().equals(scheduling.getSignInId())) {
  97 + info.setAddress(sign.getSiteName());
98 } 98 }
99 } 99 }
100 info.setResult(Objects.isNull(scheduling.getRemark()) ? "未签" : scheduling.getRemark()); 100 info.setResult(Objects.isNull(scheduling.getRemark()) ? "未签" : scheduling.getRemark());
@@ -293,56 +293,84 @@ public class BigViewServiceImpl implements BigViewService { @@ -293,56 +293,84 @@ public class BigViewServiceImpl implements BigViewService {
293 return personInfoVo; 293 return personInfoVo;
294 } 294 }
295 295
296 - private Integer handleType(String type, String dateKey) { 296 + private SignNumberVo handleType(String type, String dateKey) {
297 String key = dateKey.replaceAll("-", ""); 297 String key = dateKey.replaceAll("-", "");
298 Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key); 298 Map<String, List<DriverScheduling>> map = cache.getCacheScheduling(key);
299 Map<String, Object> typeMap = new HashMap<>(map.size()); 299 Map<String, Object> typeMap = new HashMap<>(map.size());
  300 + SignNumberVo vo = new SignNumberVo();
300 switch (type) { 301 switch (type) {
301 case "device": 302 case "device":
302 - return schedulingMapper.queryNumberByDevice(); 303 + vo.setTitle("设备数");
  304 + vo.setNowNumber(schedulingMapper.queryNumberByDevice());
  305 + return vo;
303 case "line": 306 case "line":
304 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { 307 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) {
305 for (DriverScheduling scheduling : entry.getValue()) { 308 for (DriverScheduling scheduling : entry.getValue()) {
306 typeMap.put(scheduling.getLineName(), ""); 309 typeMap.put(scheduling.getLineName(), "");
307 } 310 }
308 } 311 }
309 - return typeMap.size(); 312 + vo.setTitle("线路数");
  313 + vo.setNowNumber(typeMap.size());
  314 + return vo;
310 case "car": 315 case "car":
311 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { 316 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) {
312 for (DriverScheduling scheduling : entry.getValue()) { 317 for (DriverScheduling scheduling : entry.getValue()) {
313 typeMap.put(scheduling.getNbbm(), ""); 318 typeMap.put(scheduling.getNbbm(), "");
314 } 319 }
315 } 320 }
316 - return typeMap.size(); 321 + vo.setTitle("车辆数");
  322 + vo.setNowNumber(typeMap.size());
  323 + return vo;
317 case "sale": 324 case "sale":
  325 + Map<String,Object> saleAllMap = new HashMap<>();
318 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { 326 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) {
319 for (DriverScheduling scheduling : entry.getValue()) { 327 for (DriverScheduling scheduling : entry.getValue()) {
320 - if (SALE_STRING.equals(scheduling.getPosts()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getNbbm()) && !Objects.isNull(scheduling.getSignInId())) {  
321 - typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), ""); 328 + if (SALE_STRING.equals(scheduling.getPosts()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getNbbm())) {
  329 + if (!Objects.isNull(scheduling.getSignInId())) {
  330 + typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
  331 + }
  332 + saleAllMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
322 } 333 }
323 } 334 }
324 } 335 }
325 - return typeMap.size(); 336 + vo.setTitle("售票员签到");
  337 + vo.setNowNumber(typeMap.size());
  338 + vo.setAllNumber(saleAllMap.size());
  339 + return vo;
326 case "driver": 340 case "driver":
  341 + Map<String,Object> driverAllMap = new HashMap<>();
327 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { 342 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) {
328 for (DriverScheduling scheduling : entry.getValue()) { 343 for (DriverScheduling scheduling : entry.getValue()) {
329 - if (DRIVER_STRING.equals(scheduling.getPosts()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getNbbm()) && !Objects.isNull(scheduling.getSignInId())) {  
330 - typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), ""); 344 + if (DRIVER_STRING.equals(scheduling.getPosts()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getNbbm())) {
  345 + if (!Objects.isNull(scheduling.getSignInId())){
  346 + typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
  347 + }
  348 + driverAllMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
331 } 349 }
332 } 350 }
333 } 351 }
334 - return typeMap.size(); 352 + vo.setTitle("驾驶员签到");
  353 + vo.setNowNumber(typeMap.size());
  354 + vo.setAllNumber(driverAllMap.size());
  355 + return vo;
335 case "auxiliary": 356 case "auxiliary":
  357 + Map<String,Object> auxiliaryAllMap = new HashMap<>();
336 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) { 358 for (Map.Entry<String, List<DriverScheduling>> entry : map.entrySet()) {
337 for (DriverScheduling scheduling : entry.getValue()) { 359 for (DriverScheduling scheduling : entry.getValue()) {
338 - if (Objects.isNull(scheduling.getNbbm()) && BC_TYPE_OUT.equals(scheduling.getBcType()) && !Objects.isNull(scheduling.getSignInId())) {  
339 - typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), ""); 360 + if (Objects.isNull(scheduling.getNbbm()) && BC_TYPE_OUT.equals(scheduling.getBcType())) {
  361 + if ( !Objects.isNull(scheduling.getSignInId())){
  362 + typeMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
  363 + }
  364 + auxiliaryAllMap.put(scheduling.getJobCode() + scheduling.getBcType(), "");
340 } 365 }
341 } 366 }
342 } 367 }
343 - return typeMap.size(); 368 + vo.setTitle("辅助人员签到");
  369 + vo.setNowNumber(typeMap.size());
  370 + vo.setAllNumber(auxiliaryAllMap.size());
  371 + return vo;
344 default: 372 default:
345 - return 0; 373 + return vo;
346 } 374 }
347 } 375 }
348 } 376 }