Compare commits

...

2 Commits

Author SHA1 Message Date
gjh cab5c53493 鄞州公安环境更新:默认8080 2 weeks ago
gjh 1a21bdbbac 小程序测试 3 weeks ago
  1. 8
      ruoyi-admin/src/main/resources/application-prod.yml
  2. 1
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ExcelController.java
  3. 22
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/WeChatController.java
  4. 1
      ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java

8
ruoyi-admin/src/main/resources/application-prod.yml

@ -50,9 +50,9 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题) # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://10.1.21.250:3306/prod-management-platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://localhost:3306/prod-management-platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root username: root
password: HXj-6nR|D8xy*h#!I&:( password: G85fZ)TsXO30<XF{OH+]JY
# 从库数据源 # 从库数据源
# slave: # slave:
# lazy: true # lazy: true
@ -101,11 +101,11 @@ spring.data:
# 地址 # 地址
host: localhost host: localhost
# 端口,默认为6379 # 端口,默认为6379
port: 6383 port: 6379
# 数据库索引 # 数据库索引
database: 0 database: 0
# redis 密码必须配置 # redis 密码必须配置
password: F*Nx=BZli+ZCCI-Fil+3 password: guoyanNB@123
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
# 是否开启ssl # 是否开启ssl

1
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/ExcelController.java

@ -44,6 +44,7 @@ public class ExcelController {
@Resource @Resource
private IWorkOrderInfoService workOrderInfoService ; private IWorkOrderInfoService workOrderInfoService ;
@PostMapping("/uploadPointInfo") @PostMapping("/uploadPointInfo")
public void uploadPointInfo(MultipartFile file, HttpServletResponse response) throws IOException { public void uploadPointInfo(MultipartFile file, HttpServletResponse response) throws IOException {
long t1 = System.currentTimeMillis(); long t1 = System.currentTimeMillis();

22
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/controller/WeChatController.java

@ -60,8 +60,10 @@ public class WeChatController {
// 替换为你的 AppID 和 AppSecret // 替换为你的 AppID 和 AppSecret
private static final String APP_ID = "wxe2eba8943d47678e"; private static final String APP_ID = "wxe2eba8943d47678e";
private static final String APP_SECRET = "7af0a56aaa7780ad041ee4cda2359353"; private static final String APP_SECRET = "7af0a56aaa7780ad041ee4cda2359353";
// 替换为你的 AppOpenID 和 AccessToken
private static final String APP_OPENID = "ohCQF7nRbdBVnk4GUD_TgTRv_IYs"; private static final String APP_OPENID = "ohCQF7nRbdBVnk4GUD_TgTRv_IYs";
private static final String ACCESS_TOKEN = "93_Rdp-c-VBBN-2qNAxBQ1pmx3gvuxjoMk2A_BmczJinRcJ9G3IwJ-okucNWz30OY7bb_8tk44XjQ5pdaRf8-lvrb8blIUjuFDklcyLtjX-1g4Ik9Q1cUuzhP-O9DwLYPhAEASFW"; private static final String ACCESS_TOKEN = "94__zxL178Y10nGfyMXXtYuLsAophgmEjiIzaBHdXz6vd5qw4dpgaG8msR-sPvkzIDx0LxlipMbizq5wwOj_t62RxCKFMuT3TwdO66Gvg5q1RsJ8EWQmOUjHllStFoCQSiADARFH";
// 模板ID
private static final String TEMPLATE_ID = "z9G-4dk8JHget0Ftm8ysEa6pT2mztklfDTYF9sYBDzM"; private static final String TEMPLATE_ID = "z9G-4dk8JHget0Ftm8ysEa6pT2mztklfDTYF9sYBDzM";
private static final String SUBSCRIBE_SEND_PREFIX = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="; private static final String SUBSCRIBE_SEND_PREFIX = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=";
@ -81,13 +83,17 @@ public class WeChatController {
@GetMapping("/getOpenId") @GetMapping("/getOpenId")
public R< Map<String, String>> getOpenId(String jsCode) throws JsonProcessingException { public R< Map<String, String>> getOpenId(String jsCode) throws JsonProcessingException {
Map<String, String> result = getOpenIdForApp(jsCode); Map<String, String> result = getOpenIdForApp(jsCode);
return R.ok("根据jsCode获取对应的openId", result); String openid = result.get("openid");
log.info("获取到:openid:{} " , openid);
return R.ok("根据jsCode获取对应的openid", result);
} }
@GetMapping("/getAccessToken") @GetMapping("/getAccessToken")
public R<Map<String, String>> getAccessToken() throws JsonProcessingException { public R<Map<String, String>> getAccessToken() throws JsonProcessingException {
Map<String, String> result = getAccessTokenForApp(); Map<String, String> result = getAccessTokenForApp();
String access_token = result.get("access_token");
log.info("获取到:access_token:{} " , access_token);
// 5. 返回给前端 // 5. 返回给前端
return R.ok("获取对应的access_token",result); return R.ok("获取对应的access_token",result);
} }
@ -172,12 +178,12 @@ public class WeChatController {
request.setTemplate_id(TEMPLATE_ID); request.setTemplate_id(TEMPLATE_ID);
request.setPage("pages/index/index"); request.setPage("pages/index/index");
Map<String, WeComSubscribeDataItem> dataMap = new HashMap<>(); Map<String, WeComSubscribeDataItem> dataMap = new HashMap<>();
dataMap.put("character_string5", new WeComSubscribeDataItem("工单编号:123456")); dataMap.put("character_string5", new WeComSubscribeDataItem("123456"));
dataMap.put("thing2", new WeComSubscribeDataItem("故障标题:空调内部故障")); dataMap.put("thing2", new WeComSubscribeDataItem("空调内部故障"));
dataMap.put("time13", new WeComSubscribeDataItem("发生时间:2025年6月20日")); dataMap.put("time13", new WeComSubscribeDataItem("2025年6月20日 9:00"));
dataMap.put("thing10", new WeComSubscribeDataItem("发生位置:宁波国研机房")); dataMap.put("thing10", new WeComSubscribeDataItem("宁波国研机房"));
dataMap.put("thing8", new WeComSubscribeDataItem("计划完成时间:2025年6月21日")); dataMap.put("time8", new WeComSubscribeDataItem("2025年5月23日 18:00"));
//dataMap.put("time8", new WeComSubscribeDataItem("2025-07-14 13:47:00"));
request.setData(dataMap); request.setData(dataMap);
// 序列化 JSON 并记录日志 // 序列化 JSON 并记录日志
String jsonBody; String jsonBody;

1
ruoyi-modules/guoyan-platform/src/main/java/org/dromara/platform/service/impl/WorkOrderInfoServiceImpl.java

@ -715,6 +715,7 @@ public class WorkOrderInfoServiceImpl implements IWorkOrderInfoService {
if (targetProcess != null) { if (targetProcess != null) {
Date operationTime = targetProcess.getOperationTime(); Date operationTime = targetProcess.getOperationTime();
LocalDateTime targetDateTime = operationTime.toInstant() LocalDateTime targetDateTime = operationTime.toInstant()
.atZone(ZoneId.systemDefault()) .atZone(ZoneId.systemDefault())
.toLocalDateTime(); .toLocalDateTime();

Loading…
Cancel
Save