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
176e9879
Commit
176e9879
authored
Jun 07, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8小时运营后台--
保全支付回调
parent
6a1a7008
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
+12
-8
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
+4
-2
No files found.
src/main/java/cn/timer/api/controller/insure/CallBackContorll.java
View file @
176e9879
...
...
@@ -96,7 +96,7 @@ public class CallBackContorll {
@PostMapping
(
value
=
"/addpPayCallBack"
)
@ApiOperation
(
value
=
"11.增员核保回调"
,
httpMethod
=
"POST"
,
notes
=
"增员核保回调"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
addpPayCallBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
throws
IOException
{
public
Map
addpPayCallBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
{
/*核保*/
/*如果是在线支付的话*/
Map
map
=
Maps
.
newHashMap
();
...
...
@@ -173,7 +173,7 @@ public class CallBackContorll {
@PostMapping
(
value
=
"/CallBack"
)
@ApiOperation
(
value
=
"7.保全增员申请回调"
,
httpMethod
=
"POST"
,
notes
=
"投保申请回调"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
callBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
throws
IOException
{
public
Map
callBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
{
Map
map
=
Maps
.
newHashMap
();
map
.
put
(
"status"
,
"error"
);
if
(
StringUtils
.
isNullOrEmpty
(
pid
)
||
StringUtils
.
isNullOrEmpty
(
sign
)
&&
StringUtils
.
isNullOrEmpty
(
timestamp
))
{
...
...
@@ -223,7 +223,7 @@ public class CallBackContorll {
insurePolicy
.
setPolicyFile
(
callBack
.
getOrder_import_info
().
getEndorsement_file
());
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
paramsMap
)).
type
(
7
)
.
requestData
(
sb
.
toString
()).
createTime
(
new
Date
()).
requestType
(
1
).
returnBody
(
JSONObject
.
toJSONString
(
callBack
)).
requestPath
(
base_api_url
+
"/callBack/policy/CallBack"
)
.
returnCode
(
callBack
.
getStatus
()).
returnMsg
(
"更新成功"
).
policyId
(
insurePolicy
.
getId
()).
build
().
insert
();
.
returnCode
(
callBack
.
getStatus
()).
returnMsg
(
"
保单增员-
更新成功"
).
policyId
(
insurePolicy
.
getId
()).
build
().
insert
();
}
else
{
String
errorMsg
=
""
;
InsureLog
insureLog
=
InsureLog
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsureLog
>().
lambda
().
eq
(
InsureLog:
:
getTransId
,
callBack
.
getOrder_import_info
().
getThird_uuid
()));
...
...
@@ -271,7 +271,7 @@ public class CallBackContorll {
@GetMapping
(
value
=
"/payStatus"
)
@ApiOperation
(
value
=
"8.支付完成跳转"
,
httpMethod
=
"GET"
,
notes
=
"用于支付时跳回我们系统更新状态"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ModelAndView
callBackPayStatus
(
HttpServletRequest
request
,
@RequestParam
Integer
policyId
)
throws
IOException
{
public
ModelAndView
callBackPayStatus
(
HttpServletRequest
request
,
@RequestParam
Integer
policyId
)
{
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
id
(
policyId
).
build
().
selectById
();
InsurePay
insurePay
=
InsurePay
.
builder
().
id
(
insurePolicy
.
getPayId
()).
build
().
selectById
();
insurePay
.
setPayTime
(
new
Date
());
...
...
@@ -286,7 +286,7 @@ public class CallBackContorll {
@PostMapping
(
value
=
"/payCallBack"
)
@ApiOperation
(
value
=
"9.投保支付收银台回调"
,
httpMethod
=
"POST"
,
notes
=
"支付完成跳转"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
payCallBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
throws
IOException
{
public
Map
payCallBack
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
{
try
{
InputStream
is
=
null
;
is
=
request
.
getInputStream
();
...
...
@@ -343,7 +343,7 @@ public class CallBackContorll {
@PostMapping
(
value
=
"/issueCallback"
)
@ApiOperation
(
value
=
"10.保单出单回调"
,
httpMethod
=
"POST"
,
notes
=
"支付完成跳转"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
issueCallback
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
throws
IOException
{
public
Map
issueCallback
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
{
try
{
InputStream
is
=
null
;
is
=
request
.
getInputStream
();
...
...
@@ -397,9 +397,9 @@ public class CallBackContorll {
}
@PostMapping
(
value
=
"/batchPayCallback"
)
@ApiOperation
(
value
=
"增员支付回调
-保司接口没启用
"
,
httpMethod
=
"POST"
,
notes
=
"增员支付回调"
)
@ApiOperation
(
value
=
"增员支付回调"
,
httpMethod
=
"POST"
,
notes
=
"增员支付回调"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Map
batchPayCallback
(
HttpServletRequest
request
)
throws
IOException
{
public
Map
batchPayCallback
(
HttpServletRequest
request
,
@RequestParam
String
pid
,
@RequestParam
String
sign
,
@RequestParam
String
timestamp
)
{
try
{
InputStream
is
=
null
;
...
...
@@ -409,6 +409,10 @@ public class CallBackContorll {
for
(
int
n
;
(
n
=
is
.
read
(
b
))
!=
-
1
;
)
{
sb
.
append
(
new
String
(
b
,
0
,
n
));
}
String
value
=
DigestUtils
.
md5Hex
(
pid
+
secretq
+
timestamp
);
if
(!
value
.
equals
(
sign
))
{
throw
new
CustomException
(
"增员支付回调验签失败"
);
}
BatchPayCallBack
callBack
=
JSONObject
.
parseObject
(
sb
.
toString
(),
BatchPayCallBack
.
class
);
InsurePay
insurePay
=
InsurePay
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePay
>().
lambda
().
eq
(
InsurePay:
:
getSerialNumber
,
callBack
.
getOrder_import_uuid
()));
if
(
insurePay
!=
null
)
{
...
...
src/main/java/cn/timer/api/controller/insure/InsureContorll.java
View file @
176e9879
...
...
@@ -1342,7 +1342,6 @@ public class InsureContorll {
}
}
else
{
/*保全支付*/
toPayParamsMap
=
setParams
(
batchToPayUrl
,
appidq
,
secretq
);
toPayParamsMap
.
put
(
"order_import_uuid"
,
insurePay
.
getSerialNumber
());
String
returnPay
=
HttpUtils
.
sendPost
(
batchToPayUrl
,
setParams
(
JSONObject
.
toJSONString
(
toPayParamsMap
),
appidq
,
secretq
),
toPayParamsMap
);
Map
<
String
,
Object
>
payDataMap
=
JSONObject
.
parseObject
(
returnPay
);
...
...
@@ -1353,7 +1352,10 @@ public class InsureContorll {
insurePay
.
updateById
();
InsureLog
.
builder
().
requestParam
(
JSONObject
.
toJSONString
(
toPayParamsMap
)).
returnBody
(
returnPay
).
type
(
7
).
createTime
(
new
Date
()).
requestType
(
2
).
requestPath
(
batchToPayUrl
)
.
returnMsg
(
"请求保全支付"
).
policyId
(
insurePolicy
.
getId
()).
build
().
insert
();
return
ResultUtil
.
data
(
importPayInfo
.
get
(
"pay_url"
).
toString
()
+
"&jump_url="
+
base_api_url
+
"/callBack/policy/payStatus?policyId="
+
insurePolicy
.
getId
()
+
"¬ify_url="
+
base_api_url
+
"/callBack/policy/batchPayCallback"
);
/*设置验签参数*/
long
timestamp
=
System
.
currentTimeMillis
()
/
1000
;
String
sign
=
DigestUtils
.
md5Hex
(
appidq
+
secretq
+
timestamp
);
return
ResultUtil
.
data
(
importPayInfo
.
get
(
"pay_url"
).
toString
()
+
"&jump_url="
+
base_api_url
+
"/callBack/policy/payStatus?policyId="
+
insurePolicy
.
getId
()
+
"¬ify_url="
+
base_api_url
+
"/callBack/policy/batchPayCallback?pid="
+
appidq
+
"?timestamp="
+
timestamp
+
"?sign="
+
sign
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"重新发起支付异常:"
,
e
);
...
...
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