Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
44a58b4d
提交
44a58b4d
authored
11月 05, 2023
作者:
huningning
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整支付回传数据格式
上级
172a4274
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
409 行增加
和
125 行删除
+409
-125
NotifyParam.java
.../main/java/com/clx/performance/param/pay/NotifyParam.java
+0
-34
NotifyString.java
...main/java/com/clx/performance/param/pay/NotifyString.java
+64
-0
PayResult.java
...rc/main/java/com/clx/performance/param/pay/PayResult.java
+166
-0
PayParam.java
...n/java/com/clx/performance/param/pc/payment/PayParam.java
+15
-3
PayUnitDTO.java
...java/com/clx/performance/param/pc/payment/PayUnitDTO.java
+4
-1
PayUserDTO.java
...java/com/clx/performance/param/pc/payment/PayUserDTO.java
+4
-1
MslPaymentConfig.java
...ain/java/com/clx/performance/config/MslPaymentConfig.java
+18
-0
PayNotifyController.java
...x/performance/controller/payment/PayNotifyController.java
+13
-22
PayRemarkEnum.java
...rc/main/java/com/clx/performance/enums/PayRemarkEnum.java
+59
-0
PaymentService.java
...main/java/com/clx/performance/service/PaymentService.java
+2
-1
PaymentServiceImpl.java
.../com/clx/performance/service/impl/PaymentServiceImpl.java
+50
-57
TempServiceImpl.java
...ava/com/clx/performance/service/impl/TempServiceImpl.java
+14
-6
没有找到文件。
performance-api/src/main/java/com/clx/performance/param/pay/NotifyParam.java
deleted
100644 → 0
浏览文件 @
172a4274
package
com
.
clx
.
performance
.
param
.
pay
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.apache.poi.ss.formula.functions.T
;
@ApiModel
(
description
=
"货主绑卡"
)
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
NotifyParam
{
/** 支付操作 参考<MessageTypeEnum> */
private
Integer
action
;
/** 交易单号 */
private
String
orderNo
;
/** 支付请求唯一ID */
private
String
uuid
;
/** 出错时的交易单元编号 */
private
String
errorNo
;
private
Integer
code
;
// 返回结果代码,0为成功
private
Long
total
;
//总共记录数
private
Integer
pageNum
;
//总共页数
private
String
msg
;
private
T
data
;
}
performance-api/src/main/java/com/clx/performance/param/pay/NotifyString.java
0 → 100644
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
param
.
pay
;
import
com.msl.common.enums.ResultEnum
;
/**
*
* @author xujianke
* @date 2017年6月01日
* @description
*/
public
class
NotifyString
extends
PayResult
<
String
>
{
/** 支付操作 参考<MessageTypeEnum> */
private
Integer
action
;
/** 交易单号 */
private
String
orderNo
;
/** 支付请求唯一ID */
private
String
uuid
;
/** 出错时的交易单元编号 */
private
String
errorNo
;
public
NotifyString
(){
super
();
}
public
NotifyString
(
PayResult
<
String
>
ret
){
this
.
setCode
(
ret
.
getCode
());
this
.
setMsg
(
ret
.
getMsg
());
this
.
setData
(
ret
.
getData
());
}
public
NotifyString
(
ResultEnum
e
)
{
super
(
e
);
}
public
String
getOrderNo
()
{
return
orderNo
;
}
public
void
setOrderNo
(
String
orderNo
)
{
this
.
orderNo
=
orderNo
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
public
Integer
getAction
()
{
return
action
;
}
public
void
setAction
(
Integer
action
)
{
this
.
action
=
action
;
}
public
String
getErrorNo
()
{
return
errorNo
;
}
public
void
setErrorNo
(
String
errorNo
)
{
this
.
errorNo
=
errorNo
;
}
@Override
public
String
toString
()
{
return
"NotifyString [action="
+
action
+
", orderNo="
+
orderNo
+
", uuid="
+
uuid
+
", errorNo="
+
errorNo
+
", toString()="
+
super
.
toString
()
+
"]"
;
}
}
performance-api/src/main/java/com/clx/performance/param/pay/PayResult.java
0 → 100644
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
param
.
pay
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.msl.common.enums.ResultEnum
;
/**
*
* 类: Result
* 描述:接口返回结果类
* @author wangjf
* 时间:2017年3月23日下午3:46:50
* 版本:v1.0
* 修改人:wangjf
*/
public
class
PayResult
<
T
>
{
private
Integer
code
;
// 返回结果代码,0为成功
/**
* 返回结果代码
* 0为成功 ,其他代码请参照代码文档
* @return
*/
public
Integer
getCode
()
{
return
code
;
}
private
Long
total
;
//总共记录数
private
Integer
pageNum
;
//总共页数
/**
* 0代表成功,其他代码请参考《返回值说明文档》
* 请务必按规定填写!
* @param code 结果代码
*/
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
/**
* 错误消息,接口中的错误处理,请务必填写错误消息<br/>
* 当成功时消息应为“success”
* @param msg 错误消息
*/
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
T
getData
()
{
return
data
;
}
public
void
setData
(
T
data
)
{
this
.
data
=
data
;
}
private
String
msg
;
private
T
data
;
/**
* 默认code = 0,<br/>
* msg = "success"
*/
public
PayResult
()
{
this
.
code
=
0
;
this
.
msg
=
"success"
;
}
/**
* 默认code = 0,
* msg = "success",<br/>
* 当成功返回结果时,可使用此方法,直接将返回结果填写即可
* @param data ,返回结果
*/
public
PayResult
(
T
data
)
{
this
.
code
=
0
;
this
.
msg
=
"success"
;
this
.
data
=
data
;
}
/**
* 查询列表返回成功
* @param data
* @param pageNum
* @param total
*/
public
PayResult
(
T
data
,
Integer
pageNum
,
Long
total
)
{
this
.
code
=
0
;
this
.
msg
=
"success"
;
this
.
data
=
data
;
this
.
pageNum
=
pageNum
;
this
.
total
=
total
;
}
/**
* 产生错误时,需要在枚举中拼接自定义返回的内容
* @param e
* @param msg
*/
public
PayResult
(
ResultEnum
e
,
String
msg
)
{
this
.
code
=
e
.
getCode
();
this
.
msg
=
String
.
format
(
e
.
getMsg
(),
msg
);
}
/**
* 产生错误时,可以使用此构造方法,在new时直接填写错误代码及消息即可
* @param code
* @param msg
*/
public
PayResult
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
PayResult
(
Integer
code
,
String
msg
,
T
data
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
this
.
data
=
data
;
}
@JsonIgnore
public
void
setResultEnum
(
ResultEnum
e
){
this
.
code
=
e
.
getCode
();
this
.
msg
=
e
.
getMsg
();
}
public
PayResult
(
ResultEnum
e
)
{
this
.
code
=
e
.
getCode
();
this
.
msg
=
e
.
getMsg
();
}
public
PayResult
(
T
data
,
ResultEnum
e
)
{
this
.
code
=
e
.
getCode
();
this
.
msg
=
e
.
getMsg
();
this
.
data
=
data
;
}
public
Long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
Long
total
)
{
this
.
total
=
total
;
}
public
Integer
getPageNum
()
{
return
pageNum
;
}
public
void
setPageNum
(
Integer
pageNum
)
{
this
.
pageNum
=
pageNum
;
}
@Override
public
String
toString
()
{
return
"Result [code="
+
code
+
", msg="
+
msg
+
", data="
+
data
+
"]"
;
}
/**
* 是否成功
* @return
*/
public
boolean
succeed
()
{
return
code
!=
null
&&
code
==
0
;
}
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayParam.java
浏览文件 @
44a58b4d
...
@@ -2,25 +2,37 @@ package com.clx.performance.param.pc.payment;
...
@@ -2,25 +2,37 @@ package com.clx.performance.param.pc.payment;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
@Getter
@Getter
@Setter
@Setter
@ToString
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors
(
chain
=
true
)
public
class
PayParam
{
public
class
PayParam
{
@NotBlank
(
message
=
"支付人不能为空"
)
@ApiModelProperty
(
value
=
"支付来源"
,
example
=
"2234"
,
dataType
=
"int"
)
@ApiModelProperty
(
value
=
"支付来源"
,
example
=
"2234"
,
dataType
=
"int"
)
Integer
from
;
Integer
from
;
@NotBlank
(
message
=
"支付密码不能为空"
)
@ApiModelProperty
(
value
=
"支付方密码"
,
example
=
"2356"
,
dataType
=
"String"
)
@ApiModelProperty
(
value
=
"支付方密码"
,
example
=
"2356"
,
dataType
=
"String"
)
String
pwd
;
String
pwd
;
@NotBlank
(
message
=
"收款钱包不能为空"
)
@ApiModelProperty
(
value
=
"支付去向"
,
example
=
"2234"
,
dataType
=
"int"
)
@ApiModelProperty
(
value
=
"支付去向"
,
example
=
"2234"
,
dataType
=
"int"
)
Integer
to
;
Integer
to
;
@NotBlank
(
message
=
"金额不能为空"
)
@ApiModelProperty
(
value
=
"金额"
,
example
=
"2356"
,
dataType
=
"int"
)
@ApiModelProperty
(
value
=
"金额"
,
example
=
"2356"
,
dataType
=
"int"
)
Integer
figure
;
Integer
figure
;
@NotBlank
(
message
=
"交易单号不能为空"
)
@ApiModelProperty
(
value
=
"交易单号"
,
example
=
"2356"
,
dataType
=
"String"
)
@ApiModelProperty
(
value
=
"交易单号"
,
example
=
"2356"
,
dataType
=
"String"
)
String
tradeNo
;
String
tradeNo
;
@NotBlank
(
message
=
"交易单id不能为空"
)
@ApiModelProperty
(
value
=
"交易单id"
,
example
=
"23"
,
dataType
=
"int"
)
@ApiModelProperty
(
value
=
"交易单id"
,
example
=
"23"
,
dataType
=
"int"
)
Integer
tradeId
;
Integer
tradeId
;
@ApiModelProperty
(
value
=
"服务费收取方"
,
example
=
"2234"
,
dataType
=
"int"
)
@NotBlank
(
message
=
"交易备注不能为空"
)
Integer
figureFeeCode
;
@ApiModelProperty
(
value
=
"交易备注"
,
example
=
"23"
,
dataType
=
"int"
)
String
remark
;
}
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayUnitDTO.java
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
@Getter
@Getter
@Setter
@Setter
@ToString
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors
(
chain
=
true
)
public
class
PayUnitDTO
{
public
class
PayUnitDTO
{
/** 支付单元唯一标识*/
/** 支付单元唯一标识*/
private
String
id
;
private
String
id
;
...
...
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayUserDTO.java
浏览文件 @
44a58b4d
...
@@ -2,11 +2,14 @@ package com.clx.performance.param.pc.payment;
...
@@ -2,11 +2,14 @@ package com.clx.performance.param.pc.payment;
import
lombok.*
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
@Getter
@Getter
@Setter
@Setter
@ToString
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors
(
chain
=
true
)
public
class
PayUserDTO
{
public
class
PayUserDTO
{
/**用户钱包编号 用户发起的操作必填 */
/**用户钱包编号 用户发起的操作必填 */
private
Integer
userCode
;
private
Integer
userCode
;
...
...
performance-web/src/main/java/com/clx/performance/config/MslPaymentConfig.java
0 → 100644
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
config
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Getter
@Setter
public
class
MslPaymentConfig
{
@Value
(
"${msl.payment.host}"
)
private
String
host
;
@Value
(
"${msl.payment.notifyhost}"
)
private
String
notifyhost
;
}
performance-web/src/main/java/com/clx/performance/controller/payment/PayNotifyController.java
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
controller
.
payment
;
package
com
.
clx
.
performance
.
controller
.
payment
;
import
com.clx.performance.param.pay.NotifyParam
;
import
com.clx.performance.param.pay.NotifyString
;
import
com.clx.performance.param.pc.GoodsOrderMapParam
;
import
com.clx.performance.vo.pc.GoodsOrderSendAddressSelect
;
import
com.msl.common.convertor.aspect.UnitCovert
;
import
com.msl.common.result.Result
;
import
com.msl.common.result.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -27,21 +19,20 @@ import java.util.Objects;
...
@@ -27,21 +19,20 @@ import java.util.Objects;
@AllArgsConstructor
@AllArgsConstructor
public
class
PayNotifyController
{
public
class
PayNotifyController
{
@ApiOperation
(
value
=
"用户支付完成回调接口"
,
notes
=
" <br>By:
许建科
"
)
@ApiOperation
(
value
=
"用户支付完成回调接口"
,
notes
=
" <br>By:
胡宁宁
"
)
@RequestMapping
(
value
=
"/userPayNotify"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/userPayNotify"
,
method
=
RequestMethod
.
POST
)
public
Result
<
Object
>
userPayNotify
(
@RequestBody
String
notify
)
{
public
Result
<
Object
>
userPayNotify
(
@RequestBody
NotifyString
notify
)
{
// public Result<Object> userPayNotify(@RequestBody NotifyParam notify) {
log
.
info
(
"用户支付完成回调接口 传参 {}"
,
notify
);
log
.
info
(
"用户支付完成回调接口 传参 {}"
,
notify
);
//
if (Objects.isNull(notify) || Objects.isNull(notify.getCode()) || Objects.isNull(notify.getAction())) {
if
(
Objects
.
isNull
(
notify
)
||
Objects
.
isNull
(
notify
.
getCode
())
||
Objects
.
isNull
(
notify
.
getAction
()))
{
//
return new Result<>();
return
new
Result
<>();
//
}
}
//
if (notify.getCode() != 0) {
if
(
notify
.
getCode
()
!=
0
)
{
//
// 支付失败处理
// 支付失败处理
// log.info("
唯一id {}", notify.getOrderNo());
log
.
info
(
"支付失败处理
唯一id {}"
,
notify
.
getOrderNo
());
//
} else {
}
else
{
//
// 支付支付成功处理
// 支付支付成功处理
// log.info("
唯一id {}", notify.getOrderNo());
log
.
info
(
" 支付支付成功处理
唯一id {}"
,
notify
.
getOrderNo
());
//
}
}
Result
<
Object
>
ret
=
new
Result
<>();
Result
<
Object
>
ret
=
new
Result
<>();
return
ret
;
return
ret
;
}
}
...
...
performance-web/src/main/java/com/clx/performance/enums/PayRemarkEnum.java
0 → 100644
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
enums
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* Created by cuiwanzhe on 2017/6/2.
* 支付备注枚举
*/
public
enum
PayRemarkEnum
{
OWNER_CREDIT
(
1
,
"货主冻结押金"
),
DRIVER_CREDIT
(
2
,
"司机冻结押金"
),
OWNER_FREIGHT
(
3
,
"货主冻结运费"
),
OWNER_INSURANCE
(
4
,
"货主冻结保险"
),
DRIVER_UNFREEZE
(
5
,
"司机解冻押金"
),
INSURANCE_UNFREEZE
(
6
,
"解冻保险到系统账户"
),
COMPENSATION_TO_DRIVER
(
7
,
"司机赔偿货主"
),
FREIGHT_TO_OWNER
(
8
,
"货主支付运费给司机"
),
UPDATE_FREIGHT
(
9
,
"修正运费"
),
UPDATE_INSURANCE
(
10
,
"修正保险"
),
OWNER_UNFREEZE
(
11
,
"解冻货主的押金"
),
DRIVER_SALE
(
12
,
"冻结司机的消费"
),
DRIVER_SALE_UNFREEZE
(
13
,
"司机支付货款给货主"
),
//v78 解冻保险
UNFREEZE_INSURANCE
(
14
,
"解冻保险"
),
;
private
static
Map
<
Integer
,
String
>
map
=
new
ConcurrentHashMap
<>();
static
{
for
(
PayRemarkEnum
payRemarkEnum
:
PayRemarkEnum
.
values
()){
map
.
put
(
payRemarkEnum
.
getValue
(),
payRemarkEnum
.
getDisplayValue
());
}
}
private
int
value
;
private
String
displayValue
;
public
void
setValue
(
int
value
)
{
this
.
value
=
value
;
}
public
String
getDisplayValue
()
{
return
displayValue
;
}
public
void
setDisplayValue
(
String
displayValue
)
{
this
.
displayValue
=
displayValue
;
}
private
PayRemarkEnum
(
int
value
,
String
displayValue
){
this
.
value
=
value
;
this
.
displayValue
=
displayValue
;
}
public
int
getValue
(){
return
value
;
}
public
static
String
toString
(
int
value
){
return
map
.
get
(
value
);
}
}
performance-web/src/main/java/com/clx/performance/service/PaymentService.java
浏览文件 @
44a58b4d
package
com
.
clx
.
performance
.
service
;
package
com
.
clx
.
performance
.
service
;
import
com.clx.performance.param.pc.payment.PayParam
;
import
com.msl.common.result.Result
;
import
com.msl.common.result.Result
;
public
interface
PaymentService
{
public
interface
PaymentService
{
Result
paymentWallet
(
Integer
fromUser
,
Integer
toUser
,
Integer
figure
,
String
tradeNo
,
Integer
i
d
);
Result
paymentWallet
(
PayParam
noCheckPw
d
);
}
}
performance-web/src/main/java/com/clx/performance/service/impl/PaymentServiceImpl.java
浏览文件 @
44a58b4d
...
@@ -2,6 +2,8 @@ package com.clx.performance.service.impl;
...
@@ -2,6 +2,8 @@ package com.clx.performance.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.clx.performance.config.MslAppConfig
;
import
com.clx.performance.config.MslPaymentConfig
;
import
com.clx.performance.constant.ActionConstants
;
import
com.clx.performance.constant.ActionConstants
;
import
com.clx.performance.dao.ThirdPartRequestLogDao
;
import
com.clx.performance.dao.ThirdPartRequestLogDao
;
import
com.clx.performance.encryption.oldmsl.PayEncryptTools
;
import
com.clx.performance.encryption.oldmsl.PayEncryptTools
;
...
@@ -17,6 +19,7 @@ import com.clx.performance.param.pc.payment.PayUnitDTO;
...
@@ -17,6 +19,7 @@ import com.clx.performance.param.pc.payment.PayUnitDTO;
import
com.clx.performance.param.pc.payment.PayUserDTO
;
import
com.clx.performance.param.pc.payment.PayUserDTO
;
import
com.clx.performance.service.ThirdPartRequestLogService
;
import
com.clx.performance.service.ThirdPartRequestLogService
;
import
com.msl.common.dto.HttpDTO
;
import
com.msl.common.dto.HttpDTO
;
import
com.msl.common.enums.ResultCodeEnum
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.result.Result
;
import
com.msl.common.result.Result
;
import
com.msl.common.utils.EncryptUtil
;
import
com.msl.common.utils.EncryptUtil
;
...
@@ -27,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -27,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.security.GeneralSecurityException
;
import
java.security.GeneralSecurityException
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -37,69 +41,56 @@ import static com.clx.performance.enums.HttpEnum.PERFORMANCE_PAY_CLX_PAYMENT;
...
@@ -37,69 +41,56 @@ import static com.clx.performance.enums.HttpEnum.PERFORMANCE_PAY_CLX_PAYMENT;
@AllArgsConstructor
@AllArgsConstructor
public
class
PaymentServiceImpl
implements
PaymentService
{
public
class
PaymentServiceImpl
implements
PaymentService
{
@Autowired
ThirdPartRequestLogDao
thirdPartRequestLogDao
;
@Autowired
ThirdPartRequestLogService
thirdPartRequestLogService
;
public
static
final
String
TRANSPORT_USER
=
"13403503399"
;
public
static
final
String
TRANSPORT_USER
=
"13403503399"
;
public
static
final
String
TRANSPORT_KEY
=
"9Y1N5AUP8N2TI359"
;
public
static
final
String
TRANSPORT_KEY
=
"9Y1N5AUP8N2TI359"
;
/** 转账回调地址 **/
public
static
final
String
NOTIFY_URL
=
"/clx-performance/payment/notify/userPayNotify"
;
// 请求地址
@Autowired
public
static
final
String
OLD_CLX_HOST
=
"https://api.clxkj.cn:8088"
;
private
final
MslPaymentConfig
mslPaymentConfig
;
//回调地址
public
static
final
String
NOTIFY_HOST
=
"https://gateway.testclx.cn"
;
public
static
final
String
NOTIFY_URL
=
"/msl-performance/payment/notify/userPayNotify"
;
@Override
@Autowired
public
Result
paymentWallet
(
Integer
fromUser
,
Integer
toUser
,
Integer
figure
,
String
tradeNo
,
Integer
id
)
{
ThirdPartRequestLogDao
thirdPartRequestLogDao
;
PayParam
payDTO
=
new
PayParam
();
payDTO
.
setPwd
(
"noCheckPwd"
);
// 不校验密码
payDTO
.
setFrom
(
fromUser
);
payDTO
.
setTo
(
toUser
);
payDTO
.
setTradeNo
(
tradeNo
);
// 流水号
payDTO
.
setTradeId
(
id
);
//唯一id
payDTO
.
setFigureFeeCode
(
10000
);
//默认到平台
payDTO
.
setFigure
(
figure
);
return
userPay
(
payDTO
);
}
@Autowired
ThirdPartRequestLogService
thirdPartRequestLogService
;
/**
/**
* 组装余额支付报文并发送请求
* 钱包直接划账给钱包
*
* @param payDTO
* @return
*/
*/
public
Result
<
Object
>
userPay
(
PayParam
payDTO
)
{
@Override
PayUnitDTO
payUnitDTO
=
new
PayUnitDTO
();
public
Result
paymentWallet
(
PayParam
payDTO
)
{
payUnitDTO
.
setId
(
payDTO
.
getTradeId
().
toString
());
/** 构建支付单元 **/
payUnitDTO
.
setFrom
(
payDTO
.
getFrom
());
PayUnitDTO
payUnitDTO
=
PayUnitDTO
.
builder
()
payUnitDTO
.
setTo
(
payDTO
.
getTo
());
.
id
(
payDTO
.
getTradeId
().
toString
())
payUnitDTO
.
setFigure
(
payDTO
.
getFigure
());
.
from
(
payDTO
.
getFrom
())
payUnitDTO
.
setType
(
PayUnitTypeEnum
.
RESIDUE_PAY
.
getCode
());
.
to
(
payDTO
.
getTo
())
payUnitDTO
.
setTimestamp
(
System
.
currentTimeMillis
()
/
1000
);
.
figure
(
payDTO
.
getFigure
())
payUnitDTO
.
setRemark
(
"承运支付钱包转账"
);
.
type
(
PayUnitTypeEnum
.
RESIDUE_PAY
.
getCode
())
PayEncryptTools
.
sign
(
payUnitDTO
,
PrivateKeyConfig
.
privateKeyByte
);
// 用业务系统自己的私钥
.
timestamp
(
System
.
currentTimeMillis
()
/
1000
)
.
remark
(
payDTO
.
getRemark
()).
build
();
PayUserDTO
payUserDTO
=
new
PayUserDTO
();
/** 生成签名**/
payUserDTO
.
setPwd
(
payDTO
.
getPwd
());
PayEncryptTools
.
sign
(
payUnitDTO
,
PrivateKeyConfig
.
privateKeyByte
);
payUserDTO
.
setSystem
(
SystemCodeEnum
.
MERCHANT_SERVICE
.
getCode
());
//商户
payUserDTO
.
setUserCode
(
payDTO
.
getFrom
());
/** 构建支付支付 ***/
payUserDTO
.
setOrderNo
(
payDTO
.
getTradeNo
());
PayUserDTO
payUserDTO
=
PayUserDTO
.
builder
()
payUserDTO
.
setUuid
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
.
pwd
(
payDTO
.
getPwd
())
payUserDTO
.
setNotifyUrl
(
NOTIFY_HOST
+
NOTIFY_URL
);
.
system
(
SystemCodeEnum
.
PERFORMANCE_SERVICE
.
getCode
())
// payUserDTO.setFee(payDTO.getFigureFee());
.
userCode
(
payDTO
.
getFrom
())
payUserDTO
.
setPayUnitDTO
(
payUnitDTO
);
.
orderNo
(
payDTO
.
getTradeNo
())
payUserDTO
.
setFeeToUserCode
(
payDTO
.
getFigureFeeCode
());
.
uuid
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
))
log
.
info
(
"发起支付请求日志 {}"
,
payUserDTO
);
.
notifyUrl
(
mslPaymentConfig
.
getNotifyhost
()
+
NOTIFY_URL
)
Result
<
Object
>
notify
=
(
Result
<
Object
>)
postRequest
(
OLD_CLX_HOST
+
PERFORMANCE_PAY_CLX_PAYMENT
.
getUrl
(),
JSON
.
toJSONString
(
payUserDTO
));
.
payUnitDTO
(
payUnitDTO
).
build
();
log
.
info
(
"支付返回日志 {}"
,
notify
);
log
.
info
(
"发起支付请求日志 {}"
,
payUserDTO
);
//Result<Object> notify = feignPaymentService.payUserMQ(payUserDTO);
Result
<
Object
>
notify
=
(
Result
<
Object
>)
postRequest
(
mslPaymentConfig
.
getHost
()+
PERFORMANCE_PAY_CLX_PAYMENT
.
getUrl
(),
JSON
.
toJSONString
(
payUserDTO
));
// if (notify == null) {
log
.
info
(
"支付返回日志 {}"
,
notify
);
// //FEGIN返回null
if
(
notify
==
null
)
{
// throw new ServiceSystemException(ResultCodeEnum.FEGIN_NULL);
//FEGIN返回null
// }
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"支付服务返回异常"
);
// if (notify.getCode() != 0) {
}
// }
return
notify
;
return
notify
;
}
}
...
@@ -111,12 +102,14 @@ public class PaymentServiceImpl implements PaymentService {
...
@@ -111,12 +102,14 @@ public class PaymentServiceImpl implements PaymentService {
public
Result
<?>
postRequest
(
String
requestUrl
,
String
param
)
{
public
Result
<?>
postRequest
(
String
requestUrl
,
String
param
)
{
ThirdPartRequestLog
log
=
ThirdPartRequestLog
.
builder
()
ThirdPartRequestLog
log
=
ThirdPartRequestLog
.
builder
()
.
requestId
(
UUID
.
randomUUID
().
toString
())
.
requestId
(
UUID
.
randomUUID
().
toString
())
.
appNo
(
Long
.
valueOf
(
10000
))
//应用编号 10000 默认诚联信
//应用编号 10000 默认诚联信
.
appNo
(
Long
.
valueOf
(
10000
))
.
requestType
(
ThirdRequestTypeEnum
.
SEND
.
getCode
())
.
requestType
(
ThirdRequestTypeEnum
.
SEND
.
getCode
())
.
action
(
ActionConstants
.
CLX_PAYMENT_PAY
)
.
action
(
ActionConstants
.
CLX_PAYMENT_PAY
)
.
url
(
requestUrl
)
.
url
(
requestUrl
)
.
requestContent
(
param
)
.
requestContent
(
param
)
.
status
(
0
)
//状态: 0-请求中,1-成功,2-失败
//状态: 0-请求中,1-成功,2-失败
.
status
(
0
)
.
build
();
.
build
();
thirdPartRequestLogDao
.
saveEntity
(
log
);
thirdPartRequestLogDao
.
saveEntity
(
log
);
return
encryptPost
(
requestUrl
,
param
,
log
.
getId
());
return
encryptPost
(
requestUrl
,
param
,
log
.
getId
());
...
...
performance-web/src/main/java/com/clx/performance/service/impl/TempServiceImpl.java
浏览文件 @
44a58b4d
...
@@ -2,7 +2,9 @@ package com.clx.performance.service.impl;
...
@@ -2,7 +2,9 @@ package com.clx.performance.service.impl;
import
com.clx.performance.dao.breakcontract.BreakContractSettlementDriverDao
;
import
com.clx.performance.dao.breakcontract.BreakContractSettlementDriverDao
;
import
com.clx.performance.enums.BreakContractSettlementDriverEnum
;
import
com.clx.performance.enums.BreakContractSettlementDriverEnum
;
import
com.clx.performance.enums.PayRemarkEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.param.pc.payment.PayParam
;
import
com.clx.performance.service.PaymentService
;
import
com.clx.performance.service.PaymentService
;
import
com.clx.performance.model.breakcontract.BreakContractSettlementDriver
;
import
com.clx.performance.model.breakcontract.BreakContractSettlementDriver
;
import
com.clx.performance.service.TempService
;
import
com.clx.performance.service.TempService
;
...
@@ -39,12 +41,18 @@ public class TempServiceImpl implements TempService {
...
@@ -39,12 +41,18 @@ public class TempServiceImpl implements TempService {
@Override
@Override
public
void
paymentTest
(
String
fromUser
,
String
toUser
,
String
figure
)
{
public
void
paymentTest
(
String
fromUser
,
String
toUser
,
String
figure
)
{
paymentService
.
paymentWallet
(
PayParam
noCheckPwd
=
PayParam
.
builder
().
from
(
Integer
.
valueOf
(
fromUser
),
Integer
.
valueOf
(
fromUser
))
Integer
.
valueOf
(
toUser
),
.
to
(
Integer
.
valueOf
(
toUser
))
Integer
.
valueOf
(
figure
),
.
figure
(
Integer
.
valueOf
(
figure
))
UUID
.
randomUUID
().
toString
(),
.
tradeNo
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
))
999
);
.
tradeId
(
12345
)
.
pwd
(
"noCheckPwd"
)
.
remark
(
PayRemarkEnum
.
toString
(
PayRemarkEnum
.
FREIGHT_TO_OWNER
.
getValue
()))
.
build
();
paymentService
.
paymentWallet
(
noCheckPwd
);
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论