Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
97e8551a
Commit
97e8551a
authored
May 28, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
支付完成跳转页面
parent
2f350214
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
5 deletions
+27
-5
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
+18
-5
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+1
-0
src/main/resources/application-dev.yml
+3
-0
src/main/resources/application-pro.yml
+2
-0
src/main/resources/application-test.yml
+3
-0
No files found.
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
View file @
97e8551a
...
...
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
...
...
@@ -59,6 +60,11 @@ public class CallBackContorll {
private
String
batchToPayUrl
;
/*支付回调*/
@Value
(
"${pay_page}"
)
private
String
payPage
;
private
Map
setParams
(
String
sign
,
String
appid
,
String
secret
)
{
/*当前时间戳*/
long
timestamp
=
System
.
currentTimeMillis
()
/
1000
;
...
...
@@ -135,14 +141,14 @@ public class CallBackContorll {
}
CallBack
callBack
=
JSONObject
.
parseObject
(
sb
.
toString
(),
CallBack
.
class
);
if
(
callBack
.
getCallback_type
().
equals
(
"1"
))
{
List
<
InsureUser
>
insureUserList
=
InsureUser
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureUser
>().
lambda
().
eq
(
InsureUser:
:
get
BatchNo
,
callBack
.
getOrder_import_info
().
getU
uid
()));
List
<
InsureUser
>
insureUserList
=
InsureUser
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureUser
>().
lambda
().
eq
(
InsureUser:
:
get
TransId
,
callBack
.
getOrder_import_info
().
getThird_u
uid
()));
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
insureUserList
.
get
(
0
).
getPolicyId
()).
build
().
selectById
();
if
(
callBack
.
getStatus
().
equals
(
"1"
))
{
if
(
insureUserList
.
size
()
>
0
)
{
insurePolicy
.
setStatus
(
"4"
);
/*设置为支付状态*/
insurePolicy
.
setUpdateTime
(
new
Date
());
InsurePay
insurePay
=
InsurePay
.
builder
().
payStatus
(
1
).
serialNumber
(
callBack
.
getOrder_import_info
().
getUuid
()).
policyId
(
insurePolicy
.
getId
()).
build
();
serialNumber
(
callBack
.
getOrder_import_info
().
getUuid
()).
policyId
(
insurePolicy
.
getId
()).
amount
(
Double
.
parseDouble
(
callBack
.
getOrder_import_info
().
getTotal_money
())).
build
();
insurePay
.
insert
();
insurePolicy
.
setPayId
(
insurePay
.
getId
());
insurePolicy
.
updateById
();
...
...
@@ -150,7 +156,7 @@ public class CallBackContorll {
}
InsureLog
.
builder
().
type
(
7
)
.
requestData
(
sb
.
toString
()).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
JSONObject
.
toJSONString
(
callBack
)).
requestPath
(
base_api_url
+
"/callBack/policy/addpPayCallBack"
)
.
returnCode
(
callBack
.
getStatus
()).
returnMsg
(
"核保通过"
).
policyId
(
insurePolicy
.
getId
()).
build
();
.
returnCode
(
callBack
.
getStatus
()).
returnMsg
(
"核保通过"
).
policyId
(
insurePolicy
.
getId
()).
build
()
.
insert
()
;
}
else
{
...
...
@@ -261,10 +267,17 @@ public class CallBackContorll {
@GetMapping
(
value
=
"/payStatus"
)
@ApiOperation
(
value
=
"8.支付完成跳转"
,
httpMethod
=
"GET"
,
notes
=
"用于支付时跳回我们系统更新状态"
)
private
void
callBackPayStatus
(
HttpServletRequest
request
,
@RequestParam
Integer
policyId
)
throws
IOException
{
private
ModelAndView
callBackPayStatus
(
HttpServletRequest
request
,
@RequestParam
Integer
policyId
)
throws
IOException
{
log
.
info
(
"支付完成回调(仅代表用户点了已支付,无法确认是否真正支付)"
);
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
InsurePay
insurePay
=
InsurePay
.
builder
().
id
(
insurePolicy
.
getPayId
()).
build
().
selectById
();
insurePay
.
setPayTime
(
new
Date
());
insurePay
.
updateById
();
InsureLog
.
builder
().
type
(
7
).
createTime
(
new
Date
()).
requestType
(
2
).
requestPath
(
base_api_url
+
"/payStatus?policyId="
+
policyId
)
.
returnCode
(
"suc"
).
returnMsg
(
"用户已支付,等待更新保单状态"
).
policyId
(
policyId
).
build
().
insert
();
.
returnCode
(
"suc"
).
returnMsg
(
"用户已支付"
+
insurePay
.
getAmount
()+
"元,等待更新保单状态"
).
policyId
(
policyId
).
build
().
insert
();
ModelAndView
mav
=
new
ModelAndView
();
mav
.
setViewName
(
"redirect:"
+
payPage
+
"/#/policy/payPage"
);
return
mav
;
}
@PostMapping
(
value
=
"/payCallBack"
)
...
...
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
97e8551a
...
...
@@ -1490,6 +1490,7 @@ public class InsureContorll {
Map
<
String
,
Object
>
payData
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
payDataMap
.
get
(
"data"
)));
Map
<
String
,
Object
>
importPayInfo
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
payData
.
get
(
"import_pay_info"
)));
insurePay
.
setPaySerialNo
(
importPayInfo
.
get
(
"pay_serial_no"
).
toString
());
insurePay
.
setAmount
(
Double
.
parseDouble
(
importPayInfo
.
get
(
"pay_money"
).
toString
()));
insurePay
.
updateById
();
return
ResultUtil
.
data
(
importPayInfo
.
get
(
"pay_url"
).
toString
()+
"&jump_url="
+
base_api_url
+
"/callBack/policy/payStatus?policyId="
+
insurePolicy
.
getId
());
}
...
...
src/main/resources/application-dev.yml
View file @
97e8551a
...
...
@@ -304,3 +304,6 @@ insure:
# base_api_url
BASE_API_URL
:
'
http://o49t563035.qicp.vip'
#支付回调
pay_page
:
'
http://localhost:9527'
src/main/resources/application-pro.yml
View file @
97e8551a
...
...
@@ -286,3 +286,5 @@ youling:
#h5服务地址
h5
:
url
:
'
http://h5.8timer.cn'
#支付回调
pay_page
:
'
http://oss.youlingrc.com'
src/main/resources/application-test.yml
View file @
97e8551a
...
...
@@ -281,5 +281,8 @@ youling:
h5
:
url
:
'
http://javays.com'
#支付回调
pay_page
:
'
http://test-insurance-api.youlingrc.com'
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