Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
e85b9d82
Commit
e85b9d82
authored
Dec 29, 2020
by
yao.xiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理历史数据,放开判断
parent
3e4064aa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
21 deletions
+62
-21
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
+32
-20
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerFortuneWithdrawMapper.java
+3
-0
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerFortuneWithdrawDALService.java
+7
-0
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerFortuneWithdrawDALServiceImpl.java
+5
-0
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+2
-0
yd-api/src/main/resources/mapper/customer/AclCustomerFortuneWithdrawMapper.xml
+13
-1
No files found.
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsFortuneServiceImpl.java
View file @
e85b9d82
...
...
@@ -110,17 +110,17 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
Long
loginId
=
requestVO
.
getLoginId
();
//查询出需修改的佣金发放状态的财富
List
<
AclCustomerFortune
>
customerFortunes
=
customerFortuneDalService
.
findByIds
(
fortuneIds
);
List
<
String
>
commissionPayoutStatusList
=
new
ArrayList
<>();
for
(
AclCustomerFortune
customerFortune:
customerFortunes
)
{
commissionPayoutStatusList
.
add
(
customerFortune
.
getCommissionPayoutStatus
());
}
if
(
commissionPayoutStatusList
.
contains
(
"4"
)){
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830023"
);
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
message
);
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
//
List<String> commissionPayoutStatusList = new ArrayList<>();
//
for (AclCustomerFortune customerFortune: customerFortunes) {
//
commissionPayoutStatusList.add(customerFortune.getCommissionPayoutStatus());
//
}
//
if (commissionPayoutStatusList.contains("4")){
//
String message = ZHBErrorConfig.getErrorInfo("830023");
//
commonResult.setSuccess(false);
//
commonResult.setMessage(message);
//
responseVO.setCommonResult(commonResult);
//
return responseVO;
//
}
//佣金预计发放批次
String
payoutBatch
=
requestVO
.
getPayoutBatch
();
//通过payoutBatch查询此批次是否再库中,在库中直接获取id,不在进行保存,获取id
...
...
@@ -144,8 +144,20 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
String
message
=
ZHBErrorConfig
.
getErrorInfo
(
"800000"
);
if
((
"2"
).
equals
(
requestVO
.
getPaymentStatus
())){
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getPayoutBatch
())){
success
=
false
;
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830021"
);
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
message
);
return
commonResult
;
}
}
Long
[]
fortuneIds
=
requestVO
.
getFortuneIds
();
List
<
AclCustomerFortuneWithdraw
>
withdraws
=
customerFortuneWithdrawDalService
.
findByFortuneIds
(
fortuneIds
);
for
(
AclCustomerFortuneWithdraw
withdraw
:
withdraws
)
{
if
(
withdraw
.
getIsPaid
()==
1
){
message
=
ZHBErrorConfig
.
getErrorInfo
(
"830024"
);
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
message
);
return
commonResult
;
}
}
commonResult
.
setSuccess
(
success
);
...
...
@@ -261,19 +273,19 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
//查询这些customerId是这个批次的最后一笔未完成的提现记录(ag_acl_customer_fortune_withdraw)
Map
<
Long
,
Long
>
customerWithdrawNoPayMap
=
customerFortuneWithdrawDalService
.
findFinalWithdrawNoPayByCustomerIds
(
customerIds
,
payoutBatchId
);
//查询这些customerId最后一笔已完成的提现记录(ag_acl_customer_fortune_withdraw)
Map
<
Long
,
Long
>
customerWithdrawPayMap
=
customerFortuneWithdrawDalService
.
findFinalWithdrawPayByCustomerIds
(
customerIds
);
//
Map<Long,Long> customerWithdrawPayMap = customerFortuneWithdrawDalService.findFinalWithdrawPayByCustomerIds(customerIds);
Map
<
Long
,
Long
>
customerWithdrawMap
=
new
HashMap
<>(
16
);
//循环未完成记录,并于已完成的记录经行比较,如果未完成的id大于已完成的,则可以直接修改withdraw;如果未完成的id小于已完成的id,则需要生成新的withdraw
for
(
Map
.
Entry
<
Long
,
Long
>
customerWithdrawNoPay:
customerWithdrawNoPayMap
.
entrySet
()){
Long
payWithdrewId
=
customerWithdrawPayMap
.
get
(
customerWithdrawNoPay
.
getKey
());
if
(
CommonUtil
.
isNullOrZero
(
payWithdrewId
)){
//
Long payWithdrewId = customerWithdrawPayMap.get(customerWithdrawNoPay.getKey());
//
if (CommonUtil.isNullOrZero(payWithdrewId)){
customerWithdrawMap
.
put
(
customerWithdrawNoPay
.
getKey
(),
customerWithdrawNoPay
.
getValue
());
continue
;
}
if
(
BigDecimal
.
valueOf
(
payWithdrewId
).
compareTo
(
BigDecimal
.
valueOf
(
customerWithdrawNoPay
.
getValue
()))
>
0
){
continue
;
}
customerWithdrawMap
.
put
(
customerWithdrawNoPay
.
getKey
(),
customerWithdrawNoPay
.
getValue
());
//
}
//
if (BigDecimal.valueOf(payWithdrewId).compareTo(BigDecimal.valueOf(customerWithdrawNoPay.getValue())) > 0){
//
continue;
//
}
//
customerWithdrawMap.put(customerWithdrawNoPay.getKey(),customerWithdrawNoPay.getValue());
}
return
customerWithdrawMap
;
}
...
...
yd-api/src/main/java/com/yd/dal/mapper/customer/AclCustomerFortuneWithdrawMapper.java
View file @
e85b9d82
...
...
@@ -31,4 +31,6 @@ public interface AclCustomerFortuneWithdrawMapper {
List
<
AclCustomerFortuneWithdraw
>
findByIds
(
List
<
Long
>
withdrawUpdateIds
);
List
<
Map
<
String
,
Object
>>
findFinalWithdrawPayByCustomerIds
(
List
<
Long
>
customerIdList
);
List
<
AclCustomerFortuneWithdraw
>
findByFortuneIds
(
Long
[]
fortuneIds
);
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/customer/AclCustomerFortuneWithdrawDALService.java
View file @
e85b9d82
...
...
@@ -40,4 +40,11 @@ public interface AclCustomerFortuneWithdrawDALService {
Map
<
Long
,
Long
>
findFinalWithdrawPayByCustomerIds
(
Set
<
Long
>
customerIds
);
Long
save
(
AclCustomerFortuneWithdraw
withdraw
);
/**
* 通过fortuneIds 查询withdraw记录
* @param fortuneIds
* @return
*/
List
<
AclCustomerFortuneWithdraw
>
findByFortuneIds
(
Long
[]
fortuneIds
);
}
yd-api/src/main/java/com/yd/dal/service/customer/impl/AclCustomerFortuneWithdrawDALServiceImpl.java
View file @
e85b9d82
...
...
@@ -46,6 +46,11 @@ public class AclCustomerFortuneWithdrawDALServiceImpl implements AclCustomerFort
return
(
long
)
customerFortuneWithdrawMapper
.
insert
(
withdraw
);
}
@Override
public
List
<
AclCustomerFortuneWithdraw
>
findByFortuneIds
(
Long
[]
fortuneIds
)
{
return
customerFortuneWithdrawMapper
.
findByFortuneIds
(
fortuneIds
);
}
private
Map
<
Long
,
Long
>
changeCustomerWithdrawMap
(
List
<
Map
<
String
,
Object
>>
customerWithdrawList
)
{
Map
<
Long
,
Long
>
customerWithdrawMap
=
new
HashMap
<>(
16
);
for
(
Map
<
String
,
Object
>
customerWithdraw
:
customerWithdrawList
)
{
...
...
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
e85b9d82
...
...
@@ -37,4 +37,5 @@
830021
=
请选择发佣日期
830022
=
请选择关账记录
830023
=
已关账并发放的记录,不能修改
830024
=
存在已关账保单,禁止修改为非可发放状态
900003
=
保险公司响应报文为空!
\ No newline at end of file
yd-api/src/main/resources/mapper/customer/AclCustomerFortuneWithdrawMapper.xml
View file @
e85b9d82
...
...
@@ -548,7 +548,7 @@
<foreach
collection=
"list"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
and w.is_paid != 1
<!-- and w.is_paid != 1-->
and (f.payout_batch_id = #{payoutBatchId,jdbcType=BIGINT} or w.withdraw_amount = 0)
group by w.customer_id
</select>
...
...
@@ -574,4 +574,15 @@
and is_paid = 1
group by customer_id
</select>
<select
id=
"findByFortuneIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_acl_customer_fortune_withdraw
where id in (select withdrawed_id from ag_acl_customer_fortune where id in
<foreach
collection=
"array"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
)
</select>
</mapper>
\ No newline at end of file
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