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
1938e23d
Commit
1938e23d
authored
Jul 22, 2019
by
guanchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户用户关系后清除缓存
parent
6c6c6e52
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
5 deletions
+14
-5
PartnerAccountMapper.java
...ava/com/lanren/huhu/partner/dao/PartnerAccountMapper.java
+3
-0
UserManager.java
...ain/java/com/lanren/huhu/partner/manager/UserManager.java
+2
-3
UserService.java
...ain/java/com/lanren/huhu/partner/service/UserService.java
+2
-2
UserServiceImpl.java
...com/lanren/huhu/partner/service/impl/UserServiceImpl.java
+0
-0
PartnerAccountMapper.xml
src/main/resources/mapper/PartnerAccountMapper.xml
+7
-0
No files found.
src/main/java/com/lanren/huhu/partner/dao/PartnerAccountMapper.java
View file @
1938e23d
...
@@ -39,4 +39,6 @@ public interface PartnerAccountMapper extends BaseMapper<PartnerAccount> {
...
@@ -39,4 +39,6 @@ public interface PartnerAccountMapper extends BaseMapper<PartnerAccount> {
List
<
PartnerAccount
>
getChildListByUserId
(
Integer
userId
);
List
<
PartnerAccount
>
getChildListByUserId
(
Integer
userId
);
int
updatePartnerRelation
(
String
from
,
String
to
);
int
updatePartnerRelation
(
String
from
,
String
to
);
PartnerAccount
getPartnerAccountByPhone
(
String
phone
);
}
}
\ No newline at end of file
src/main/java/com/lanren/huhu/partner/manager/UserManager.java
View file @
1938e23d
...
@@ -283,9 +283,8 @@ public class UserManager {
...
@@ -283,9 +283,8 @@ public class UserManager {
int
cnt
=
updatePartnerRelation
(
from
,
to
);
int
cnt
=
updatePartnerRelation
(
from
,
to
);
logger
.
info
(
"更新合伙人推荐关系, 将{}的上级改为{},更新{}行数据"
,
from
,
to
,
cnt
);
logger
.
info
(
"更新合伙人推荐关系, 将{}的上级改为{},更新{}行数据"
,
from
,
to
,
cnt
);
}
}
Result
<
String
>
result
=
new
Result
<
String
>();
PartnerAccount
partnerAccount
=
userService
.
getPartnerAccountByPhone
(
from
);
result
.
setCode
(
500
);
return
purgeRelation
(
partnerAccount
.
getUserId
());
return
result
;
}
}
private
int
updatePartnerRelation
(
String
from
,
String
to
)
{
private
int
updatePartnerRelation
(
String
from
,
String
to
)
{
...
...
src/main/java/com/lanren/huhu/partner/service/UserService.java
View file @
1938e23d
package
com
.
lanren
.
huhu
.
partner
.
service
;
import
com.lanren.huhu.partner.domain.PartnerAccount
;
import
com.lanren.huhu.partner.domain.UserAgent
;
import
com.lanren.huhu.partner.model.ParentAgent
;
import
com.lanren.huhu.partner.model.User
;
import
java.util.List
;
/** * @author houseme * @date 2019-06-28 18:35 * @Project partner * @Package com.lanren.huhu.partner.service * @File: UserService */
public
interface
UserService
{
/** * @description: 根据用户id, 查找一个用户的全部合伙人上级 和 代理商上级(此处为层级关系 非平推关系) * 缓存用户邀请关系和代理商关系数据 * 缓存不能带有构造方法的Bean 所以只能返回User的Bean * 包装Result在Cacheable注解的方法之外进行操作 * 注意 !!!!!!!! 这个方法是按输入用户的邀请关系链上查找 第一个有agent_level<=4的代理商身份的邀请人, 然后再走他的代理关系 * 注意 !!!!!!!! 如果需要获取一个代理商的上级代理 需要从UserAgentService里的方法获取 * @param userId * @return User * @throws * @author chen * @date 2019-06-26 20:01 */
User
getRelationByUserId
(
Integer
userId
);
List
<
ParentAgent
>
getAgentListByUserId
(
Integer
userId
,
String
parentColumnName
);
/** * 清理用户缓存 */
boolean
deleteRalationByUserId
(
Integer
userId
);
/*** * PartnerAccount * * 根据用户id查询账户信息 * @param userId * @return PartnerAccount */
PartnerAccount
getPartnerAccountByUserId
(
Integer
userId
);
/** * @description: 根据用户id查询全部直属下级合伙人 * @param userId * @return List<PartnerAccount> * @author chen * @date 2019-06-28 11:49 */
List
<
PartnerAccount
>
getPartnerAccountChildListByUserId
(
Integer
userId
);
/*** * UserAgent * 根据用户id查询账户信息 * @param userId * @return */
UserAgent
getUserAgentByUserId
(
Integer
userId
);
/** * @description: 根据用户id查询全部直属下级代理商 * @param userId * @return List<PartnerAccount> * @author chen * @date 2019-06-28 11:49 */
List
<
UserAgent
>
getUserAgentChildListByUserId
(
Integer
userId
,
String
parentColumnName
);
int
updatePartnerRelation
(
String
from
,
String
to
);
int
updatePingtuiRelation
(
String
from
,
String
to
);
int
updateCengjiRelation
(
String
from
,
String
to
);
}
package
com
.
lanren
.
huhu
.
partner
.
service
;
import
com.lanren.huhu.partner.domain.PartnerAccount
;
import
com.lanren.huhu.partner.domain.UserAgent
;
import
com.lanren.huhu.partner.model.ParentAgent
;
import
com.lanren.huhu.partner.model.User
;
import
java.util.List
;
/** * @author houseme * @date 2019-06-28 18:35 * @Project partner * @Package com.lanren.huhu.partner.service * @File: UserService */
public
interface
UserService
{
/** * @description: 根据用户id, 查找一个用户的全部合伙人上级 和 代理商上级(此处为层级关系 非平推关系) * 缓存用户邀请关系和代理商关系数据 * 缓存不能带有构造方法的Bean 所以只能返回User的Bean * 包装Result在Cacheable注解的方法之外进行操作 * 注意 !!!!!!!! 这个方法是按输入用户的邀请关系链上查找 第一个有agent_level<=4的代理商身份的邀请人, 然后再走他的代理关系 * 注意 !!!!!!!! 如果需要获取一个代理商的上级代理 需要从UserAgentService里的方法获取 * @param userId * @return User * @throws * @author chen * @date 2019-06-26 20:01 */
User
getRelationByUserId
(
Integer
userId
);
List
<
ParentAgent
>
getAgentListByUserId
(
Integer
userId
,
String
parentColumnName
);
/** * 清理用户缓存 */
boolean
deleteRalationByUserId
(
Integer
userId
);
/*** * PartnerAccount * * 根据用户id查询账户信息 * @param userId * @return PartnerAccount */
PartnerAccount
getPartnerAccountByUserId
(
Integer
userId
);
/** * @description: 根据用户id查询全部直属下级合伙人 * @param userId * @return List<PartnerAccount> * @author chen * @date 2019-06-28 11:49 */
List
<
PartnerAccount
>
getPartnerAccountChildListByUserId
(
Integer
userId
);
/*** * UserAgent * 根据用户id查询账户信息 * @param userId * @return */
UserAgent
getUserAgentByUserId
(
Integer
userId
);
/** * @description: 根据用户id查询全部直属下级代理商 * @param userId * @return List<PartnerAccount> * @author chen * @date 2019-06-28 11:49 */
List
<
UserAgent
>
getUserAgentChildListByUserId
(
Integer
userId
,
String
parentColumnName
);
int
updatePartnerRelation
(
String
from
,
String
to
);
int
updatePingtuiRelation
(
String
from
,
String
to
);
int
updateCengjiRelation
(
String
from
,
String
to
);
PartnerAccount
getPartnerAccountByPhone
(
String
phone
);
}
\ No newline at end of file
\ No newline at end of file
...
...
src/main/java/com/lanren/huhu/partner/service/impl/UserServiceImpl.java
View file @
1938e23d
This diff is collapsed.
Click to expand it.
src/main/resources/mapper/PartnerAccountMapper.xml
View file @
1938e23d
...
@@ -508,4 +508,10 @@
...
@@ -508,4 +508,10 @@
)
)
WHERE b.user_phone='#{from}'
WHERE b.user_phone='#{from}'
</update>
</update>
<select
id=
"getPartnerAccountByPhone"
resultMap=
"BaseResultMap"
>
SELECT a.*
FROM partner_account a
JOIN user_info b on a.user_id=b.user_id
WHERE b.user_phone=#{phone}
</select>
</mapper>
</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