From 310633feef20e9b77d44fd25e0b41778e033b33b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 11 十一月 2025 21:48:46 +0800
Subject: [PATCH] feat: 车辆GPS统计,并修改了一些变更任务状态的逻辑
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/evaluation/EvaluationController.java | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/evaluation/EvaluationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/evaluation/EvaluationController.java
index 2786bef..06bf884 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/evaluation/EvaluationController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/evaluation/EvaluationController.java
@@ -8,13 +8,13 @@
import com.ruoyi.common.utils.WechatUtils;
import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.config.WechatMpConfig;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.system.domain.EvaluationDetail;
import com.ruoyi.system.service.IEvaluationDimensionService;
import com.ruoyi.system.domain.EvaluationDimension;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -47,6 +47,9 @@
@Autowired
private IEvaluationDimensionService evaluationDimensionService;
+
+ @Autowired
+ private WechatMpConfig wechatMpConfig;
/**
* 鏌ヨ瀹㈡埛璇勪环鍒楄〃
@@ -150,12 +153,6 @@
}
}
- @Value("${wechat.appId}")
- private String wechatAppId;
-
- @Value("${wechat.appSecret}")
- private String wechatAppSecret;
-
/**
* 鐢熸垚寰俊鎺堟潈URL
*/
@@ -170,7 +167,12 @@
logger.info("鐢熸垚寰俊鎺堟潈URL - 鍘熷redirectUri: {}", redirectUri);
// 鐢熸垚寰俊鎺堟潈URL锛屼娇鐢╯nsapi_userinfo鑾峰彇鐢ㄦ埛淇℃伅
- String authUrl = WechatUtils.generateAuthUrl(wechatAppId, redirectUri, "snsapi_userinfo", state);
+ String authUrl = WechatUtils.generateAuthUrl(
+ wechatMpConfig.getAppId(),
+ redirectUri,
+ "snsapi_userinfo",
+ state
+ );
if (authUrl == null) {
return error("鐢熸垚寰俊鎺堟潈URL澶辫触");
}
@@ -180,7 +182,7 @@
Map<String, String> result = new HashMap<>();
result.put("authUrl", authUrl);
result.put("originalRedirectUri", redirectUri);
- result.put("appId", wechatAppId);
+ result.put("appId", wechatMpConfig.getAppId());
return success(result);
} catch (Exception e) {
logger.error("鐢熸垚寰俊鎺堟潈URL澶辫触", e);
@@ -201,7 +203,11 @@
}
// 鑾峰彇缃戦〉鎺堟潈Access Token
- JSONObject tokenInfo = WechatUtils.getWebAccessToken(wechatAppId, wechatAppSecret, code);
+ JSONObject tokenInfo = WechatUtils.getWebAccessToken(
+ wechatMpConfig.getAppId(),
+ wechatMpConfig.getAppSecret(),
+ code
+ );
if (tokenInfo == null) {
return error("鑾峰彇寰俊鎺堟潈淇℃伅澶辫触");
}
--
Gitblit v1.9.1