Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
7451ce2b
提交
7451ce2b
authored
11月 04, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into…
Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into v5.7_break_contract_reverse_20231020
上级
88913da1
d7568f6b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
27 个修改的文件
包含
1000 行增加
和
1 行删除
+1000
-1
ActionConstants.java
...in/java/com/clx/performance/constant/ActionConstants.java
+6
-0
ThirdRequestStatusEnum.java
...ava/com/clx/performance/enums/ThirdRequestStatusEnum.java
+18
-0
ThirdRequestTypeEnum.java
.../java/com/clx/performance/enums/ThirdRequestTypeEnum.java
+16
-0
NotifyParam.java
.../main/java/com/clx/performance/param/pay/NotifyParam.java
+34
-0
FreezeUnitDTO.java
...a/com/clx/performance/param/pc/payment/FreezeUnitDTO.java
+41
-0
PayCardDTO.java
...java/com/clx/performance/param/pc/payment/PayCardDTO.java
+14
-0
PayChildDTO.java
...ava/com/clx/performance/param/pc/payment/PayChildDTO.java
+16
-0
PayParam.java
...n/java/com/clx/performance/param/pc/payment/PayParam.java
+26
-0
PayUnitDTO.java
...java/com/clx/performance/param/pc/payment/PayUnitDTO.java
+32
-0
PayUserDTO.java
...java/com/clx/performance/param/pc/payment/PayUserDTO.java
+30
-0
PayNotifyController.java
...x/performance/controller/payment/PayNotifyController.java
+48
-0
TempController.java
...a/com/clx/performance/controller/temp/TempController.java
+13
-0
ThirdPartRequestLogDao.java
.../java/com/clx/performance/dao/ThirdPartRequestLogDao.java
+27
-0
PayEncryptTools.java
...om/clx/performance/encryption/oldmsl/PayEncryptTools.java
+150
-0
PrivateKeyConfig.java
...m/clx/performance/encryption/oldmsl/PrivateKeyConfig.java
+24
-0
RSACoder.java
.../java/com/clx/performance/encryption/oldmsl/RSACoder.java
+0
-0
SystemCodeEnum.java
...com/clx/performance/encryption/oldmsl/SystemCodeEnum.java
+48
-0
HttpEnum.java
...web/src/main/java/com/clx/performance/enums/HttpEnum.java
+25
-0
PayUnitTypeEnum.java
.../main/java/com/clx/performance/enums/PayUnitTypeEnum.java
+87
-0
PaymentService.java
...clx/performance/extranal/thirdPayment/PaymentService.java
+9
-0
PaymentServiceImpl.java
...rmance/extranal/thirdPayment/impl/PaymentServiceImpl.java
+148
-0
ThirdPartRequestLogMapper.java
...com/clx/performance/mapper/ThirdPartRequestLogMapper.java
+10
-0
ThirdPartRequestLog.java
...n/java/com/clx/performance/model/ThirdPartRequestLog.java
+71
-0
TempService.java
...rc/main/java/com/clx/performance/service/TempService.java
+2
-0
ThirdPartRequestLogService.java
...m/clx/performance/service/ThirdPartRequestLogService.java
+36
-0
TempServiceImpl.java
...ava/com/clx/performance/service/impl/TempServiceImpl.java
+15
-1
ThirdPartRequestLogServiceImpl.java
...formance/service/impl/ThirdPartRequestLogServiceImpl.java
+54
-0
没有找到文件。
performance-api/src/main/java/com/clx/performance/constant/ActionConstants.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
constant
;
public
class
ActionConstants
{
public
static
final
String
CLX_PAYMENT_PAY
=
"clx.payment.pay"
;
}
performance-api/src/main/java/com/clx/performance/enums/ThirdRequestStatusEnum.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
ThirdRequestStatusEnum
{
HAVING
(
0
,
"请求中"
),
SUCCESS
(
1
,
"成功"
),
FAIL
(
2
,
"失败"
),
;
private
final
int
code
;
private
final
String
mark
;
}
performance-api/src/main/java/com/clx/performance/enums/ThirdRequestTypeEnum.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
ThirdRequestTypeEnum
{
SEND
(
1
,
"发送请求"
),
RECEIVE
(
2
,
"接收请求"
),
;
private
final
int
code
;
private
final
String
msg
;
}
performance-api/src/main/java/com/clx/performance/param/pay/NotifyParam.java
0 → 100644
浏览文件 @
7451ce2b
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/pc/payment/FreezeUnitDTO.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
import
java.util.List
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
FreezeUnitDTO
{
/** 冻结序列号 */
private
String
freezeNo
;
/** 操作金额(单位分) */
private
Long
figure
;
/** 平台信息费用(单位分) */
private
Long
fee
;
/** 平台信息费收费方式 1from 2to 3all 默认是2 */
private
Integer
feeType
;
/** 返还费用 */
private
Long
returnFee
;
/** 操作类型 1撤销 2完成 3修改*/
private
Integer
action
;
/** 时间戳(单位毫秒) **/
private
Long
timestamp
;
/** 签名使用业务系统私钥签名 不参与签名 **/
private
String
signature
;
/** 备注 不参与签名 可空 */
private
String
remark
;
/** 消费卡列表 */
private
List
<
PayCardDTO
>
cardList
;
/** 分账列表 */
private
List
<
PayChildDTO
>
childList
;
/** 流程标志 1线上2线下 */
private
String
flag
;
/** 补充标记,结合枚举使用(PatchMarkEnum),确定实际业务含义 */
private
Integer
patchMark
;
/** 优惠卷id */
private
Integer
userCouponId
;
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayCardDTO.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
PayCardDTO
{
/** VIP 消费卡ID*/
private
Integer
cardId
;
/** 金额 */
private
Integer
figure
;
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayChildDTO.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
PayChildDTO
{
/** 支付给谁 用户钱包编号 支付给系统时为10000 **/
private
Integer
to
;
/** 交易金额(单位分) 必须为正数 **/
private
Integer
figure
;
/** 备注 不参与签名 可空 */
private
String
remark
;
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayParam.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
PayParam
{
@ApiModelProperty
(
value
=
"支付来源"
,
example
=
"2234"
,
dataType
=
"int"
)
Integer
from
;
@ApiModelProperty
(
value
=
"支付方密码"
,
example
=
"2356"
,
dataType
=
"String"
)
String
pwd
;
@ApiModelProperty
(
value
=
"支付去向"
,
example
=
"2234"
,
dataType
=
"int"
)
Integer
to
;
@ApiModelProperty
(
value
=
"金额"
,
example
=
"2356"
,
dataType
=
"int"
)
Integer
figure
;
@ApiModelProperty
(
value
=
"交易单号"
,
example
=
"2356"
,
dataType
=
"String"
)
String
tradeNo
;
@ApiModelProperty
(
value
=
"交易单id"
,
example
=
"23"
,
dataType
=
"int"
)
Integer
tradeId
;
@ApiModelProperty
(
value
=
"服务费收取方"
,
example
=
"2234"
,
dataType
=
"int"
)
Integer
figureFeeCode
;
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayUnitDTO.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
PayUnitDTO
{
/** 支付单元唯一标识*/
private
String
id
;
/** 谁支付 用户钱包编号 */
private
Integer
from
;
/** 支付给谁 用户钱包编号 支付给系统时为10000 **/
private
Integer
to
;
/** 交易金额(单位分) 必须为正数 **/
private
Integer
figure
;
/** 支付类型 参考 <PayUnitTypeEnum> **/
private
Integer
type
;
/** 时间戳(单位毫秒) **/
private
Long
timestamp
;
/** 签名使用业务系统私钥签名 不参与签名 **/
private
String
signature
;
/** 备注 不参与签名 可空 */
private
String
remark
;
/** 关联名称 不参与签名 可空 */
private
String
relationName
;
/** 优惠卷id */
private
Integer
userCouponId
;
/** 订单编码 批量发送 单独处理的订单号 */
private
String
orderNo
;
}
performance-api/src/main/java/com/clx/performance/param/pc/payment/PayUserDTO.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
param
.
pc
.
payment
;
import
lombok.*
;
@Getter
@Setter
@ToString
@NoArgsConstructor
public
class
PayUserDTO
{
/**用户钱包编号 用户发起的操作必填 */
private
Integer
userCode
;
/** 交易密码 用户发起的操作必填 */
private
String
pwd
;
/** 支付单元 */
PayUnitDTO
payUnitDTO
;
/** 平台服务续费 **/
private
Integer
fee
=
0
;
/** 平台服务续费的去向 **/
private
Integer
feeToUserCode
=
10000
;
/** 业务系统编码 参考<SystemCodeEnum> */
private
Integer
system
;
/** 支付结果通知回调地址 */
private
String
notifyUrl
;
/** 操作唯一标识 UUID */
private
String
uuid
;
/** 关联单号 */
private
String
orderNo
;
}
performance-web/src/main/java/com/clx/performance/controller/payment/PayNotifyController.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
controller
.
payment
;
import
com.clx.performance.param.pay.NotifyParam
;
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
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.AllArgsConstructor
;
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.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Objects
;
@Slf4j
@RestController
@RequestMapping
(
value
=
"/payment/notify"
)
@Validated
@Api
(
tags
=
"承运端-支付回调"
)
@AllArgsConstructor
public
class
PayNotifyController
{
@ApiOperation
(
value
=
"用户支付完成回调接口"
,
notes
=
" <br>By:许建科"
)
@RequestMapping
(
value
=
"/userPayNotify"
,
method
=
RequestMethod
.
POST
)
public
Result
<
Object
>
userPayNotify
(
@RequestBody
NotifyParam
notify
)
{
log
.
info
(
"用户支付完成回调接口 传参 {}"
,
notify
);
if
(
Objects
.
isNull
(
notify
)
||
Objects
.
isNull
(
notify
.
getCode
())
||
Objects
.
isNull
(
notify
.
getAction
()))
{
return
new
Result
<>();
}
if
(
notify
.
getCode
()
!=
0
)
{
// 支付失败处理
log
.
info
(
"唯一id {}"
,
notify
.
getOrderNo
());
}
else
{
// 支付支付成功处理
log
.
info
(
"唯一id {}"
,
notify
.
getOrderNo
());
}
Result
<
Object
>
ret
=
new
Result
<>();
return
ret
;
}
}
performance-web/src/main/java/com/clx/performance/controller/temp/TempController.java
浏览文件 @
7451ce2b
...
@@ -7,8 +7,11 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -7,8 +7,11 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.constraints.NotBlank
;
/**
/**
* @Author: aiqingguo
* @Author: aiqingguo
...
@@ -51,4 +54,14 @@ public class TempController {
...
@@ -51,4 +54,14 @@ public class TempController {
return
Result
.
ok
();
return
Result
.
ok
();
}
}
@ApiOperation
(
value
=
"测试支付划账 (临时接口)"
,
notes
=
"<br>By:胡宁宁"
)
@RequestMapping
(
value
=
"/paymentTest"
,
method
=
RequestMethod
.
GET
)
public
Result
<
Void
>
paymentTest
(
@RequestParam
(
"fromUser"
)
@NotBlank
(
message
=
"扣款方"
)
String
fromUser
,
@RequestParam
(
"toUser"
)
@NotBlank
(
message
=
"收款方"
)
String
toUser
,
@RequestParam
(
"figure"
)
@NotBlank
(
message
=
"金额"
)
String
figure
)
{
tempService
.
paymentTest
(
fromUser
,
toUser
,
figure
);
return
Result
.
ok
();
}
}
}
performance-web/src/main/java/com/clx/performance/dao/ThirdPartRequestLogDao.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
dao
;
import
com.clx.performance.mapper.ThirdPartRequestLogMapper
;
import
com.clx.performance.model.ThirdPartRequestLog
;
import
com.msl.common.dao.BaseDao
;
import
java.util.List
;
public
interface
ThirdPartRequestLogDao
extends
BaseDao
<
ThirdPartRequestLogMapper
,
ThirdPartRequestLog
,
Integer
>
{
/**
* 查询发送请求失败的数据
*
* @param time
* @return
*/
List
<
ThirdPartRequestLog
>
listThirdPartRequestLogError
(
String
time
);
/**
* 修改重试次数
*
* @param logId
* @param retryTimes
*/
void
updateLogRetryTimes
(
Integer
logId
,
Integer
retryTimes
);
}
performance-web/src/main/java/com/clx/performance/encryption/oldmsl/PayEncryptTools.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
encryption
.
oldmsl
;
import
com.clx.performance.param.pc.payment.FreezeUnitDTO
;
import
com.clx.performance.param.pc.payment.PayUnitDTO
;
import
java.util.List
;
/**
*
* @author xujianke
* @date 2017年4月18日
* @description
*/
public
class
PayEncryptTools
{
/**
* 生成签名,签名结果直接赋值到PayUnitDTO签名字段
* @param
* @param privateKeyBytes
* @return 签名是否成功
*/
public
static
boolean
sign
(
PayUnitDTO
payDTO
,
byte
[]
privateKeyBytes
){
if
(
payDTO
==
null
){
//参数错误
return
false
;
}
byte
[]
data
=
makeByte
(
payDTO
);
String
sign
=
RSACoder
.
sign
(
data
,
privateKeyBytes
);
if
(
sign
==
null
){
//签名失败
return
false
;
}
payDTO
.
setSignature
(
sign
);
return
true
;
}
/**
* 生成签名,签名结果直接赋值到FreezeUnitDTO签名字段
* @param freezeDTO
* @param privateKeyBytes
* @return 签名是否成功
*/
public
static
boolean
sign
(
FreezeUnitDTO
freezeDTO
,
byte
[]
privateKeyBytes
){
if
(
freezeDTO
==
null
){
//参数错误
return
false
;
}
byte
[]
data
=
makeByte
(
freezeDTO
);
String
sign
=
RSACoder
.
sign
(
data
,
privateKeyBytes
);
if
(
sign
==
null
){
//签名失败
return
false
;
}
freezeDTO
.
setSignature
(
sign
);
return
true
;
}
/**
* 验证签名
* @param payDTO
* @param publicKeyBytes
* @return
*/
public
static
boolean
verify
(
PayUnitDTO
payDTO
,
byte
[]
publicKeyBytes
){
if
(
payDTO
==
null
||
payDTO
.
getSignature
()
==
null
){
//参数错误
return
false
;
}
byte
[]
data
=
makeByte
(
payDTO
);
return
RSACoder
.
verify
(
data
,
publicKeyBytes
,
payDTO
.
getSignature
());
}
/**
* 验证签名
* @param freezeDTO
* @param publicKeyBytes
* @return
*/
public
static
boolean
verify
(
FreezeUnitDTO
freezeDTO
,
byte
[]
publicKeyBytes
){
if
(
freezeDTO
==
null
||
freezeDTO
.
getSignature
()
==
null
){
//参数错误
return
false
;
}
byte
[]
data
=
makeByte
(
freezeDTO
);
return
RSACoder
.
verify
(
data
,
publicKeyBytes
,
freezeDTO
.
getSignature
());
}
/**
* 组装需要签名的字符串
* @param payDTO
* @return 字符串的字节数组
*/
public
static
byte
[]
makeByte
(
PayUnitDTO
payDTO
){
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
payDTO
.
getFigure
());
sb
.
append
(
':'
).
append
(
payDTO
.
getId
());
sb
.
append
(
':'
).
append
(
payDTO
.
getFrom
());
sb
.
append
(
':'
).
append
(
payDTO
.
getTimestamp
());
sb
.
append
(
':'
).
append
(
payDTO
.
getTo
());
sb
.
append
(
':'
).
append
(
payDTO
.
getType
());
String
text
=
sb
.
toString
();
return
text
.
getBytes
();
}
/**
* 组装需要签名的字符串
* @param freezeDTO
* @return 字符串的字节数组
*/
public
static
byte
[]
makeByte
(
FreezeUnitDTO
freezeDTO
){
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
freezeDTO
.
getAction
());
sb
.
append
(
':'
).
append
(
freezeDTO
.
getFigure
());
sb
.
append
(
':'
).
append
(
freezeDTO
.
getFee
());
sb
.
append
(
':'
).
append
(
freezeDTO
.
getFeeType
());
sb
.
append
(
':'
).
append
(
freezeDTO
.
getFreezeNo
());
sb
.
append
(
':'
).
append
(
freezeDTO
.
getTimestamp
());
if
(
freezeDTO
.
getReturnFee
()
!=
null
){
sb
.
append
(
':'
).
append
(
freezeDTO
.
getReturnFee
());
}
String
text
=
sb
.
toString
();
return
text
.
getBytes
();
}
/**
* 批量签名
* @param privateKeyBytes
* @return 成功签名的个数
*/
public
static
int
signBatch
(
List
<
PayUnitDTO
>
list
,
byte
[]
privateKeyBytes
){
int
count
=
0
;
boolean
b
;
for
(
PayUnitDTO
payDTO:
list
){
b
=
sign
(
payDTO
,
privateKeyBytes
);
if
(
b
){
count
++;
}
}
return
count
;
}
/**
* 批量验证签名
* @param publicKeyBytes
* @return
*/
public
static
int
verifyBatch
(
List
<
PayUnitDTO
>
list
,
byte
[]
publicKeyBytes
){
boolean
ret
=
true
;
int
i
;
PayUnitDTO
payDTO
;
for
(
i
=
0
;
i
<
list
.
size
();
i
++){
payDTO
=
list
.
get
(
i
);
ret
=
verify
(
payDTO
,
publicKeyBytes
);
if
(!
ret
){
break
;
}
}
return
i
;
}
}
performance-web/src/main/java/com/clx/performance/encryption/oldmsl/PrivateKeyConfig.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
encryption
.
oldmsl
;
import
org.bouncycastle.util.encoders.Base64
;
/**
* 加密使用的私钥配置类(等于商户的)
*/
public
class
PrivateKeyConfig
{
/** 非对称加密RSA私钥 私钥长度1024字节 单次最多加密53个字符
* 对应公钥为 SecretConfig.PAYMENT_PUBLIC_KEY
* */
private
static
final
String
privateKey
=
"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOT9q9k4SE5s"
+
"RC1xOtbRzKCwPa2Zp0j9/IGGQ1DUQzhJ1dtMaOzUs66ddMTokoG7nzUyFk8+50QbSb8AQTd+CoGa47oM4P48W9n91"
+
"fAsA1QHpSv4cBrVRbkZv77/XCPZgibnGSoP3IdaMp/GTGwUVnNuUtszNglG8mRB/IFLWMNLAgMBAAECgYBc0eqHuU"
+
"Wt7DrShLRKAW7Fr8rAhKkHcFSbGBZPPEsnFN7H7rgVT76pyA9eBbvlNG07fdsHMkNCGyGQd4T3/nI5BH/xwgT7P4E"
+
"pYy8PnyrIj185CEY7VplgH4l9cHPMcY8pKCwJZjbHBUlgS6ZCA3+DRB7c+7MZZiV/DX2Ay3IBeQJBAPdlTO7i9ncr"
+
"QWMI7So6byt9OSHQz6Gxdml6YS51gQTFKTCMc8n45yAhr7D7XxhgHSDqkSCmkcWkLlKm15XXkvUCQQDs9ICzCWE+I"
+
"viGhVNu2XZQwMiMLQZoC1go+ZBo0mPoxt8YDWVBJ+PqJ4y1fkASKQTdphuoEtpqCx4mzGAL15U/AkA6BiVcJhlea+"
+
"PDIZXWgKwQTCd5Oeto5iF6rbxbVC31e3SksVx684jp7VyyqtJr+ib60GlHeinYbCB9PCp2N4B9AkEAtJLTbRzNzUN"
+
"rL2B1J3lzL7DqY+CADFPw2DDvOuJyHtdG9hZnPlL+3ddL5JeUjgJSYfMPCnNrnPph/OEspHmikwJAIcOTlQmik37h"
+
"BsaoRTEoJG4X5NrqGx5apjXwkIbf4jjfMP4TdyZBX73yjWKNbPdXLd7Aixoqam5CP0nUg3uWKg=="
;
public
static
final
byte
[]
privateKeyByte
=
Base64
.
decode
(
privateKey
);
}
performance-web/src/main/java/com/clx/performance/encryption/oldmsl/RSACoder.java
0 → 100644
浏览文件 @
7451ce2b
差异被折叠。
点击展开。
performance-web/src/main/java/com/clx/performance/encryption/oldmsl/SystemCodeEnum.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
encryption
.
oldmsl
;
/**
* 业务系统编码枚举类
* @author xujianke
* @date 2017年4月21日
* @description
*/
public
enum
SystemCodeEnum
{
USER_SERVICE
(
1
,
"用户服务"
),
ORDER_SERVICE
(
2
,
"订单服务"
),
PAYMENT_SERVICE
(
3
,
"支付服务"
),
MESSAGE_SERVICE
(
4
,
"消息服务"
),
MANAGE_SERVICE
(
5
,
"管理服务"
),
MERCHANT_SERVICE
(
6
,
"商户服务"
),
TRADE_SERVICE
(
7
,
"交易平台服务"
),
AUCTION_SERVICE
(
8
,
"竞拍服务"
),
PERFORMANCE_SERVICE
(
9
,
"履约服务"
);
// 成员变量
private
String
msg
;
private
int
code
;
// 构造方法
private
SystemCodeEnum
(
int
code
,
String
msg
)
{
this
.
msg
=
msg
;
this
.
code
=
code
;
}
// 普通方法
public
static
String
getMsg
(
int
code
)
{
for
(
SystemCodeEnum
c
:
SystemCodeEnum
.
values
())
{
if
(
c
.
getCode
()
==
code
)
{
return
c
.
msg
;
}
}
return
null
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
}
performance-web/src/main/java/com/clx/performance/enums/HttpEnum.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
HttpEnum
{
PERFORMANCE_PAY_CLX_PAYMENT
(
10000
,
"履约服务向老马上来发起钱包转账"
,
"/payment-service/payUserWalletTransfer"
),
;
private
final
int
code
;
private
final
String
mark
;
private
final
String
url
;
public
static
HttpEnum
getMsg
(
int
code
)
{
for
(
HttpEnum
httpEnum
:
HttpEnum
.
values
())
{
if
(
httpEnum
.
getCode
()
==
code
)
{
return
httpEnum
;
}
}
return
null
;
}
}
performance-web/src/main/java/com/clx/performance/enums/PayUnitTypeEnum.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
enums
;
public
enum
PayUnitTypeEnum
{
FREEZE
(
100
,
"冻结"
),
FREEZE_OWNER_DEPOSIT
(
101
,
"冻结货主保证金"
),
FREEZE_FREIGHT
(
102
,
"冻结货主运费"
),
FREEZE_DRIVER_DEPOSIT
(
103
,
"冻结司机保证金"
),
FREEZE_INSURANCE_FEE
(
104
,
"冻结货物担保"
),
FREEZE_PLATFORM_FEE
(
105
,
"冻结平台信息费"
),
FREEZE_WITHDRAW_DEPOSIT
(
106
,
"冻结提现金额"
),
FREEZE_SALE
(
107
,
"冻结货款"
),
FREEZE_SETTLEMENT_FEE
(
108
,
"冻结提现手续费"
),
FREEZE_SETTLEMENT_MER
(
109
,
"冻结子钱包提现金额"
),
FREEZE_SETTLEMENT_MER_FEE
(
110
,
"冻结提现手续费"
),
FREEZE_TRANSFER_WITHDRAW_DEPOSIT
(
111
,
"冻结转账提现金额"
),
FREEZE_TRANSFER_DEPOSIT
(
112
,
"转账收入"
),
FREEZE_TRADE_DEPOSIT
(
113
,
"冻结交易平台保证金"
),
FREEZE_TRADE_PAYMENT_GOODS
(
114
,
"冻结交易平台货款"
),
FREEZE_OIL_DRIVER_TO_MERCHANT
(
115
,
"冻结司机余额给商户用于加油"
),
FREEZE_AUCTION_DEPOSIT
(
116
,
"冻结竞拍保证金"
),
FREEZE_GROUP_SIGN_UP_DEPOSIT
(
117
,
"集采集销的保证金冻结"
),
FREEZE_WALLET_CARD
(
118
,
"消费卡消费到钱包冻结"
),
FREEZE_MERCHANT_CARD
(
119
,
"消费卡消费到商户冻结"
),
FREEZE_ORDER_CHILD
(
120
,
"冻结提现金额-运费自动提现"
),
UNFREEZE
(
200
,
"解冻"
),
UNFREEZE_OWNER_DEPOSIT
(
201
,
"解冻货主保证金"
),
UNFREEZE_FREIGHT
(
202
,
"解冻货主运费"
),
UNFREEZE_DRIVER_DEPOSIT
(
203
,
"解冻司机保证金"
),
UNFREEZE_INSURANCE_FEE
(
204
,
"解冻货物担保"
),
UNFREEZE_PLATFORM_FEE
(
205
,
"解冻平台信息费"
),
UNFREEZE_WITHDRAW_DEPOSIT
(
206
,
"解冻提现金额"
),
UNFREEZE_SALE
(
207
,
"解冻货款"
),
UNFREEZE_SETTLEMENT_FEE
(
208
,
"解冻提现手续费"
),
UNFREEZE_SETTLEMENT_MER
(
209
,
"解冻子钱包提现金额"
),
UNFREEZE_SETTLEMENT_MER_FEE
(
210
,
"解冻提现手续费"
),
UNFREEZE_TRANSFER_DEPOSIT
(
212
,
"解冻转账收入"
),
UNFREEZE_TRADE_DEPOSIT
(
213
,
"解冻交易平台保证金"
),
UNFREEZE_TRADE_PAYMENT_GOODS
(
214
,
"解冻交易平台货款"
),
UNFREEZE_OIL_DRIVER_TO_MERCHANT
(
215
,
"解冻司机余额给商户用于加油"
),
UNFREEZE_AUCTION_DEPOSIT
(
216
,
"解冻竞拍保证金"
),
UNFREEZE_FREEZE_GROUP_SIGN_UP_DEPOSIT
(
217
,
"集采集销的保证金冻结解冻"
),
UNFREEZE_WALLET_CARD
(
218
,
"消费卡消费到钱包解冻"
),
UNFREEZE_MERCHANT_CARD
(
219
,
"消费卡消费到商户解冻"
),
FREEZE_PAY
(
300
,
"从冻结支付"
),
FREEZE_PAY_OWNER_DEPOSIT
(
301
,
"支付货主保证金"
),
FREEZE_PAY_FREIGHT
(
302
,
"支付货物运费"
),
FREEZE_PAY_DRIVER_DEPOSIT
(
303
,
"支付司机保证金"
),
FREEZE_PAY_INSURANCE_FEE
(
304
,
"支付货物担保"
),
FREEZE_PAY_PLATFORM_FEE
(
305
,
"支付平台信息费"
),
FREEZE_PAY_WITHDRAW_DEPOSIT
(
306
,
"支付提现金额"
),
FREEZE_PAY_SALE
(
307
,
"支付货款"
),
FREEZE_PAY_SETTLEMENT_FEE
(
308
,
"支付提现手续费"
),
FREEZE_PAY_SETTLEMENT_MER
(
309
,
"支付子钱包提现金额"
),
FREEZE_PAY_SETTLEMENT_MER_FEE
(
310
,
"支付子钱包手续费"
),
FREEZE_PAY_TRANSFER_WITHDRAW_DEPOSIT
(
311
,
"支付余额转账提现金额"
),
FREEZE_PAY_TRANSFER_DEPOSIT
(
312
,
"支付转账收入"
),
FREEZE_PAY_TRADE_DEPOSIT
(
313
,
"保证金冻结"
),
FREEZE_PAY_TRADE_PAYMENT_GOODS
(
314
,
"货款扣款"
),
FREEZE_PAY_OIL_DRIVER_TO_MERCHANT
(
315
,
"消费"
),
FREEZE_PAY_AUCTION_DEPOSIT
(
316
,
"竞拍保证金冻结"
),
FREEZE_PAY_GROUP_SIGN_UP_DEPOSIT
(
317
,
"集采集销的保证金冻结"
),
FREEZE_PAY_WALLET_CARD
(
318
,
"消费"
),
FREEZE_PAY_MERCHANT_CARD
(
319
,
"消费"
),
FREEZE_PAY_ORDER_CHILD
(
320
,
"自动支付提现金额"
),
FREEZE_MODIFY
(
400
,
"修正冻结资金"
),
FREEZE_MODIFY_OWNER_DEPOSIT
(
401
,
"修正货主保证金"
),
FREEZE_MODIFY_FREIGHT
(
402
,
"修正货主运费"
),
FREEZE_MODIFY_DRIVER_DEPOSIT
(
403
,
"修正司机保证金"
),
FREEZE_MODIFY_INSURANCE_FEE
(
404
,
"修正货物担保"
),
FREEZE_MODIFY_PLATFORM_FEE
(
405
,
"修正平台信息费"
),
FREEZE_MODIFY_WITHDRAW_DEPOSIT
(
406
,
"修正提现金额"
),
FREEZE_MODIFY_SALE
(
407
,
"修正货款"
),
FREEZE_MODIFY_SETTLEMENT_FEE
(
408
,
"修正提现手续费"
),
FREEZE_MODIFY_SETTLEMENT_MER
(
409
,
"修正子钱包提现金额"
),
FREEZE_MODIFY_SETTLEMENT_MER_FEE
(
410
,
"修正子钱包提现手续费"
),
FREEZE_MODIFY_TRANSFER_DEPOSIT
(
412
,
"修正转账收入"
),
FREEZE_MODIFY_TRADE_PAYMENT_GOODS
(
414
,
"修正交易平台冻结货款"
),
RESIDUE_PAY
(
500
,
"余额支付"
),
RESIDUE_ACTIVITY_RETURN
(
502
,
"余额活动返现"
),
RESIDUE_ACTIVITY_RETURN_CARD
(
503
,
"余额活动返现到消费卡"
),
/** 支付违约金 */
RESIDUE_PAY_DEFAULT
(
501
,
"支付违约金"
),
CARD_PAY
(
600
,
"消费卡支付到钱包"
),
CARD_PAY_WALLET
(
601
,
"消费卡支付到子钱包"
),
SYSTEM_PAY
(
701
,
"系统支付到用户余额"
),
SYSTEM_PAY_CARD
(
702
,
"系统支付到用户消费卡"
),
SYSTEM_ACTIVITY_PAY
(
703
,
"系统活动返现到余额"
),
;
// 成员变量
private
String
msg
;
private
int
code
;
// 构造方法
private
PayUnitTypeEnum
(
int
code
,
String
msg
)
{
this
.
msg
=
msg
;
this
.
code
=
code
;
}
// 普通方法
public
static
String
getMsg
(
int
code
)
{
for
(
PayUnitTypeEnum
c
:
PayUnitTypeEnum
.
values
())
{
if
(
c
.
getCode
()
==
code
)
{
return
c
.
msg
;
}
}
return
null
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
}
performance-web/src/main/java/com/clx/performance/extranal/thirdPayment/PaymentService.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
extranal
.
thirdPayment
;
import
com.msl.common.result.Result
;
public
interface
PaymentService
{
Result
paymentWallet
(
Integer
fromUser
,
Integer
toUser
,
Integer
figure
,
String
tradeNo
,
Integer
id
);
}
performance-web/src/main/java/com/clx/performance/extranal/thirdPayment/impl/PaymentServiceImpl.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
extranal
.
thirdPayment
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.clx.performance.constant.ActionConstants
;
import
com.clx.performance.dao.ThirdPartRequestLogDao
;
import
com.clx.performance.encryption.oldmsl.PayEncryptTools
;
import
com.clx.performance.encryption.oldmsl.PrivateKeyConfig
;
import
com.clx.performance.encryption.oldmsl.SystemCodeEnum
;
import
com.clx.performance.enums.PayUnitTypeEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.ThirdRequestTypeEnum
;
import
com.clx.performance.extranal.thirdPayment.PaymentService
;
import
com.clx.performance.model.ThirdPartRequestLog
;
import
com.clx.performance.param.pc.payment.PayParam
;
import
com.clx.performance.param.pc.payment.PayUnitDTO
;
import
com.clx.performance.param.pc.payment.PayUserDTO
;
import
com.clx.performance.service.ThirdPartRequestLogService
;
import
com.msl.common.dto.HttpDTO
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.result.Result
;
import
com.msl.common.utils.EncryptUtil
;
import
com.msl.common.utils.HttpUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.security.GeneralSecurityException
;
import
java.util.UUID
;
import
static
com
.
clx
.
performance
.
enums
.
HttpEnum
.
PERFORMANCE_PAY_CLX_PAYMENT
;
@Service
@Slf4j
@AllArgsConstructor
public
class
PaymentServiceImpl
implements
PaymentService
{
@Autowired
ThirdPartRequestLogDao
thirdPartRequestLogDao
;
@Autowired
ThirdPartRequestLogService
thirdPartRequestLogService
;
public
static
final
String
TRANSPORT_USER
=
"13403503399"
;
public
static
final
String
TRANSPORT_KEY
=
"9Y1N5AUP8N2TI359"
;
// 请求地址
public
static
final
String
OLD_CLX_HOST
=
"https://api.clxkj.cn:8088"
;
//回调地址
public
static
final
String
NOTIFY_HOST
=
"/msl-performance/payment/notify/userPayNotify"
;
public
static
final
String
NOTIFY_URL
=
"https://gateway.testclx.cn"
;
@Override
public
Result
paymentWallet
(
Integer
fromUser
,
Integer
toUser
,
Integer
figure
,
String
tradeNo
,
Integer
id
)
{
PayParam
payDTO
=
new
PayParam
();
payDTO
.
setPwd
(
"NOPASSWORD"
);
payDTO
.
setFrom
(
fromUser
);
payDTO
.
setTo
(
toUser
);
payDTO
.
setTradeNo
(
tradeNo
);
// 流水号
payDTO
.
setTradeId
(
id
);
//唯一id
payDTO
.
setFigureFeeCode
(
10000
);
//默认到平台
payDTO
.
setFigure
(
figure
);
return
userPay
(
payDTO
);
}
/**
* 组装余额支付报文并发送请求
*/
public
Result
<
Object
>
userPay
(
PayParam
payDTO
)
{
PayUnitDTO
payUnitDTO
=
new
PayUnitDTO
();
payUnitDTO
.
setId
(
payDTO
.
getTradeId
().
toString
());
payUnitDTO
.
setFrom
(
payDTO
.
getFrom
());
payUnitDTO
.
setTo
(
payDTO
.
getTo
());
payUnitDTO
.
setFigure
(
payDTO
.
getFigure
());
payUnitDTO
.
setType
(
PayUnitTypeEnum
.
RESIDUE_PAY
.
getCode
());
payUnitDTO
.
setTimestamp
(
System
.
currentTimeMillis
()
/
1000
);
payUnitDTO
.
setRemark
(
"承运支付钱包转账"
);
PayEncryptTools
.
sign
(
payUnitDTO
,
PrivateKeyConfig
.
privateKeyByte
);
// 用业务系统自己的私钥
PayUserDTO
payUserDTO
=
new
PayUserDTO
();
payUserDTO
.
setPwd
(
payDTO
.
getPwd
());
payUserDTO
.
setSystem
(
SystemCodeEnum
.
PERFORMANCE_SERVICE
.
getCode
());
payUserDTO
.
setUserCode
(
payDTO
.
getFrom
());
payUserDTO
.
setOrderNo
(
payDTO
.
getTradeNo
());
payUserDTO
.
setUuid
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
payUserDTO
.
setNotifyUrl
(
NOTIFY_HOST
+
NOTIFY_URL
);
// payUserDTO.setFee(payDTO.getFigureFee());
// payUserDTO.setPayUnitDTO(payUnitDTO);
payUserDTO
.
setFeeToUserCode
(
payDTO
.
getFigureFeeCode
());
log
.
info
(
"发起支付请求日志 {}"
,
payUserDTO
);
Result
<
Object
>
notify
=
(
Result
<
Object
>)
postRequest
(
OLD_CLX_HOST
+
PERFORMANCE_PAY_CLX_PAYMENT
.
getUrl
(),
JSON
.
toJSONString
(
payUserDTO
));
log
.
info
(
"支付返回日志 {}"
,
notify
);
//Result<Object> notify = feignPaymentService.payUserMQ(payUserDTO);
// if (notify == null) {
// //FEGIN返回null
// throw new ServiceSystemException(ResultCodeEnum.FEGIN_NULL);
// }
// if (notify.getCode() != 0) {
// }
return
notify
;
}
/**
* post请求
*/
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
Result
<?>
postRequest
(
String
requestUrl
,
String
param
)
{
ThirdPartRequestLog
log
=
ThirdPartRequestLog
.
builder
()
.
requestId
(
UUID
.
randomUUID
().
toString
())
.
appNo
(
Long
.
valueOf
(
10000
))
//应用编号 10000 默认诚联信
.
requestType
(
ThirdRequestTypeEnum
.
SEND
.
getCode
())
.
action
(
ActionConstants
.
CLX_PAYMENT_PAY
)
.
url
(
requestUrl
)
.
requestContent
(
param
)
.
status
(
0
)
//状态: 0-请求中,1-成功,2-失败
.
build
();
thirdPartRequestLogDao
.
saveEntity
(
log
);
return
encryptPost
(
requestUrl
,
param
,
log
.
getId
());
}
private
Result
<?>
encryptPost
(
String
url
,
String
param
,
Integer
httpLogId
)
{
try
{
return
HttpUtil
.
post
(
url
,
null
,
EncryptUtil
.
buildDTO
(
TRANSPORT_USER
,
param
,
TRANSPORT_KEY
,
System
.
currentTimeMillis
()))
.
map
(
r
->
JSON
.
parseObject
(
r
,
new
TypeReference
<
HttpDTO
>()
{
}))
.
peek
(
dto
->
log
.
info
(
"http请求返回------dto->{}"
,
dto
))
.
mapTry
(
dto
->
EncryptUtil
.
decrypt
(
dto
.
getData
(),
TRANSPORT_KEY
))
.
map
(
this
::
covertResult
)
.
peek
(
result
->
thirdPartRequestLogService
.
updateResult
(
httpLogId
,
result
))
.
filter
(
Result:
:
succeed
)
.
orElseThrow
();
}
catch
(
GeneralSecurityException
e
)
{
log
.
error
(
"解密失败"
,
e
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"http 请求异常"
);
}
}
private
<
T
>
Result
<?>
covertResult
(
String
result
)
{
return
JSON
.
parseObject
(
result
,
Result
.
class
);
}
}
performance-web/src/main/java/com/clx/performance/mapper/ThirdPartRequestLogMapper.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.clx.performance.model.ThirdPartRequestLog
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
ThirdPartRequestLogMapper
extends
BaseMapper
<
ThirdPartRequestLog
>
{
}
performance-web/src/main/java/com/clx/performance/model/ThirdPartRequestLog.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.msl.common.config.KeyColumn
;
import
com.msl.common.model.HasKey
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.*
;
import
lombok.experimental.Accessors
;
import
java.time.LocalDateTime
;
@Getter
@Setter
@Accessors
(
chain
=
true
)
@TableName
(
"third_part_request_log"
)
@AllArgsConstructor
@NoArgsConstructor
@Builder
public
class
ThirdPartRequestLog
implements
HasKey
<
Integer
>
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"ID"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"请求id"
)
private
String
requestId
;
@ApiModelProperty
(
value
=
"应用编号"
)
private
Long
appNo
;
@ApiModelProperty
(
value
=
"请求类型: 1-发送请求;2-接收请求"
)
private
Integer
requestType
;
@ApiModelProperty
(
value
=
"操作类型"
)
private
String
action
;
@ApiModelProperty
(
value
=
"请求地址"
)
private
String
url
;
@ApiModelProperty
(
value
=
"请求参数(JSON格式)"
)
private
String
requestContent
;
@ApiModelProperty
(
value
=
"返回数据(JSON格式)"
)
private
String
responseContent
;
@ApiModelProperty
(
value
=
"返回状态码"
)
private
Integer
statusCode
;
@ApiModelProperty
(
value
=
"状态: 0-请求中,1-成功,2-失败"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"重试次数"
)
private
Integer
retryTimes
;
@ApiModelProperty
(
value
=
"其他字段"
)
private
String
otherFields
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
value
=
"修改时间"
)
private
LocalDateTime
modifiedTime
;
@KeyColumn
(
"id"
)
@Override
public
Integer
gainKey
()
{
return
id
;
}
}
performance-web/src/main/java/com/clx/performance/service/TempService.java
浏览文件 @
7451ce2b
...
@@ -6,4 +6,6 @@ public interface TempService {
...
@@ -6,4 +6,6 @@ public interface TempService {
void
updateBreakContractDriverSettlementFinish
(
String
settlementNo
);
void
updateBreakContractDriverSettlementFinish
(
String
settlementNo
);
void
paymentTest
(
String
fromUser
,
String
toUser
,
String
figure
);
}
}
performance-web/src/main/java/com/clx/performance/service/ThirdPartRequestLogService.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
service
;
import
com.clx.performance.model.ThirdPartRequestLog
;
import
com.msl.common.base.Optional
;
import
com.msl.common.result.Result
;
public
interface
ThirdPartRequestLogService
{
/**
* 保存第三方接口调用记录
*
* @param log
*/
void
save
(
ThirdPartRequestLog
log
);
/**
* 修改第三方接口返回值
*
* @param logId
* @param result
*/
void
updateResult
(
Integer
logId
,
Result
<?>
result
);
/**
* 修改重试次数
*
* @param logId
* @param retryTimes
*/
void
updateLogRetryTimes
(
Integer
logId
,
Integer
retryTimes
);
/**
* 根据id 查询
*/
Optional
<
ThirdPartRequestLog
>
getById
(
Integer
id
);
}
performance-web/src/main/java/com/clx/performance/service/impl/TempServiceImpl.java
浏览文件 @
7451ce2b
...
@@ -3,6 +3,7 @@ package com.clx.performance.service.impl;
...
@@ -3,6 +3,7 @@ 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.PerformanceResultEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.extranal.thirdPayment.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
;
import
com.clx.performance.service.settle.SettlementService
;
import
com.clx.performance.service.settle.SettlementService
;
...
@@ -10,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -10,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.UUID
;
@Slf4j
@Slf4j
@Service
@Service
public
class
TempServiceImpl
implements
TempService
{
public
class
TempServiceImpl
implements
TempService
{
...
@@ -19,7 +22,8 @@ public class TempServiceImpl implements TempService {
...
@@ -19,7 +22,8 @@ public class TempServiceImpl implements TempService {
@Autowired
@Autowired
private
BreakContractSettlementDriverDao
breakContractSettlementDriverDao
;
private
BreakContractSettlementDriverDao
breakContractSettlementDriverDao
;
@Autowired
private
PaymentService
paymentService
;
@Override
@Override
public
void
updateInvoiceType
(
String
childNo
,
Integer
invoiceType
)
{
public
void
updateInvoiceType
(
String
childNo
,
Integer
invoiceType
)
{
...
@@ -33,4 +37,14 @@ public class TempServiceImpl implements TempService {
...
@@ -33,4 +37,14 @@ public class TempServiceImpl implements TempService {
settlement
.
setSettleStatus
(
BreakContractSettlementDriverEnum
.
SettleStatus
.
YES
.
getCode
());
settlement
.
setSettleStatus
(
BreakContractSettlementDriverEnum
.
SettleStatus
.
YES
.
getCode
());
}
}
@Override
public
void
paymentTest
(
String
fromUser
,
String
toUser
,
String
figure
)
{
paymentService
.
paymentWallet
(
Integer
.
valueOf
(
fromUser
),
Integer
.
valueOf
(
toUser
),
Integer
.
valueOf
(
figure
),
UUID
.
randomUUID
().
toString
(),
999
);
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/ThirdPartRequestLogServiceImpl.java
0 → 100644
浏览文件 @
7451ce2b
package
com
.
clx
.
performance
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.clx.performance.dao.ThirdPartRequestLogDao
;
import
com.clx.performance.enums.ThirdRequestStatusEnum
;
import
com.clx.performance.model.ThirdPartRequestLog
;
import
com.clx.performance.service.ThirdPartRequestLogService
;
import
com.msl.common.base.Optional
;
import
com.msl.common.result.Result
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
ThirdPartRequestLogServiceImpl
implements
ThirdPartRequestLogService
{
@Autowired
ThirdPartRequestLogDao
thirdPartRequestLogDao
;
@Override
public
void
save
(
ThirdPartRequestLog
log
)
{
thirdPartRequestLogDao
.
saveEntity
(
log
);
}
@Override
public
void
updateResult
(
Integer
logId
,
Result
<?>
result
)
{
thirdPartRequestLogDao
.
updateEntityByKey
(
new
ThirdPartRequestLog
()
.
setId
(
logId
)
.
setResponseContent
(
JSON
.
toJSONString
(
result
))
.
setStatusCode
(
result
.
getCode
())
.
setStatus
(
result
.
succeed
()
?
ThirdRequestStatusEnum
.
SUCCESS
.
getCode
()
:
ThirdRequestStatusEnum
.
FAIL
.
getCode
()));
}
/**
* 修改重试次数
*
* @param logId
* @param retryTimes
*/
@Override
public
void
updateLogRetryTimes
(
Integer
logId
,
Integer
retryTimes
)
{
thirdPartRequestLogDao
.
updateLogRetryTimes
(
logId
,
retryTimes
);
}
/**
* 根据id 查询
*
* @param id
*/
@Override
public
Optional
<
ThirdPartRequestLog
>
getById
(
Integer
id
)
{
return
thirdPartRequestLogDao
.
getEntityByKey
(
id
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论