Merge remote-tracking branch 'origin/xc' into xc
This commit is contained in:
+46
-2
@@ -258,8 +258,11 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public AuthResult publicNetworkTokenNoCache() {
|
* @description: 旧版公网获取token实现(SM4 + AnYanResult 包裹解密),保留备份
|
||||||
|
* @author PengJ
|
||||||
|
*/
|
||||||
|
public AuthResult publicNetworkTokenNoCacheBAK() {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
String password = anYanProperties.getPublicPassWrod();
|
String password = anYanProperties.getPublicPassWrod();
|
||||||
String userName = anYanProperties.getPublicUserNmae();
|
String userName = anYanProperties.getPublicUserNmae();
|
||||||
@@ -289,6 +292,47 @@ public class AnYanClientExecutor implements AnYanClient {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 公网获取token(密码模式,调用方式与 getAuthTokenByPassword 保持一致)
|
||||||
|
* 表单提交 + 公网 host + QUERY_AUTH_TOKEN,仅 RSA 加密密码,不写 Redis(缓存由调用方负责)
|
||||||
|
* @author PengJ
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AuthResult publicNetworkTokenNoCache() {
|
||||||
|
String username = anYanProperties.getPublicUserNmae();
|
||||||
|
String password = anYanProperties.getPublicPassWrod();
|
||||||
|
try {
|
||||||
|
// 仅 RSA 加密密码,与 getAuthTokenByPassword 保持一致
|
||||||
|
String encryptPassword = StringUtils.encryptByPublicKey(publicKey, password);
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
|
||||||
|
MultiValueMap<String, String> formData = new LinkedMultiValueMap<>();
|
||||||
|
formData.add("grant_type", "password");
|
||||||
|
formData.add("username", username);
|
||||||
|
formData.add("password", encryptPassword);
|
||||||
|
formData.add("client_id", anYanProperties.getClientId());
|
||||||
|
formData.add("client_secret", anYanProperties.getClientSecret());
|
||||||
|
ResponseEntity<AuthResult> authResult = RestTemplateUtil.postExchangeForGetTokenByPassword(AnYanApiEnum.QUERY_AUTH_TOKEN, formData, headers, AuthResult.class);
|
||||||
|
if (HttpStatus.OK.equals(authResult.getStatusCode())
|
||||||
|
&& ObjectUtils.isNotEmpty(authResult.getBody())) {
|
||||||
|
return authResult.getBody();
|
||||||
|
} else {
|
||||||
|
log.error("------安眼系统获取公网token失败{}------", authResult.getBody());
|
||||||
|
ExceptionAssertsUtil.fail("------安眼系统获取公网token失败------" + authResult.getBody());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (HttpClientErrorException e) {
|
||||||
|
log.error("------安眼系统获取公网token失败{}------", e.getMessage());
|
||||||
|
String replace = Objects.requireNonNull(e.getMessage()).replace("401 Unauthorized: ", "");
|
||||||
|
replace = replace.replace("\"", "");
|
||||||
|
AuthResult bean = JSONUtil.toBean(replace, AuthResult.class);
|
||||||
|
ExceptionAssertsUtil.fail(bean.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
ExceptionAssertsUtil.fail(e.getMessage());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 根据token获取用户信息
|
* @description: 根据token获取用户信息
|
||||||
* @author PengJ
|
* @author PengJ
|
||||||
|
|||||||
+10
-1
@@ -1,5 +1,6 @@
|
|||||||
package com.renkang.anyan.config;
|
package com.renkang.anyan.config;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.renkang.anyan.enums.AnYanApiEnum;
|
import com.renkang.anyan.enums.AnYanApiEnum;
|
||||||
import com.renkang.anyan.model.vo.AnYanResult;
|
import com.renkang.anyan.model.vo.AnYanResult;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -81,7 +82,15 @@ public class RestTemplateUtil {
|
|||||||
public static <T> ResponseEntity<T> postExchangeForGetToken(AnYanApiEnum api, Object requestBody, Class<T> responseType) {
|
public static <T> ResponseEntity<T> postExchangeForGetToken(AnYanApiEnum api, Object requestBody, Class<T> responseType) {
|
||||||
String url = getProperties().getPublicHost() + api.getMethodPath() + api.getMethodParam();
|
String url = getProperties().getPublicHost() + api.getMethodPath() + api.getMethodParam();
|
||||||
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody);
|
HttpEntity<Object> requestEntity = new HttpEntity<>(requestBody);
|
||||||
return getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
// 打印请求入参,便于排查
|
||||||
|
String bodyJson = JSON.toJSONString(requestBody);
|
||||||
|
log.info("安眼获取token请求入参: url={}, body={}", url, bodyJson);
|
||||||
|
// 打印等价 curl(application/json),便于本地手动调试
|
||||||
|
log.info("安眼获取token等价curl: curl -X POST '{}' -H 'Content-Type: application/json' -d '{}'", url, bodyJson);
|
||||||
|
ResponseEntity<T> response = getRestTemplate().exchange(url, api.getHttpMethod(), requestEntity, responseType);
|
||||||
|
// 打印返回信息(状态码 + 响应体)
|
||||||
|
log.info("安眼获取token返回信息: statusCode={}, body={}", response.getStatusCode(), JSON.toJSONString(response.getBody()));
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+9
@@ -44,4 +44,13 @@ public interface LargeScreenDataMapper extends MPJBaseMapper<LargeScreenData> {
|
|||||||
*/
|
*/
|
||||||
List<Map<String, String>> selectEmployeeNumsByPhones(@Param("phones") List<String> phones);
|
List<Map<String, String>> selectEmployeeNumsByPhones(@Param("phones") List<String> phones);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询 EMP_CARE_EMP 表中 FIRST_AIDER_INFO 是否包含指定工号
|
||||||
|
*
|
||||||
|
* @param workNo 工号
|
||||||
|
* @return 命中记录数,大于 0 表示该工号是急救人员
|
||||||
|
*/
|
||||||
|
@Select("SELECT COUNT(1) FROM AYGC_YWK.EMP_CARE_EMP WHERE DEL_FLAG = '0' AND FIRST_AIDER_INFO LIKE CONCAT('%', #{workNo}, '%')")
|
||||||
|
int countFirstAiderByWorkNo(@Param("workNo") String workNo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -936,9 +936,7 @@ public class LargeScreenDataServiceImpl extends ServiceImpl<LargeScreenDataMappe
|
|||||||
if (StrUtil.isEmpty(workNo)) {
|
if (StrUtil.isEmpty(workNo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// todo 目前查的是关爱人员,后面换成急救人员需要改成查急救人员
|
return baseMapper.countFirstAiderByWorkNo(workNo) > 0;
|
||||||
// return baseMapper.countByAdminNum(workNo) > 0;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,6 +43,14 @@
|
|||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>yixiong-tech</id>
|
||||||
|
<name>yixiong-tech Repository</name>
|
||||||
|
<url>https://maven.ops.yixiong-tech.com/repository/public/</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -367,6 +375,31 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- IOSP 日志 Kafka 上送:Boot2 starter(JDK8字节码),启动时把日志异步推送到对方Kafka app-log topic -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>ptr.xjyt.iosp.starter</groupId>
|
||||||
|
<artifactId>iosp-starter-log</artifactId>
|
||||||
|
<version>2.0.9.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- hongyousoft logback KafkaAppender 底层实现 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.hongyousoft</groupId>
|
||||||
|
<artifactId>kafka-appender</artifactId>
|
||||||
|
<version>0.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- SkyWalking 日志 traceId 占位符 %tid 支持(无agent时显示N/A,不影响推送) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.skywalking</groupId>
|
||||||
|
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
||||||
|
<version>9.3.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Kafka 客户端:与 starter 设计基线一致(2.4.0),对方3.7.2 broker 向下兼容 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.kafka</groupId>
|
||||||
|
<artifactId>kafka-clients</artifactId>
|
||||||
|
<version>2.4.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ public class SysMessageController extends JeecgController<SysMessage, ISysMessag
|
|||||||
// 员工电话: esContent中手机号以"3位~4位~4位"(全角波浪线)格式存储,
|
// 员工电话: esContent中手机号以"3位~4位~4位"(全角波浪线)格式存储,
|
||||||
// 前端传入纯数字手机号,此处还原为存储格式后对 esContent 做模糊查询
|
// 前端传入纯数字手机号,此处还原为存储格式后对 esContent 做模糊查询
|
||||||
if (employeePhone != null && !employeePhone.trim().isEmpty()) {
|
if (employeePhone != null && !employeePhone.trim().isEmpty()) {
|
||||||
queryWrapper.like("esContent", buildEmployeePhoneLikeValue(employeePhone));
|
queryWrapper.like("ES_CONTENT", buildEmployeePhoneLikeValue(employeePhone));
|
||||||
}
|
}
|
||||||
Page<SysMessage> page = new Page<SysMessage>(pageNo, pageSize);
|
Page<SysMessage> page = new Page<SysMessage>(pageNo, pageSize);
|
||||||
IPage<SysMessage> pageList = sysMessageService.page(page, queryWrapper);
|
IPage<SysMessage> pageList = sysMessageService.page(page, queryWrapper);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<id>dt-releases</id>
|
<id>dt-releases</id>
|
||||||
<name>jeecg Repository</name>
|
<name>jeecg Repository</name>
|
||||||
<url>https://maven.icdat.cn/repository/releases/</url>
|
<url>https://maven.ops.yixiong-tech.com/repository/releases/</url>
|
||||||
<snapshots>
|
<snapshots>
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<id>dt-snapshots</id>
|
<id>dt-snapshots</id>
|
||||||
<name>jeecg-snapshots Repository</name>
|
<name>jeecg-snapshots Repository</name>
|
||||||
<url>https://maven.icdat.cn/repository/shapshots/</url>
|
<url>https://maven.ops.yixiong-tech.com/repository/shapshots/</url>
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
|
|||||||
Reference in New Issue
Block a user