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
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 | 19 | * @date 2024年07月30日 14:37 |
| 20 | 20 | */ |
| 21 | 21 | @RestController |
| 22 | -@RequestMapping("/test") | |
| 23 | -public class TestController { | |
| 22 | +@RequestMapping("/refresh") | |
| 23 | +public class RefreshController { | |
| 24 | 24 | @Autowired |
| 25 | 25 | private DriverJob driverJob; |
| 26 | 26 | @Autowired |
| ... | ... | @@ -28,19 +28,12 @@ public class TestController { |
| 28 | 28 | @Autowired |
| 29 | 29 | private NewDriverService newDriverService; |
| 30 | 30 | |
| 31 | - @GetMapping(value = "/test") | |
| 32 | - @ApiOperation("test") | |
| 31 | + @GetMapping(value = "/scheduling") | |
| 32 | + @ApiOperation("scheduling") | |
| 33 | 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 | 34 | Date date = new Date(); |
| 42 | 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 | 39 | return ResponseResult.success(); |
| ... | ... | @@ -54,7 +47,8 @@ public class TestController { |
| 54 | 47 | } |
| 55 | 48 | |
| 56 | 49 | @GetMapping(value = "/driver") |
| 57 | - public ResponseResult<Boolean> insertDriver(){ | |
| 50 | + @ApiOperation("driver") | |
| 51 | + public ResponseResult<Boolean> insertDriver() { | |
| 58 | 52 | newDriverService.insertJob(); |
| 59 | 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 | 244 | |
| 245 | 245 | @PostMapping(value = "Driver/UpLoadPicture") |
| 246 | 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 | 248 | if (bindingResult.hasErrors()) { |
| 249 | 249 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 250 | 250 | } |
| 251 | 251 | List<LinggangSignInResource> convertLinggangSignInResources = convertLinggangSignInResource(dto); |
| 252 | 252 | try { |
| 253 | 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 | 256 | } catch (InterruptException e) { |
| 256 | 257 | log.error("图片上传失败,[{}]", dto); |
| 257 | 258 | return ResponseResult.error("上传失败,请稍后再试"); |
| ... | ... | @@ -260,14 +261,14 @@ public class DssDriverController extends BaseController { |
| 260 | 261 | |
| 261 | 262 | @PostMapping(value = "/Driver/UpLoadVideo") |
| 262 | 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 | 265 | if (bindingResult.hasErrors()) { |
| 265 | 266 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 266 | 267 | } |
| 267 | 268 | LinggangSignInResource resource = cconvertLinggangSignInResource(dto); |
| 268 | 269 | try { |
| 269 | 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 | 272 | } catch (InterruptException e) { |
| 272 | 273 | log.error("视频上传失败,[{}]", dto); |
| 273 | 274 | return ResponseResult.error("上传失败,请稍后再试"); |
| ... | ... | @@ -474,6 +475,8 @@ public class DssDriverController extends BaseController { |
| 474 | 475 | resource.setCreateTime(new Date()); |
| 475 | 476 | resource.setDevice(dto.getDevice()); |
| 476 | 477 | resource.setContent(pic.getPic()); |
| 478 | + | |
| 479 | + resources.add(resource); | |
| 477 | 480 | } |
| 478 | 481 | |
| 479 | 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 | 420 | List<String> keys = new ArrayList<>(driverSchedulingMap.keySet()); |
| 421 | 421 | for (String key : keys) { |
| 422 | 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 | 436 | schedulingList.sort(Comparator.comparing(ResponseSchedulingDto::getFcsjT)); |
| 424 | 437 | } |
| 425 | 438 | // 存入签到报表 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/pojo/response/ResponseSchedulingDto.java
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
| ... | ... | @@ -420,7 +420,7 @@ public class ThreadJobService { |
| 420 | 420 | //查询当天是否保存过考情表 如果不存在则保存 |
| 421 | 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 | 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 | 424 | String dateStr = DateUtil.YYYY_MM_DD.format(date); |
| 425 | 425 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); |
| 426 | 426 | NowSchedulingCache.handlerResultMap(resultMap, bcList); |
| ... | ... | @@ -433,8 +433,10 @@ public class ThreadJobService { |
| 433 | 433 | log.info("调度最新数据:{},当天获取数据:{},时间:[{}]", originSchedulingMap.size(),bcList.size(),date); |
| 434 | 434 | return; |
| 435 | 435 | } |
| 436 | - // TODO maybe delete | |
| 437 | - TempCache.resetMapStatus(); | |
| 436 | + | |
| 437 | + if(Objects.equals(1,type)) { | |
| 438 | + TempCache.resetMapStatus(); | |
| 439 | + } | |
| 438 | 440 | bcList = getBcList(originSchedulingMap, type); |
| 439 | 441 | |
| 440 | 442 | // 处理非司售人员的排班明细 |
| ... | ... | @@ -483,7 +485,7 @@ public class ThreadJobService { |
| 483 | 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 | 487 | String dateStr = DateUtil.YYYY_MM_DD.format(date); |
| 486 | - if (!CollectionUtil.isEmpty(bcList)) { | |
| 488 | + if (!CollectionUtil.isEmpty(bcList) && Objects.equals(1,type)) { | |
| 487 | 489 | Map<String, List<DriverScheduling>> resultMap = new HashMap<>(800); |
| 488 | 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 | 166 | builder.append(UUID.randomUUID().toString().replace("-", "")); |
| 167 | 167 | builder.append(".mp4"); |
| 168 | 168 | |
| 169 | + entity.setPath(builder.toString()); | |
| 169 | 170 | boolean flag = save(entity); |
| 170 | 171 | if (flag) { |
| 171 | 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 | 215 | faceFeature: |
| 216 | 216 | url: http://222.76.217.238:8880/fcgi-bin/entry.fcgi/system |
| 217 | 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