Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
payment
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
payment
Commits
fbdd250f
提交
fbdd250f
authored
6月 01, 2023
作者:
张小凤
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RepoCash
上级
65f985b9
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
110 行增加
和
26 行删除
+110
-26
ResultEnum.java
src/main/java/com/mmc/payment/common/ResultEnum.java
+10
-9
RepoCashController.java
...n/java/com/mmc/payment/controller/RepoCashController.java
+4
-6
OrderVcuDO.java
src/main/java/com/mmc/payment/entity/OrderVcuDO.java
+42
-0
RepoCashDO.java
src/main/java/com/mmc/payment/entity/RepoCashDO.java
+2
-0
RepoCashServiceImpl.java
...ava/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
+44
-7
RepoCashService.java
src/main/java/com/mmc/payment/service/RepoCashService.java
+1
-1
application-local.yml
src/main/resources/application-local.yml
+4
-0
RepoCashDao.xml
src/main/resources/mapper/RepoCashDao.xml
+3
-3
没有找到文件。
src/main/java/com/mmc/payment/common/ResultEnum.java
浏览文件 @
fbdd250f
...
...
@@ -381,14 +381,14 @@ public enum ResultEnum implements BaseErrorInfoInterface {
SCORE_ERROR
(
"40177"
,
"您输入的积分数量有误,请重新输入!"
),
PLEASE_FILL_IN_THE_CONTRACT_TEMPLATE_FIRST
(
"40178"
,
"请先填充合同模板!"
),
SCORE_NOT_GIVE_MYSELF
(
"40179"
,
"积分不能转赠给本人,请重新操作"
),
SCORE_NOT_GIVE_MYSELF
(
"40179"
,
"积分不能转赠给本人,请重新操作"
),
ALREADY_FINISH_ENT_AUTH_ERROR
(
"2000"
,
"助力已完成!"
),
SYSTEM_ERROR
(
"2001"
,
"系统错误,请稍后重试"
)
,
RULE_ERROR
(
"2002"
,
"当前兑换比例已失效,请刷新后重试"
),
SYSTEM_ERROR
(
"2001"
,
"系统错误,请稍后重试"
)
,
RULE_ERROR
(
"2002"
,
"当前兑换比例已失效,请刷新后重试"
),
COUNT_LIMIT_ERROR
(
"2003"
,
"参与次数已达上线"
),
ALREADY_ENT_AUTH_ERROR
(
"2004"
,
"助力失败,您已完成企业认证!"
),
ALREADY_REAL_NAME_AUTH_ERROR
(
"2005"
,
"助力失败,您已完成实名认证!"
),
ALREADY_ENT_AUTH_ERROR
(
"2004"
,
"助力失败,您已完成企业认证!"
),
ALREADY_REAL_NAME_AUTH_ERROR
(
"2005"
,
"助力失败,您已完成实名认证!"
),
PARTICIPATE_BUT_NOT_AUTH_ERROR
(
"2006"
,
"待完成授权或认证"
),
ALREADY_HELP_ERROR
(
"2007"
,
"已助力"
),
ALREADY_STOP_ERROR
(
"2008"
,
"活动已下线"
),
...
...
@@ -396,10 +396,11 @@ public enum ResultEnum implements BaseErrorInfoInterface {
ALREADY_BINDING_ERROR
(
"2010"
,
"优惠券已被绑定"
),
ALREADY_DIVIDE_ERROR
(
"2011"
,
"订单已分成"
),
DIVIDE_OBJ_NOT_EXIST
(
"2012"
,
"先点击确认添加分成对象"
),
THE_REQUEST_IS_NOT_AUTHENTICATED
(
"2013"
,
"请求未经过鉴权"
),
THE_TOKEN_IS_INVALID
(
"2014"
,
"token失效"
),
FAILED_TO_CHARGE_MONEY
(
"2015"
,
"只有后台账号才能给小程序客户端充值"
)
,
NO_WALLET_FUNCTION
(
"2016"
,
"后台账号无钱包功能"
)
;
THE_REQUEST_IS_NOT_AUTHENTICATED
(
"2013"
,
"请求未经过鉴权"
),
THE_TOKEN_IS_INVALID
(
"2014"
,
"token失效"
),
FAILED_TO_CHARGE_MONEY
(
"2015"
,
"只有后台账号才能给小程序客户端充值"
),
NO_WALLET_FUNCTION
(
"2016"
,
"后台账号无钱包功能"
),
THE_ORDER_HAS_BEEN_PAID
(
"2017"
,
"订单已支付/订单编号错误"
);
/**
* 错误码
...
...
src/main/java/com/mmc/payment/controller/RepoCashController.java
浏览文件 @
fbdd250f
...
...
@@ -80,11 +80,11 @@ public class RepoCashController extends BaseController {
return
repoCashService
.
walletUsers
(
this
.
getCurrentAccount
(
request
),
walletUsersVO
);
}
@ApiIgnore
@ApiOperation
(
value
=
"
web-
订单支付"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
PayCashResultDTO
.
class
)})
@ApiOperation
(
value
=
"
租赁——
订单支付"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"orderPayment"
)
public
PayCashResultDTO
orderPayment
(
HttpServletRequest
request
,
@RequestParam
String
orderNo
)
{
public
ResultBody
orderPayment
(
HttpServletRequest
request
,
@RequestParam
String
orderNo
)
{
return
repoCashService
.
orderPayment
(
this
.
getCurrentAccount
(
request
),
orderNo
);
}
...
...
@@ -101,8 +101,6 @@ public class RepoCashController extends BaseController {
@GetMapping
(
"RemainingBalance"
)
public
BigDecimal
RemainingBalance
(
@RequestParam
(
value
=
"repoAccountId"
,
required
=
true
)
Integer
repoAccountId
)
{
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
"R2023052814538712"
);
return
repoCashService
.
RemainingBalance
(
repoAccountId
);
}
...
...
src/main/java/com/mmc/payment/entity/OrderVcuDO.java
0 → 100644
浏览文件 @
fbdd250f
package
com
.
mmc
.
payment
.
entity
;
import
com.mmc.payment.model.dto.OrderVcuDTO
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.Serializable
;
import
java.util.Arrays
;
import
java.util.Date
;
/**
* @Author small
* @Date 2023/6/1 15:55
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
OrderVcuDO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
5685858931224789256L
;
private
Integer
id
;
private
Integer
orderInfoId
;
private
Integer
orderRefundId
;
private
Integer
vcuType
;
private
Integer
vcuSatus
;
private
String
imgs
;
private
String
videoUrl
;
private
String
remark
;
private
Date
createTime
;
public
OrderVcuDTO
buildOrderVcuDTO
()
{
return
OrderVcuDTO
.
builder
().
id
(
this
.
id
).
orderInfoId
(
this
.
orderInfoId
).
vcuType
(
this
.
vcuType
)
.
vcuSatus
(
this
.
vcuSatus
)
.
imgs
(
StringUtils
.
isBlank
(
this
.
imgs
)
?
null
:
Arrays
.
asList
(
this
.
imgs
.
split
(
","
)))
.
remark
(
this
.
remark
)
.
videoUrl
(
this
.
videoUrl
).
build
();
}
}
src/main/java/com/mmc/payment/entity/RepoCashDO.java
浏览文件 @
fbdd250f
...
...
@@ -52,6 +52,8 @@ public class RepoCashDO implements Serializable {
private
String
type
;
private
BigDecimal
cashFreeze
;
private
BigDecimal
shouldPay
;
private
BigDecimal
actualPay
;
public
RepoCashDTO
buildRepoCashDTO
()
{
return
RepoCashDTO
.
builder
().
id
(
this
.
id
).
repoAccountId
(
this
.
repoAccountId
).
uid
(
this
.
uid
)
...
...
src/main/java/com/mmc/payment/service/Impl/RepoCashServiceImpl.java
浏览文件 @
fbdd250f
...
...
@@ -22,9 +22,13 @@ import io.jsonwebtoken.lang.Collections;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestTemplate
;
import
java.math.BigDecimal
;
...
...
@@ -59,6 +63,9 @@ public class RepoCashServiceImpl implements RepoCashService {
@Value
(
"${userapp.url}"
)
private
String
userAppUrl
;
@Value
(
"${oms.url}"
)
private
String
omsUrl
;
@Override
public
PageResult
listPageRepoCash
(
BaseAccountDTO
cuser
,
RepoCashQO
param
)
{
int
count
=
repoCashDao
.
countPagePFRepoCash
(
param
);
...
...
@@ -263,16 +270,30 @@ public class RepoCashServiceImpl implements RepoCashService {
}
@Override
public
PayCashResultDTO
orderPayment
(
BaseAccountDTO
currentAccount
,
String
orderNo
)
{
public
ResultBody
orderPayment
(
BaseAccountDTO
currentAccount
,
String
orderNo
)
{
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
orderNo
);
if
(
s
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
THE_ORDER_HAS_BEEN_PAID
);
}
RepoCashDO
repoCashDO
=
JSONObject
.
parseObject
(
s
,
RepoCashDO
.
class
);
repoCashDao
.
orderPayment
(
JSONObject
.
parseObject
(
s
,
RepoCashDO
.
class
));
BigDecimal
actualPay
=
repoCashDO
.
getActualPay
();
BigDecimal
negate
=
new
BigDecimal
(
String
.
valueOf
(
actualPay
)).
negate
();
RepoWalletDO
wallet
=
repoCashDao
.
getRepoWalletInfo
(
currentAccount
.
getUserAccountId
());
if
(
wallet
==
null
)
{
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
BigDecimal
newCashAmt
=
(
wallet
.
getCashAmt
().
add
(
negate
)).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
);
repoCashDO
.
setAmtPaid
(
negate
);
repoCashDO
.
setCashAmt
(
newCashAmt
);
repoCashDao
.
orderPayment
(
repoCashDO
);
repoCashDao
.
updateRepoWalletAmt
(
currentAccount
.
getUserAccountId
(),
negate
);
if
(!
currentAccount
.
getUserAccountId
().
equals
(
currentAccount
.
getUserAccountId
()))
{
return
PayCashResultDTO
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
.
getResultCode
(),
ResultEnum
.
WALLET_NOT_FIND_ERROR
.
getResultMsg
());
return
ResultBody
.
error
(
ResultEnum
.
WALLET_NOT_FIND_ERROR
);
}
return
null
;
orderStatusChanges
(
currentAccount
.
getToken
(),
orderNo
);
return
ResultBody
.
success
();
}
@Override
...
...
@@ -373,13 +394,29 @@ public class RepoCashServiceImpl implements RepoCashService {
* @return
*/
private
List
<
RepoWalletDO
>
getRepoWalletDOS
(
WalletMessageQO
walletMessageQO
)
{
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
"http://localhost:35150/userapp/
back-user/feignListBAccountPage"
ResponseEntity
<
String
>
responseEntity
=
restTemplate
.
postForEntity
(
userAppUrl
+
"
back-user/feignListBAccountPage"
,
walletMessageQO
,
String
.
class
);
String
body
=
responseEntity
.
getBody
();
List
<
RepoWalletDO
>
repoWalletDOS1
=
JSONArray
.
parseArray
(
body
,
RepoWalletDO
.
class
);
return
repoWalletDOS1
;
}
/**
* 立即付款 修改订单编号
*
* @param orderNo
* @return
*/
private
void
orderStatusChanges
(
String
token
,
String
orderNo
)
{
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
"token"
,
token
);
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
formEntity
=
new
HttpEntity
<
MultiValueMap
<
String
,
Object
>>(
headers
);
ResponseEntity
<
String
>
exchange
=
restTemplate
.
exchange
(
omsUrl
+
"RentalOrders/orderStatusChanges?orderNo="
+
orderNo
+
"&tranStatus="
+
200
,
HttpMethod
.
GET
,
formEntity
,
String
.
class
);
System
.
out
.
println
(
exchange
);
}
@Override
public
ResultBody
walletUsers
(
BaseAccountDTO
cuser
,
WalletUsersVO
walletUsersVO
)
{
...
...
src/main/java/com/mmc/payment/service/RepoCashService.java
浏览文件 @
fbdd250f
...
...
@@ -37,7 +37,7 @@ public interface RepoCashService {
BigDecimal
RemainingBalance
(
Integer
uid
);
PayCashResultDTO
orderPayment
(
BaseAccountDTO
currentAccount
,
String
orderNo
);
ResultBody
orderPayment
(
BaseAccountDTO
currentAccount
,
String
orderNo
);
PayCashResultDTO
payCashOrder
(
RepoOrderPayVO
orderPay
);
...
...
src/main/resources/application-local.yml
浏览文件 @
fbdd250f
...
...
@@ -37,4 +37,8 @@ mount:
userapp
:
url
:
http://localhost:35150/userapp/
oms
:
url
:
http://localhost:8077/oms/
src/main/resources/mapper/RepoCashDao.xml
浏览文件 @
fbdd250f
...
...
@@ -192,11 +192,11 @@
insert into repo_cash
(repo_account_id, uid, account_name, order_info_id, order_no, sku_info_id, sku_title,
ware_info_id, ware_no, ware_title, pay_no, pay_method, amt_paid, cash_amt, pay_time, remark,
voucher, refund_no, update_time, update_user, create_time, create_user)
voucher, refund_no, update_time, update_user, create_time, create_user
, cash_type_id
)
values (#{repoAccountId}, #{uid}, #{accountName}, #{orderInfoId}, #{orderNo}, #{skuInfoId}, #{skuTitle},
#{wareInfoId}, #{wareNo}, #{wareTitle}, #{payNo}, #{payMethod}, #{amtPaid}, #{cashAmt},
#{payTime}
,
#{wareInfoId}, #{wareNo}, #{wareTitle}, #{payNo}, #{payMethod}, #{amtPaid}, #{cashAmt},
now()
,
#{remark},
#{voucher}, #{refundNo}, #{updateTime}, #{updateUser},
#{createTime}, #{createUser}
)
#{voucher}, #{refundNo}, #{updateTime}, #{updateUser},
now(), #{createUser}, 2
)
</insert>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论