Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-platform-enterprise
Commits
518485c7
Commit
518485c7
authored
Apr 28, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信套餐包续订定时器添加:订购逻辑
parent
acc5e9ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
BillingAccountApiServiceImpl.java
...rise/service/outer/impl/BillingAccountApiServiceImpl.java
+10
-10
No files found.
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/BillingAccountApiServiceImpl.java
View file @
518485c7
...
...
@@ -50,8 +50,8 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
private
UserApiService
userApiService
;
@Autowired
private
Config
config
;
//
@Autowired
//
private BillingOrderApiService billingOrderApiService;
@Autowired
private
BillingOrderApiService
billingOrderApiService
;
@Override
public
ServiceResponse
<
BillingAccountDTO
>
getByEnterpriseId
(
Integer
enterpriseId
)
{
...
...
@@ -165,9 +165,9 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
Integer
preNumber
=
(
Integer
)
resultMap
.
get
(
AutoRechargeRedisConstant
.
PRE_NUMBER_MAP_KEY
);
if
(
preNumber
>
getSmsBalanceNumber
(
enterpriseId
))
{
//进行自动扣款
account
.
setAccountBalance
(
account
.
getAccountBalance
()
-
money
);
billingAccountService
.
updateBillingAccount
(
account
);
//生成订单
//
account.setAccountBalance(account.getAccountBalance() - money);
//
billingAccountService.updateBillingAccount(account);
//生成订单
支付
BillingOrderDTO
orderDTO
=
new
BillingOrderDTO
();
orderDTO
.
setEnterpriseId
(
enterpriseId
);
orderDTO
.
setOrderContent
(
smsPackageDTO
.
getSmsPackageName
());
...
...
@@ -175,20 +175,20 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
orderDTO
.
setTotalFeePaid
(
money
);
orderDTO
.
setPayType
(
PayTypeEnum
.
BALANCE_PAY
.
getCode
());
SmsPackageOrderItemDTO
itemDTO
=
new
SmsPackageOrderItemDTO
();
itemDTO
.
setBuyCount
(
smsPackageDTO
.
getItemCount
()
);
itemDTO
.
setBuyCount
(
1
);
itemDTO
.
setCode
(
smsPackageDTO
.
getSmsPackageCode
());
itemDTO
.
setCost
(
smsPackageDTO
.
getItemFee
());
// itemDTO.setPackageLength(qo.getPackageHours()
);
itemDTO
.
setPackageLength
(
12
);
itemDTO
.
setSmsAmount
(
smsPackageDTO
.
getItemCount
());
for
(
PackageHoursEnum
packageHoursEnum
:
PackageHoursEnum
.
values
()){
if
(
packageHoursEnum
.
getCode
()
==
itemDTO
.
getPackageLength
()){
itemDTO
.
setPackageHours
(
packageHoursEnum
.
getMessage
());
}
}
// ServiceResponse<Integer> orderResponse = this.
billingOrderApiService.saveSmsOrderBuyNow(orderDTO, itemDTO);
ServiceResponse
<
Integer
>
orderResponse
=
billingOrderApiService
.
saveSmsOrderBuyNow
(
orderDTO
,
itemDTO
);
//订购短信套餐包
// this.
billingOrderApiService.
//
paySmsPackageOrder(enterpriseId, orderResponse.getResult(), PayTypeEnum.BALANCE_PAY.getCode(), null);
billingOrderApiService
.
paySmsPackageOrder
(
enterpriseId
,
orderResponse
.
getResult
(),
PayTypeEnum
.
BALANCE_PAY
.
getCode
(),
null
);
}
}
}
else
{
...
...
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