Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
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
TCM
tcm-system
Commits
d92584e4
Commit
d92584e4
authored
Sep 24, 2024
by
tangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改余额为0的处理,
添加银行卡空指针问题
parent
7f85b6b8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
163 additions
and
17 deletions
+163
-17
FinanceController.java
.../pangding/web/authority/controller/FinanceController.java
+23
-2
FinanceService.java
...va/com/pangding/web/authority/service/FinanceService.java
+2
-0
CompanyMsgServiceImpl.java
...ing/web/authority/service/impl/CompanyMsgServiceImpl.java
+48
-0
CompanyServiceImpl.java
...ngding/web/authority/service/impl/CompanyServiceImpl.java
+5
-5
FinanceServiceImpl.java
...ngding/web/authority/service/impl/FinanceServiceImpl.java
+50
-7
ExamineConfigReqVo.java
...m/pangding/web/authority/vo/reqvo/ExamineConfigReqVo.java
+31
-0
WithdrawalResVo.java
.../com/pangding/web/authority/vo/resvo/WithdrawalResVo.java
+4
-3
No files found.
src/main/java/com/pangding/web/authority/controller/FinanceController.java
View file @
d92584e4
...
...
@@ -73,6 +73,25 @@ public class FinanceController {
return
ResponseResult
.
result
(
capitalFlowListResVo
);
}
/**
* 查询订单列表PageSizeData<CapitalFlowResVo>
*
* @param req
* @return
*/
@RequestMapping
(
value
=
"/findCapitalFlow"
)
public
ResponseResult
<
CapitalFlowResVo
>
findCapitalFlow
(
@RequestBody
CapitalFlowReqVo
req
)
{
CheckerHelper
.
newInstance
()
.
notBlankCheck
(
"id"
,
req
.
getId
())
.
checkException
();
if
(
"10001"
.
equals
(
req
.
getCompanyId
()))
{
req
.
setCompanyId
(
""
);
}
CapitalFlowResVo
capitalFlowResVo
=
financeService
.
findCapitalFlow
(
req
);
return
ResponseResult
.
result
(
capitalFlowResVo
);
}
@RequestMapping
(
value
=
"/findCapitalFlowListGroup"
)
public
ResponseResult
<
List
<
CapitalFlowResVo
>>
findCapitalFlowListGroup
(
@RequestBody
CapitalFlowReqVo
req
)
{
...
...
@@ -121,6 +140,8 @@ public class FinanceController {
.
notBlankCheck
(
"bankId"
,
req
.
getBankId
())
.
notBlankCheck
(
"bankCardCode"
,
req
.
getBankCardCode
())
.
notBlankCheck
(
"orderMoney"
,
req
.
getOrderMoney
())
// .notBlankCheck("createUserId", req.getCreateUserId())
// .notBlankCheck("createUserName", req.getCreateUserName())
.
checkException
();
return
financeService
.
applyWithdrawal
(
req
);
}
...
...
@@ -161,13 +182,13 @@ public class FinanceController {
// .notBlankCheck("endDate", req.getEndDate())
// .checkException();
Date
now
=
DateHelper
.
getDateTime
(
DateHelper
.
toDay
(
DateHelper
.
getDateTime
(
getCurDate
())));
if
(!
StringHelper
.
isEmpty
(
req
.
getStartDate
()))
{
if
(!
StringHelper
.
isEmpty
(
req
.
getStartDate
()))
{
Date
start
=
DateHelper
.
getDateTime
(
DateHelper
.
toDay
(
DateHelper
.
getDateTime
(
req
.
getStartDate
())));
if
(
DateHelper
.
compare
(
start
,
now
)
==
0
)
{
req
.
setStartDate
(
DateUtil
.
getNextDateStr
(
req
.
getStartDate
()));
}
}
if
(!
StringHelper
.
isEmpty
(
req
.
getEndDate
()))
{
if
(!
StringHelper
.
isEmpty
(
req
.
getEndDate
()))
{
Date
end
=
DateHelper
.
getDateTime
(
DateHelper
.
toDay
(
DateHelper
.
getDateTime
(
req
.
getEndDate
())));
if
(
DateHelper
.
compare
(
end
,
now
)
==
0
)
{
req
.
setEndDate
(
DateUtil
.
getBeforDateStr
(
req
.
getEndDate
()));
...
...
src/main/java/com/pangding/web/authority/service/FinanceService.java
View file @
d92584e4
...
...
@@ -18,6 +18,8 @@ import java.util.List;
*/
public
interface
FinanceService
{
CapitalFlowResVo
findCapitalFlow
(
CapitalFlowReqVo
req
);
WithdrawalResVo
withdrawal
(
WithdrawalReqVo
reqVo
);
CapitalFlowListResVo
findCapitalFlowList
(
CapitalFlowReqVo
req
);
...
...
src/main/java/com/pangding/web/authority/service/impl/CompanyMsgServiceImpl.java
View file @
d92584e4
...
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.service.impl;
import
com.pangding.web.authority.dao.CompanyMsgDao
;
import
com.pangding.web.authority.dao.DeviceDao
;
import
com.pangding.web.authority.dao.UserDao
;
import
com.pangding.web.authority.dao.company.CompanyDao
;
import
com.pangding.web.authority.mq.CompanyConsumer
;
import
com.pangding.web.authority.service.CompanyMsgService
;
import
com.pangding.web.constant.CompanyConstant
;
...
...
@@ -11,12 +12,17 @@ import com.pangding.web.partner.vo.req.SoundContentVo;
import
com.pangding.web.vo.order.tl.SoundContentInfoVo
;
import
com.pangding.web.vo.order.tl.SoundContentReqVo
;
import
com.pangding.web.vo.order.tl.SoundReqVo
;
import
com.pangding.web.vo.system.pd.company.CompanyVo
;
import
com.pangding.web.vo.system.req.CompanyMsgReqVo
;
import
com.pangding.web.vo.system.req.DeviceReqVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.company.CompanyReqVo
;
import
com.pangding.web.vo.system.res.CompanyMsgResVo
;
import
com.pangding.web.vo.system.res.DeviceResVo
;
import
com.pangding.web.vo.system.res.authority.UserResVo
;
import
com.pangding.web.vo.system.res.company.CompanyResVo
;
import
com.yanzuoguang.util.base.ObjectHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -24,12 +30,18 @@ import com.yanzuoguang.util.vo.ResponseResult;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
static
com
.
yanzuoguang
.
util
.
helper
.
DateHelper
.
getCurDate
;
@Service
public
class
CompanyMsgServiceImpl
implements
CompanyMsgService
{
@Autowired
private
CompanyDao
companyDao
;
@Autowired
private
CompanyMsgDao
companyMsgDao
;
@Autowired
...
...
@@ -94,4 +106,40 @@ public class CompanyMsgServiceImpl implements CompanyMsgService {
return
ResponseResult
.
result
(
"处理成功"
);
}
public
void
checkCompanyExpirationDate
(
CompanyReqVo
req
){
CompanyResVo
companyResVo
=
companyDao
.
load
(
req
.
getId
(),
CompanyResVo
.
class
);
if
(
StringHelper
.
isEmpty
(
companyResVo
)){
return
;
}
String
expirationDate
=
companyResVo
.
getExpirationDate
();
Date
toDate
=
DateHelper
.
getDateTime
(
DateHelper
.
toDay
(
DateHelper
.
getDateTime
(
expirationDate
)));
Date
today
=
DateHelper
.
getDateTime
(
DateHelper
.
toDay
(
getCurDate
()));
long
day
=
DateHelper
.
betweenDay
(
toDate
,
today
);
// 过期时间 - 今天 = 还有几天过期 今天日期到过期日期还有几天
if
(
day
<=
30
&&
day
>=
0
){
// 提示消息还有多少天到期
CompanyMsgReqVo
companyMsgReqVo
=
new
CompanyMsgReqVo
();
companyMsgReqVo
.
setCompanyId
(
companyResVo
.
getId
());
companyMsgReqVo
.
setCompanyName
(
companyResVo
.
getCompanyName
());
companyMsgReqVo
.
setMsgContent
(
"您的账号还有"
+
day
+
"天到期,请尽快充值或者联系管理员。"
);
companyMsgReqVo
.
setMsgType
(
1
);
companyMsgReqVo
.
setType
(
0
);
companyMsgReqVo
.
setId
(
StringHelper
.
getNewID
());
companyMsgDao
.
create
(
companyMsgReqVo
);
CompanyVo
companyVo
=
new
CompanyVo
();
ObjectHelper
.
writeWithFromClass
(
companyVo
,
companyResVo
);
companyVo
.
setExpirationMsg
(
"您的账号还有"
+
day
+
"天到期,请尽快充值或者联系管理员。"
);
companyDao
.
update
(
companyVo
);
}
else
{
CompanyVo
companyVo
=
new
CompanyVo
();
ObjectHelper
.
writeWithFromClass
(
companyVo
,
companyResVo
);
companyVo
.
setExpirationMsg
(
""
);
companyDao
.
update
(
companyVo
);
}
}
}
src/main/java/com/pangding/web/authority/service/impl/CompanyServiceImpl.java
View file @
d92584e4
...
...
@@ -1178,6 +1178,7 @@ public class CompanyServiceImpl implements CompanyService {
}
companyVo
.
setExamineStatus
(
reqVo
.
getExamineStatus
());
companyVo
.
setExamineFailedReason
(
reqVo
.
getExamineFailedReason
());
companyVo
.
setExpirationDate
(
reqVo
.
getExpirationDate
());
companyDao
.
update
(
companyVo
);
// 更新或新增提现规则表
...
...
@@ -1469,6 +1470,9 @@ public class CompanyServiceImpl implements CompanyService {
@Override
public
CompanyResVo
findCompanyById
(
CompanyReqVo
req
)
{
CompanyResVo
companyResVo
=
companyDao
.
load
(
req
.
getId
(),
CompanyResVo
.
class
);
if
(
StringHelper
.
isEmpty
(
companyResVo
)){
throw
new
CodeException
(
"101"
,
"该公司信息缺失,如有疑问,请联系管理员。"
);
}
if
(
CompanyConstant
.
EXAMINE_STATUS_STOP
==
companyResVo
.
getExamineStatus
())
{
// 判断公司审核状态
...
...
@@ -1544,7 +1548,6 @@ public class CompanyServiceImpl implements CompanyService {
DateHelper
.
getDateTime
(
companyInvitationRuleVo
.
getEndDate
().
substring
(
0
,
10
)))
>=
0
)
{
// 当前时间和开始时间和结束时间进行对比
if
(
orderNumTotal
>=
companyInvitationRuleVo
.
getOrderNum
())
{
System
.
out
.
println
(
"==============用户激活=============="
);
// 可激活公司
CompanyExtendVo
companyExtendVo
=
new
CompanyExtendVo
();
ObjectHelper
.
writeWithFromClass
(
companyExtendVo
,
companyResVo
);
...
...
@@ -1558,7 +1561,6 @@ public class CompanyServiceImpl implements CompanyService {
}
else
{
if
(
orderNumTotal
>=
companyInvitationRuleVo
.
getOrderNum
())
{
// 可激活公司
System
.
out
.
println
(
"==============用户激活=============="
);
CompanyExtendVo
companyExtendVo
=
new
CompanyExtendVo
();
ObjectHelper
.
writeWithFromClass
(
companyExtendVo
,
companyResVo
);
companyExtendVo
.
setActivationStatus
(
1
);
...
...
@@ -1592,7 +1594,6 @@ public class CompanyServiceImpl implements CompanyService {
CompanyInvitationRuleVo
companyInvitationRuleVo
=
companyInvitationRuleVoList
.
get
(
i
);
if
(
3
==
companyInvitationRuleVo
.
getRewardType
()
&&
CompanyConstant
.
CATEGORY_ACTIVATION_BONUS
==
companyResVo
.
getRewardType
())
{
// 对象激活时奖励
System
.
out
.
println
(
"==============对象激活时奖励=============="
);
dd
(
companyResVo
,
companyInvitationRuleVo
);
}
if
(
4
==
companyInvitationRuleVo
.
getRewardType
()
&&
CompanyConstant
.
CATEGORY_ACTIVATION_SALE_BONUS
==
companyResVo
.
getRewardType
())
{
...
...
@@ -1603,10 +1604,8 @@ public class CompanyServiceImpl implements CompanyService {
CompanyMoneyVo
companyMoneyVo
=
companyMoneyDao
.
findReport
(
companyMoneyReqVo
);
if
(!
StringHelper
.
isEmpty
(
companyMoneyVo
))
{
orderNumTotal
=
companyMoneyVo
.
getInNumber
();
System
.
out
.
println
(
"=======入账数量:"
+
orderNumTotal
+
",==="
+
companyInvitationRuleVo
.
getOrderNum
());
if
(
orderNumTotal
>=
companyInvitationRuleVo
.
getOrderNum
())
{
// 邀请公司可获取奖励
System
.
out
.
println
(
"==============邀请公司可获取奖励=============="
);
dd
(
companyResVo
,
companyInvitationRuleVo
);
}
}
...
...
@@ -1651,4 +1650,5 @@ public class CompanyServiceImpl implements CompanyService {
List
<
CompanyVo
>
list
=
companyDao
.
loadList
(
req
,
CompanyVo
.
class
);
return
list
;
}
}
src/main/java/com/pangding/web/authority/service/impl/FinanceServiceImpl.java
View file @
d92584e4
...
...
@@ -31,7 +31,6 @@ import com.yanzuoguang.util.base.ObjectHelper;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.CalcHelper
;
import
com.yanzuoguang.util.helper.DateHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.vo.PageSizeData
;
import
com.yanzuoguang.util.vo.ResponseResult
;
...
...
@@ -71,9 +70,7 @@ public class FinanceServiceImpl implements FinanceService {
/*返回对象*/
WithdrawalResVo
resVo
=
new
WithdrawalResVo
();
CompanyExtendGetReqVo
getReqVo
=
new
CompanyExtendGetReqVo
();
getReqVo
.
setId
(
reqVo
.
getCompanyId
());
CompanyExtendVo
extendVo
=
companyExtendDao
.
load
(
getReqVo
,
CompanyExtendVo
.
class
);
CompanyResVo
extendVo
=
companyDao
.
load
(
reqVo
.
getCompanyId
(),
CompanyResVo
.
class
);
if
(
null
==
extendVo
)
{
throw
new
CodeException
(
"未查到该公司数据"
);
}
...
...
@@ -130,6 +127,14 @@ public class FinanceServiceImpl implements FinanceService {
return
capitalFlowTotal
;
}
@Override
public
CapitalFlowResVo
findCapitalFlow
(
CapitalFlowReqVo
req
)
{
CapitalFlowResVo
capitalFlowResVo
=
capitalFlowDao
.
load
(
req
,
CapitalFlowResVo
.
class
);
return
capitalFlowResVo
;
}
/**
* 申请提现
*
...
...
@@ -235,13 +240,20 @@ public class FinanceServiceImpl implements FinanceService {
// 滞纳金
double
lateFee
=
StringHelper
.
isEmpty
(
companyResVo
.
getLateFee
())
?
0
:
companyResVo
.
getLateFee
();
// 系统手续费
double
serviceCharge
=
getServiceCharge1
(
companyResVo
,
req
.
getOrderMoney
());
double
payServiceCharge
=
CalcHelper
.
add
(
lateFee
,
serviceCharge
);
double
actualMoney
=
CalcHelper
.
sub
(
req
.
getOrderMoney
(),
CalcHelper
.
add
(
withdrawFee
,
payServiceCharge
));
CapitalFlowVo
capitalFlowVo
=
new
CapitalFlowVo
();
ObjectHelper
.
writeWithFrom
(
capitalFlowVo
,
req
);
capitalFlowVo
.
setOrderId
(
StringHelper
.
getNewID
());
capitalFlowVo
.
setCategory
(
1
);
capitalFlowVo
.
setOrderFee
(
withdrawFee
+
lateFee
);
// todo...2021.10.9被注释 capitalFlowVo.setServiceCharge(lateFe
e);
capitalFlowVo
.
setActualMoney
(
req
.
getOrderMoney
()
-
capitalFlowVo
.
getOrderFee
()
);
capitalFlowVo
.
setOrderFee
(
withdrawFee
);
capitalFlowVo
.
setServiceCharge
(
payServiceCharg
e
);
capitalFlowVo
.
setActualMoney
(
actualMoney
);
capitalFlowVo
.
setTime
(
DateHelper
.
getNow
());
capitalFlowVo
.
setStatus
(
0
);
capitalFlowDao
.
save
(
capitalFlowVo
);
...
...
@@ -249,6 +261,7 @@ public class FinanceServiceImpl implements FinanceService {
ObjectHelper
.
writeWithFrom
(
cashWithdrawalReqVo
,
capitalFlowVo
);
cashWithdrawalReqVo
.
setActualType
(
companyResVo
.
getWithdrawType
());
cashWithdrawalReqVo
.
setBankCardType
(
companyBankCardVo
.
getType
());
cashWithdrawalReqVo
.
setOrderFee
(
CalcHelper
.
sub
(
capitalFlowVo
.
getOrderFee
(),
capitalFlowVo
.
getServiceCharge
()));
companyConsumer
.
cashWithdrawal
(
cashWithdrawalReqVo
);
ResponseResult
<
CapitalFlowReqVo
>
responseResult
=
new
ResponseResult
<>();
responseResult
.
setData
(
req
);
...
...
@@ -284,6 +297,36 @@ public class FinanceServiceImpl implements FinanceService {
return
serviceCharge
;
}
/**
* 获取提现手续费
*
* @param companyResVo
* @return
*/
public
Double
getServiceCharge1
(
CompanyResVo
companyResVo
,
double
money
)
{
// 提现手续费
double
serviceCharge
=
0
d
;
// 该公司有优惠
switch
(
companyResVo
.
getServiceChargePayType
())
{
case
1
:
// 提现扣除
int
serviceChargeMoneyType
=
companyResVo
.
getServiceChargeMoneyType
();
if
(
0
==
serviceChargeMoneyType
)
{
// 固定值
serviceCharge
=
companyResVo
.
getServiceCharge
();
}
else
{
// 提现金额的比例
serviceCharge
=
CalcHelper
.
mul
(
money
,
companyResVo
.
getServiceCharge
());
}
break
;
default
:
break
;
}
serviceCharge
=
Math
.
round
(
serviceCharge
*
100
)
/
100.0
;
return
serviceCharge
;
}
/**
* 获取提现手续费
*
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/ExamineConfigReqVo.java
View file @
d92584e4
...
...
@@ -123,6 +123,10 @@ public class ExamineConfigReqVo {
private
Integer
serviceChargeStatus
;
@ApiModelProperty
(
notes
=
"服务费类型"
)
private
Integer
serviceChargeType
;
@ApiModelProperty
(
notes
=
"服务费资金类型"
)
private
Integer
serviceChargeMoneyType
;
@ApiModelProperty
(
notes
=
"服务费缴纳方式:0-预交,1-提现扣除,2-先交后用"
)
private
Integer
serviceChargePayType
;
@ApiModelProperty
(
notes
=
"服务费"
)
private
Double
serviceCharge
;
...
...
@@ -144,6 +148,9 @@ public class ExamineConfigReqVo {
@ApiModelProperty
(
notes
=
"审核失败原因"
)
private
String
examineFailedReason
;
@ApiModelProperty
(
notes
=
"到期日期"
)
private
String
expirationDate
;
/**
* 给该用户分配的角色id
*/
...
...
@@ -475,4 +482,28 @@ public class ExamineConfigReqVo {
public
void
setServiceCharge
(
Double
serviceCharge
)
{
this
.
serviceCharge
=
serviceCharge
;
}
public
Integer
getServiceChargeMoneyType
()
{
return
serviceChargeMoneyType
;
}
public
void
setServiceChargeMoneyType
(
Integer
serviceChargeMoneyType
)
{
this
.
serviceChargeMoneyType
=
serviceChargeMoneyType
;
}
public
String
getExpirationDate
()
{
return
expirationDate
;
}
public
void
setExpirationDate
(
String
expirationDate
)
{
this
.
expirationDate
=
expirationDate
;
}
public
Integer
getServiceChargePayType
()
{
return
serviceChargePayType
;
}
public
void
setServiceChargePayType
(
Integer
serviceChargePayType
)
{
this
.
serviceChargePayType
=
serviceChargePayType
;
}
}
src/main/java/com/pangding/web/authority/vo/resvo/WithdrawalResVo.java
View file @
d92584e4
...
...
@@ -3,6 +3,7 @@ package com.pangding.web.authority.vo.resvo;
import
com.pangding.web.vo.system.pd.company.CompanyBankCardVo
;
import
com.pangding.web.vo.system.pd.company.CompanyExtendVo
;
import
com.pangding.web.vo.system.pd.company.CompanyRuleVo
;
import
com.pangding.web.vo.system.res.company.CompanyResVo
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
...
...
@@ -14,7 +15,7 @@ import java.util.List;
public
class
WithdrawalResVo
{
private
Double
withdrawTotalCash
;
private
Company
Extend
Vo
companyExtend
;
private
Company
Res
Vo
companyExtend
;
private
List
<
CompanyBankCardVo
>
bankCardVoList
;
...
...
@@ -37,11 +38,11 @@ public class WithdrawalResVo {
this
.
bankCardVoList
=
bankCardVoList
;
}
public
Company
Extend
Vo
getCompanyExtend
()
{
public
Company
Res
Vo
getCompanyExtend
()
{
return
companyExtend
;
}
public
void
setCompanyExtend
(
Company
Extend
Vo
companyExtend
)
{
public
void
setCompanyExtend
(
Company
Res
Vo
companyExtend
)
{
this
.
companyExtend
=
companyExtend
;
}
...
...
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