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
0f71691f
Commit
0f71691f
authored
May 28, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时后台--
支付完成跳转页面
parent
065e806b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
+18
-5
No files found.
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
View file @
0f71691f
...
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
...
@@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -59,6 +60,11 @@ public class CallBackContorll {
...
@@ -59,6 +60,11 @@ public class CallBackContorll {
private
String
batchToPayUrl
;
private
String
batchToPayUrl
;
/*支付回调*/
@Value
(
"${pay_page}"
)
private
String
payPage
;
private
Map
setParams
(
String
sign
,
String
appid
,
String
secret
)
{
private
Map
setParams
(
String
sign
,
String
appid
,
String
secret
)
{
/*当前时间戳*/
/*当前时间戳*/
long
timestamp
=
System
.
currentTimeMillis
()
/
1000
;
long
timestamp
=
System
.
currentTimeMillis
()
/
1000
;
...
@@ -135,14 +141,14 @@ public class CallBackContorll {
...
@@ -135,14 +141,14 @@ public class CallBackContorll {
}
}
CallBack
callBack
=
JSONObject
.
parseObject
(
sb
.
toString
(),
CallBack
.
class
);
CallBack
callBack
=
JSONObject
.
parseObject
(
sb
.
toString
(),
CallBack
.
class
);
if
(
callBack
.
getCallback_type
().
equals
(
"1"
))
{
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
();
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
insureUserList
.
get
(
0
).
getPolicyId
()).
build
().
selectById
();
if
(
callBack
.
getStatus
().
equals
(
"1"
))
{
if
(
callBack
.
getStatus
().
equals
(
"1"
))
{
if
(
insureUserList
.
size
()
>
0
)
{
if
(
insureUserList
.
size
()
>
0
)
{
insurePolicy
.
setStatus
(
"4"
);
/*设置为支付状态*/
insurePolicy
.
setStatus
(
"4"
);
/*设置为支付状态*/
insurePolicy
.
setUpdateTime
(
new
Date
());
insurePolicy
.
setUpdateTime
(
new
Date
());
InsurePay
insurePay
=
InsurePay
.
builder
().
payStatus
(
1
).
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
();
insurePay
.
insert
();
insurePolicy
.
setPayId
(
insurePay
.
getId
());
insurePolicy
.
setPayId
(
insurePay
.
getId
());
insurePolicy
.
updateById
();
insurePolicy
.
updateById
();
...
@@ -150,7 +156,7 @@ public class CallBackContorll {
...
@@ -150,7 +156,7 @@ public class CallBackContorll {
}
}
InsureLog
.
builder
().
type
(
7
)
InsureLog
.
builder
().
type
(
7
)
.
requestData
(
sb
.
toString
()).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
JSONObject
.
toJSONString
(
callBack
)).
requestPath
(
base_api_url
+
"/callBack/policy/addpPayCallBack"
)
.
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
{
}
else
{
...
@@ -261,10 +267,17 @@ public class CallBackContorll {
...
@@ -261,10 +267,17 @@ public class CallBackContorll {
@GetMapping
(
value
=
"/payStatus"
)
@GetMapping
(
value
=
"/payStatus"
)
@ApiOperation
(
value
=
"8.支付完成跳转"
,
httpMethod
=
"GET"
,
notes
=
"用于支付时跳回我们系统更新状态"
)
@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
(
"支付完成回调(仅代表用户点了已支付,无法确认是否真正支付)"
);
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
)
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"
)
@PostMapping
(
value
=
"/payCallBack"
)
...
...
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