Commit f50323cd7b31df86dbb13eb615669d127af193dd
1 parent
52fd9259
feat: 修改请求ip
Showing
6 changed files
with
13 additions
and
13 deletions
Bsth-admin/src/main/java/com/ruoyi/common/ErrorTypeProperties.java
| @@ -5,7 +5,7 @@ package com.ruoyi.common; | @@ -5,7 +5,7 @@ package com.ruoyi.common; | ||
| 5 | */ | 5 | */ |
| 6 | public interface ErrorTypeProperties { | 6 | public interface ErrorTypeProperties { |
| 7 | String SIGN_IN_ERROR = "签到异常"; | 7 | String SIGN_IN_ERROR = "签到异常"; |
| 8 | - String SIGN_OUT_ERROR = "签退异常"; | 8 | + String SIGN_OUT_ERROR = "签到异常"; |
| 9 | String EQUIPMENT_ERROR = "设备异常"; | 9 | String EQUIPMENT_ERROR = "设备异常"; |
| 10 | String ALCOHOL_SIGN_IN_ERROR = "酒精测试超标,"; | 10 | String ALCOHOL_SIGN_IN_ERROR = "酒精测试超标,"; |
| 11 | String WORK_DAY_ERROR = "当天没有排班,"; | 11 | String WORK_DAY_ERROR = "当天没有排班,"; |
Bsth-admin/src/main/java/com/ruoyi/common/cache/NowSchedulingCache.java
| @@ -29,7 +29,7 @@ public class NowSchedulingCache { | @@ -29,7 +29,7 @@ public class NowSchedulingCache { | ||
| 29 | this.schedulingMapper = driverSchedulingMapper; | 29 | this.schedulingMapper = driverSchedulingMapper; |
| 30 | this.errorJobcodeService = errorJobcodeService; | 30 | this.errorJobcodeService = errorJobcodeService; |
| 31 | log.info("金高项目启动加载中获取排班表-----"); | 31 | log.info("金高项目启动加载中获取排班表-----"); |
| 32 | -// cacheNowDaySchedulingInit(); | 32 | + cacheNowDaySchedulingInit(); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | private void cacheNowDaySchedulingInit() { | 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,6 +4,7 @@ import com.ruoyi.pojo.response.ResponseSchedulingDto; | ||
| 4 | import com.ruoyi.utils.ConstDateUtil; | 4 | import com.ruoyi.utils.ConstDateUtil; |
| 5 | import org.slf4j.Logger; | 5 | import org.slf4j.Logger; |
| 6 | import org.slf4j.LoggerFactory; | 6 | import org.slf4j.LoggerFactory; |
| 7 | +import org.springframework.beans.factory.annotation.Value; | ||
| 7 | import org.springframework.core.ParameterizedTypeReference; | 8 | import org.springframework.core.ParameterizedTypeReference; |
| 8 | import org.springframework.http.HttpMethod; | 9 | import org.springframework.http.HttpMethod; |
| 9 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| @@ -28,7 +29,7 @@ public class SchedulingCache { | @@ -28,7 +29,7 @@ public class SchedulingCache { | ||
| 28 | 29 | ||
| 29 | 30 | ||
| 30 | // @Value("${api.url.getSchedulingInfoNew}") | 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 | // @Value("${api.config.nonce}") | 33 | // @Value("${api.config.nonce}") |
| 33 | private static final String NONCE = "adfsad"; | 34 | private static final String NONCE = "adfsad"; |
| 34 | // @Value("${api.config.password}") | 35 | // @Value("${api.config.password}") |
| @@ -60,10 +61,9 @@ public class SchedulingCache { | @@ -60,10 +61,9 @@ public class SchedulingCache { | ||
| 60 | private String getUrl(String formatNowDate) { | 61 | private String getUrl(String formatNowDate) { |
| 61 | String url = null; | 62 | String url = null; |
| 62 | long timestamp = System.currentTimeMillis(); | 63 | long timestamp = System.currentTimeMillis(); |
| 63 | -// String formatDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1)); | ||
| 64 | // 获取排班请求 | 64 | // 获取排班请求 |
| 65 | try { | 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 | } catch (Exception e) { | 67 | } catch (Exception e) { |
| 68 | throw new RuntimeException(e); | 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,7 +424,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 424 | result = checkWorkDay(now, dto, globalIndex, signIn, driver.getPosts()); | 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 | if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) <= 0) { | 428 | if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) <= 0) { |
| 429 | threadJobService.asyncSendEmail(dto, globalIndex.getIndex(), signIn, driver); | 429 | threadJobService.asyncSendEmail(dto, globalIndex.getIndex(), signIn, driver); |
| 430 | signIn.setRemark(signIn.getRemark() + ALCOHOL_SIGN_IN_ERROR + signIn.getAlcoholIntake().toString() + "mg/100ml。"); | 430 | signIn.setRemark(signIn.getRemark() + ALCOHOL_SIGN_IN_ERROR + signIn.getAlcoholIntake().toString() + "mg/100ml。"); |
| @@ -587,7 +587,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -587,7 +587,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 587 | // 单挑数据 且不在范围内 | 587 | // 单挑数据 且不在范围内 |
| 588 | if (BC_TYPE_IN.equals(dto.get(0).getBcType())) { | 588 | if (BC_TYPE_IN.equals(dto.get(0).getBcType())) { |
| 589 | if (!(Math.abs(nowBetween) <= 60)) { | 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 | return false; | 591 | return false; |
| 592 | } else { | 592 | } else { |
| 593 | return true; | 593 | return true; |
| @@ -595,7 +595,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -595,7 +595,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 595 | } | 595 | } |
| 596 | if (BC_TYPE_OUT.equals(dto.get(0).getBcType())) { | 596 | if (BC_TYPE_OUT.equals(dto.get(0).getBcType())) { |
| 597 | if (!(Math.abs(nowBetween) <= 60)) { | 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 | return false; | 599 | return false; |
| 600 | } else { | 600 | } else { |
| 601 | return true; | 601 | return true; |
Bsth-admin/src/main/java/com/ruoyi/job/DriverJob.java
| @@ -228,7 +228,7 @@ public class DriverJob implements InitializingBean { | @@ -228,7 +228,7 @@ public class DriverJob implements InitializingBean { | ||
| 228 | 228 | ||
| 229 | log.info("开始获取{}的排班数据", formatDate); | 229 | log.info("开始获取{}的排班数据", formatDate); |
| 230 | try { | 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 | } catch (Exception e) { | 232 | } catch (Exception e) { |
| 233 | throw new RuntimeException(e); | 233 | throw new RuntimeException(e); |
| 234 | } | 234 | } |
Bsth-admin/src/main/resources/application-druid-prd.yml
| @@ -155,12 +155,12 @@ swagger: | @@ -155,12 +155,12 @@ swagger: | ||
| 155 | api: | 155 | api: |
| 156 | url: | 156 | url: |
| 157 | # all 为获取所有驾驶员信息 | 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 | config: | 164 | config: |
| 165 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 | 165 | password: c4dd3d8cb9a82f6d6a625818618b28ca7bebb464 |
| 166 | # 随机字符串 | 166 | # 随机字符串 |