Commit 9b5b8ba9 authored by jiaorz's avatar jiaorz

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 3cb4d93c 65dff1ce
...@@ -74,6 +74,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel ...@@ -74,6 +74,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
relation.setBindType(type); relation.setBindType(type);
insertSelective(relation); insertSelective(relation);
} }
Long bindTime=time-validTime;
//判断用户是否有有效的下线
if (getCountByParentId(userId,bindTime)==0L){
relation=getMyBiz().getRelationByUserId(userId); relation=getMyBiz().getRelationByUserId(userId);
if(relation==null){ if(relation==null){
relation=new AppUserRelation(); relation=new AppUserRelation();
...@@ -83,10 +86,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel ...@@ -83,10 +86,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
relation.setBindTime(time); relation.setBindTime(time);
insertSelective(relation); insertSelective(relation);
}else { }else {
//(B无有效上线+无有效下线) //判断用户是否有有效的上线
Long bindTime=time-validTime;
log.info("----userId==="+userId+"----bindTime===="+bindTime+"----relation.getBindTime()==="+relation.getBindTime()); log.info("----userId==="+userId+"----bindTime===="+bindTime+"----relation.getBindTime()==="+relation.getBindTime());
if((relation.getParentId()==null||relation.getParentId()==0||(relation.getIsForever()!=1&&relation.getBindTime()<bindTime))&&getCountByParentId(userId,bindTime)==0L){ if(relation.getParentId()==null||relation.getParentId()==0||(relation.getIsForever()!=1&&relation.getBindTime()<bindTime)){
relation.setParentId(parentId); relation.setParentId(parentId);
relation.setBindType(type); relation.setBindType(type);
relation.setBindTime(time); relation.setBindTime(time);
...@@ -94,6 +96,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel ...@@ -94,6 +96,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
} }
} }
} }
}
//首页关系绑定 //首页关系绑定
public ObjectRestResponse appBindRelation(Integer userId,String code){ public ObjectRestResponse appBindRelation(Integer userId,String code){
Integer parentId=0; Integer parentId=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment