Commit 30c97f431e655436e6200f21ea23693f78db8c90

Authored by liujun001
1 parent fa9ea695

对接文件系统和蓝斯设备日志上传

Bsth-admin/src/main/java/com/ruoyi/config/BsthSystemConfig.java
1 package com.ruoyi.config; 1 package com.ruoyi.config;
2 2
3 -import com.ruoyi.common.config.RuoYiConfig; 3 +import com.ruoyi.system.service.ISysDictDataService;
  4 +import com.ruoyi.utils.SpringApplicationUtil;
4 import lombok.Data; 5 import lombok.Data;
5 import org.apache.commons.lang3.ArrayUtils; 6 import org.apache.commons.lang3.ArrayUtils;
6 -import org.springframework.beans.factory.annotation.Autowired;  
7 import org.springframework.beans.factory.annotation.Value; 7 import org.springframework.beans.factory.annotation.Value;
8 import org.springframework.stereotype.Component; 8 import org.springframework.stereotype.Component;
9 9
@@ -30,22 +30,25 @@ public class BsthSystemConfig { @@ -30,22 +30,25 @@ public class BsthSystemConfig {
30 @Value("${api.url.getDriverInfo}") 30 @Value("${api.url.getDriverInfo}")
31 private String getDriverInfoURL; 31 private String getDriverInfoURL;
32 32
33 - @Autowired  
34 - private RuoYiConfig ruoYiConfig; 33 +// @Autowired
  34 +// private RuoYiConfig ruoYiConfig;
35 35
36 @Value("${bsth.face.faceFeature.url}") 36 @Value("${bsth.face.faceFeature.url}")
37 private String faceFeatureURL; 37 private String faceFeatureURL;
38 38
39 - public String getImageBasePath(){  
40 - return combationChar(ruoYiConfig.getUploadPath(),imageBasePath1); 39 + public String getImageBasePath() {
  40 + ISysDictDataService service = SpringApplicationUtil.getBean(ISysDictDataService.class);
  41 + return service.combationValue("");
  42 +// return combationChar(ruoYiConfig.getUploadPath(),imageBasePath1);
41 } 43 }
42 44
43 45
44 - public String getVideoBasePath(){  
45 - return combationChar(ruoYiConfig.getUploadPath(),videoBasePath1); 46 + public String getVideoBasePath() {
  47 + ISysDictDataService service = SpringApplicationUtil.getBean(ISysDictDataService.class);
  48 + return service.combationValue("");
46 } 49 }
47 50
48 - public static String combationChar(String...strs){ 51 + public static String combationChar(String... strs) {
49 StringBuilder builder = new StringBuilder(); 52 StringBuilder builder = new StringBuilder();
50 int length = ArrayUtils.getLength(strs); 53 int length = ArrayUtils.getLength(strs);
51 for (int i = 0; i < length; i++) { 54 for (int i = 0; i < length; i++) {
Bsth-admin/src/main/java/com/ruoyi/config/FaceEngineConfig.java
@@ -31,10 +31,8 @@ public class FaceEngineConfig { @@ -31,10 +31,8 @@ public class FaceEngineConfig {
31 31
32 @Bean 32 @Bean
33 public FaceEngine createFaceEngine(BsthSystemConfig bsthSystemConfig) { 33 public FaceEngine createFaceEngine(BsthSystemConfig bsthSystemConfig) {
34 - if(isDev()){  
35 - return null;  
36 - }  
37 FaceEngine faceEngine = new FaceEngine(bsthSystemConfig.getFaceLibPath()); 34 FaceEngine faceEngine = new FaceEngine(bsthSystemConfig.getFaceLibPath());
  35 +
38 // FaceEngine faceEngine = new FaceEngine("D:\\\\arcsoft_lib"); 36 // FaceEngine faceEngine = new FaceEngine("D:\\\\arcsoft_lib");
39 //激活引擎 37 //激活引擎
40 int errorCode = faceEngine.activeOnline(bsthSystemConfig.getFaceAppId(), bsthSystemConfig.getFaceSdkKey()); 38 int errorCode = faceEngine.activeOnline(bsthSystemConfig.getFaceAppId(), bsthSystemConfig.getFaceSdkKey());
Bsth-admin/src/main/java/com/ruoyi/controller/RefreshController.java
1 package com.ruoyi.controller; 1 package com.ruoyi.controller;
2 2
3 import com.alibaba.fastjson2.JSON; 3 import com.alibaba.fastjson2.JSON;
  4 +import com.alibaba.fastjson2.JSONObject;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 import com.ruoyi.common.core.domain.ResponseResult; 6 import com.ruoyi.common.core.domain.ResponseResult;
5 import com.ruoyi.common.utils.sign.Base64; 7 import com.ruoyi.common.utils.sign.Base64;
6 import com.ruoyi.controller.dss.DssFaceController; 8 import com.ruoyi.controller.dss.DssFaceController;
@@ -8,6 +10,7 @@ import com.ruoyi.domain.driver.NewDriver; @@ -8,6 +10,7 @@ import com.ruoyi.domain.driver.NewDriver;
8 import com.ruoyi.domain.driver.dss.syn.res.dto.FaceRegisterDTO; 10 import com.ruoyi.domain.driver.dss.syn.res.dto.FaceRegisterDTO;
9 import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; 11 import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo;
10 import com.ruoyi.domain.scheduling.LinggangScheduling; 12 import com.ruoyi.domain.scheduling.LinggangScheduling;
  13 +import com.ruoyi.domain.sign.in.resource.LinggangSignInResource;
11 import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; 14 import com.ruoyi.domain.sign.in.summary.SignReportDaySummary;
12 import com.ruoyi.equipment.domain.Equipment; 15 import com.ruoyi.equipment.domain.Equipment;
13 import com.ruoyi.equipment.service.IEquipmentService; 16 import com.ruoyi.equipment.service.IEquipmentService;
@@ -17,12 +20,15 @@ import com.ruoyi.service.SignReportServer; @@ -17,12 +20,15 @@ import com.ruoyi.service.SignReportServer;
17 import com.ruoyi.service.driver.NewDriverService; 20 import com.ruoyi.service.driver.NewDriverService;
18 import com.ruoyi.service.key.location.LinggangKeyWorkLocationService; 21 import com.ruoyi.service.key.location.LinggangKeyWorkLocationService;
19 import com.ruoyi.service.scheduling.LinggangSchedulingService; 22 import com.ruoyi.service.scheduling.LinggangSchedulingService;
  23 +import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService;
20 import com.ruoyi.service.sign.in.summary.SignReportDaySummaryService; 24 import com.ruoyi.service.sign.in.summary.SignReportDaySummaryService;
21 import com.ruoyi.utils.DateUtil; 25 import com.ruoyi.utils.DateUtil;
  26 +import com.ruoyi.utils.HttpClientUtil;
22 import io.swagger.annotations.ApiOperation; 27 import io.swagger.annotations.ApiOperation;
23 import lombok.extern.slf4j.Slf4j; 28 import lombok.extern.slf4j.Slf4j;
24 import org.apache.commons.collections4.CollectionUtils; 29 import org.apache.commons.collections4.CollectionUtils;
25 import org.apache.commons.io.FileUtils; 30 import org.apache.commons.io.FileUtils;
  31 +import org.apache.commons.io.IOUtils;
26 import org.apache.commons.lang3.ArrayUtils; 32 import org.apache.commons.lang3.ArrayUtils;
27 import org.apache.commons.lang3.StringUtils; 33 import org.apache.commons.lang3.StringUtils;
28 import org.apache.commons.lang3.time.DateUtils; 34 import org.apache.commons.lang3.time.DateUtils;
@@ -31,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -31,8 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
31 import org.springframework.security.access.prepost.PreAuthorize; 37 import org.springframework.security.access.prepost.PreAuthorize;
32 import org.springframework.web.bind.annotation.*; 38 import org.springframework.web.bind.annotation.*;
33 39
34 -import java.io.File;  
35 -import java.io.IOException; 40 +import java.io.*;
36 import java.text.ParseException; 41 import java.text.ParseException;
37 import java.util.*; 42 import java.util.*;
38 import java.util.stream.Collectors; 43 import java.util.stream.Collectors;
@@ -63,6 +68,10 @@ public class RefreshController { @@ -63,6 +68,10 @@ public class RefreshController {
63 private SignReportServer signReportServer; 68 private SignReportServer signReportServer;
64 @Autowired 69 @Autowired
65 private SignReportSummerJob signReportSummerJob; 70 private SignReportSummerJob signReportSummerJob;
  71 + @Autowired
  72 + private HttpClientUtil httpClientUtil;
  73 + @Autowired
  74 + private LinggangSignInResourceService signInResourceService;
66 75
67 76
68 @GetMapping(value = "/scheduling") 77 @GetMapping(value = "/scheduling")
@@ -292,7 +301,7 @@ public class RefreshController { @@ -292,7 +301,7 @@ public class RefreshController {
292 boolean flag = false; 301 boolean flag = false;
293 while (true) { 302 while (true) {
294 index++; 303 index++;
295 - Date startDate1 = DateUtils.addMonths(startDate,index); 304 + Date startDate1 = DateUtils.addMonths(startDate, index);
296 dateStr = DateUtil.YYYY_MM_LINK.format(startDate1); 305 dateStr = DateUtil.YYYY_MM_LINK.format(startDate1);
297 List<SignReportGroupByVo> signReportGroupByVos = signReportServer.querySignReportGroupByDateStrVo(dateStr); 306 List<SignReportGroupByVo> signReportGroupByVos = signReportServer.querySignReportGroupByDateStrVo(dateStr);
298 307
@@ -302,7 +311,7 @@ public class RefreshController { @@ -302,7 +311,7 @@ public class RefreshController {
302 if (DateUtils.isSameDay(now, date)) { 311 if (DateUtils.isSameDay(now, date)) {
303 flag = true; 312 flag = true;
304 break; 313 break;
305 - }else if(date.getTime()>=now.getTime()){ 314 + } else if (date.getTime() >= now.getTime()) {
306 flag = true; 315 flag = true;
307 break; 316 break;
308 } 317 }
@@ -342,4 +351,159 @@ public class RefreshController { @@ -342,4 +351,159 @@ public class RefreshController {
342 return ResponseResult.success(); 351 return ResponseResult.success();
343 } 352 }
344 353
  354 + @GetMapping("/init/driver/data")
  355 + public ResponseResult<Boolean> initDriverData() {
  356 + LambdaQueryWrapper<NewDriver> ndWrapper = new LambdaQueryWrapper<>();
  357 + ndWrapper.isNotNull(NewDriver::getFaceFeature);
  358 +
  359 + List<NewDriver> drivers = newDriverService.list(ndWrapper);
  360 + if (CollectionUtils.isEmpty(drivers)) {
  361 + return ResponseResult.success(Boolean.TRUE);
  362 + }
  363 +
  364 + String basePath = "C:\\Users\\密码:0000\\Desktop\\fsdownload\\uploadPath\\upload\\image\\";
  365 + String basePath1 = "C:\\Users\\密码:0000\\Desktop\\fsdownload\\uploadPath\\upload\\image\\";
  366 + String token = getToken();
  367 + Map<String, Object> headMap = new HashMap<>();
  368 + headMap.put("Content-Type", "application/json");
  369 + headMap.put("Authorization", token);
  370 +
  371 + for (NewDriver driver : drivers) {
  372 + StringBuilder path = new StringBuilder();
  373 + path.append(basePath);
  374 + path.append(driver.getImage());
  375 +
  376 +
  377 + InputStream inputStream = null;
  378 + try {
  379 + File file = new File(path.toString());
  380 + inputStream = new FileInputStream(file);
  381 + String content = cn.hutool.core.codec.Base64.encode(inputStream);
  382 + Map<String, Object> pms = new HashMap<>();
  383 + pms.put("device", "10001");
  384 + pms.put("regTime", DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.format(new Date()));
  385 + pms.put("staffCode", driver.getJobCode());
  386 + pms.put("faceValue", content);
  387 +
  388 + String json = httpClientUtil.doPost("http://10.10.150.173:8102/dss/Face/FaceRegister", pms, headMap);
  389 + log.info("[{}],[{}]", json, JSON.toJSONString(pms));
  390 + } catch (Exception e) {
  391 + log.error("读取图片异常", e);
  392 + } finally {
  393 + IOUtils.closeQuietly(inputStream);
  394 + }
  395 + }
  396 + return ResponseResult.success(Boolean.TRUE);
  397 + }
  398 +
  399 + @GetMapping("/init/driver/sign/resource/{dateStr}")
  400 + public ResponseResult<Boolean> initDriverSignResource(@PathVariable String dateStr) {
  401 + LambdaQueryWrapper<LinggangSignInResource> wrapper = new LambdaQueryWrapper<>();
  402 + wrapper.ge(LinggangSignInResource::getTime, dateStr);
  403 +
  404 + List<LinggangSignInResource> sources = signInResourceService.list(wrapper);
  405 + if (CollectionUtils.isEmpty(sources)) {
  406 + return ResponseResult.success(Boolean.TRUE);
  407 + }
  408 +
  409 + String token = getToken();
  410 + String basePath = "C:\\Users\\密码:0000\\Desktop\\fsdownload\\uploadPath\\upload\\image\\";
  411 + for (LinggangSignInResource source : sources) {
  412 + if (Objects.equals(source.getResourceType(), 2)) {
  413 + uploadSignResource2(source, token, basePath);
  414 + } else {
  415 + uploadSignResource(source, token, basePath);
  416 + }
  417 + }
  418 +
  419 +
  420 + return ResponseResult.success(Boolean.TRUE);
  421 + }
  422 +
  423 + private String uploadSignResource(LinggangSignInResource source, String token, String basePath) {
  424 + Map<String, Object> headMap = new HashMap<>();
  425 + headMap.put("Content-Type", "application/json");
  426 + headMap.put("Authorization", token);
  427 +
  428 +
  429 + Map<String, Object> pms = new HashMap<>();
  430 + pms.put("device", "10001");
  431 + pms.put("driverCode", "10001");
  432 + pms.put("testId", source.getSignId());
  433 + pms.put("time", DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.format(source.getTime()));
  434 +
  435 + List<Map<String, Object>> lists = new ArrayList<>();
  436 + Map<String, Object> pms1 = new HashMap<>();
  437 + pms1.put("index", source.getIndex1());
  438 + pms1.put("time", DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.format(source.getTime()));
  439 +
  440 + InputStream inputStream = null;
  441 + try {
  442 + StringBuilder path = new StringBuilder();
  443 + path.append(basePath);
  444 + path.append(source.getPath());
  445 +
  446 + inputStream = new FileInputStream(new File(path.toString()));
  447 + String content = cn.hutool.core.codec.Base64.encode(inputStream);
  448 + pms1.put("pic", content);
  449 +
  450 + lists.add(pms1);
  451 + pms.put("picData", lists);
  452 +
  453 + String json = httpClientUtil.doPost("http://10.10.150.173:8102/dss/Driver/UpLoadPicture", pms, headMap);
  454 + log.info("[{}],[{}]", json, JSON.toJSONString(pms));
  455 + return json;
  456 + } catch (Exception e) {
  457 + log.error("读取图片异常", e);
  458 + } finally {
  459 + IOUtils.closeQuietly(inputStream);
  460 + }
  461 + return null;
  462 + }
  463 +
  464 + private String uploadSignResource2(LinggangSignInResource source, String token, String basePath) {
  465 + Map<String, Object> headMap = new HashMap<>();
  466 + headMap.put("Content-Type", "application/json");
  467 + headMap.put("Authorization", token);
  468 +
  469 +
  470 + Map<String, Object> pms = new HashMap<>();
  471 + pms.put("device", "10001");
  472 + pms.put("driverCode", "10001");
  473 + pms.put("testId", source.getSignId());
  474 + pms.put("time", DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.format(source.getTime()));
  475 +
  476 +
  477 + InputStream inputStream = null;
  478 + try {
  479 + StringBuilder path = new StringBuilder();
  480 + path.append(basePath);
  481 + path.append(source.getPath());
  482 +
  483 + inputStream = new FileInputStream(new File(path.toString()));
  484 + String content = cn.hutool.core.codec.Base64.encode(inputStream);
  485 + pms.put("video", content);
  486 +
  487 + String json = httpClientUtil.doPost("http://10.10.150.173:8102/dss/Driver/UpLoadVideo", pms, headMap);
  488 + log.info("[{}],[{}]", json, JSON.toJSONString(pms));
  489 + return json;
  490 + } catch (Exception e) {
  491 + log.error("读取图片异常", e);
  492 + } finally {
  493 + IOUtils.closeQuietly(inputStream);
  494 + }
  495 + return null;
  496 + }
  497 +
  498 +
  499 + private String getToken() {
  500 + Map<String, Object> pms = new HashMap<>();
  501 + pms.put("authTime", DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.format(new Date()));
  502 + pms.put("device", "10001");
  503 +
  504 + String json = httpClientUtil.doPost("http://10.10.150.173:8102/dss/Driver/Auth", pms, null);
  505 + JSONObject jsonObject = JSON.parseObject(json);
  506 + JSONObject jsonObject1 = jsonObject.getJSONObject("data");
  507 + return jsonObject1.getString("access_token");
  508 + }
345 } 509 }
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssFaceController.java
@@ -264,7 +264,7 @@ public class DssFaceController extends BaseController { @@ -264,7 +264,7 @@ public class DssFaceController extends BaseController {
264 264
265 private FaceCheckVo convertFaceCheckVo(NewDriver driver) { 265 private FaceCheckVo convertFaceCheckVo(NewDriver driver) {
266 FaceCheckVo faceCheckVo = new FaceCheckVo(); 266 FaceCheckVo faceCheckVo = new FaceCheckVo();
267 - faceCheckVo.setDriverCode(driver.getIcRfid()); 267 + faceCheckVo.setDriverCode(driver.getJobCode());
268 268
269 return faceCheckVo; 269 return faceCheckVo;
270 } 270 }
Bsth-admin/src/main/java/com/ruoyi/controller/venue/info/LinggangVenueInfoController.java
@@ -56,7 +56,17 @@ public class LinggangVenueInfoController extends BaseController { @@ -56,7 +56,17 @@ public class LinggangVenueInfoController extends BaseController {
56 public com.ruoyi.common.core.domain.ResponseResult<List<LinggangVenueInfoVO>> listSelect(LinggangVenueInfoQueryDTO request) { 56 public com.ruoyi.common.core.domain.ResponseResult<List<LinggangVenueInfoVO>> listSelect(LinggangVenueInfoQueryDTO request) {
57 LinggangVenueInfo entity = convert(request); 57 LinggangVenueInfo entity = convert(request);
58 List<LinggangVenueInfo> selectList = linggangVenueInfoService.listOfSelect(entity); 58 List<LinggangVenueInfo> selectList = linggangVenueInfoService.listOfSelect(entity);
59 - return com.ruoyi.common.core.domain.ResponseResult.success(convert(selectList)); 59 +
  60 + return com.ruoyi.common.core.domain.ResponseResult.success(
  61 + java.util.Optional.ofNullable(selectList).map(scs -> {
  62 + return scs.stream().map(source -> {
  63 + LinggangVenueInfoVO target = new LinggangVenueInfoVO();
  64 + BeanUtils.copyProperties(source, target);
  65 + target.setName(target.getName() + "-" + target.getParkCode());
  66 + return target;
  67 + }).collect(java.util.stream.Collectors.toList());
  68 + }).orElseGet(null)
  69 + );
60 } 70 }
61 71
62 @PreAuthorize("@ss.hasPermi('linggang:venue:info:export')") 72 @PreAuthorize("@ss.hasPermi('linggang:venue:info:export')")
Bsth-admin/src/main/java/com/ruoyi/driver/controller/DriverController.java
@@ -18,7 +18,6 @@ import com.ruoyi.system.service.ISysDictDataService; @@ -18,7 +18,6 @@ import com.ruoyi.system.service.ISysDictDataService;
18 import io.swagger.annotations.Api; 18 import io.swagger.annotations.Api;
19 import io.swagger.annotations.ApiOperation; 19 import io.swagger.annotations.ApiOperation;
20 import io.swagger.annotations.ApiParam; 20 import io.swagger.annotations.ApiParam;
21 -import org.apache.commons.lang3.StringUtils;  
22 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.validation.annotation.Validated; 22 import org.springframework.validation.annotation.Validated;
24 import org.springframework.web.bind.annotation.*; 23 import org.springframework.web.bind.annotation.*;
@@ -156,9 +155,7 @@ public class DriverController extends BaseController { @@ -156,9 +155,7 @@ public class DriverController extends BaseController {
156 @PutMapping("/edit") 155 @PutMapping("/edit")
157 @ApiOperation("修改驾驶员信息") 156 @ApiOperation("修改驾驶员信息")
158 public AjaxResult edit(@ApiParam("driver") @RequestBody Driver driver) { 157 public AjaxResult edit(@ApiParam("driver") @RequestBody Driver driver) {
159 - if (StringUtils.isNotEmpty(driver.getImage())) {  
160 - driver.setImage(sysDictDataService.splitURL(driver.getImage()));  
161 - } 158 +
162 return toAjax(driverService.updateDriver(driver) + 1); 159 return toAjax(driverService.updateDriver(driver) + 1);
163 } 160 }
164 161
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
@@ -51,7 +51,6 @@ import com.ruoyi.utils.ListUtils; @@ -51,7 +51,6 @@ import com.ruoyi.utils.ListUtils;
51 import com.ruoyi.utils.SpringApplicationUtil; 51 import com.ruoyi.utils.SpringApplicationUtil;
52 import org.apache.commons.collections4.CollectionUtils; 52 import org.apache.commons.collections4.CollectionUtils;
53 import org.apache.commons.io.FilenameUtils; 53 import org.apache.commons.io.FilenameUtils;
54 -import org.apache.commons.io.IOUtils;  
55 import org.apache.commons.lang3.RandomUtils; 54 import org.apache.commons.lang3.RandomUtils;
56 import org.apache.commons.lang3.StringUtils; 55 import org.apache.commons.lang3.StringUtils;
57 import org.slf4j.Logger; 56 import org.slf4j.Logger;
@@ -60,17 +59,14 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -60,17 +59,14 @@ import org.springframework.beans.factory.annotation.Autowired;
60 import org.springframework.beans.factory.annotation.Value; 59 import org.springframework.beans.factory.annotation.Value;
61 import org.springframework.stereotype.Service; 60 import org.springframework.stereotype.Service;
62 import org.springframework.web.multipart.MultipartFile; 61 import org.springframework.web.multipart.MultipartFile;
63 -import sun.misc.BASE64Encoder;  
64 62
65 import javax.annotation.Resource; 63 import javax.annotation.Resource;
66 import javax.servlet.ServletOutputStream; 64 import javax.servlet.ServletOutputStream;
67 import javax.servlet.http.HttpServletRequest; 65 import javax.servlet.http.HttpServletRequest;
68 import javax.servlet.http.HttpServletResponse; 66 import javax.servlet.http.HttpServletResponse;
69 import java.io.File; 67 import java.io.File;
70 -import java.io.FileInputStream;  
71 import java.io.IOException; 68 import java.io.IOException;
72 import java.io.InputStream; 69 import java.io.InputStream;
73 -import java.nio.file.Paths;  
74 import java.time.LocalDateTime; 70 import java.time.LocalDateTime;
75 import java.time.temporal.ChronoUnit; 71 import java.time.temporal.ChronoUnit;
76 import java.util.*; 72 import java.util.*;
@@ -313,7 +309,7 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme @@ -313,7 +309,7 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme
313 driver.setImageVersion(imageVersion.toString()); 309 driver.setImageVersion(imageVersion.toString());
314 log.info("[{}]", JSON.toJSONString(driver)); 310 log.info("[{}]", JSON.toJSONString(driver));
315 } 311 }
316 - 312 + driver.setImage(sysDictDataService.splitURL(driver.getImage()));
317 } 313 }
318 314
319 return driverMapper.updateDriver(driver); 315 return driverMapper.updateDriver(driver);
@@ -398,14 +394,11 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme @@ -398,14 +394,11 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme
398 } 394 }
399 395
400 @Override 396 @Override
401 - public AjaxResult uploadImage(MultipartFile file, Integer id) throws InvalidExtensionException, IOException {  
402 - // 上传并返回新文件名称  
403 - // 上传文件路径  
404 - String baseUrl = RuoYiConfig.getUploadPath() + headImagePre; 397 + public AjaxResult uploadImage(MultipartFile file, Integer id) throws InvalidExtensionException {
405 // 校验文件格式 398 // 校验文件格式
406 FileUploadUtils.assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); 399 FileUploadUtils.assertAllowed(file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
407 // 后期可以通过请求头拿到对应的工号 400 // 后期可以通过请求头拿到对应的工号
408 - String fileName = FilenameUtils.getBaseName(file.getOriginalFilename()) + "." + FileUploadUtils.getExtension(file); 401 + String fileName = FilenameUtils.getBaseName(file.getOriginalFilename()) +"_"+UUID.randomUUID().toString().replaceAll("-","")+ "." + FileUploadUtils.getExtension(file);
409 if (Objects.nonNull(id)) { 402 if (Objects.nonNull(id)) {
410 fileName = StringUtils.join(id, "/", fileName); 403 fileName = StringUtils.join(id, "/", fileName);
411 } else { 404 } else {
@@ -823,14 +816,10 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme @@ -823,14 +816,10 @@ public class DriverServiceImpl extends ServiceImpl&lt;DriverMapper, Driver&gt; impleme
823 } 816 }
824 817
825 private String calimageContentFaceFeature(String imagePath) { 818 private String calimageContentFaceFeature(String imagePath) {
826 - String baseUrl = RuoYiConfig.getUploadPath() + headImagePre;  
827 - try {  
828 - String path = FileUploadUtils.getAbsoluteFile(baseUrl, imagePath).getAbsolutePath();  
829 - ResponseResult<String> responseResult = SpringApplicationUtil.getBean(FaceService.class).getFaceFeatureImagePath(path);  
830 - return Objects.nonNull(responseResult) && responseResult.isSuccess() ? responseResult.getData() : null;  
831 - } catch (IOException e) {  
832 - throw new RuntimeException(e);  
833 - } 819 + String baseUrl = sysDictDataService.combationValue(imagePath);
  820 + ResponseResult<String> result = SpringApplicationUtil.getBean(FaceService.class).getFaceFeatureImageURL(baseUrl);
  821 + return Objects.isNull(result) ? null : result.isSuccess() ? result.getData() : null;
  822 +
834 } 823 }
835 824
836 825
Bsth-admin/src/main/java/com/ruoyi/mapper/venue/info/LinggangVenueInfoMapper.java
1 package com.ruoyi.mapper.venue.info; 1 package com.ruoyi.mapper.venue.info;
2 2
3 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.ruoyi.domain.DriverScheduling;
4 import com.ruoyi.domain.venue.info.LinggangVenueInfo; 5 import com.ruoyi.domain.venue.info.LinggangVenueInfo;
5 import org.apache.ibatis.annotations.Mapper; 6 import org.apache.ibatis.annotations.Mapper;
6 7
  8 +import java.util.List;
  9 +
7 10
8 @Mapper 11 @Mapper
9 /**场地Info Mapper接口*/ 12 /**场地Info Mapper接口*/
@@ -11,5 +14,7 @@ public interface LinggangVenueInfoMapper extends BaseMapper&lt;LinggangVenueInfo&gt; { @@ -11,5 +14,7 @@ public interface LinggangVenueInfoMapper extends BaseMapper&lt;LinggangVenueInfo&gt; {
11 /** 14 /**
12 * 插入有值的列 15 * 插入有值的列
13 */ 16 */
14 - int insertSelective(LinggangVenueInfo name); 17 + int insertSelective(LinggangVenueInfo entity);
  18 +
  19 + boolean insertNotExit(LinggangVenueInfo entity);
15 } 20 }
16 \ No newline at end of file 21 \ No newline at end of file
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
@@ -40,6 +40,7 @@ import com.ruoyi.service.driver.NewDriverService; @@ -40,6 +40,7 @@ import com.ruoyi.service.driver.NewDriverService;
40 import com.ruoyi.service.key.location.LinggangKeyWorkLocationService; 40 import com.ruoyi.service.key.location.LinggangKeyWorkLocationService;
41 import com.ruoyi.service.scheduling.LinggangSchedulingService; 41 import com.ruoyi.service.scheduling.LinggangSchedulingService;
42 import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; 42 import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService;
  43 +import com.ruoyi.service.venue.info.LinggangVenueInfoService;
43 import com.ruoyi.system.domain.SysNotice; 44 import com.ruoyi.system.domain.SysNotice;
44 import com.ruoyi.system.service.ISysNoticeService; 45 import com.ruoyi.system.service.ISysNoticeService;
45 import com.ruoyi.utils.ConstDateUtil; 46 import com.ruoyi.utils.ConstDateUtil;
@@ -139,6 +140,8 @@ public class ThreadJobService { @@ -139,6 +140,8 @@ public class ThreadJobService {
139 private NewDriverService newDriverService; 140 private NewDriverService newDriverService;
140 @Autowired 141 @Autowired
141 private LingangCarInfoService lingangCarInfoService; 142 private LingangCarInfoService lingangCarInfoService;
  143 + @Autowired
  144 + private LinggangVenueInfoService venueInfoService;
142 145
143 @Value("${bsth.process.sign.url}") 146 @Value("${bsth.process.sign.url}")
144 private String processSignExceptionURL; 147 private String processSignExceptionURL;
@@ -342,8 +345,6 @@ public class ThreadJobService { @@ -342,8 +345,6 @@ public class ThreadJobService {
342 List<NewDriver> newDrivers = null; 345 List<NewDriver> newDrivers = null;
343 if (CollectionUtils.isNotEmpty(linggangSchedulings)) { 346 if (CollectionUtils.isNotEmpty(linggangSchedulings)) {
344 qdznames = linggangSchedulings.stream().map(LinggangScheduling::getQdzname).filter(org.apache.commons.lang3.StringUtils::isNotEmpty).collect(Collectors.toSet()); 347 qdznames = linggangSchedulings.stream().map(LinggangScheduling::getQdzname).filter(org.apache.commons.lang3.StringUtils::isNotEmpty).collect(Collectors.toSet());
345 - qdznames.add("鸿音路临时停车点");  
346 -  
347 newDrivers = newDriverService.listByQdzName(qdznames); 348 newDrivers = newDriverService.listByQdzName(qdznames);
348 } 349 }
349 350
@@ -373,7 +374,7 @@ public class ThreadJobService { @@ -373,7 +374,7 @@ public class ThreadJobService {
373 map.put("noticeIssuer", "运控中心"); 374 map.put("noticeIssuer", "运控中心");
374 map.put("noticeRecipient", "05-" + newDriver.getJobCode()); 375 map.put("noticeRecipient", "05-" + newDriver.getJobCode());
375 map.put("noticeTitle", "异常通知"); 376 map.put("noticeTitle", "异常通知");
376 - map.put("noticeSubtitle", ""); 377 +// map.put("noticeSubtitle", "");
377 378
378 StringBuilder builder = new StringBuilder(); 379 StringBuilder builder = new StringBuilder();
379 builder 380 builder
@@ -387,13 +388,6 @@ public class ThreadJobService { @@ -387,13 +388,6 @@ public class ThreadJobService {
387 map.put("phone", newDriver.getTelphone()); 388 map.put("phone", newDriver.getTelphone());
388 map.put("smscontent", builder.toString()); 389 map.put("smscontent", builder.toString());
389 map.put("noticeType", "岗前检查"); 390 map.put("noticeType", "岗前检查");
390 - map.put("remark", "schedulingId=" + item.getId() + "&signId=" + signIn.getId());  
391 - map.put("signId", signIn.getId());  
392 - map.put("associatedId", item.getId());  
393 -  
394 - Map<String, Object> paramMap = new HashMap<>();  
395 - paramMap.put("schedulingId", item.getId());  
396 - map.put("params", paramMap);  
397 391
398 String key = SignatureUtils.generateSignature(map, "your_secret_key_here"); 392 String key = SignatureUtils.generateSignature(map, "your_secret_key_here");
399 map.put("signature", key); 393 map.put("signature", key);
@@ -411,6 +405,28 @@ public class ThreadJobService { @@ -411,6 +405,28 @@ public class ThreadJobService {
411 } 405 }
412 } 406 }
413 407
  408 + public static void main(String[] args) {
  409 + Map<String, Object> map = new HashMap<>();
  410 + map.put("noticeIssuer", "运控中心");
  411 + map.put("noticeRecipient", "05-006154");
  412 + map.put("noticeTitle", "异常通知");
  413 +
  414 +
  415 + map.put("noticeContent", "工号:1700003,姓名:测试,工种:驾驶员,排班:有排班,打卡时间:2025-01-07 03:29:20,酒精测试超标,当前测试值达到50mg/100ml。属于饮酒后驾驶机动车");
  416 + map.put("phone", "13681905733");
  417 + map.put("smscontent", "工号:1700003,姓名:测试,工种:驾驶员,排班:有排班,打卡时间:2025-01-07 03:29:20,酒精测试超标,当前测试值达到50mg/100ml。属于饮酒后驾驶机动车");
  418 + map.put("noticeType", "岗前检查");
  419 +
  420 + String key = SignatureUtils.generateSignature(map, "your_secret_key_here");
  421 + System.out.println(key);
  422 + }
  423 +
  424 + private static String[] comStrs(String str) {
  425 + String[] values = new String[1];
  426 + values[0] = str;
  427 + return values;
  428 + }
  429 +
414 private String getResultString(BigDecimal alcoholIntake) { 430 private String getResultString(BigDecimal alcoholIntake) {
415 if (alcoholIntake.compareTo(new BigDecimal(20)) >= 0 && alcoholIntake.compareTo(new BigDecimal(80)) < 0) { 431 if (alcoholIntake.compareTo(new BigDecimal(20)) >= 0 && alcoholIntake.compareTo(new BigDecimal(80)) < 0) {
416 return "饮酒后驾驶机动车"; 432 return "饮酒后驾驶机动车";
@@ -628,7 +644,7 @@ public class ThreadJobService { @@ -628,7 +644,7 @@ public class ThreadJobService {
628 TempCache.resetMapStatus(); 644 TempCache.resetMapStatus();
629 } 645 }
630 List<DriverScheduling> bcList = getBcList(originSchedulingMap, type); 646 List<DriverScheduling> bcList = getBcList(originSchedulingMap, type);
631 - 647 + insertThread(bcList);
632 lingangCarInfoService.insert(bcList); 648 lingangCarInfoService.insert(bcList);
633 649
634 // 处理非司售人员的排班明细 650 // 处理非司售人员的排班明细
@@ -1160,5 +1176,17 @@ public class ThreadJobService { @@ -1160,5 +1176,17 @@ public class ThreadJobService {
1160 return recoveryList; 1176 return recoveryList;
1161 } 1177 }
1162 1178
  1179 + private void insertThread(List<DriverScheduling> entities) {
  1180 + String userId = JwtAuthenticationTokenFilter.getRequestIdOfMDCValue();
  1181 + String traceId = JwtAuthenticationTokenFilter.getRequestIdOfMDCValue();
  1182 + new Thread(new Runnable() {
  1183 + @Override
  1184 + public void run() {
  1185 + JwtAuthenticationTokenFilter.putMDC(userId, traceId + "_002");
  1186 + venueInfoService.insertNotExit(entities);
  1187 + }
  1188 + }).start();
  1189 + }
  1190 +
1163 1191
1164 } 1192 }
Bsth-admin/src/main/java/com/ruoyi/service/dss/FaceService.java
@@ -23,5 +23,6 @@ public interface FaceService { @@ -23,5 +23,6 @@ public interface FaceService {
23 23
24 ResponseResult<String> getFaceFeatureImageContent(String content); 24 ResponseResult<String> getFaceFeatureImageContent(String content);
25 ResponseResult<String> getFaceFeatureImagePath(String path); 25 ResponseResult<String> getFaceFeatureImagePath(String path);
  26 + ResponseResult<String> getFaceFeatureImageURL(String url);
26 27
27 } 28 }
Bsth-admin/src/main/java/com/ruoyi/service/impl/dss/FaceServiceImpl.java
1 package com.ruoyi.service.impl.dss; 1 package com.ruoyi.service.impl.dss;
2 2
3 import cn.hutool.core.convert.Convert; 3 import cn.hutool.core.convert.Convert;
  4 +import cn.hutool.http.HttpUtil;
4 import com.alibaba.fastjson2.JSON; 5 import com.alibaba.fastjson2.JSON;
5 import com.arcsoft.face.FaceEngine; 6 import com.arcsoft.face.FaceEngine;
6 import com.arcsoft.face.FaceFeature; 7 import com.arcsoft.face.FaceFeature;
@@ -9,6 +10,7 @@ import com.arcsoft.face.FaceSimilar; @@ -9,6 +10,7 @@ import com.arcsoft.face.FaceSimilar;
9 import com.arcsoft.face.enums.ErrorInfo; 10 import com.arcsoft.face.enums.ErrorInfo;
10 import com.arcsoft.face.toolkit.ImageFactory; 11 import com.arcsoft.face.toolkit.ImageFactory;
11 import com.arcsoft.face.toolkit.ImageInfo; 12 import com.arcsoft.face.toolkit.ImageInfo;
  13 +import com.ruoyi.common.config.RuoYiConfig;
12 import com.ruoyi.common.core.domain.ResponseResult; 14 import com.ruoyi.common.core.domain.ResponseResult;
13 import com.ruoyi.common.utils.file.FileUploadUtils; 15 import com.ruoyi.common.utils.file.FileUploadUtils;
14 import com.ruoyi.common.utils.sign.Base64; 16 import com.ruoyi.common.utils.sign.Base64;
@@ -16,15 +18,16 @@ import com.ruoyi.config.BsthSystemConfig; @@ -16,15 +18,16 @@ import com.ruoyi.config.BsthSystemConfig;
16 import com.ruoyi.domain.driver.NewDriver; 18 import com.ruoyi.domain.driver.NewDriver;
17 import com.ruoyi.service.driver.NewDriverService; 19 import com.ruoyi.service.driver.NewDriverService;
18 import com.ruoyi.service.dss.FaceService; 20 import com.ruoyi.service.dss.FaceService;
  21 +import com.ruoyi.system.service.ISysDictDataService;
19 import com.ruoyi.utils.HttpClientUtil; 22 import com.ruoyi.utils.HttpClientUtil;
20 import com.ruoyi.utils.SpringApplicationUtil; 23 import com.ruoyi.utils.SpringApplicationUtil;
21 import lombok.extern.slf4j.Slf4j; 24 import lombok.extern.slf4j.Slf4j;
22 import org.apache.commons.collections4.CollectionUtils; 25 import org.apache.commons.collections4.CollectionUtils;
  26 +import org.apache.commons.io.FileUtils;
23 import org.apache.commons.io.IOUtils; 27 import org.apache.commons.io.IOUtils;
24 import org.apache.commons.lang3.StringUtils; 28 import org.apache.commons.lang3.StringUtils;
25 import org.springframework.beans.factory.annotation.Autowired; 29 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.stereotype.Service; 30 import org.springframework.stereotype.Service;
27 -import sun.misc.BASE64Encoder;  
28 31
29 import javax.imageio.ImageIO; 32 import javax.imageio.ImageIO;
30 import java.awt.image.BufferedImage; 33 import java.awt.image.BufferedImage;
@@ -47,6 +50,10 @@ public class FaceServiceImpl implements FaceService { @@ -47,6 +50,10 @@ public class FaceServiceImpl implements FaceService {
47 private BsthSystemConfig bsthSystemConfig; 50 private BsthSystemConfig bsthSystemConfig;
48 @Autowired 51 @Autowired
49 private HttpClientUtil httpClientUtil; 52 private HttpClientUtil httpClientUtil;
  53 + @Autowired
  54 + private ISysDictDataService sysDictDataService;
  55 + @Autowired
  56 + private RuoYiConfig ruoYiConfig;
50 57
51 58
52 @Override 59 @Override
@@ -82,7 +89,7 @@ public class FaceServiceImpl implements FaceService { @@ -82,7 +89,7 @@ public class FaceServiceImpl implements FaceService {
82 89
83 json = httpClientUtil.doPost(bsthSystemConfig.getFaceFeatureURL(), parentMap, null); 90 json = httpClientUtil.doPost(bsthSystemConfig.getFaceFeatureURL(), parentMap, null);
84 if (StringUtils.isEmpty(json)) { 91 if (StringUtils.isEmpty(json)) {
85 - log.warn("获取面部特征失败,请检查数据:[{}],[{}],[{}]", json,bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap)); 92 + log.warn("获取面部特征失败,请检查数据:[{}],[{}],[{}]", json, bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap));
86 return ResponseResult.error("获取面部特征失败,请稍后再试"); 93 return ResponseResult.error("获取面部特征失败,请稍后再试");
87 } 94 }
88 json = StringUtils.substringAfter(json, "{"); 95 json = StringUtils.substringAfter(json, "{");
@@ -98,15 +105,15 @@ public class FaceServiceImpl implements FaceService { @@ -98,15 +105,15 @@ public class FaceServiceImpl implements FaceService {
98 105
99 106
100 if (!StringUtils.equalsIgnoreCase(resultMap.get("result"), "ok")) { 107 if (!StringUtils.equalsIgnoreCase(resultMap.get("result"), "ok")) {
101 - log.warn("获取面部特征不成功,,请检查数据:[{}],[{}],[{}]", json,bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap)); 108 + log.warn("获取面部特征不成功,,请检查数据:[{}],[{}],[{}]", json, bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap));
102 return ResponseResult.error("获取面部特征失败,请稍后再试"); 109 return ResponseResult.error("获取面部特征失败,请稍后再试");
103 } 110 }
104 String faceFeature = Convert.toStr(resultMap.get("strlitefeature")); 111 String faceFeature = Convert.toStr(resultMap.get("strlitefeature"));
105 - ResponseResult<String> responseResult =ResponseResult.success(); 112 + ResponseResult<String> responseResult = ResponseResult.success();
106 responseResult.setData(faceFeature); 113 responseResult.setData(faceFeature);
107 return responseResult; 114 return responseResult;
108 } catch (Exception e) { 115 } catch (Exception e) {
109 - log.error("获取面部特征异常,返回的结果是:[{}],[{}],[{}]", json,bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap), e); 116 + log.error("获取面部特征异常,返回的结果是:[{}],[{}],[{}]", json, bsthSystemConfig.getFaceFeatureURL(), JSON.toJSONString(parentMap), e);
110 return ResponseResult.error("获取面部特征异常,请稍后再试"); 117 return ResponseResult.error("获取面部特征异常,请稍后再试");
111 } 118 }
112 } 119 }
@@ -117,6 +124,27 @@ public class FaceServiceImpl implements FaceService { @@ -117,6 +124,27 @@ public class FaceServiceImpl implements FaceService {
117 return getFaceFeatureImageContent(content); 124 return getFaceFeatureImageContent(content);
118 } 125 }
119 126
  127 + @Override
  128 + public ResponseResult<String> getFaceFeatureImageURL(String urlString) {
  129 + String path = null;
  130 + try {
  131 +// String fileName = sysDictDataService.splitURL(urlString);
  132 +// path = RuoYiConfig.getDownloadPath() + fileName+"/";
  133 + byte[] bytes = HttpUtil.downloadBytes(urlString);
  134 + String content = convertBase64(bytes);
  135 + return getFaceFeatureImageContent(content);
  136 + } finally {
  137 +// if(StringUtils.isNotEmpty(path)) {
  138 +// File file = new File()
  139 +// }
  140 + }
  141 + }
  142 +
  143 + public static void main(String[] args) {
  144 + FaceServiceImpl faceService = new FaceServiceImpl();
  145 + faceService.getFaceFeatureImageURL("http://192.168.168.167:9000/alchohol/head/76408/driver.png");
  146 + }
  147 +
120 private NewDriver checkFace(List<NewDriver> drivers, NewDriver sourceDriver) { 148 private NewDriver checkFace(List<NewDriver> drivers, NewDriver sourceDriver) {
121 if (CollectionUtils.isEmpty(drivers)) { 149 if (CollectionUtils.isEmpty(drivers)) {
122 return null; 150 return null;
@@ -173,14 +201,28 @@ public class FaceServiceImpl implements FaceService { @@ -173,14 +201,28 @@ public class FaceServiceImpl implements FaceService {
173 return -1; 201 return -1;
174 } 202 }
175 StringBuilder builder = new StringBuilder(); 203 StringBuilder builder = new StringBuilder();
176 - builder.append(bsthSystemConfig.getImageBasePath());  
177 - builder.append("/"); 204 + builder.append(RuoYiConfig.getDownloadPath1());
  205 + if (!StringUtils.startsWith(dr.getImage(), "/")) {
  206 + dr.setImage("/"+dr.getImage()) ;
  207 + }
  208 + if(!StringUtils.startsWith(dr.getImage(),"/head")){
  209 + dr.setImage("/head"+dr.getImage()) ;
  210 + }
178 builder.append(dr.getImage()); 211 builder.append(dr.getImage());
179 212
180 File targetFile = new File(builder.toString()); 213 File targetFile = new File(builder.toString());
181 if (!targetFile.exists() || !targetFile.isFile()) { 214 if (!targetFile.exists() || !targetFile.isFile()) {
182 - log.error("没有比对的图片;[{}]", dr);  
183 - return -1; 215 + String url = sysDictDataService.combationValue(dr.getImage());
  216 + try {
  217 + FileUtils.forceMkdirParent(targetFile);
  218 + HttpUtil.downloadFileFromUrl(url, targetFile);
  219 + } catch (Exception e) {
  220 + log.error("[{}] error", url, e);
  221 + }
  222 +
  223 + if (!targetFile.isFile()) {
  224 + return -1;
  225 + }
184 } 226 }
185 227
186 ImageInfo target = getRGBData(targetFile); 228 ImageInfo target = getRGBData(targetFile);
@@ -243,7 +285,7 @@ public class FaceServiceImpl implements FaceService { @@ -243,7 +285,7 @@ public class FaceServiceImpl implements FaceService {
243 285
244 private String convertBase64(byte[] data) { 286 private String convertBase64(byte[] data) {
245 // 对字节数组进行Base64编码,得到Base64编码的字符串 287 // 对字节数组进行Base64编码,得到Base64编码的字符串
246 - return Base64.encode(data); 288 + return Base64.encode(data);
247 } 289 }
248 290
249 } 291 }
Bsth-admin/src/main/java/com/ruoyi/service/impl/venue/info/LinggangVenueInfoServiceImpl.java
@@ -5,17 +5,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage; @@ -5,17 +5,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
5 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 import com.github.pagehelper.PageHelper; 7 import com.github.pagehelper.PageHelper;
  8 +import com.ruoyi.domain.DriverScheduling;
8 import com.ruoyi.domain.OrderEntity; 9 import com.ruoyi.domain.OrderEntity;
9 import com.ruoyi.domain.venue.info.LinggangVenueInfo; 10 import com.ruoyi.domain.venue.info.LinggangVenueInfo;
10 import com.ruoyi.mapper.venue.info.LinggangVenueInfoMapper; 11 import com.ruoyi.mapper.venue.info.LinggangVenueInfoMapper;
11 import com.ruoyi.service.venue.info.LinggangVenueInfoService; 12 import com.ruoyi.service.venue.info.LinggangVenueInfoService;
12 import lombok.extern.slf4j.Slf4j; 13 import lombok.extern.slf4j.Slf4j;
  14 +import org.apache.commons.collections4.CollectionUtils;
  15 +import org.apache.commons.lang3.StringUtils;
13 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
  18 +import org.springframework.transaction.annotation.Transactional;
15 19
16 -import java.util.Collection;  
17 -import java.util.Collections;  
18 -import java.util.List; 20 +import java.util.*;
19 21
20 @Slf4j 22 @Slf4j
21 @Service 23 @Service
@@ -59,7 +61,8 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM @@ -59,7 +61,8 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM
59 @Override 61 @Override
60 public List<LinggangVenueInfo> listOfSelect(LinggangVenueInfo entity) { 62 public List<LinggangVenueInfo> listOfSelect(LinggangVenueInfo entity) {
61 LambdaQueryWrapper<LinggangVenueInfo> wrapper = new LambdaQueryWrapper<>(entity); 63 LambdaQueryWrapper<LinggangVenueInfo> wrapper = new LambdaQueryWrapper<>(entity);
62 - wrapper.select(LinggangVenueInfo::getId, LinggangVenueInfo::getName); 64 + wrapper.select(LinggangVenueInfo::getId, LinggangVenueInfo::getName, LinggangVenueInfo::getParkCode);
  65 + wrapper.orderByAsc(LinggangVenueInfo::getName);
63 return list(wrapper); 66 return list(wrapper);
64 } 67 }
65 68
@@ -120,6 +123,36 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM @@ -120,6 +123,36 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM
120 return save(entity); 123 return save(entity);
121 } 124 }
122 125
  126 + @Override
  127 + public boolean insertNotExit(List<DriverScheduling> entities) {
  128 + if (CollectionUtils.isEmpty(entities)) {
  129 + return Boolean.TRUE;
  130 + }
  131 +
  132 + Set<LinggangVenueInfo> venueInfos = new HashSet<>();
  133 + entities.stream().forEach(entity -> {
  134 + LinggangVenueInfo venueInfo = new LinggangVenueInfo();
  135 + venueInfo.setParkCode(entity.getQdzCode());
  136 + venueInfo.setName(entity.getQdzName());
  137 + venueInfo.setDelFlag(Boolean.FALSE);
  138 + venueInfos.add(venueInfo);
  139 +
  140 + venueInfo = new LinggangVenueInfo();
  141 + venueInfo.setParkCode(entity.getZdzCode());
  142 + venueInfo.setName(entity.getZdzName());
  143 + venueInfo.setDelFlag(Boolean.FALSE);
  144 + venueInfos.add(venueInfo);
  145 + });
  146 +
  147 + for (LinggangVenueInfo venueInfo : venueInfos) {
  148 + if (StringUtils.isNotEmpty(venueInfo.getParkCode()) && StringUtils.isNotEmpty(venueInfo.getName())) {
  149 + linggangVenueInfoMapper.insertNotExit(venueInfo);
  150 + }
  151 + }
  152 +
  153 + return Boolean.TRUE;
  154 + }
  155 +
123 /** 156 /**
124 * 根据主键修改数据 157 * 根据主键修改数据
125 */ 158 */
@@ -196,4 +229,5 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM @@ -196,4 +229,5 @@ public class LinggangVenueInfoServiceImpl extends ServiceImpl&lt;LinggangVenueInfoM
196 wrapper.orderByDesc(LinggangVenueInfo::getId); 229 wrapper.orderByDesc(LinggangVenueInfo::getId);
197 } 230 }
198 } 231 }
  232 +
199 } 233 }
200 \ No newline at end of file 234 \ No newline at end of file
Bsth-admin/src/main/java/com/ruoyi/service/venue/info/LinggangVenueInfoService.java
@@ -2,6 +2,7 @@ package com.ruoyi.service.venue.info; @@ -2,6 +2,7 @@ package com.ruoyi.service.venue.info;
2 2
3 import com.baomidou.mybatisplus.core.metadata.IPage; 3 import com.baomidou.mybatisplus.core.metadata.IPage;
4 import com.baomidou.mybatisplus.extension.service.IService; 4 import com.baomidou.mybatisplus.extension.service.IService;
  5 +import com.ruoyi.domain.DriverScheduling;
5 import com.ruoyi.domain.OrderEntity; 6 import com.ruoyi.domain.OrderEntity;
6 import com.ruoyi.domain.venue.info.LinggangVenueInfo; 7 import com.ruoyi.domain.venue.info.LinggangVenueInfo;
7 8
@@ -45,6 +46,7 @@ public interface LinggangVenueInfoService extends IService&lt;LinggangVenueInfo&gt; { @@ -45,6 +46,7 @@ public interface LinggangVenueInfoService extends IService&lt;LinggangVenueInfo&gt; {
45 46
46 /***插入数据*/ 47 /***插入数据*/
47 boolean insert(LinggangVenueInfo entity); 48 boolean insert(LinggangVenueInfo entity);
  49 + boolean insertNotExit(List<DriverScheduling> entities);
48 50
49 /** 51 /**
50 * 根据主键修改数据 52 * 根据主键修改数据
Bsth-admin/src/main/resources/mapper/venue/inf/LinggangVenueInfoMapper.xml
@@ -19,6 +19,13 @@ @@ -19,6 +19,13 @@
19 <include refid="insertSelectiveColumn"></include> 19 <include refid="insertSelectiveColumn"></include>
20 <include refid="insertSelectiveValue"></include> 20 <include refid="insertSelectiveValue"></include>
21 </insert> 21 </insert>
  22 + <insert id="insertNotExit" keyColumn="ID" keyProperty="id" useGeneratedKeys="true"
  23 + parameterType="com.ruoyi.domain.venue.info.LinggangVenueInfo">
  24 + INSERT INTO venue_info (park_Code,del_flag,name)
  25 + select #{parkCode} park_Code,#{delFlag} del_flag,#{name} name from(
  26 + select count(park_Code) c from venue_info vi where vi.park_Code =#{parkCode}
  27 + )t where t.c=0
  28 + </insert>
22 29
23 <sql id="columns"> 30 <sql id="columns">
24 ID 31 ID
Bsth-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
@@ -5,7 +5,7 @@ import org.springframework.stereotype.Component; @@ -5,7 +5,7 @@ import org.springframework.stereotype.Component;
5 5
6 /** 6 /**
7 * 读取项目相关配置 7 * 读取项目相关配置
8 - * 8 + *
9 * @author ruoyi 9 * @author ruoyi
10 */ 10 */
11 @Component 11 @Component
@@ -125,6 +125,11 @@ public class RuoYiConfig @@ -125,6 +125,11 @@ public class RuoYiConfig
125 return getProfile() + "/download/"; 125 return getProfile() + "/download/";
126 } 126 }
127 127
  128 + public static String getDownloadPath1()
  129 + {
  130 + return getProfile() + "/download";
  131 + }
  132 +
128 /** 133 /**
129 * 获取上传路径 134 * 获取上传路径
130 */ 135 */
Bsth-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
@@ -117,6 +117,10 @@ public class SysDictDataServiceImpl extends ServiceImpl&lt;SysDictDataMapper, SysDi @@ -117,6 +117,10 @@ public class SysDictDataServiceImpl extends ServiceImpl&lt;SysDictDataMapper, SysDi
117 return url; 117 return url;
118 } 118 }
119 119
  120 + if(StringUtils.startsWith(url,dictData.getDictValueStr())){
  121 + return url;
  122 + }
  123 +
120 if (dictData.isCombationVal()) { 124 if (dictData.isCombationVal()) {
121 String fil = "/"; 125 String fil = "/";
122 126