Commit c5379c84928170e9e3bdb85548be476f319e9e11

Authored by liujun001
1 parent da3efa1f

同步数据

Bsth-admin/src/main/java/com/ruoyi/common/SchedulerProperty.java
... ... @@ -5,6 +5,8 @@ import lombok.Data;
5 5 @Data
6 6 public class SchedulerProperty {
7 7 private String getSchedulingInfoUrl;
  8 + private String getSchedulingInfo;
8 9 private String nonce;
9 10 private String password;
  11 + private String getSchedulingInfoNew1;
10 12 }
... ...
Bsth-admin/src/main/java/com/ruoyi/common/cache/SchedulingCache.java
1 1 package com.ruoyi.common.cache;
2 2  
3 3 import com.ruoyi.common.SchedulerProperty;
  4 +import com.ruoyi.common.core.redis.RedisCache;
4 5 import com.ruoyi.pojo.response.ResponseSchedulingDto;
5 6 import com.ruoyi.utils.ConstDateUtil;
  7 +import org.apache.commons.collections4.CollectionUtils;
6 8 import org.slf4j.Logger;
7 9 import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
8 11 import org.springframework.core.ParameterizedTypeReference;
  12 +import org.springframework.data.redis.core.RedisTemplate;
9 13 import org.springframework.http.HttpMethod;
10 14 import org.springframework.stereotype.Component;
11 15 import org.springframework.web.client.RestTemplate;
... ... @@ -13,6 +17,7 @@ import org.springframework.web.client.RestTemplate;
13 17 import java.security.MessageDigest;
14 18 import java.util.*;
15 19 import java.util.concurrent.ConcurrentHashMap;
  20 +import java.util.concurrent.TimeUnit;
16 21 import java.util.stream.Collectors;
17 22  
18 23 import static com.ruoyi.common.redispre.GlobalRedisPreName.DRIVER_SCHEDULING_PRE;
... ... @@ -26,6 +31,10 @@ import static com.ruoyi.common.redispre.GlobalRedisPreName.DRIVER_SCHEDULING_PRE
26 31 public class SchedulingCache {
27 32  
28 33 private static final Logger log = LoggerFactory.getLogger(SchedulingCache.class);
  34 + @Autowired
  35 + private RedisCache redisCache;
  36 + @Autowired
  37 + private RedisTemplate redisTemplate;
29 38  
30 39  
31 40 /**
... ... @@ -34,8 +43,9 @@ public class SchedulingCache {
34 43 private static final ConcurrentHashMap<String, Map<String, List<ResponseSchedulingDto>>> CONCURRENT_HASH_MAP = new ConcurrentHashMap<>();
35 44  
36 45  
37   - public SchedulingCache(SchedulerProperty property) {
  46 + public SchedulingCache(SchedulerProperty property,RedisCache redisCache) {
38 47 log.info("项目启动加载中获取实时班次并存入缓存-----");
  48 + this.redisCache = redisCache;
39 49 schedulingInit(property);
40 50 }
41 51  
... ... @@ -50,17 +60,36 @@ public class SchedulingCache {
50 60 saveSchedulingToCache(url, formatNowDate);
51 61 String formatYesterdayDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
52 62 log.info("初始化排班数据:{}", formatYesterdayDate);
53   - url = getUrl(formatYesterdayDate, property);
  63 + url = getUrlOld(formatYesterdayDate, property);
54 64 saveSchedulingToCache(url, formatYesterdayDate);
55 65 }
56 66  
57   - private String getUrl(String formatNowDate, SchedulerProperty property) {
  67 + public String getUrl(String formatNowDate, SchedulerProperty property) {
58 68 String url = null;
59 69 long timestamp = System.currentTimeMillis();
60 70 // String formatDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
61 71 // 获取排班请求
  72 + String key = "Scheduling:timeStr:" + formatNowDate;
62 73 try {
63   - url = String.format(property.getGetSchedulingInfoUrl(), "99", formatNowDate, timestamp, property.getNonce(), property.getPassword(), getSHA1(getStringStringMap(String.valueOf(timestamp), property)));
  74 + long timestampValue = timestamp;
  75 + if (!redisCache.hasKey(key)) {
  76 + redisCache.setCacheObject(key, "1", 30, TimeUnit.HOURS);
  77 + timestampValue = 0;
  78 + }
  79 + url = String.format(property.getGetSchedulingInfoUrl(), "77", formatNowDate, timestampValue, timestamp, property.getNonce(), property.getPassword(), getSHA1(getStringStringMap(String.valueOf(timestamp), property)));
  80 + } catch (Exception e) {
  81 + throw new RuntimeException(e);
  82 + }
  83 + return url;
  84 + }
  85 +
  86 + public String getUrlOld(String formatNowDate, SchedulerProperty property) {
  87 + String url = null;
  88 + long timestamp = System.currentTimeMillis();
  89 +// String formatDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
  90 + // 获取排班请求
  91 + try {
  92 + url = String.format(property.getGetSchedulingInfo(), "77", formatNowDate, timestamp, property.getNonce(), property.getPassword(), getSHA1(getStringStringMap(String.valueOf(timestamp), property)));
64 93 } catch (Exception e) {
65 94 throw new RuntimeException(e);
66 95 }
... ... @@ -132,6 +161,7 @@ public class SchedulingCache {
132 161 splitSaveScheduling(driverSchedulingMap, jobCode, item);
133 162 splitSaveScheduling(driverSchedulingMap, salePersonJobCode, item);
134 163 });
  164 +
135 165 // 排序
136 166 List<String> keys = new ArrayList<>(driverSchedulingMap.keySet());
137 167 for (String key : keys) {
... ... @@ -147,6 +177,29 @@ public class SchedulingCache {
147 177 return driverSchedulingMap;
148 178 }
149 179  
  180 + public List<ResponseSchedulingDto> requestScheduling(String getSchedulingInfoUrl) {
  181 + List<ResponseSchedulingDto> originSchedulingList = null;
  182 + int index = 0;
  183 + int size = 0;
  184 + while (size == 0) {
  185 + originSchedulingList = new RestTemplate().exchange(
  186 + getSchedulingInfoUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<ResponseSchedulingDto>>() {
  187 + }).getBody();
  188 + size = CollectionUtils.size(originSchedulingList);
  189 + index++;
  190 + if (index > 10 || size > 0) {
  191 + break;
  192 + }
  193 + try {
  194 + Thread.sleep(1000);
  195 + } catch (InterruptedException e) {
  196 + throw new RuntimeException(e);
  197 + }
  198 + }
  199 +
  200 + return originSchedulingList;
  201 + }
  202 +
150 203 private void splitSaveScheduling(Map<String, List<ResponseSchedulingDto>> driverSchedulingMap, String jobCode, ResponseSchedulingDto item) {
151 204 if (!Objects.isNull(jobCode))
152 205 if (Objects.isNull(driverSchedulingMap.get(jobCode))) {
... ...
Bsth-admin/src/main/java/com/ruoyi/config/SchedulerConfig.java
... ... @@ -13,6 +13,10 @@ public class SchedulerConfig {
13 13 private String nonce;
14 14 @Value("${api.config.password}")
15 15 private String password;
  16 + @Value("${api.url.getSchedulingInfo}")
  17 + private String getSchedulingInfo;
  18 + @Value("${api.url.getSchedulingInfoNew1}")
  19 + private String getSchedulingInfoNew1;
16 20  
17 21 @Bean
18 22 public SchedulerProperty getSchedulerProperty(){
... ... @@ -20,6 +24,8 @@ public class SchedulerConfig {
20 24 property.setPassword(password);
21 25 property.setNonce(nonce);
22 26 property.setGetSchedulingInfoUrl(getSchedulingInfoUrl);
  27 + property.setGetSchedulingInfo(getSchedulingInfo);
  28 + property.setGetSchedulingInfoNew1(getSchedulingInfoNew1);
23 29 return property;
24 30 }
25 31 }
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/RefreshController.java
... ... @@ -54,7 +54,7 @@ public class RefreshController {
54 54  
55 55 @GetMapping(value = "/scheduling")
56 56 @ApiOperation("scheduling")
57   - @PreAuthorize("@ss.hasPermi('refresh:scheduling')")
  57 +// @PreAuthorize("@ss.hasPermi('refresh:scheduling')")
58 58 public ResponseResult<Boolean> test() {
59 59 Date date = new Date();
60 60 for (int i = 0; i < 2; i++) {
... ...
Bsth-admin/src/main/java/com/ruoyi/controller/dss/RemindDriverKeyLocalController.java
... ... @@ -79,7 +79,7 @@ public class RemindDriverKeyLocalController extends BaseController {
79 79 }
80 80 }
81 81 RemindDriverReportVo reportVo = new RemindDriverReportVo();
82   - reportVo.setCount(linggangSchedulings.stream().filter(ls-> StringUtils.equalsAnyIgnoreCase(ls.getBcType(),"out")).count());
  82 + reportVo.setCount(linggangSchedulings.stream().filter(ls -> StringUtils.equalsAnyIgnoreCase(ls.getBcType(), "out")).count());
83 83  
84 84 if (CollectionUtils.isNotEmpty(linggangKeyWorkLocations)) {
85 85 List<RemindKeyInfoLocalVo> remindKeyInfoLocalVoList = new ArrayList<>();
... ... @@ -97,7 +97,7 @@ public class RemindDriverKeyLocalController extends BaseController {
97 97 Optional<LinggangKeyWorkLocation> finalOptional = optional;
98 98 Optional<Equipment> equipmentOptional = equipments.stream().filter(e -> Objects.equals(e.getDeviceId(), finalOptional.get().getDevice())).findFirst();
99 99 equipmentOptional.ifPresent(equipment -> localVo.setEquipmentName(equipment.getName()));
100   - if(i == 0){
  100 + if (i == 0) {
101 101  
102 102 }
103 103 }
... ... @@ -114,11 +114,23 @@ public class RemindDriverKeyLocalController extends BaseController {
114 114 }
115 115 }
116 116 }
117   - if(i == 0){
118   - reportVo.setCurrentKeyLocaltion(localVo.getEquipmentName());
119   - }
120 117 remindKeyInfoLocalVoList.add(localVo);
121 118 }
  119 + Optional<LinggangScheduling> opt = linggangSchedulings.stream().filter(f -> Objects.nonNull(f.getSignInId())).max(Comparator.comparing(LinggangScheduling::getFcsjT));
  120 + if (opt.isPresent()) {
  121 + Optional<LinggangKeyWorkLocation> optional = linggangKeyWorkLocations.stream().filter(kl -> Objects.equals(kl.getSchedulingId(), opt.get().getId())).findFirst();
  122 + if (optional.isPresent()) {
  123 + Optional<Equipment> equipmentOptional = equipments.stream().filter(e -> Objects.equals(e.getDeviceId(), optional.get().getDevice())).findFirst();
  124 + equipmentOptional.ifPresent(equipment -> reportVo.setCurrentKeyLocaltion(equipment.getName()));
  125 + }
  126 + } else {
  127 + Optional<LinggangKeyWorkLocation> optional = linggangKeyWorkLocations.stream().filter(kl -> Objects.equals(kl.getSchedulingId(), linggangSchedulings.get(0).getId())).findFirst();
  128 + if (optional.isPresent()) {
  129 + Optional<Equipment> equipmentOptional = equipments.stream().filter(e -> Objects.equals(e.getDeviceId(), optional.get().getDevice())).findFirst();
  130 + equipmentOptional.ifPresent(equipment -> reportVo.setCurrentKeyLocaltion(equipment.getName()));
  131 + }
  132 + }
  133 +
122 134 reportVo.setRemindKeyInfoLocalVoList(remindKeyInfoLocalVoList);
123 135 }
124 136  
... ...
Bsth-admin/src/main/java/com/ruoyi/domain/key/location/LinggangKeyWorkLocation.java
... ... @@ -101,6 +101,8 @@ public class LinggangKeyWorkLocation {
101 101 @Excel(name = "状态:1 是归还;0是借出;2是初始状态")
102 102 private java.lang.Integer type;
103 103  
  104 + private Integer type1;
  105 +
104 106 @TableField(exist = false)
105 107 private Long scheduleDateTimeDiff;
106 108  
... ...
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
... ... @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
4 4 import cn.hutool.http.HttpUtil;
5 5 import com.alibaba.fastjson2.JSON;
6 6 import com.alibaba.fastjson2.JSONArray;
  7 +import com.ruoyi.common.SchedulerProperty;
7 8 import com.ruoyi.common.cache.NowSchedulingCache;
8 9 import com.ruoyi.common.cache.SchedulingCache;
9 10 import com.ruoyi.common.core.redis.RedisCache;
... ... @@ -37,8 +38,10 @@ import org.springframework.beans.BeanUtils;
37 38 import org.springframework.beans.factory.InitializingBean;
38 39 import org.springframework.beans.factory.annotation.Autowired;
39 40 import org.springframework.beans.factory.annotation.Value;
40   -import org.springframework.core.ParameterizedTypeReference;
41   -import org.springframework.http.*;
  41 +import org.springframework.http.HttpEntity;
  42 +import org.springframework.http.HttpHeaders;
  43 +import org.springframework.http.MediaType;
  44 +import org.springframework.http.ResponseEntity;
42 45 import org.springframework.stereotype.Component;
43 46 import org.springframework.transaction.annotation.Transactional;
44 47 import org.springframework.web.client.RestTemplate;
... ... @@ -131,6 +134,9 @@ public class DriverJob implements InitializingBean {
131 134 @Value("${api.config.nonce}")
132 135 private String nonce;
133 136  
  137 + @Autowired
  138 + private SchedulerProperty property;
  139 +
134 140  
135 141 private static DriverSchedulingExpandMapper EXPAND_MAPPER;
136 142 private static DriverSchedulingExpandSmartService EXPAND_SMART_SERVICE;
... ... @@ -248,7 +254,7 @@ public class DriverJob implements InitializingBean {
248 254 Date date = new Date();
249 255  
250 256 for (int i = 0; i < 2; i++) {
251   - JwtAuthenticationTokenFilter.putMDC("job",JwtAuthenticationTokenFilter.getRandomValue());
  257 + JwtAuthenticationTokenFilter.putMDC("job", JwtAuthenticationTokenFilter.getRandomValue());
252 258 runScheduling(DateUtils.addDays(date, i).getTime());
253 259 }
254 260  
... ... @@ -276,26 +282,38 @@ public class DriverJob implements InitializingBean {
276 282  
277 283 Set<Long> idSets = null;
278 284 if (isSameDay) {
  285 + String key = "Scheduling:timeStr:" + formatDate;
  286 + long timestampValu = timestamp;
  287 + if (!redisCache.hasKey(key)) {
  288 + redisCache.setCacheObject(key, "1", 30, TimeUnit.HOURS);
  289 + timestampValu = 0;
  290 + }
279 291 scheduling.setType(100);
280 292 List<LinggangScheduling> linggangSchedulings = schedulingService.list(scheduling);
281 293 idSets = linggangSchedulings.stream().map(LinggangScheduling::getId).collect(Collectors.toSet());
282   - }
283   -
284   -
285 294  
  295 + try {
  296 + log.info("url:[{}];formatDate:[{}];timestamp:[{}]", url, formatDate, timestamp);
  297 + getSchedulingInfoUrl = String.format(url, "77", formatDate, timestampValu, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
  298 + } catch (Exception e) {
  299 + throw new RuntimeException(e);
  300 + }
286 301  
  302 + } else {
  303 + try {
  304 + log.info("url:[{}];formatDate:[{}];timestamp:[{}]", url, formatDate, timestamp);
  305 + getSchedulingInfoUrl = String.format(url, "77", formatDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
  306 + } catch (Exception e) {
  307 + throw new RuntimeException(e);
  308 + }
  309 + }
287 310  
288 311  
289 312 // String url = getSchedulingInfoPlan;
290   - try {
291   - log.info("url:[{}];formatDate:[{}];timestamp:[{}]",url,formatDate,timestamp);
292   - getSchedulingInfoUrl = String.format(url, "77", formatDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
293   - } catch (Exception e) {
294   - throw new RuntimeException(e);
295   - }
  313 +
296 314 String requestId = JwtAuthenticationTokenFilter.getRequestIdOfMDCValue();
297 315 // 获取排班信息并存入redis
298   - saveSchedulingToRedis(getSchedulingInfoUrl, formatDate, timeOut, date, type,idSets,requestId);
  316 + saveSchedulingToRedis(getSchedulingInfoUrl, formatDate, timeOut, date, type, idSets, requestId);
299 317 // 删除两天前排班信息
300 318 if (isSameDay) {
301 319 deleteScheduling();
... ... @@ -392,19 +410,11 @@ public class DriverJob implements InitializingBean {
392 410 }
393 411  
394 412  
395   - public Map<String, List<ResponseSchedulingDto>> saveSchedulingToRedis(String getSchedulingInfoUrl, String dateKey, String timeOut, Date date, int type,Set<Long> idSets,String requestId) {
396   - JwtAuthenticationTokenFilter.putMDC("job",requestId);
  413 + public Map<String, List<ResponseSchedulingDto>> saveSchedulingToRedis(String getSchedulingInfoUrl, String dateKey, String timeOut, Date date, int type, Set<Long> idSets, String requestId) {
  414 + JwtAuthenticationTokenFilter.putMDC("job", requestId);
397 415 log.info("开始拉取排班:{};[{}]", dateKey, getSchedulingInfoUrl);
398   - List<ResponseSchedulingDto> originSchedulingList = RESTTEMPLATE.exchange(
399   - getSchedulingInfoUrl,
400   - HttpMethod.GET,
401   - null,
402   - new ParameterizedTypeReference<List<ResponseSchedulingDto>>() {
403   - }).getBody();
404   -
405   - if (CollectionUtils.isEmpty(originSchedulingList)) {
406   - return null;
407   - }
  416 + List<ResponseSchedulingDto> originSchedulingList = schedulingCache.requestScheduling(getSchedulingInfoUrl);
  417 + log.info("originSchedulingList:[{}]", JSON.toJSONString(originSchedulingList));
408 418 Map<String, List<ResponseSchedulingDto>> driverSchedulingMap = new HashMap<>(200);
409 419 // 以员工号为key存入排班集合
410 420 originSchedulingList.stream().forEach(item -> {
... ... @@ -423,13 +433,13 @@ public class DriverJob implements InitializingBean {
423 433 List<String> keys = new ArrayList<>(driverSchedulingMap.keySet());
424 434 for (String key : keys) {
425 435 List<ResponseSchedulingDto> schedulingList = driverSchedulingMap.get(key);
426   - if(CollectionUtils.isNotEmpty(schedulingList)){
427   - schedulingList = schedulingList.stream().map(s->{
428   - if(Objects.isNull(s.getFcsjT())){
  436 + if (CollectionUtils.isNotEmpty(schedulingList)) {
  437 + schedulingList = schedulingList.stream().map(s -> {
  438 + if (Objects.isNull(s.getFcsjT())) {
429 439 s.setFcsjT(0L);
430 440 }
431 441  
432   - if(Objects.isNull(s.getZdsjT())){
  442 + if (Objects.isNull(s.getZdsjT())) {
433 443 s.setZdsjT(0L);
434 444 }
435 445  
... ... @@ -440,7 +450,7 @@ public class DriverJob implements InitializingBean {
440 450 }
441 451  
442 452 // 存入签到报表
443   - THREAD_JOB_SERVICE.asyncComputedScheduling(driverSchedulingMap, timeOut, date, type,idSets,requestId);
  453 + THREAD_JOB_SERVICE.asyncComputedScheduling(driverSchedulingMap, timeOut, date, type, idSets, requestId);
444 454 // 实时排班直接存入缓存
445 455 SCHEDULING_CACHE.setCacheScheduling(DRIVER_SCHEDULING_PRE + dateKey, driverSchedulingMap);
446 456  
... ...
Bsth-admin/src/main/java/com/ruoyi/job/NewDriverJob.java 0 → 100644
  1 +package com.ruoyi.job;
  2 +
  3 +import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
  4 +import com.ruoyi.service.driver.NewDriverService;
  5 +import lombok.extern.slf4j.Slf4j;
  6 +import org.springframework.beans.factory.InitializingBean;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Component;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import java.util.Date;
  12 +
  13 +@Component("newDriverJob")
  14 +@Slf4j
  15 +public class NewDriverJob implements InitializingBean {
  16 + @Autowired
  17 + private NewDriverService newDriverService;
  18 + @Transactional(rollbackFor = Exception.class)
  19 + public void syDriver() {
  20 + Date date = new Date();
  21 +
  22 + for (int i = 0; i < 2; i++) {
  23 + JwtAuthenticationTokenFilter.putMDC("job",JwtAuthenticationTokenFilter.getRandomValue());
  24 + newDriverService.insertJob();
  25 + }
  26 +
  27 +
  28 + }
  29 +
  30 + @Override
  31 + public void afterPropertiesSet() throws Exception {
  32 +
  33 + }
  34 +}
... ...
Bsth-admin/src/main/java/com/ruoyi/pojo/response/ResponseSchedulingDto.java
... ... @@ -59,6 +59,7 @@ public class ResponseSchedulingDto implements Serializable {
59 59 private Integer dfsj;
60 60 private String scheduleDateStr;
61 61  
  62 +
62 63 public void setScheduleDateStr(Object scheduleDateStr) {
63 64 if (Objects.nonNull(scheduleDateStr)) {
64 65 this.scheduleDateStr = scheduleDateStr.toString();
... ... @@ -103,6 +104,21 @@ public class ResponseSchedulingDto implements Serializable {
103 104 return null;
104 105 }
105 106  
  107 +// public String getJobCode(){
  108 +// if(StringUtils.isEmpty(this.jobCode) && StringUtils.isNotEmpty(this.jsy)){
  109 +// this.jobCode = StringUtils.substringBeforeLast(this.jsy,"/");
  110 +// }
  111 +// return this.jobCode;
  112 +// }
  113 +//
  114 +// public String getName(){
  115 +// if(StringUtils.isEmpty(this.name) && StringUtils.isNotEmpty(this.jsy)){
  116 +// this.name = StringUtils.substringAfterLast(this.jsy,"/");
  117 +// }
  118 +// return this.name;
  119 +// }
  120 +
  121 +
106 122 public void setUpDowm(String upDowm){
107 123 this.upDown = upDowm;
108 124 }
... ...
Bsth-admin/src/main/java/com/ruoyi/service/ThreadJobService.java
... ... @@ -546,7 +546,7 @@ public class ThreadJobService {
546 546 scheduling.setType(b.getType());
547 547  
548 548 return scheduling;
549   - }).filter(s->StringUtils.isBlank(s.getJobCode()) && StringUtils.isBlank(s.getName()) && !StringUtils.equalsAnyIgnoreCase(s.getJobCode(),"null")
  549 + }).filter(s->!StringUtils.isBlank(s.getJobCode()) && !StringUtils.isBlank(s.getName()) && !StringUtils.equalsAnyIgnoreCase(s.getJobCode(),"null")
550 550 && !StringUtils.equalsAnyIgnoreCase(s.getName(),"null")).collect(Collectors.toList());
551 551 if (CollectionUtils.isNotEmpty(schedulings)) {
552 552 Map<String, List<LinggangScheduling>> distinctMap = new HashMap<>();
... ... @@ -599,6 +599,10 @@ public class ThreadJobService {
599 599 if(CollectionUtils.isNotEmpty(removeSchedulings)){
600 600 Set<Long> ids = removeSchedulings.stream().map(LinggangScheduling::getId).collect(Collectors.toSet());
601 601 schedulingService.removeByIds(ids);
  602 + schedulings = schedulings1.stream().filter(s->{
  603 + Optional<LinggangScheduling> opt = removeSchedulings.stream().filter(s1 -> s1.importEqus(s)).findFirst();
  604 + return !opt.isPresent();
  605 + }).collect(Collectors.toList());
602 606 }
603 607  
604 608 schedulings = schedulings.stream().filter(s -> {
... ...
Bsth-admin/src/main/java/com/ruoyi/utils/HttpClientUtil.java
... ... @@ -3,12 +3,18 @@ package com.ruoyi.utils;
3 3 import com.alibaba.fastjson2.JSON;
4 4 import lombok.extern.slf4j.Slf4j;
5 5 import org.apache.commons.collections4.MapUtils;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.apache.http.HttpEntity;
6 8 import org.apache.http.HttpResponse;
  9 +import org.apache.http.ParseException;
7 10 import org.apache.http.client.ClientProtocolException;
8 11 import org.apache.http.client.HttpClient;
  12 +import org.apache.http.client.methods.CloseableHttpResponse;
  13 +import org.apache.http.client.methods.HttpGet;
9 14 import org.apache.http.client.methods.HttpPost;
10 15 import org.apache.http.entity.ContentType;
11 16 import org.apache.http.entity.StringEntity;
  17 +import org.apache.http.impl.client.CloseableHttpClient;
12 18 import org.apache.http.impl.client.HttpClients;
13 19 import org.apache.http.util.EntityUtils;
14 20 import org.springframework.stereotype.Component;
... ... @@ -16,6 +22,7 @@ import org.springframework.stereotype.Component;
16 22 import java.io.IOException;
17 23 import java.net.URI;
18 24 import java.net.URISyntaxException;
  25 +import java.nio.charset.StandardCharsets;
19 26 import java.util.Map;
20 27 import java.util.Objects;
21 28  
... ... @@ -69,4 +76,24 @@ public class HttpClientUtil {
69 76 }
70 77 return null;
71 78 }
  79 +
  80 +
  81 + public static String get(String url) {
  82 + String resultContent = null;
  83 + HttpGet httpGet = new HttpGet(url);
  84 + try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
  85 + try (CloseableHttpResponse response = httpclient.execute(httpGet)) {
  86 +
  87 + HttpEntity entity = response.getEntity();
  88 + // 获取响应信息
  89 + resultContent = EntityUtils.toString(entity);
  90 + if(StringUtils.isNotEmpty(resultContent)){
  91 + resultContent = new String(resultContent.getBytes(),StandardCharsets.UTF_8);
  92 + }
  93 + }
  94 + } catch (IOException | ParseException e) {
  95 + e.printStackTrace();
  96 + }
  97 + return resultContent;
  98 + }
72 99 }
... ...
Bsth-admin/src/main/resources/application-druid-dev.yml
... ... @@ -165,7 +165,8 @@ api:
165 165 getCompanyInfo:
166 166 # 获取排班信息
167 167 getSchedulingInfo: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
168   - getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
  168 + getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk4modify/%s/%s/%d?timestamp=%d&nonce=%s&password=%s&sign=%s
  169 + getSchedulingInfoNew1: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
169 170 getSchedulingInfoPlan: http://58.34.47.74:9089/webservice/rest/schedule/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
170 171 config:
171 172 password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464
... ...
Bsth-admin/src/main/resources/application-druid-lingangTest.yml
... ... @@ -165,7 +165,8 @@ api:
165 165 getCompanyInfo:
166 166 # 获取排班信息
167 167 getSchedulingInfo: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
168   - getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
  168 + getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk4modify/%s/%s/%d?timestamp=%d&nonce=%s&password=%s&sign=%s
  169 + getSchedulingInfoNew1: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
169 170 getSchedulingInfoPlan: http://58.34.47.74:9089/webservice/rest/schedule/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
170 171 config:
171 172 password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464
... ...
Bsth-admin/src/main/resources/application-druid-prd.yml
... ... @@ -185,7 +185,8 @@ api:
185 185 getCompanyInfo:
186 186 # 获取排班信息
187 187 getSchedulingInfo: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
188   - getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
  188 + getSchedulingInfoNew: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk4modify/%s/%s/%d?timestamp=%d&nonce=%s&password=%s&sign=%s
  189 + getSchedulingInfoNew1: http://58.34.47.74:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
189 190 getSchedulingInfoPlan: http://58.34.47.74:9089/webservice/rest/schedule/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
190 191 config:
191 192 password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464
... ...