Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-slsy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xuwenhao
qianhe-slsy
Commits
d5158684
Commit
d5158684
authored
Dec 15, 2025
by
jiang'yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改问题
parent
eb78dd0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
13 deletions
+60
-13
qianhe-admin/src/main/java/com/qianhe/system/controller/CCBRefundController.java
+2
-2
qianhe-admin/src/main/java/com/qianhe/system/controller/MessageController.java
+33
-5
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterOrderServiceImpl.java
+14
-2
qianhe-admin/src/main/resources/application.yml
+11
-4
No files found.
qianhe-admin/src/main/java/com/qianhe/system/controller/CCBRefundController.java
View file @
d5158684
...
...
@@ -61,13 +61,13 @@ public class CCBRefundController {
String
termNo
=
zdbh
;
//建行8位终端编号(固定)
//参数
String
address
=
"山东省东营市东营区北二路37号"
;
//地址
String
gps
=
"37.470666,118.602392"
;
//GPS地理位置信息
//
String gps="37.470666,118.602392";//GPS地理位置信息
String
amt
=
"0.01"
;
//退款金额
String
orderNo
=
waterOrder
.
getOrderNum
();
//订单号
String
numberId
=
waterOrder
.
getTkbh
();
//退款订单号
//参数加密
MisApiHttpVo
misApiHttpVo
=
new
MisApiHttpVo
(
TransRequestEnum
.
RF001
,
mchtNo
,
termNo
,
"1.2.0"
);
TransRequest
transResult
=
new
TransRequest
(
address
,
gps
);
TransRequest
transResult
=
new
TransRequest
(
address
,
null
);
TransData
transData
=
new
TransData
();
transData
.
setAmt
(
amt
);
transData
.
setOrderNo
(
orderNo
);
...
...
qianhe-admin/src/main/java/com/qianhe/system/controller/MessageController.java
View file @
d5158684
package
com
.
qianhe
.
system
.
controller
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.qianhe.system.vo.GzhVo
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -30,11 +33,16 @@ public class MessageController {
//根据appId、appSecret获取access_token
public
String
getAccessToken
()
{
String
url
=
accessTokenUri
;
System
.
out
.
println
(
"accessTokenUrl"
+
url
);
// 利用hutool的http工具类请求获取access_token
String
result
=
HttpUtil
.
get
(
url
);
// String result = HttpUtil.get(url);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"grant_type"
,
"client_credential"
);
paramMap
.
put
(
"appid"
,
"wxb1da01db0d0feb95"
);
paramMap
.
put
(
"secret"
,
"5e7479823d02130a95ee8d868db515b2"
);
Gson
gson
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
String
json
=
gson
.
toJson
(
paramMap
);
String
result
=
HttpRequest
.
post
(
url
).
body
(
json
).
execute
().
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
System
.
out
.
println
(
jsonObject
);
return
jsonObject
.
getStr
(
"access_token"
);
}
...
...
@@ -60,13 +68,33 @@ public class MessageController {
@GetMapping
(
"/getToken"
)
public
String
getToken
()
{
String
url
=
accessTokenUri
;
System
.
out
.
println
(
url
);
// 利用hutool的http工具类请求获取access_token
String
result
=
HttpUtil
.
get
(
url
);
// String result = HttpUtil.get(url);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"grant_type"
,
"client_credential"
);
paramMap
.
put
(
"appid"
,
"wxb1da01db0d0feb95"
);
paramMap
.
put
(
"secret"
,
"907d7f545d5fd2ba57c08a9d497f353d"
);
Gson
gson
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
String
json
=
gson
.
toJson
(
paramMap
);
String
result
=
HttpRequest
.
post
(
url
).
body
(
json
).
execute
().
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
return
jsonObject
.
getStr
(
"access_token"
);
}
public
static
void
main
(
String
[]
args
)
{
String
url
=
"https://api.weixin.qq.com/cgi-bin/stable_token"
;
// 利用hutool的http工具类请求获取access_token
// String result = HttpUtil.get(url);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"grant_type"
,
"client_credential"
);
paramMap
.
put
(
"appid"
,
"wxb1da01db0d0feb95"
);
paramMap
.
put
(
"secret"
,
"907d7f545d5fd2ba57c08a9d497f353d"
);
Gson
gson
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
String
json
=
gson
.
toJson
(
paramMap
);
String
result
=
HttpRequest
.
post
(
url
).
body
(
json
).
execute
().
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
System
.
out
.
println
(
jsonObject
.
getStr
(
"access_token"
));
}
//公众号发送
@GetMapping
(
"/gzhSend"
)
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterOrderServiceImpl.java
View file @
d5158684
package
com
.
qianhe
.
system
.
service
.
impl
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.ccb.CCBMisSdk
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.qianhe.common.core.domain.AjaxResult
;
import
com.qianhe.common.exception.ServiceException
;
import
com.qianhe.common.utils.DateUtils
;
...
...
@@ -472,7 +475,7 @@ public class WaterOrderServiceImpl implements IWaterOrderService
String
numberId
=
waterOrder
.
getTkbh
();
//退款订单号
//参数加密
MisApiHttpVo
misApiHttpVo
=
new
MisApiHttpVo
(
TransRequestEnum
.
RF001
,
mchtNo
,
termNo
,
"1.2.0"
);
TransRequest
transResult
=
new
TransRequest
(
address
,
gps
);
TransRequest
transResult
=
new
TransRequest
(
address
,
null
);
TransData
transData
=
new
TransData
();
transData
.
setAmt
(
amt
);
transData
.
setOrderNo
(
orderNo
);
...
...
@@ -691,7 +694,16 @@ public class WaterOrderServiceImpl implements IWaterOrderService
public
String
getAccessToken
()
{
String
url
=
accessTokenUri
;
// 利用hutool的http工具类请求获取access_token
String
result
=
HttpUtil
.
get
(
url
);
// String result = HttpUtil.get(url);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"grant_type"
,
"client_credential"
);
paramMap
.
put
(
"appid"
,
"wxb1da01db0d0feb95"
);
paramMap
.
put
(
"secret"
,
"5e7479823d02130a95ee8d868db515b2"
);
Gson
gson
=
new
GsonBuilder
().
setPrettyPrinting
().
create
();
String
json
=
gson
.
toJson
(
paramMap
);
System
.
out
.
println
(
"url"
+
url
);
System
.
out
.
println
(
"参数"
+
json
);
String
result
=
HttpRequest
.
post
(
url
).
body
(
json
).
execute
().
body
();
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
return
jsonObject
.
getStr
(
"access_token"
);
}
...
...
qianhe-admin/src/main/resources/application.yml
View file @
d5158684
...
...
@@ -72,7 +72,8 @@ spring:
# redis 配置
redis
:
# 地址
host
:
1.116.38.25
host
:
182.92.202.17
# host: 127.0.0.1
# 端口,默认为6379
port
:
7789
# # 密码
...
...
@@ -124,7 +125,7 @@ pagehelper:
# Swagger配置
swagger
:
# 是否开启swagger
enabled
:
tru
e
enabled
:
fals
e
# 请求前缀
pathMapping
:
/dev-api
...
...
@@ -161,6 +162,8 @@ wx:
backNotifyUrl
:
https://www.dyzmxx.com/ss/ccbback/payNotify/
#退款通知回调
refundNotifyUrl
:
https://www.dyzmxx.com/ss/callback/refundNotify/
# 正式
# refundNotifyUrl: https://www.slwater.cn/ccbback/payNotify/
#证书地址
keyPemPath
:
apiclient_key.pem
# 商户编号
...
...
@@ -189,6 +192,10 @@ aliyun:
# 微信公众号
wxgzh
:
appId
:
wxb1da01db0d0feb95
appSecret
:
907d7f545d5fd2ba57c08a9d497f353d
access-token-uri
:
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${wxgzh.appId}&secret=${wxgzh.appSecret}
appSecret
:
5e7479823d02130a95ee8d868db515b2
# 供水
# appId: wx47e39b01b2512656
# appSecret:
# access-token-uri: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${wxgzh.appId}&secret=${wxgzh.appSecret}
access-token-uri
:
https://api.weixin.qq.com/cgi-bin/stable_token
template_id
:
uHjot1RT24Ws9he-8EVffVHq6hQgqPVTD1Y4w8wRHg8
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment