省厅系统接口对接

This commit is contained in:
mythxb 2025-03-18 17:31:01 +08:00
parent cf929bb4c0
commit 3b782b7368
20 changed files with 389 additions and 682 deletions

View File

@ -1,4 +1,4 @@
package com.common.utils.encryption; package com.rzyc.provinceUtil;
import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.CharsetUtil;
@ -6,6 +6,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.asymmetric.KeyType; import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA; import cn.hutool.crypto.asymmetric.RSA;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
@ -22,7 +23,7 @@ import java.util.Base64;
* 省清单数据对接请求响应加解密工具 * 省清单数据对接请求响应加解密工具
* Created by why on 2024/5/11. * Created by why on 2024/5/11.
*/ */
public class ENDEUtils { public class EnedUtils {
private static final String AES_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding"; private static final String AES_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";
@ -122,8 +123,51 @@ public class ENDEUtils {
return JSONObject.parseObject(decryptData); return JSONObject.parseObject(decryptData);
} }
/**
* 省厅接口网络请求
* @version v1.0
* @author dong
* @date 2025/3/18 14:38
*/
public static String doPost(String url,String paramsSts,String accessToken){
//加密请求参数
JSONObject req = RSAEncryptRequest(paramsSts);
HttpRequest request = HttpUtil.createPost(url)
.header("Content-Type", "application/json") // 确保服务器能解析 JSON
.header("access_token", accessToken)
.header("accessToken", accessToken)
.header("Authorization", accessToken)
.setFollowRedirects(false)
.body(req.toJSONString());
// 3. 打印请求信息调试用
System.out.println("Request Body: " + req.toJSONString());
System.out.println("Request Headers: " + request.headers());
// 4. 发送请求
HttpResponse response = request.execute();
// 5. 打印响应信息调试用
System.out.println("Response Status: " + response.getStatus());
System.out.println("Response Body: " + response.body());
//返回结果转json
JSONObject res = JSONObject.parseObject(response.body());
//返回结果解密
JSONObject responseStr = RSADecryptResponse(res.getString("k"), res.getString("v"));
//返回界面结果
return responseStr.toJSONString();
}
public static void main(String[] args) { public static void main(String[] args) {
//加密请求测试JSON格式字符参数 //加密请求测试JSON格式字符参数
String bodyStr = "{\"sysUniqueCode\":\"127829545796636679\"}"; String bodyStr = "{\"sysUniqueCode\":\"127829545796636679\"}";
//加密请求参数 //加密请求参数

View File

@ -0,0 +1,116 @@
package com.rzyc.provinceUtil;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
/**
* @author dong
* @date 2025-03-18 15:25
* @Version V1.0
*/
public class JsonUtils {
private static final ObjectMapper objectMapper = new ObjectMapper();
/**
* JSON 字符串转换为包含泛型的对象
* @param json JSON 字符串
* @param mainClass 主类型 Result.class
* @param subClass 泛型参数类型 User.class
* @return 转换后的对象
*/
public static <T, R> T fromJson(String json, Class<T> mainClass, Class<R> subClass) {
try {
// 动态构建泛型类型例如 Result<User>
Type type = createParametricType(mainClass, subClass);
return objectMapper.readValue(json, new TypeReference<T>() {
@Override
public Type getType() {
return type;
}
});
} catch (Exception e) {
throw new RuntimeException("JSON 转换失败", e);
}
}
/**
* 构建 ParameterizedType例如 Result<User>
*/
private static ParameterizedType createParametricType(final Class<?> rawType,
final Type... typeArguments){
return new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return typeArguments;
}
@Override
public Type getRawType() {
return rawType;
}
@Override
public Type getOwnerType() {
return null;
}
};
}
/**
* 使用示例解析 Result<List<User>>
* @version v1.0
* @author dong
* @date 2025/3/18 15:44
*/
/* Type userListType = new TypeToken<List<User>>() {}.getType();
Result<List<User>> result = JsonUtils.fromJsonComplex(
json,
Result.class,
userListType
);*/
/**
* json转list
* @version v1.0
* @author dong
* @date 2025/3/18 15:43
*/
public static <T> T fromJsonComplex(String json, Class<?> rawType, Type... genericTypes) {
try {
ParameterizedType type = new ParameterizedType() {
@Override
public Type[] getActualTypeArguments() {
return genericTypes;
}
@Override
public Type getRawType() {
return rawType;
}
@Override
public Type getOwnerType() {
return null;
}
};
return objectMapper.readValue(json, new TypeReference<T>() {
@Override
public Type getType() {
return type;
}
});
} catch (Exception e) {
throw new RuntimeException("JSON 转换失败", e);
}
}
}

View File

@ -0,0 +1,28 @@
package com.rzyc.provinceUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.rzyc.provinceUtil.bean.TokenData;
import lombok.Data;
import java.lang.reflect.Type;
/**
* @author dong
* @date 2025-03-18 14:30
* @Version V1.0
*/
@Data
public class ProvData<T> {
//访问状态
private String code;
//返回信息
private String msg;
//返回数据
private T data;
}

View File

@ -0,0 +1,28 @@
package com.rzyc.provinceUtil.bean;
import lombok.Data;
import java.util.List;
/**
* 部门信息
* @author dong
* @date 2025-03-18 16:16
* @Version V1.0
*/
@Data
public class DeptInfo {
//部门id
private String deptId;
//部门名
private String deptName;
//父级id
private String parentId;
//子级部门
private List<DeptInfo> children;
}

View File

@ -0,0 +1,22 @@
package com.rzyc.provinceUtil.bean;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
/**
* 省厅token信息
* @author dong
* @date 2025-03-18 14:46
* @Version V1.0
*/
@Data
public class TokenData {
//token
private String access_token;
//时效分钟
private String expires_in;
}

View File

@ -1,4 +1,4 @@
package com.rzyc.config; package com.rzyc.redis;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;

View File

@ -1,4 +1,4 @@
package com.rzyc.config; package com.rzyc.redis;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -15,8 +15,10 @@ import com.rzyc.mapper.oth.*;
import com.rzyc.mapper.personal.SysResourceMapper; import com.rzyc.mapper.personal.SysResourceMapper;
import com.rzyc.mapper.sys.*; import com.rzyc.mapper.sys.*;
import com.rzyc.mapper.user.*; import com.rzyc.mapper.user.*;
import com.rzyc.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/** /**
@ -587,4 +589,8 @@ public class BaseService {
@Autowired @Autowired
protected ExScoreRecordMapper exScoreRecordMapper; protected ExScoreRecordMapper exScoreRecordMapper;
//redis
@Resource
protected RedisUtil redisUtil;
} }

View File

@ -1,15 +1,116 @@
package com.rzyc.service; package com.rzyc.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.common.utils.StringUtils;
import com.common.utils.TypeConversion;
import com.google.gson.Gson;
import com.google.zxing.Result;
import com.rzyc.provinceUtil.EnedUtils;
import com.rzyc.provinceUtil.JsonUtils;
import com.rzyc.provinceUtil.ProvData;
import com.rzyc.provinceUtil.bean.DeptInfo;
import com.rzyc.provinceUtil.bean.TokenData;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
/** /**
* 省厅接口对接 * 省厅接口对接
* @author dong * @author dong
* @date 2025-03-18 9:40 * @date 2025-03-18 9:40
* @Version V1.0 * @Version V1.0
*/ */
@Service @Service("ProvinceService")
public class ProvinceService extends BaseService{ public class ProvinceService extends BaseService{
//接口基础地址 正式服
private static String BASE_URL = "https://qdz.scasst.net/prod-api";
//平台唯一标识码
private static String SYS_UNIQUE_CODE = "127829545796636679 ";
//获取token接口地址
private static String GET_TOKEN_URL = "/auth/sync/getToken";
private static String REDIS_TOKEN_KEY = "province_token_key";
/**
* 通过接口后期token
* @version v1.0
* @author dong
* @date 2025/3/18 16:01
*/
public String getTokenApi(){
Map<String,String> params = new HashMap<>();
params.put("sysUniqueCode",SYS_UNIQUE_CODE);
//加密请求参数
String responseStr = EnedUtils.doPost(BASE_URL+GET_TOKEN_URL,JSONObject.toJSONString(params),"");
ProvData<TokenData> data = JsonUtils.fromJson(responseStr,ProvData.class,TokenData.class);
System.out.println("req --> "+data.getData().getAccess_token());
System.out.println("req --> "+data.getData().getExpires_in());
String expiresIn = data.getData().getExpires_in();
String token = data.getData().getAccess_token();
redisUtil.set(REDIS_TOKEN_KEY, token, TypeConversion.StringToInteger(expiresIn)-1);
return token;
}
/**
* 获取token
* @version v1.0
* @author dong
* @date 2025/3/18 14:13
*/
public String getToken(){
Object accessToken = redisUtil.get(REDIS_TOKEN_KEY);
if(null == accessToken){
accessToken = getTokenApi();
}
return accessToken.toString();
}
//获取部门信息
private static String GET_DEPT = "/gov/sync/base/dept";
/**
* 获取部门信息
* @version v1.0
* @author dong
* @date 2025/3/18 16:18
*/
public void getDeptApi(){
String token = getToken();
Map<String,String> params = new HashMap<>();
params.put("sysUniqueCode",SYS_UNIQUE_CODE);
params.put("access_token",token);
//加密请求参数
String responseStr = EnedUtils.doPost(BASE_URL+GET_DEPT,JSONObject.toJSONString(params),token);
Type userListType = new TypeToken<List<DeptInfo>>() {}.getType();
ProvData<List<DeptInfo>> data = JsonUtils.fromJsonComplex(responseStr,ProvData.class, userListType);
System.out.println("data --> "+JSONArray.toJSONString(data));
}
/**
* 数据测试
* @version v1.0
* @author dong
* @date 2025/3/18 16:19
*/
public void dataTest(){
getDeptApi();
}
} }

View File

@ -1,52 +0,0 @@
package com.rzyc.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* Redis 连接及序列化
* @author Xuwanxin
* @date 2022/10/13
* */
@Configuration
public class RedisConfig {
/**
* 在使用localTime对象时GenericJackson2JsonRedisSerializer反序列化会报转换错误遇到之后还需要再单独处理
* */
@Bean
public RedisTemplate<String,Object> strRedisTemplate(RedisConnectionFactory redisConnectionFactory){
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
// key 序列化方式
redisTemplate.setKeySerializer(new StringRedisSerializer());
// value 序列化
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
// hash 类型 key序列化
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
// hash 类型 value序列化方式
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
// 注入连接工厂
redisTemplate.setConnectionFactory(redisConnectionFactory);
// 让设置生效
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}

View File

@ -1,618 +0,0 @@
package com.rzyc.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
* Redis操作api工具
* @author Xuwanxin
* @date 2022/10/17
* */
@Component
public class RedisUtil {
RedisTemplate<String,Object> redisTemplate;
@Autowired
public RedisUtil(RedisTemplate<String, Object> redisTemplate) {
this.redisTemplate = redisTemplate;
}
/**
* get 多参数分隔 :
* @param key
*/
public String appendSymbol(String ... key) {
StringBuilder stringBuilder = new StringBuilder();
try {
for (String k:key) {
stringBuilder.append(k);
stringBuilder.append(":");
}
return stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(":")).toString();
} catch (Exception e) {
e.printStackTrace();
return "error";
}
}
/**
* 指定缓存失效时间
* @param key
* @param time 时间()
*/
public boolean expire(String key, long time) {
try {
if (time > 0) {
redisTemplate.expire(key, time, TimeUnit.SECONDS);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据key 获取过期时间
* @param key 不能为null
* @return 时间() 返回0代表为永久有效
*/
public long getExpire(String key) {
return redisTemplate.getExpire(key, TimeUnit.SECONDS);
}
/**
* 判断key是否存在
* @param key
* @return true 存在 false不存在
*/
public boolean hasKey(String key) {
try {
return redisTemplate.hasKey(key);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除缓存
* @param key 可以传一个值 或多个
*/
@SuppressWarnings("unchecked")
public void del(String... key) {
if (key != null && key.length > 0) {
if (key.length == 1) {
redisTemplate.delete(key[0]);
} else {
redisTemplate.delete(String.valueOf(CollectionUtils.arrayToList(key)));
}
}
}
// ============================String=============================
/**
* 普通缓存获取
* @param key
* @return
*/
public Object get(String key) {
return key == null ? null : redisTemplate.opsForValue().get(key);
}
/**
* 普通缓存放入
* @param key
* @param value
* @return true成功 false失败
*/
public boolean set(String key, Object value) {
try {
redisTemplate.opsForValue().set(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 普通缓存放入并设置时间
* @param key
* @param value
* @param time 时间() time要大于0 如果time小于等于0 将设置默认8小时
* @return true成功 false 失败
*/
public boolean set(String key, Object value, long time) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
if (time > 0) {
redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
} else {
set(key, value);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 递增
* @param key
* @param delta 要增加几(大于0)
*/
public long incr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递增因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, delta);
}
/**
* 递减
* @param key
* @param delta 要减少几(小于0)
*/
public long decr(String key, long delta) {
if (delta < 0) {
throw new RuntimeException("递减因子必须大于0");
}
return redisTemplate.opsForValue().increment(key, -delta);
}
// ================================Map=================================
/**
* HashGet
* @param key 不能为null
* @param item 不能为null
*/
public Object hget(String key, String item) {
return redisTemplate.opsForHash().get(key, item);
}
/**
* 获取hashKey对应的所有键值
* @param key
* @return 对应的多个键值
*/
public Map<Object, Object> hmget(String key) {
return redisTemplate.opsForHash().entries(key);
}
/**
* HashSet
* @param key
* @param map 对应多个键值
*/
public boolean hmset(String key, Map<String, Object> map) {
try {
redisTemplate.opsForHash().putAll(key, map);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* HashSet 并设置时间
* @param key
* @param map 对应多个键值
* @param time 时间()
* @return true成功 false失败
*/
public boolean hmset(String key, Map<String, Object> map, long time) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
redisTemplate.opsForHash().putAll(key, map);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key
* @param item
* @param value
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value) {
try {
redisTemplate.opsForHash().put(key, item, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 向一张hash表中放入数据,如果不存在将创建
*
* @param key
* @param item
* @param value
* @param time 时间() 注意:如果已存在的hash表有时间,这里将会替换原有的时间
* @return true 成功 false失败
*/
public boolean hset(String key, String item, Object value, long time) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
redisTemplate.opsForHash().put(key, item, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 删除hash表中的值
*
* @param key 不能为null
* @param item 可以使多个 不能为null
*/
public void hdel(String key, Object... item) {
redisTemplate.opsForHash().delete(key, item);
}
/**
* 判断hash表中是否有该项的值
*
* @param key 不能为null
* @param item 不能为null
* @return true 存在 false不存在
*/
public boolean hHasKey(String key, String item) {
return redisTemplate.opsForHash().hasKey(key, item);
}
/**
* hash递增 如果不存在,就会创建一个 并把新增后的值返回
*
* @param key
* @param item
* @param by 要增加几(大于0)
*/
public double hincr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, by);
}
/**
* hash递减
*
* @param key
* @param item
* @param by 要减少记(小于0)
*/
public double hdecr(String key, String item, double by) {
return redisTemplate.opsForHash().increment(key, item, -by);
}
// ============================set=============================
/**
* 根据key获取Set中的所有值
* @param key
*/
public Set<Object> sGet(String key) {
try {
return redisTemplate.opsForSet().members(key);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 根据value从一个set中查询,是否存在
*
* @param key
* @param value
* @return true 存在 false不存在
*/
public boolean sHasKey(String key, Object value) {
try {
return redisTemplate.opsForSet().isMember(key, value);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将数据放入set缓存
*
* @param key
* @param values 可以是多个
* @return 成功个数
*/
public long sSet(String key, Object... values) {
try {
return redisTemplate.opsForSet().add(key, values);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 将set数据放入缓存
*
* @param key
* @param time 时间()
* @param values 可以是多个
* @return 成功个数
*/
public long sSetAndTime(String key, long time, Object... values) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
Long count = redisTemplate.opsForSet().add(key, values);
if (time > 0) {
expire(key, time);
}
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 获取set缓存的长度
*
* @param key
*/
public long sGetSetSize(String key) {
try {
return redisTemplate.opsForSet().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 移除值为value的
*
* @param key
* @param values 可以是多个
* @return 移除的个数
*/
public long setRemove(String key, Object... values) {
try {
Long count = redisTemplate.opsForSet().remove(key, values);
return count;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
// ===============================list=================================
/**
* 获取list缓存的内容
*
* @param key
* @param start 开始
* @param end 结束 0 -1代表所有值
*/
public List<Object> lGet(String key, long start, long end) {
try {
return redisTemplate.opsForList().range(key, start, end);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 获取list缓存的长度
*
* @param key
*/
public long lGetListSize(String key) {
try {
return redisTemplate.opsForList().size(key);
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
/**
* 通过索引 获取list中的值
*
* @param key
* @param index 索引 index>=0时 0 表头1 第二个元素依次类推index<0时-1表尾-2倒数第二个元素依次类推
*/
public Object lGetIndex(String key, long index) {
try {
return redisTemplate.opsForList().index(key, index);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 将list放入缓存
*
* @param key
* @param value
*/
public boolean lSet(String key, Object value) {
try {
redisTemplate.opsForList().rightPush(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
* @param key
* @param value
* @param time 时间()
*/
public boolean lSet(String key, Object value, long time) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
redisTemplate.opsForList().rightPush(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
*
* @param key
* @param value
* @return
*/
public boolean lSet(String key, List<Object> value) {
try {
redisTemplate.opsForList().rightPushAll(key, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 将list放入缓存
*
* @param key
* @param value
* @param time 时间()
* @return
*/
public boolean lSet(String key, List<Object> value, long time) {
//默认8小时ttl时间
time = time > 0 ? time : 28800;
try {
redisTemplate.opsForList().rightPushAll(key, value);
if (time > 0) {
expire(key, time);
}
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据索引修改list中的某条数据
*
* @param key
* @param index 索引
* @param value
* @return
*/
public boolean lUpdateIndex(String key, long index, Object value) {
try {
redisTemplate.opsForList().set(key, index, value);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 移除N个值为value
*
* @param key
* @param count 移除多少个
* @param value
* @return 移除的个数
*/
public long lRemove(String key, long count, Object value) {
try {
Long remove = redisTemplate.opsForList().remove(key, count, value);
return remove;
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
}

View File

@ -3,7 +3,6 @@ package com.rzyc.controller;
import com.common.utils.model.SingleResult; import com.common.utils.model.SingleResult;
import com.rzyc.config.MethodAnnotation; import com.rzyc.config.MethodAnnotation;
import com.rzyc.config.RedisUtil;
import com.rzyc.model.ent.EntEmEquipment; import com.rzyc.model.ent.EntEmEquipment;
import com.rzyc.model.ent.EntEmExpert; import com.rzyc.model.ent.EntEmExpert;
import com.rzyc.model.ent.EntEmRehearsal; import com.rzyc.model.ent.EntEmRehearsal;
@ -12,6 +11,7 @@ import com.rzyc.model.dto.EntEmEquipmentDto;
import com.rzyc.model.dto.EntEmExpertDto; import com.rzyc.model.dto.EntEmExpertDto;
import com.rzyc.model.dto.EntEmRehearsalDto; import com.rzyc.model.dto.EntEmRehearsalDto;
import com.rzyc.model.dto.EntEmReservePlanDto; import com.rzyc.model.dto.EntEmReservePlanDto;
import com.rzyc.redis.RedisUtil;
import com.rzyc.service.PcBusinessService; import com.rzyc.service.PcBusinessService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;

View File

@ -10,10 +10,10 @@ import com.common.utils.model.SingleResult;
import com.rzyc.bean.user.dto.AppLoginDto; import com.rzyc.bean.user.dto.AppLoginDto;
import com.rzyc.bean.user.dto.LoginDto; import com.rzyc.bean.user.dto.LoginDto;
import com.rzyc.config.MethodAnnotation; import com.rzyc.config.MethodAnnotation;
import com.rzyc.config.RedisUtil;
import com.rzyc.model.*; import com.rzyc.model.*;
import com.rzyc.model.dto.*; import com.rzyc.model.dto.*;
import com.rzyc.model.ent.*; import com.rzyc.model.ent.*;
import com.rzyc.redis.RedisUtil;
import com.rzyc.service.PcBusinessService; import com.rzyc.service.PcBusinessService;
import com.rzyc.service.UserLoginService; import com.rzyc.service.UserLoginService;
import com.rzyc.bean.user.dto.WeChartLoginDto; import com.rzyc.bean.user.dto.WeChartLoginDto;

View File

@ -11,7 +11,6 @@ import com.common.utils.model.SingleResult;
import com.rzyc.pager.PageOperation; import com.rzyc.pager.PageOperation;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.rzyc.advice.CustomException; import com.rzyc.advice.CustomException;
import com.rzyc.config.RedisUtil;
import com.rzyc.controller.BaseController; import com.rzyc.controller.BaseController;
import com.rzyc.enums.*; import com.rzyc.enums.*;
import com.rzyc.model.*; import com.rzyc.model.*;
@ -21,6 +20,7 @@ import com.rzyc.model.dto.*;
import com.rzyc.model.ent.*; import com.rzyc.model.ent.*;
import com.rzyc.model.dto.SparePartDto; import com.rzyc.model.dto.SparePartDto;
import com.rzyc.redis.RedisUtil;
import com.rzyc.utils.easyexcel.EntEnterpriseListener; import com.rzyc.utils.easyexcel.EntEnterpriseListener;
import com.rzyc.utils.easyexcel.InListListener; import com.rzyc.utils.easyexcel.InListListener;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;

View File

@ -1,13 +1,12 @@
package com.rzyc.advice.log; package com.rzyc.advice.log;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.RandomNumber; import com.common.utils.RandomNumber;
import com.common.utils.StringUtils; import com.common.utils.StringUtils;
import com.common.utils.jwt.JwtUtil; import com.common.utils.jwt.JwtUtil;
import com.common.utils.model.Result; import com.common.utils.model.Result;
import com.rzyc.advice.exception.AccessException; import com.rzyc.advice.exception.AccessException;
import com.rzyc.config.RedisUtil; import com.rzyc.redis.RedisUtil;
import com.rzyc.mapper.log.SysLogsMapper; import com.rzyc.mapper.log.SysLogsMapper;
import com.rzyc.mapper.user.SysUserMapper; import com.rzyc.mapper.user.SysUserMapper;
import com.rzyc.model.user.SysUser; import com.rzyc.model.user.SysUser;

View File

@ -40,10 +40,12 @@ import com.rzyc.model.sys.SysOrg;
import com.rzyc.model.sys.SysRole; import com.rzyc.model.sys.SysRole;
import com.rzyc.model.user.*; import com.rzyc.model.user.*;
import com.common.utils.copy.ObjectConversion; import com.common.utils.copy.ObjectConversion;
import com.rzyc.service.ProvinceService;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.InputStream; import java.io.InputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -614,6 +616,10 @@ public class BaseController {
@Autowired @Autowired
protected ExScoreRecordMapper exScoreRecordMapper; protected ExScoreRecordMapper exScoreRecordMapper;
//省厅数据对接
@Resource
protected ProvinceService provinceService;

View File

@ -3,6 +3,7 @@ package com.rzyc.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.AMAP.Amap; import com.common.utils.AMAP.Amap;
import com.common.utils.RandomNumber; import com.common.utils.RandomNumber;
import com.common.utils.RedisClient;
import com.common.utils.StringUtils; import com.common.utils.StringUtils;
import com.common.utils.TypeConversion; import com.common.utils.TypeConversion;
import com.common.utils.encryption.PasswdFactory; import com.common.utils.encryption.PasswdFactory;
@ -741,4 +742,21 @@ public class DataController extends com.rzyc.controller.BaseController {
return result; return result;
} }
/**
* 数据测试
* @version v1.0
* @author dong
* @date 2025/3/18 12:30
*/
@ApiOperation(value = "数据测试", notes = "数据测试")
@RequestMapping(value = "/dataTest", method = RequestMethod.GET)
@ResponseBody
public SingleResult<String>dataTest()throws Exception{
SingleResult<String> result = new SingleResult<>();
provinceService.dataTest();
return result;
}
} }

View File

@ -1,6 +1,6 @@
package com.rzyc.filter; package com.rzyc.filter;
import com.rzyc.config.RedisUtil; import com.rzyc.redis.RedisUtil;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.context.support.WebApplicationContextUtils;

View File

@ -8,7 +8,7 @@ import com.common.utils.model.SingleResult;
import com.rzyc.pager.PageOperation; import com.rzyc.pager.PageOperation;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.rzyc.bean.RiskSource.RiskSourceStatistic; import com.rzyc.bean.RiskSource.RiskSourceStatistic;
import com.rzyc.config.RedisUtil; import com.rzyc.redis.RedisUtil;
import com.rzyc.controller.BaseController; import com.rzyc.controller.BaseController;
import com.rzyc.model.*; import com.rzyc.model.*;
import com.rzyc.model.EasyExcel.EasyExcelPostList; import com.rzyc.model.EasyExcel.EasyExcelPostList;

View File

@ -552,6 +552,15 @@
</dependency> </dependency>
<!--
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.0</version>
</dependency>
-->
</dependencies> </dependencies>