测试、生产环境配置更新

master
liuqingkun 3 months ago
parent 6fb679bcc7
commit 47b85f3914
  1. 2
      src/main/java/com/nov/KgLowDurable/config/FileUploadConfig.java
  2. 201
      src/main/java/com/nov/KgLowDurable/service/Impl/UserServiceImpl.java
  3. 64
      src/main/resources/application-dev.properties
  4. 15
      src/main/resources/application-prop.properties
  5. 19
      src/main/resources/application-test.properties
  6. 3
      src/main/resources/application.properties

@ -13,7 +13,7 @@ public class FileUploadConfig {
private String serverUrl;
// 基础存储路径
@Value("${file.upload.base-path:D:/opt/SmartParkFilesTest}")
@Value("${file.upload.base-path:/opt/SmartParkFilesTest}")
private String basePath;
// 允许的文件类型

@ -6,8 +6,10 @@ import com.nov.KgLowDurable.mapper.UserMapper;
import com.nov.KgLowDurable.pojo.entity.*;
import com.nov.KgLowDurable.pojo.vo.*;
import com.nov.KgLowDurable.service.*;
import com.nov.KgLowDurable.util.HttpUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -17,7 +19,9 @@ import org.springframework.util.StringUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -51,8 +55,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
//
// String resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://192.168.198.1:8105",
// "/dsTasking/processAuthorized",
// "http://10.90.100.231:8132",
// "/AES/decryptAndGetUser",
// "GET",
// headers,
// querys
@ -64,7 +68,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
// if (!"200".equals(obj.getString("code"))) {
// throw new RuntimeException("失败: " + obj.getString("message"));
// }
//
// UserInfoVO data = JSON.toJavaObject(obj.getJSONObject("data"), UserInfoVO.class);
UserInfoVO data = new UserInfoVO();
@ -161,33 +165,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
if (formId == null || formId <= 0) {
throw new IllegalArgumentException("表单ID必须大于0");
}
log.info("模拟获取审批人,参数: deptId={}, type={}, formId={}", mainErDepartment, type, formId);
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// put("type",type);
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://10.90.100.231:8132",
// "/ld-person-form/getApprove",
// "GET",
// headers,
// querys
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
Map<String, String> headers = new HashMap<String, String>() {{
put("Content-Type", "application/json");
}};
Map<String, String> querys = new HashMap<String, String>() {{
put("type",type);
}};
String resp = null;
try {
resp = EntityUtils.toString(
HttpUtils.doGet(
"http://10.90.100.231:8132",
"/ld-person-form/getApprove",
"GET",
headers,
querys
).getEntity()
);
} catch (Exception e) {
e.printStackTrace();
}
try {
// 1.解析模拟数据
JSONObject obj = JSON.parseObject(MOCK_APPROVAL_DATA);
JSONObject obj = JSON.parseObject(resp);
if (!"200".equals(obj.getString("code")) || !obj.getBooleanValue("success")) {
String message = obj.getString("message");
@ -293,64 +296,59 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
@Override
public void submitApproval(String json) {
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doPost(
// "http://10.90.100.231:8132",
// "/qywx/applySubmit",
// "POST",
// headers,
// querys,
// json
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
Map<String, String> headers = new HashMap<String, String>() {{
put("Content-Type", "application/json");
}};
Map<String, String> querys = new HashMap<String, String>() {{
}};
String resp = null;
try {
resp = EntityUtils.toString(
HttpUtils.doPost(
"http://10.90.100.231:8132",
"/qywx/applySubmit",
"POST",
headers,
querys,
json
).getEntity()
);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public List<GroupVO> getOutGroupName() {
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://10.90.100.231:8132",
// "/ld-person-form/getOutGroupName",
// "GET",
// headers,
// querys
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
// JSONObject obj = JSON.parseObject(resp);
//
// if (!"200".equals(obj.getString("code"))) {
// throw new RuntimeException("失败: " + obj.getString("message"));
// }
Map<String, String> headers = new HashMap<String, String>() {{
put("Content-Type", "application/json");
}};
String resp = "{\"success\":true,\"message\":\"获取所有可出库分组名称成功\",\"code\":200,\"result\":[{\"groupIds\":\"44\",\"groupName\":\"B分组\"},{\"groupIds\":null,\"groupName\":\"自由出库\"}],\"timestamp\":1768356690213}";
Map<String, String> querys = new HashMap<String, String>() {{
}};
String resp = null;
try {
resp = EntityUtils.toString(
HttpUtils.doGet(
"http://10.90.100.231:8132",
"/ld-person-form/getOutGroupName",
"GET",
headers,
querys
).getEntity()
);
} catch (Exception e) {
e.printStackTrace();
}
JSONObject obj = JSON.parseObject(resp);
if (!"200".equals(obj.getString("code"))) {
throw new RuntimeException("失败: " + obj.getString("message"));
}
List<GroupVO> list = obj.getJSONArray("result").toJavaList(GroupVO.class);
if(CollectionUtils.isEmpty(list)){
throw new RuntimeException("解析失败: " + obj.getString("message"));
@ -360,35 +358,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
@Override
public List<GroupMaterialVO> getGroupMaterial(String groupName, String departmentId) {
// Map<String, String> headers = new HashMap<String, String>() {{
// put("Content-Type", "application/json");
// }};
//
// Map<String, String> querys = new HashMap<String, String>() {{
// put("groupName",groupName);
// }};
//
// String resp = null;
// try {
// resp = EntityUtils.toString(
// HttpUtils.doGet(
// "http://10.90.100.231:8132",
// "/ld-person-form/getGroupMaterial",
// "GET",
// headers,
// querys
// ).getEntity()
// );
// } catch (Exception e) {
// e.printStackTrace();
// }
// JSONObject obj = JSON.parseObject(resp);
// if (!"200".equals(obj.getString("code"))) {
// throw new RuntimeException("失败: " + obj.getString("message"));
// }
Map<String, String> headers = new HashMap<String, String>() {{
put("Content-Type", "application/json");
}};
String resp = "{\"success\":true,\"message\":\"获取物资需求清单成功\",\"code\":200,\"result\":{\"groupName\":\"A分组\",\"totalMaterials\":2,\"totalApplyNum\":6,\"year\":\"2026\",\"materials\":[{\"materialName\":\"A1复印纸\",\"unit\":null,\"model\":null,\"materialCode\":\"03001\",\"remark\":\"胶水\",\"materialId\":\"53\",\"applyNum\":4,\"picture\":null},{\"materialName\":\"文件夹1\",\"unit\":null,\"model\":null,\"materialCode\":\"03001\",\"remark\":\"文件夹\",\"materialId\":\"1\",\"applyNum\":2,\"picture\":null}],\"quarter\":\"1\"},\"timestamp\":1768352459318}";
Map<String, String> querys = new HashMap<String, String>() {{
put("groupName",groupName);
}};
String resp = null;
try {
resp = EntityUtils.toString(
HttpUtils.doGet(
"http://10.90.100.231:8132",
"/ld-person-form/getGroupMaterial",
"GET",
headers,
querys
).getEntity()
);
} catch (Exception e) {
e.printStackTrace();
}
JSONObject obj = JSON.parseObject(resp);
if (!"200".equals(obj.getString("code"))) {
throw new RuntimeException("失败: " + obj.getString("message"));
}
GroupResultVO result = JSON.parseObject(
obj.getJSONObject("result").toString(),

@ -0,0 +1,64 @@
#\u6D4B\u8BD5\u7AEF\u53E3
server.port=8333
server.tomcat.max-http-form-post-size=50MB
#\u65E5\u5FD7\u8F93\u51FA
logging.config=classpath:logback-spring.xml
logging.level.com.kg.KgMediaCloud.mapper=debug
#\u914D\u7F6E\u5B9A\u65F6\u4EFB\u52A1\u7EBF\u7A0B\u6C60
spring.task.scheduling.pool.size=100
spring.task.scheduling.thread-name-prefix=KgLowDurable
#JDBC\u8FDE\u63A5
#Mysql6\u4EE5\u4E0Acom.mysql.cj.jdbc.Driver
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
# dev-db config
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smartpark_durable?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=123456
#MYSQL 8\u5C0F\u65F6\u8FDE\u63A5\u8D85\u65F6\u914D\u7F6E
#\u9A8C\u8BC1\u8FDE\u63A5\u7684\u6709\u6548\u6027
spring.datasource.test-while-idle=true
#\u83B7\u53D6\u8FDE\u63A5\u65F6\u5019\u9A8C\u8BC1\uFF0C\u4F1A\u5F71\u54CD\u6027\u80FD
spring.datasource.test-on-borrow=true
spring.datasource.validation-query=SELECT 1
#\u7A7A\u95F2\u8FDE\u63A5\u56DE\u6536\u7684\u65F6\u95F4\u95F4\u9694\uFF0C\u4E0Etest-while-idle\u4E00\u8D77\u4F7F\u7528\uFF0C\u8BBE\u7F6E5\u5206\u949F
spring.datasource.time-between-eviction-runs-millis=300000
#\u8FDE\u63A5\u6C60\u7A7A\u95F2\u8FDE\u63A5\u7684\u6709\u6548\u65F6\u95F4 \uFF0C\u8BBE\u7F6E30\u5206\u949F
spring.datasource.min-evictable-idle-time-millis=1800000
#mybatis
mybatis.typeAliasesPackage=com.nov.KgLowDurable.domain
mybatis.mapperLocations=classpath:mapper/*.xml
##pageHelper\u5206\u9875\u63D2\u4EF6
pagehelper.helper-dialect=MYSQL
pagehelper.reasonable=false
pagehelper.support-methods-arguments=true
pagehelper.params=count=countSql
#swagger\u914D\u7F6E\u5F00\u542F\u5173\u95ED
mconfig.swagger-ui-open=true
#mybatis-plus
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.configuration.auto-mapping-behavior=full
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.nologging.NoLoggingImpl
mybatis-plus.mapper-locations=classpath:mapper/*.xml
qywx.cropId=
qywx.agentId=
qywx.secret=
qywx.token=
qywx.encodingAesKey=
isc.ip=
isc.port=
path.upload=
path.virtualPath=
path.download=
spring.servlet.multipart.enabled=true
spring.servlet.multipart.file-size-threshold=0
spring.mvc.async.request-timeout=100000
spring.servlet.multipart.max-file-size=500MB
spring.servlet.multipart.max-request-size=500MB
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.password=
spring.redis.database=0
spring.redis.timeout=3000ms
spring.redis.connect-timeout=2000ms

@ -1,5 +1,5 @@
#运行端口
server.port=
server.port=8334
server.tomcat.max-http-form-post-size=50MB
@ -15,9 +15,9 @@ spring.task.scheduling.thread-name-prefix=KgLowDurable
#Mysql6以上com.mysql.cj.jdbc.Driver
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
#Mysql6以上需加serverTimezone=GMT%2B8 否则会与系统时区有差异造成异常
spring.datasource.url=jdbc:mysql://00.00.00.00:00/smartpark?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=
spring.datasource.password=
spring.datasource.url=jdbc:mysql://10.90.100.201:3889/smartpark?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=1qaz@WSX
#MYSQL 8小时连接超时配置
#验证连接的有效性
spring.datasource.test-while-idle=true
@ -68,5 +68,10 @@ spring.servlet.multipart.file-size-threshold=0
spring.mvc.async.request-timeout=100000
spring.servlet.multipart.max-file-size =500MB
spring.servlet.multipart.max-request-size =500MB
spring.redis.host=10.90.100.231
spring.redis.port=6379
spring.redis.password=@WDC4eszVGY&8ik,
spring.redis.database=1
spring.redis.timeout=3000ms
spring.redis.connect-timeout=2000ms

@ -1,5 +1,5 @@
#\u6D4B\u8BD5\u7AEF\u53E3
server.port=8082
server.port=8333
server.tomcat.max-http-form-post-size=50MB
@ -14,10 +14,15 @@ spring.task.scheduling.thread-name-prefix=KgLowDurable
#JDBC\u8FDE\u63A5
#Mysql6\u4EE5\u4E0Acom.mysql.cj.jdbc.Driver
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
#Mysql6\u4EE5\u4E0A\u9700\u52A0serverTimezone=GMT%2B8 \u5426\u5219\u4F1A\u4E0E\u7CFB\u7EDF\u65F6\u533A\u6709\u5DEE\u5F02\u9020\u6210\u5F02\u5E38
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smartpark_durable?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
# dev-db config
#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/smartpark_durable?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
#spring.datasource.username=root
#spring.datasource.password=123456
# test-db config
spring.datasource.url=jdbc:mysql://10.90.100.201:3889/smartpark_test?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.password=1qaz@WSX
#MYSQL 8\u5C0F\u65F6\u8FDE\u63A5\u8D85\u65F6\u914D\u7F6E
#\u9A8C\u8BC1\u8FDE\u63A5\u7684\u6709\u6548\u6027
spring.datasource.test-while-idle=true
@ -68,10 +73,10 @@ spring.servlet.multipart.file-size-threshold=0
spring.mvc.async.request-timeout=100000
spring.servlet.multipart.max-file-size =500MB
spring.servlet.multipart.max-request-size =500MB
spring.redis.host=localhost
spring.redis.host=10.90.100.231
spring.redis.port=6379
spring.redis.password=
spring.redis.database=0
spring.redis.password=@WDC4eszVGY&8ik,
spring.redis.database=1
spring.redis.timeout=3000ms
spring.redis.connect-timeout=2000ms

@ -1,2 +1,3 @@
#spring.profiles.active=prop
spring.profiles.active=test
#spring.profiles.active=test
spring.profiles.active=dev
Loading…
Cancel
Save