Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
huhu-partner
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanchen
huhu-partner
Commits
f7f3b1fe
Commit
f7f3b1fe
authored
Mar 20, 2020
by
guanchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新奖励类型790
接口返回代理商关系时 剔除失效
parent
48c284ed
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
60 deletions
+76
-60
Constants.java
...ain/java/com/lanren/huhu/partner/constants/Constants.java
+23
-12
UserManager.java
...ain/java/com/lanren/huhu/partner/manager/UserManager.java
+0
-0
AgentTree.java
src/main/java/com/lanren/huhu/partner/model/AgentTree.java
+15
-16
ParentAgent.java
src/main/java/com/lanren/huhu/partner/model/ParentAgent.java
+14
-23
AgentRewardQueueTask.java
...om/lanren/huhu/partner/schedule/AgentRewardQueueTask.java
+5
-3
RevokeAgentRewardTask.java
...m/lanren/huhu/partner/schedule/RevokeAgentRewardTask.java
+3
-1
UserServiceImpl.java
...com/lanren/huhu/partner/service/impl/UserServiceImpl.java
+16
-5
No files found.
src/main/java/com/lanren/huhu/partner/constants/Constants.java
View file @
f7f3b1fe
...
@@ -19,10 +19,10 @@ public class Constants {
...
@@ -19,10 +19,10 @@ public class Constants {
*/
*/
public
static
final
int
AGENT_REWARD_TYPE_YEAR_VIP
=
710
;
public
static
final
int
AGENT_REWARD_TYPE_YEAR_VIP
=
710
;
public
static
final
String
AGENT_REWARD_TYPE_YEAR_VIP_REMARK
=
"推荐奖励-年VIP"
;
public
static
final
String
AGENT_REWARD_TYPE_YEAR_VIP_REMARK
=
"推荐奖励-年VIP"
;
//
public static final int AGENT_REWARD_TYPE_HALF_YEAR_VIP = 720;
public
static
final
int
AGENT_REWARD_TYPE_HALF_YEAR_VIP
=
720
;
//
public static final String AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK = "城市代理商所得的购买半年-VIP";
public
static
final
String
AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK
=
"城市代理商所得的购买半年-VIP"
;
//
public static final int AGENT_REWARD_TYPE_SVIP = 730;
public
static
final
int
AGENT_REWARD_TYPE_SVIP
=
730
;
//
public static final String AGENT_REWARD_TYPE_SVIP_REMARK = "城市代理商所得的购买超级VIP收益";
public
static
final
String
AGENT_REWARD_TYPE_SVIP_REMARK
=
"城市代理商所得的购买超级VIP收益"
;
public
static
final
int
AGENT_REWARD_TYPE_REDPACK
=
740
;
public
static
final
int
AGENT_REWARD_TYPE_REDPACK
=
740
;
public
static
final
String
AGENT_REWARD_TYPE_REDPACK_REMARK
=
"推荐奖励-普通用户购买红包"
;
public
static
final
String
AGENT_REWARD_TYPE_REDPACK_REMARK
=
"推荐奖励-普通用户购买红包"
;
public
static
final
int
AGENT_REWARD_TYPE_SELF_ORDER
=
750
;
public
static
final
int
AGENT_REWARD_TYPE_SELF_ORDER
=
750
;
...
@@ -31,6 +31,8 @@ public class Constants {
...
@@ -31,6 +31,8 @@ public class Constants {
public
static
final
String
AGENT_REWARD_TYPE_SHARE_ORDER_REMARK
=
"推荐奖励-分享赚"
;
public
static
final
String
AGENT_REWARD_TYPE_SHARE_ORDER_REMARK
=
"推荐奖励-分享赚"
;
public
static
final
int
AGENT_REWARD_TYPE_VIP_PACKAGE
=
780
;
public
static
final
int
AGENT_REWARD_TYPE_VIP_PACKAGE
=
780
;
public
static
final
String
AGENT_REWARD_TYPE_VIP_PACKAGE_REMARK
=
"推荐奖励-VIP礼包"
;
public
static
final
String
AGENT_REWARD_TYPE_VIP_PACKAGE_REMARK
=
"推荐奖励-VIP礼包"
;
public
static
final
int
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
=
790
;
public
static
final
String
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP_REMARK
=
"推荐奖励-购买礼包(送VIP会员)"
;
public
static
final
int
JD_OFFSET
=
1000
;
//用于查找京东的平推奖励比例
public
static
final
int
JD_OFFSET
=
1000
;
//用于查找京东的平推奖励比例
public
static
final
int
MT_OFFSET
=
2000
;
//用于查找美团的平推奖励比例
public
static
final
int
MT_OFFSET
=
2000
;
//用于查找美团的平推奖励比例
public
static
final
int
TN_OFFSET
=
3000
;
//用于查找途牛的平推奖励比例
public
static
final
int
TN_OFFSET
=
3000
;
//用于查找途牛的平推奖励比例
...
@@ -60,6 +62,7 @@ public class Constants {
...
@@ -60,6 +62,7 @@ public class Constants {
public
static
final
int
AGENT_REVOKE_TYPE_SHARE_ORDER
=
400
;
public
static
final
int
AGENT_REVOKE_TYPE_SHARE_ORDER
=
400
;
public
static
final
String
AGENT_REVOKE_TYPE_SHARE_ORDER_REMARK
=
"分享赚奖励扣回"
;
public
static
final
String
AGENT_REVOKE_TYPE_SHARE_ORDER_REMARK
=
"分享赚奖励扣回"
;
public
static
Map
<
Integer
,
String
>
AGENT_REVOKE_TYPE_MAP
=
new
HashMap
<
Integer
,
String
>();
public
static
Map
<
Integer
,
String
>
AGENT_REVOKE_TYPE_MAP
=
new
HashMap
<
Integer
,
String
>();
/**
/**
* 回扣状态
* 回扣状态
*/
*/
...
@@ -90,9 +93,10 @@ public class Constants {
...
@@ -90,9 +93,10 @@ public class Constants {
* 代理商平推奖励比例配置
* 代理商平推奖励比例配置
*/
*/
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_YEAR_VIP
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_YEAR_VIP
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_HALF_YEAR_VIP
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SVIP
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_VIP_PACKAGE
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_VIP_PACKAGE
,
new
HashMap
<
Integer
,
BigDecimal
>());
// AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_HALF_YEAR_VIP, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
,
new
HashMap
<
Integer
,
BigDecimal
>());
// AGENT_RATE_MAP.put(AGENT_REWARD_TYPE_SVIP, new HashMap<Integer, BigDecimal>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_REDPACK
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_REDPACK
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SHARE_ORDER
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SHARE_ORDER
,
new
HashMap
<
Integer
,
BigDecimal
>());
...
@@ -103,10 +107,16 @@ public class Constants {
...
@@ -103,10 +107,16 @@ public class Constants {
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
+
MTJD_OFFSET
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
+
MTJD_OFFSET
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
+
ELM_OFFSET
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
+
ELM_OFFSET
,
new
HashMap
<
Integer
,
BigDecimal
>());
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_YEAR_VIP
).
put
(
0
,
new
BigDecimal
(
"0.02512563"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_YEAR_VIP
).
put
(
0
,
new
BigDecimal
(
"0.03015076"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_YEAR_VIP
).
put
(
1
,
new
BigDecimal
(
"0.01507538"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_YEAR_VIP
).
put
(
1
,
new
BigDecimal
(
"0.0201005"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_VIP_PACKAGE
).
put
(
0
,
new
BigDecimal
(
"0.02512563"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_HALF_YEAR_VIP
).
put
(
0
,
new
BigDecimal
(
"0.03015076"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_VIP_PACKAGE
).
put
(
1
,
new
BigDecimal
(
"0.01507538"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_HALF_YEAR_VIP
).
put
(
1
,
new
BigDecimal
(
"0.0201005"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_SVIP
).
put
(
0
,
new
BigDecimal
(
"0.03015076"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_SVIP
).
put
(
1
,
new
BigDecimal
(
"0.0201005"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_VIP_PACKAGE
).
put
(
0
,
new
BigDecimal
(
"0.03015076"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_VIP_PACKAGE
).
put
(
1
,
new
BigDecimal
(
"0.0201005"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
).
put
(
0
,
new
BigDecimal
(
"0.03015076"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
).
put
(
1
,
new
BigDecimal
(
"0.0201005"
));
/**
/**
* 红包
* 红包
...
@@ -137,9 +147,10 @@ public class Constants {
...
@@ -137,9 +147,10 @@ public class Constants {
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_SHARE_ORDER
+
JD_OFFSET
).
put
(
1
,
new
BigDecimal
(
"0.0087"
));
AGENT_RATE_MAP
.
get
(
AGENT_REWARD_TYPE_SHARE_ORDER
+
JD_OFFSET
).
put
(
1
,
new
BigDecimal
(
"0.0087"
));
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_YEAR_VIP
,
AGENT_REWARD_TYPE_YEAR_VIP_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_YEAR_VIP
,
AGENT_REWARD_TYPE_YEAR_VIP_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_HALF_YEAR_VIP
,
AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_SVIP
,
AGENT_REWARD_TYPE_SVIP_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_VIP_PACKAGE
,
AGENT_REWARD_TYPE_VIP_PACKAGE_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_VIP_PACKAGE
,
AGENT_REWARD_TYPE_VIP_PACKAGE_REMARK
);
// AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_HALF_YEAR_VIP, AGENT_REWARD_TYPE_HALF_YEAR_VIP_REMARK);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
,
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP_REMARK
);
// AGENT_REWARD_REMARK.put(AGENT_REWARD_TYPE_SVIP, AGENT_REWARD_TYPE_SVIP_REMARK);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_REDPACK
,
AGENT_REWARD_TYPE_REDPACK_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_REDPACK
,
AGENT_REWARD_TYPE_REDPACK_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
,
AGENT_REWARD_TYPE_SELF_ORDER_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_SELF_ORDER
,
AGENT_REWARD_TYPE_SELF_ORDER_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_SHARE_ORDER
,
AGENT_REWARD_TYPE_SHARE_ORDER_REMARK
);
AGENT_REWARD_REMARK
.
put
(
AGENT_REWARD_TYPE_SHARE_ORDER
,
AGENT_REWARD_TYPE_SHARE_ORDER_REMARK
);
...
...
src/main/java/com/lanren/huhu/partner/manager/UserManager.java
View file @
f7f3b1fe
This diff is collapsed.
Click to expand it.
src/main/java/com/lanren/huhu/partner/model/AgentTree.java
View file @
f7f3b1fe
...
@@ -3,8 +3,6 @@ package com.lanren.huhu.partner.model;
...
@@ -3,8 +3,6 @@ package com.lanren.huhu.partner.model;
import
com.lanren.huhu.partner.model.base.BaseModel
;
import
com.lanren.huhu.partner.model.base.BaseModel
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
/**
/**
* @author chen
* @author chen
* @title: AgentTree
* @title: AgentTree
...
@@ -14,19 +12,20 @@ import java.util.ArrayList;
...
@@ -14,19 +12,20 @@ import java.util.ArrayList;
* @date 2019-07-02 20:15
* @date 2019-07-02 20:15
*/
*/
@Data
@Data
@Deprecated
public
class
AgentTree
extends
BaseModel
{
public
class
AgentTree
extends
BaseModel
{
Integer
userId
;
//
Integer userId;
Integer
agentId
;
//
Integer agentId;
Integer
level
;
//
Integer level;
ArrayList
<
ParentAgent
>
parentList
;
//
ArrayList<ParentAgent> parentList;
ArrayList
<
AgentTree
>
childList
=
new
ArrayList
<
AgentTree
>();
//
ArrayList<AgentTree> childList = new ArrayList<AgentTree>();
//
public
ArrayList
<
ParentAgent
>
cloneParent
()
{
//
public ArrayList<ParentAgent> cloneParent() {
ArrayList
<
ParentAgent
>
copyList
=
new
ArrayList
<
ParentAgent
>();
//
ArrayList<ParentAgent> copyList = new ArrayList<ParentAgent>();
for
(
ParentAgent
parentAgent
:
this
.
getParentList
())
{
//
for (ParentAgent parentAgent : this.getParentList()) {
ParentAgent
one
=
new
ParentAgent
(
parentAgent
.
getUserId
(),
parentAgent
.
getAgentId
(),
parentAgent
.
getLevel
());
//
ParentAgent one = new ParentAgent(parentAgent.getUserId(), parentAgent.getAgentId(), parentAgent.getLevel());
copyList
.
add
(
one
);
//
copyList.add(one);
}
//
}
return
copyList
;
//
return copyList;
}
//
}
}
}
src/main/java/com/lanren/huhu/partner/model/ParentAgent.java
View file @
f7f3b1fe
package
com
.
lanren
.
huhu
.
partner
.
model
;
package
com
.
lanren
.
huhu
.
partner
.
model
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.lanren.huhu.partner.model.base.BaseModel
;
import
com.lanren.huhu.partner.model.base.BaseModel
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Objects
;
/**
/**
* @author chen
* @author chen
* @title: ParentAgent
* @title: ParentAgent
...
@@ -16,42 +19,30 @@ public class ParentAgent extends BaseModel {
...
@@ -16,42 +19,30 @@ public class ParentAgent extends BaseModel {
int
userId
;
int
userId
;
int
agentId
;
int
agentId
;
int
level
;
int
level
;
@JSONField
(
serialize
=
false
)
int
agentState
;
public
ParentAgent
(
int
userId
,
int
agentId
,
int
level
)
{
public
ParentAgent
(
int
userId
,
int
agentId
,
int
level
,
int
agentState
)
{
this
.
userId
=
userId
;
this
.
userId
=
userId
;
this
.
agentId
=
agentId
;
this
.
agentId
=
agentId
;
this
.
level
=
level
;
this
.
level
=
level
;
this
.
agentState
=
agentState
;
}
}
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
o
)
{
if
(
obj
==
null
)
{
if
(
this
==
o
)
{
return
false
;
}
if
(
this
==
obj
)
{
return
true
;
return
true
;
}
}
if
(
obj
instanceof
ParentAgent
){
if
(!(
o
instanceof
ParentAgent
))
{
ParentAgent
parentAgent
=
(
ParentAgent
)
obj
;
return
false
;
if
(
parentAgent
.
agentId
==
this
.
agentId
)
{
return
true
;
}
else
{
return
false
;
}
}
}
return
false
;
ParentAgent
that
=
(
ParentAgent
)
o
;
return
agentId
==
that
.
agentId
;
}
}
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
StringBuilder
sb
=
new
StringBuilder
();
return
Objects
.
hash
(
agentId
);
sb
.
append
(
agentId
);
char
[]
charArr
=
sb
.
toString
().
toCharArray
();
int
hash
=
0
;
for
(
char
c
:
charArr
)
{
hash
=
hash
*
131
+
c
;
}
return
hash
;
}
}
}
}
src/main/java/com/lanren/huhu/partner/schedule/AgentRewardQueueTask.java
View file @
f7f3b1fe
...
@@ -22,6 +22,7 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -22,6 +22,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.TransactionStatus
;
...
@@ -63,7 +64,7 @@ public class AgentRewardQueueTask {
...
@@ -63,7 +64,7 @@ public class AgentRewardQueueTask {
@Autowired
@Autowired
TransactionDefinition
transactionDefinition
;
TransactionDefinition
transactionDefinition
;
//
@Scheduled(fixedDelay = 5000L)
@Scheduled
(
fixedDelay
=
5000L
)
public
void
runScheduledTask
()
{
public
void
runScheduledTask
()
{
logger
.
info
(
"run AgentRewardQueueTask"
);
logger
.
info
(
"run AgentRewardQueueTask"
);
runConsume
();
runConsume
();
...
@@ -320,6 +321,7 @@ public class AgentRewardQueueTask {
...
@@ -320,6 +321,7 @@ public class AgentRewardQueueTask {
agentReward
.
setCreatedAt
(
System
.
currentTimeMillis
()
/
1000L
);
agentReward
.
setCreatedAt
(
System
.
currentTimeMillis
()
/
1000L
);
agentReward
.
setCommissionRate
(
commissionRate
);
agentReward
.
setCommissionRate
(
commissionRate
);
agentReward
.
setRewardTypeChild
(
message
.
getRewardTypeChild
()
==
null
?
""
:
message
.
getRewardTypeChild
());
agentReward
.
setRewardTypeChild
(
message
.
getRewardTypeChild
()
==
null
?
""
:
message
.
getRewardTypeChild
());
agentReward
.
setRewardStatus
(
100
);
/**
/**
* agent_reward里:
* agent_reward里:
* money 面额(message里, 需要上供的代理商自己获得的奖励)
* money 面额(message里, 需要上供的代理商自己获得的奖励)
...
@@ -329,8 +331,8 @@ public class AgentRewardQueueTask {
...
@@ -329,8 +331,8 @@ public class AgentRewardQueueTask {
* cash_code 支付金额
* cash_code 支付金额
*/
*/
BigDecimal
rewardBasement
;
BigDecimal
rewardBasement
;
// if (rewardType == AGENT_REWARD_TYPE_YEAR_VIP || rewardType == AGENT_REWARD_TYPE_HALF_YEAR_VIP || rewardType == AGENT_REWARD_TYPE_SVIP) {
if
(
rewardType
==
AGENT_REWARD_TYPE_YEAR_VIP
||
rewardType
==
AGENT_REWARD_TYPE_HALF_YEAR_VIP
||
rewardType
==
AGENT_REWARD_TYPE_SVIP
if
(
rewardType
==
AGENT_REWARD_TYPE_YEAR_VIP
||
rewardType
==
AGENT_REWARD_TYPE_REDPACK
||
rewardType
==
AGENT_REWARD_TYPE_VIP_PACKAGE
)
{
||
rewardType
==
AGENT_REWARD_TYPE_REDPACK
||
rewardType
==
AGENT_REWARD_TYPE_VIP_PACKAGE
||
rewardType
==
AGENT_REWARD_TYPE_PACKAGE_WITH_VIP
)
{
rewardBasement
=
message
.
getSourceUserPayment
();
rewardBasement
=
message
.
getSourceUserPayment
();
}
else
{
}
else
{
/**
/**
...
...
src/main/java/com/lanren/huhu/partner/schedule/RevokeAgentRewardTask.java
View file @
f7f3b1fe
...
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
...
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.jdbc.datasource.DataSourceTransactionManager
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.TransactionStatus
;
...
@@ -41,7 +42,7 @@ public class RevokeAgentRewardTask {
...
@@ -41,7 +42,7 @@ public class RevokeAgentRewardTask {
@Autowired
@Autowired
TransactionDefinition
transactionDefinition
;
TransactionDefinition
transactionDefinition
;
//
@Scheduled(fixedDelay = 5000L)
@Scheduled
(
fixedDelay
=
5000L
)
public
void
runScheduledTask
()
{
public
void
runScheduledTask
()
{
logger
.
info
(
"run RevokeAgentRewardTask"
);
logger
.
info
(
"run RevokeAgentRewardTask"
);
runConsume
();
runConsume
();
...
@@ -117,6 +118,7 @@ public class RevokeAgentRewardTask {
...
@@ -117,6 +118,7 @@ public class RevokeAgentRewardTask {
agentReward
.
setAmount
(
agentReward
.
getAmount
().
negate
());
agentReward
.
setAmount
(
agentReward
.
getAmount
().
negate
());
agentReward
.
setCommission
(
agentReward
.
getAmount
().
negate
());
agentReward
.
setCommission
(
agentReward
.
getAmount
().
negate
());
agentReward
.
setSettleTime
(
new
Date
());
agentReward
.
setSettleTime
(
new
Date
());
agentReward
.
setRewardStatus
(
100
);
insertList
.
add
(
agentReward
);
insertList
.
add
(
agentReward
);
}
else
if
(
agentReward
.
getSettleState
()
==
SETTLE_STATE_ON_THE_WAY
||
agentReward
.
getSettleState
()
==
SETTLE_STATE_PRE
)
{
}
else
if
(
agentReward
.
getSettleState
()
==
SETTLE_STATE_ON_THE_WAY
||
agentReward
.
getSettleState
()
==
SETTLE_STATE_PRE
)
{
agentReward
.
setAmount
(
new
BigDecimal
(
0
));
agentReward
.
setAmount
(
new
BigDecimal
(
0
));
...
...
src/main/java/com/lanren/huhu/partner/service/impl/UserServiceImpl.java
View file @
f7f3b1fe
...
@@ -71,7 +71,7 @@ public class UserServiceImpl implements UserService {
...
@@ -71,7 +71,7 @@ public class UserServiceImpl implements UserService {
return
user
;
return
user
;
}
}
@Override
@Override
@CacheEvict
(
key
=
"#userId"
)
@CacheEvict
(
key
=
"#userId"
)
public
boolean
deleteRalationByUserId
(
Integer
userId
)
{
public
boolean
deleteRalationByUserId
(
Integer
userId
)
{
logger
.
info
(
"UserServiceImpl delete user relation cache, userId: {}"
,
userId
);
logger
.
info
(
"UserServiceImpl delete user relation cache, userId: {}"
,
userId
);
...
@@ -234,7 +234,7 @@ public class UserServiceImpl implements UserService {
...
@@ -234,7 +234,7 @@ public class UserServiceImpl implements UserService {
ParentAgent
parentAgent
=
null
;
ParentAgent
parentAgent
=
null
;
if
(
null
!=
userAgent
)
{
if
(
null
!=
userAgent
)
{
int
agentLevel
=
userAgent
.
getAgentLevel
();
int
agentLevel
=
userAgent
.
getAgentLevel
();
parentAgent
=
new
ParentAgent
(
userAgent
.
getUserId
(),
userAgent
.
getAgentId
(),
agentLevel
);
parentAgent
=
new
ParentAgent
(
userAgent
.
getUserId
(),
userAgent
.
getAgentId
(),
agentLevel
,
userAgent
.
getAgentState
()
);
}
}
return
parentAgent
;
return
parentAgent
;
}
}
...
@@ -337,7 +337,7 @@ public class UserServiceImpl implements UserService {
...
@@ -337,7 +337,7 @@ public class UserServiceImpl implements UserService {
/**
/**
* 添加代理到list时 都需要加个判断 如果找到总代 就不再找了
* 添加代理到list时 都需要加个判断 如果找到总代 就不再找了
*/
*/
agentList
.
add
(
new
ParentAgent
(
firstAgent
.
getUserId
(),
firstAgent
.
getAgentId
(),
firstAgent
.
getAgentLevel
()));
agentList
.
add
(
new
ParentAgent
(
firstAgent
.
getUserId
(),
firstAgent
.
getAgentId
(),
firstAgent
.
getAgentLevel
()
,
firstAgent
.
getAgentState
()
));
if
(
firstAgent
.
getAgentLevel
()
!=
AGENT_LEVEL_1
)
{
if
(
firstAgent
.
getAgentLevel
()
!=
AGENT_LEVEL_1
)
{
loopTimes
=
0
;
loopTimes
=
0
;
if
(
logger
.
isDebugEnabled
())
{
if
(
logger
.
isDebugEnabled
())
{
...
@@ -361,7 +361,7 @@ public class UserServiceImpl implements UserService {
...
@@ -361,7 +361,7 @@ public class UserServiceImpl implements UserService {
/**
/**
* 添加代理到list时 都需要加个判断 如果找到总代 就不再找了
* 添加代理到list时 都需要加个判断 如果找到总代 就不再找了
*/
*/
agentList
.
add
(
new
ParentAgent
(
loopUserAgent
.
getUserId
(),
loopUserAgent
.
getAgentId
(),
loopUserAgent
.
getLevel
()));
agentList
.
add
(
new
ParentAgent
(
loopUserAgent
.
getUserId
(),
loopUserAgent
.
getAgentId
(),
loopUserAgent
.
getLevel
()
,
loopUserAgent
.
getAgentState
()
));
if
(
loopUserAgent
.
getLevel
()
==
AGENT_LEVEL_1
)
{
if
(
loopUserAgent
.
getLevel
()
==
AGENT_LEVEL_1
)
{
break
;
break
;
}
}
...
@@ -398,6 +398,16 @@ public class UserServiceImpl implements UserService {
...
@@ -398,6 +398,16 @@ public class UserServiceImpl implements UserService {
if
(
logger
.
isInfoEnabled
())
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"setAgentList {} for user: {} end"
,
parentColumnName
,
userId
);
logger
.
info
(
"setAgentList {} for user: {} end"
,
parentColumnName
,
userId
);
}
}
return
agentList
;
return
filterInvalid
(
agentList
);
}
private
List
<
ParentAgent
>
filterInvalid
(
ArrayList
<
ParentAgent
>
agentList
)
{
List
<
ParentAgent
>
resultList
=
new
ArrayList
<
ParentAgent
>();
for
(
ParentAgent
parentAgent
:
agentList
)
{
if
(
parentAgent
.
getAgentState
()
==
1
)
{
resultList
.
add
(
parentAgent
);
}
}
return
resultList
;
}
}
}
}
\ 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