Commit f50323cd7b31df86dbb13eb615669d127af193dd

Authored by guzijian
1 parent 52fd9259

feat: 修改请求ip

Bsth-admin/src/main/java/com/ruoyi/common/ErrorTypeProperties.java
... ... @@ -5,7 +5,7 @@ package com.ruoyi.common;
5 5 */
6 6 public interface ErrorTypeProperties {
7 7 String SIGN_IN_ERROR = "签到异常";
8   - String SIGN_OUT_ERROR = "签退异常";
  8 + String SIGN_OUT_ERROR = "签异常";
9 9 String EQUIPMENT_ERROR = "设备异常";
10 10 String ALCOHOL_SIGN_IN_ERROR = "酒精测试超标,";
11 11 String WORK_DAY_ERROR = "当天没有排班,";
... ...
Bsth-admin/src/main/java/com/ruoyi/common/cache/NowSchedulingCache.java
... ... @@ -29,7 +29,7 @@ public class NowSchedulingCache {
29 29 this.schedulingMapper = driverSchedulingMapper;
30 30 this.errorJobcodeService = errorJobcodeService;
31 31 log.info("金高项目启动加载中获取排班表-----");
32   -// cacheNowDaySchedulingInit();
  32 + cacheNowDaySchedulingInit();
33 33 }
34 34  
35 35 private void cacheNowDaySchedulingInit() {
... ...
Bsth-admin/src/main/java/com/ruoyi/common/cache/SchedulingCache.java
... ... @@ -4,6 +4,7 @@ import com.ruoyi.pojo.response.ResponseSchedulingDto;
4 4 import com.ruoyi.utils.ConstDateUtil;
5 5 import org.slf4j.Logger;
6 6 import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.factory.annotation.Value;
7 8 import org.springframework.core.ParameterizedTypeReference;
8 9 import org.springframework.http.HttpMethod;
9 10 import org.springframework.stereotype.Component;
... ... @@ -28,7 +29,7 @@ public class SchedulingCache {
28 29  
29 30  
30 31 // @Value("${api.url.getSchedulingInfoNew}")
31   - private static final String getSchedulingInfoUrl = "http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s";
  32 + private static final String getSchedulingInfoUrl = "http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s";
32 33 // @Value("${api.config.nonce}")
33 34 private static final String NONCE = "adfsad";
34 35 // @Value("${api.config.password}")
... ... @@ -60,10 +61,9 @@ public class SchedulingCache {
60 61 private String getUrl(String formatNowDate) {
61 62 String url = null;
62 63 long timestamp = System.currentTimeMillis();
63   -// String formatDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
64 64 // 获取排班请求
65 65 try {
66   - url = String.format(getSchedulingInfoUrl, "99", formatNowDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
  66 + url = String.format(getSchedulingInfoUrl, "22", formatNowDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
67 67 } catch (Exception e) {
68 68 throw new RuntimeException(e);
69 69 }
... ...
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -424,7 +424,7 @@ public class SignInServiceImpl implements ISignInService {
424 424 result = checkWorkDay(now, dto, globalIndex, signIn, driver.getPosts());
425 425  
426 426 // 酒精测试校验 确定 且员工工种是驾驶员
427   - if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag()) ) {
  427 + if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag())) {
428 428 if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) <= 0) {
429 429 threadJobService.asyncSendEmail(dto, globalIndex.getIndex(), signIn, driver);
430 430 signIn.setRemark(signIn.getRemark() + ALCOHOL_SIGN_IN_ERROR + signIn.getAlcoholIntake().toString() + "mg/100ml。");
... ... @@ -587,7 +587,7 @@ public class SignInServiceImpl implements ISignInService {
587 587 // 单挑数据 且不在范围内
588 588 if (BC_TYPE_IN.equals(dto.get(0).getBcType())) {
589 589 if (!(Math.abs(nowBetween) <= 60)) {
590   - signIn.setRemark(SIGN_OUT_TIMEOUT);
  590 + signIn.setRemark(SIGN_OUT_TIMEOUT + "请在" + ConstDateUtil.formatDate("HH:mm", new Date(currentScheduling.getTimestamps())) + "前后一小时内打卡。");
591 591 return false;
592 592 } else {
593 593 return true;
... ... @@ -595,7 +595,7 @@ public class SignInServiceImpl implements ISignInService {
595 595 }
596 596 if (BC_TYPE_OUT.equals(dto.get(0).getBcType())) {
597 597 if (!(Math.abs(nowBetween) <= 60)) {
598   - signIn.setRemark(SIGN_IN_TIMEOUT);
  598 + signIn.setRemark(SIGN_IN_TIMEOUT + "请在" + ConstDateUtil.formatDate("HH:mm", new Date(currentScheduling.getTimestamps())) + "前后一小时内打卡。");
599 599 return false;
600 600 } else {
601 601 return true;
... ...
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
... ... @@ -228,7 +228,7 @@ public class DriverJob implements InitializingBean {
228 228  
229 229 log.info("开始获取{}的排班数据", formatDate);
230 230 try {
231   - getSchedulingInfoUrl = String.format(GET_SCHEDULING_INFO_URL, "99", formatDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
  231 + getSchedulingInfoUrl = String.format(GET_SCHEDULING_INFO_URL, "22", formatDate, timestamp, NONCE, PASSWORD, getSHA1(getStringStringMap(String.valueOf(timestamp))));
232 232 } catch (Exception e) {
233 233 throw new RuntimeException(e);
234 234 }
... ...
Bsth-admin/src/main/resources/application-druid-prd.yml
... ... @@ -155,12 +155,12 @@ swagger:
155 155 api:
156 156 url:
157 157 # all 为获取所有驾驶员信息
158   - getDriverInfo: http://101.95.136.206:9089/webservice/rest/person/%s
  158 + getDriverInfo: http://58.247.254.118:9089/webservice/rest/person/%s
159 159 # 获取公司编码下的员工信息 暂时没用
160   - getCompanyInfo: http://101.95.136.206:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s
  160 + getCompanyInfo: http://58.247.254.118:9089/webservice/rest/person/company/%d?timestamp=%&nonce=%s&password=%s&sign=%s
161 161 # 获取排班信息
162   - getSchedulingInfo: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
163   - getSchedulingInfoNew: http://101.95.136.206:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
  162 + getSchedulingInfo: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
  163 + getSchedulingInfoNew: http://58.247.254.118:9089/webservice/rest/schedule_real/sch_jk_db/%s/%s?timestamp=%d&nonce=%s&password=%s&sign=%s
164 164 config:
165 165 password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464
166 166 # 随机字符串
... ...