Commit 0978e53ee38ec47dccf353262e8236c021e28788
1 parent
41f21df0
酒测未通过审核
Showing
10 changed files
with
61 additions
and
23 deletions
Bsth-admin/src/main/java/com/ruoyi/common/TipEnum.java
| @@ -27,6 +27,7 @@ public enum TipEnum { | @@ -27,6 +27,7 @@ public enum TipEnum { | ||
| 27 | TIP_404(404, "Not Found"), | 27 | TIP_404(404, "Not Found"), |
| 28 | 28 | ||
| 29 | TIP_500(500, "ERROR"), | 29 | TIP_500(500, "ERROR"), |
| 30 | + TIP_504(504, "EXCEPTION"), | ||
| 30 | ; | 31 | ; |
| 31 | private int code; | 32 | private int code; |
| 32 | private String msg; | 33 | private String msg; |
Bsth-admin/src/main/java/com/ruoyi/controller/TestController.java renamed to Bsth-admin/src/main/java/com/ruoyi/controller/RefreshController.java
| @@ -19,8 +19,8 @@ import java.util.Date; | @@ -19,8 +19,8 @@ import java.util.Date; | ||
| 19 | * @date 2024年07月30日 14:37 | 19 | * @date 2024年07月30日 14:37 |
| 20 | */ | 20 | */ |
| 21 | @RestController | 21 | @RestController |
| 22 | -@RequestMapping("/test") | ||
| 23 | -public class TestController { | 22 | +@RequestMapping("/refresh") |
| 23 | +public class RefreshController { | ||
| 24 | @Autowired | 24 | @Autowired |
| 25 | private DriverJob driverJob; | 25 | private DriverJob driverJob; |
| 26 | @Autowired | 26 | @Autowired |
| @@ -28,19 +28,12 @@ public class TestController { | @@ -28,19 +28,12 @@ public class TestController { | ||
| 28 | @Autowired | 28 | @Autowired |
| 29 | private NewDriverService newDriverService; | 29 | private NewDriverService newDriverService; |
| 30 | 30 | ||
| 31 | - @GetMapping(value = "/test") | ||
| 32 | - @ApiOperation("test") | 31 | + @GetMapping(value = "/scheduling") |
| 32 | + @ApiOperation("scheduling") | ||
| 33 | public ResponseResult<Boolean> test() { | 33 | public ResponseResult<Boolean> test() { |
| 34 | - // driverJob.getSchedulingInfo("02:30:30"); | ||
| 35 | -// Calendar calendar = Calendar.getInstance(); | ||
| 36 | -// calendar.setTime(new Date()); | ||
| 37 | -// calendar.set(Calendar.HOUR,2); | ||
| 38 | -// calendar.set(Calendar.MINUTE,30); | ||
| 39 | -// calendar.set(Calendar.SECOND,30); | ||
| 40 | -// Date date = calendar.getTime(); | ||
| 41 | Date date = new Date(); | 34 | Date date = new Date(); |
| 42 | for (int i = 0; i < 2; i++) { | 35 | for (int i = 0; i < 2; i++) { |
| 43 | - driverJob.runScheduling(DateUtils.addDays(date,i).getTime()); | 36 | + driverJob.runScheduling(DateUtils.addDays(date, i).getTime()); |
| 44 | } | 37 | } |
| 45 | 38 | ||
| 46 | return ResponseResult.success(); | 39 | return ResponseResult.success(); |
| @@ -54,7 +47,8 @@ public class TestController { | @@ -54,7 +47,8 @@ public class TestController { | ||
| 54 | } | 47 | } |
| 55 | 48 | ||
| 56 | @GetMapping(value = "/driver") | 49 | @GetMapping(value = "/driver") |
| 57 | - public ResponseResult<Boolean> insertDriver(){ | 50 | + @ApiOperation("driver") |
| 51 | + public ResponseResult<Boolean> insertDriver() { | ||
| 58 | newDriverService.insertJob(); | 52 | newDriverService.insertJob(); |
| 59 | return ResponseResult.success(); | 53 | return ResponseResult.success(); |
| 60 | } | 54 | } |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| @@ -244,14 +244,15 @@ public class DssDriverController extends BaseController { | @@ -244,14 +244,15 @@ public class DssDriverController extends BaseController { | ||
| 244 | 244 | ||
| 245 | @PostMapping(value = "Driver/UpLoadPicture") | 245 | @PostMapping(value = "Driver/UpLoadPicture") |
| 246 | @ApiOperation(value = "25.酒测照片上传") | 246 | @ApiOperation(value = "25.酒测照片上传") |
| 247 | - public ResponseResult<Boolean> UpLoadPicture(@Valid @RequestBody UpLoadPictureDTO dto, BindingResult bindingResult) { | 247 | + public ResponseResult<Set<String>> UpLoadPicture(@Valid @RequestBody UpLoadPictureDTO dto, BindingResult bindingResult) { |
| 248 | if (bindingResult.hasErrors()) { | 248 | if (bindingResult.hasErrors()) { |
| 249 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 249 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 250 | } | 250 | } |
| 251 | List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto); | 251 | List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto); |
| 252 | try { | 252 | try { |
| 253 | boolean flag = signInResourceService.insertImage(convertLinggangSignInResources); | 253 | boolean flag = signInResourceService.insertImage(convertLinggangSignInResources); |
| 254 | - return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("上传失败,请稍后再试"); | 254 | + Set<String> paths = convertLinggangSignInResources.stream().map(LinggangSignInResource::getPath).collect(Collectors.toSet()); |
| 255 | + return flag ? ResponseResult.success(paths) : ResponseResult.error("上传失败,请稍后再试"); | ||
| 255 | } catch (InterruptException e) { | 256 | } catch (InterruptException e) { |
| 256 | log.error("图片上传失败,[{}]", dto); | 257 | log.error("图片上传失败,[{}]", dto); |
| 257 | return ResponseResult.error("上传失败,请稍后再试"); | 258 | return ResponseResult.error("上传失败,请稍后再试"); |
| @@ -260,14 +261,14 @@ public class DssDriverController extends BaseController { | @@ -260,14 +261,14 @@ public class DssDriverController extends BaseController { | ||
| 260 | 261 | ||
| 261 | @PostMapping(value = "/Driver/UpLoadVideo") | 262 | @PostMapping(value = "/Driver/UpLoadVideo") |
| 262 | @ApiOperation(value = "26.酒测视频上传") | 263 | @ApiOperation(value = "26.酒测视频上传") |
| 263 | - public ResponseResult<Boolean> UpLoadVideo(@Valid @RequestBody UpLoadVideoDTO dto, BindingResult bindingResult) { | 264 | + public ResponseResult<String> UpLoadVideo(@Valid @RequestBody UpLoadVideoDTO dto, BindingResult bindingResult) { |
| 264 | if (bindingResult.hasErrors()) { | 265 | if (bindingResult.hasErrors()) { |
| 265 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); | 266 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 266 | } | 267 | } |
| 267 | LinggangSignInResource resource = cconvertLinggangSignInResource(dto); | 268 | LinggangSignInResource resource = cconvertLinggangSignInResource(dto); |
| 268 | try { | 269 | try { |
| 269 | boolean flag = signInResourceService.insertVoide(resource); | 270 | boolean flag = signInResourceService.insertVoide(resource); |
| 270 | - return flag ? ResponseResult.success(Boolean.TRUE) : ResponseResult.error("上传失败,请稍后再试"); | 271 | + return flag ? ResponseResult.success(resource.getPath()) : ResponseResult.error("上传失败,请稍后再试"); |
| 271 | } catch (InterruptException e) { | 272 | } catch (InterruptException e) { |
| 272 | log.error("视频上传失败,[{}]", dto); | 273 | log.error("视频上传失败,[{}]", dto); |
| 273 | return ResponseResult.error("上传失败,请稍后再试"); | 274 | return ResponseResult.error("上传失败,请稍后再试"); |
| @@ -474,6 +475,8 @@ public class DssDriverController extends BaseController { | @@ -474,6 +475,8 @@ public class DssDriverController extends BaseController { | ||
| 474 | resource.setCreateTime(new Date()); | 475 | resource.setCreateTime(new Date()); |
| 475 | resource.setDevice(dto.getDevice()); | 476 | resource.setDevice(dto.getDevice()); |
| 476 | resource.setContent(pic.getPic()); | 477 | resource.setContent(pic.getPic()); |
| 478 | + | ||
| 479 | + resources.add(resource); | ||
| 477 | } | 480 | } |
| 478 | 481 | ||
| 479 | return resources; | 482 | return resources; |
Bsth-admin/src/main/java/com/ruoyi/interceptor/MyExceptionHandler.java
0 → 100644
| 1 | +package com.ruoyi.interceptor; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.TipEnum; | ||
| 4 | +import com.ruoyi.common.core.domain.ResponseResult; | ||
| 5 | +import lombok.extern.slf4j.Slf4j; | ||
| 6 | +import org.springframework.web.bind.annotation.ControllerAdvice; | ||
| 7 | +import org.springframework.web.bind.annotation.ExceptionHandler; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @author liujun | ||
| 11 | + * @date 2024年08月14日 10:52 | ||
| 12 | + */ | ||
| 13 | +@Slf4j | ||
| 14 | +@ControllerAdvice | ||
| 15 | +public class MyExceptionHandler { | ||
| 16 | + @ExceptionHandler(value = Exception.class) | ||
| 17 | + public <T> ResponseResult<T> exceptionHandler(Exception e) { | ||
| 18 | + log.error(e.getMessage(), e); | ||
| 19 | + return ResponseResult.error(TipEnum.TIP_504.getCode(), TipEnum.TIP_504.getMsg()); | ||
| 20 | + } | ||
| 21 | +} |
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
| @@ -420,6 +420,19 @@ public class DriverJob implements InitializingBean { | @@ -420,6 +420,19 @@ public class DriverJob implements InitializingBean { | ||
| 420 | List<String> keys = new ArrayList<>(driverSchedulingMap.keySet()); | 420 | List<String> keys = new ArrayList<>(driverSchedulingMap.keySet()); |
| 421 | for (String key : keys) { | 421 | for (String key : keys) { |
| 422 | List<ResponseSchedulingDto> schedulingList = driverSchedulingMap.get(key); | 422 | List<ResponseSchedulingDto> schedulingList = driverSchedulingMap.get(key); |
| 423 | + if(CollectionUtils.isNotEmpty(schedulingList)){ | ||
| 424 | + schedulingList = schedulingList.stream().map(s->{ | ||
| 425 | + if(Objects.isNull(s.getFcsjT())){ | ||
| 426 | + s.setFcsjT(0L); | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + if(Objects.isNull(s.getZdsjT())){ | ||
| 430 | + s.setZdsjT(0L); | ||
| 431 | + } | ||
| 432 | + | ||
| 433 | + return s; | ||
| 434 | + }).collect(Collectors.toList()); | ||
| 435 | + } | ||
| 423 | schedulingList.sort(Comparator.comparing(ResponseSchedulingDto::getFcsjT)); | 436 | schedulingList.sort(Comparator.comparing(ResponseSchedulingDto::getFcsjT)); |
| 424 | } | 437 | } |
| 425 | // 存入签到报表 | 438 | // 存入签到报表 |
Bsth-admin/src/main/java/com/ruoyi/pojo/response/ResponseSchedulingDto.java
| @@ -49,4 +49,6 @@ public class ResponseSchedulingDto implements Serializable { | @@ -49,4 +49,6 @@ public class ResponseSchedulingDto implements Serializable { | ||
| 49 | private String remarks; | 49 | private String remarks; |
| 50 | private List<CTasks> cTasks; | 50 | private List<CTasks> cTasks; |
| 51 | private String name; | 51 | private String name; |
| 52 | + | ||
| 53 | + | ||
| 52 | } | 54 | } |
| 53 | \ No newline at end of file | 55 | \ No newline at end of file |
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| @@ -420,7 +420,7 @@ public class ThreadJobService { | @@ -420,7 +420,7 @@ public class ThreadJobService { | ||
| 420 | //查询当天是否保存过考情表 如果不存在则保存 | 420 | //查询当天是否保存过考情表 如果不存在则保存 |
| 421 | List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date),DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null); | 421 | List<DriverScheduling> bcList = schedulingMapper.queryToDay(DateUtil.YYYY_MM_DD_LINK.format(date),DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null); |
| 422 | Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(date)); | 422 | Map<String, List<DriverScheduling>> dto = nowSchedulingCache.getCacheScheduling(ConstDateUtil.formatDate(date)); |
| 423 | - if(CollectionUtils.isNotEmpty(bcList) && MapUtils.isEmpty(dto)){ | 423 | + if(CollectionUtils.isNotEmpty(bcList) && MapUtils.isEmpty(dto) && Objects.equals(1,type)){ |
| 424 | String dateStr = DateUtil.YYYY_MM_DD.format(date); | 424 | String dateStr = DateUtil.YYYY_MM_DD.format(date); |
| 425 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); | 425 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); |
| 426 | NowSchedulingCache.handlerResultMap(resultMap, bcList); | 426 | NowSchedulingCache.handlerResultMap(resultMap, bcList); |
| @@ -433,8 +433,10 @@ public class ThreadJobService { | @@ -433,8 +433,10 @@ public class ThreadJobService { | ||
| 433 | log.info("调度最新数据:{},当天获取数据:{},时间:[{}]", originSchedulingMap.size(),bcList.size(),date); | 433 | log.info("调度最新数据:{},当天获取数据:{},时间:[{}]", originSchedulingMap.size(),bcList.size(),date); |
| 434 | return; | 434 | return; |
| 435 | } | 435 | } |
| 436 | - // TODO maybe delete | ||
| 437 | - TempCache.resetMapStatus(); | 436 | + |
| 437 | + if(Objects.equals(1,type)) { | ||
| 438 | + TempCache.resetMapStatus(); | ||
| 439 | + } | ||
| 438 | bcList = getBcList(originSchedulingMap, type); | 440 | bcList = getBcList(originSchedulingMap, type); |
| 439 | 441 | ||
| 440 | // 处理非司售人员的排班明细 | 442 | // 处理非司售人员的排班明细 |
| @@ -483,7 +485,7 @@ public class ThreadJobService { | @@ -483,7 +485,7 @@ public class ThreadJobService { | ||
| 483 | bcList = schedulingMapper.queryToDay(dateStr1, DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null); | 485 | bcList = schedulingMapper.queryToDay(dateStr1, DateUtil.YYYY_MM_DD_LINK.format(org.apache.commons.lang3.time.DateUtils.addDays(date,1)), null, null, null); |
| 484 | // 处理缓存和错误排班 | 486 | // 处理缓存和错误排班 |
| 485 | String dateStr = DateUtil.YYYY_MM_DD.format(date); | 487 | String dateStr = DateUtil.YYYY_MM_DD.format(date); |
| 486 | - if (!CollectionUtil.isEmpty(bcList)) { | 488 | + if (!CollectionUtil.isEmpty(bcList) && Objects.equals(1,type)) { |
| 487 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); | 489 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); |
| 488 | NowSchedulingCache.handlerResultMap(resultMap, bcList); | 490 | NowSchedulingCache.handlerResultMap(resultMap, bcList); |
| 489 | // 更新缓存 | 491 | // 更新缓存 |
Bsth-admin/src/main/java/com/ruoyi/service/impl/sign/in/resource/LinggangSignInResourceServiceImpl.java
| @@ -166,6 +166,7 @@ public class LinggangSignInResourceServiceImpl extends ServiceImpl<LinggangSignI | @@ -166,6 +166,7 @@ public class LinggangSignInResourceServiceImpl extends ServiceImpl<LinggangSignI | ||
| 166 | builder.append(UUID.randomUUID().toString().replace("-", "")); | 166 | builder.append(UUID.randomUUID().toString().replace("-", "")); |
| 167 | builder.append(".mp4"); | 167 | builder.append(".mp4"); |
| 168 | 168 | ||
| 169 | + entity.setPath(builder.toString()); | ||
| 169 | boolean flag = save(entity); | 170 | boolean flag = save(entity); |
| 170 | if (flag) { | 171 | if (flag) { |
| 171 | ResponseResult<Boolean> result = uploadUtil.uploadVideoOfBase64(entity.getContent(), entity.getPath()); | 172 | ResponseResult<Boolean> result = uploadUtil.uploadVideoOfBase64(entity.getContent(), entity.getPath()); |
Bsth-admin/src/main/resources/application-druid-devTest.yml
| @@ -215,4 +215,4 @@ bsth: | @@ -215,4 +215,4 @@ bsth: | ||
| 215 | faceFeature: | 215 | faceFeature: |
| 216 | url: http://222.76.217.238:8880/fcgi-bin/entry.fcgi/system | 216 | url: http://222.76.217.238:8880/fcgi-bin/entry.fcgi/system |
| 217 | skip: | 217 | skip: |
| 218 | - url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/test/**;/login/no/code | 218 | + url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/login/no/code |
Bsth-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
| 1 | package com.ruoyi.common.utils; | 1 | package com.ruoyi.common.utils; |
| 2 | 2 | ||
| 3 | +import org.apache.commons.lang3.exception.ExceptionUtils; | ||
| 4 | + | ||
| 3 | import java.io.PrintWriter; | 5 | import java.io.PrintWriter; |
| 4 | import java.io.StringWriter; | 6 | import java.io.StringWriter; |
| 5 | -import org.apache.commons.lang3.exception.ExceptionUtils; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 错误信息处理类。 | 9 | * 错误信息处理类。 |