Commit 9b5b8ba9 authored by jiaorz's avatar jiaorz

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

parents 3cb4d93c 65dff1ce
...@@ -74,25 +74,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel ...@@ -74,25 +74,28 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
relation.setBindType(type); relation.setBindType(type);
insertSelective(relation); insertSelective(relation);
} }
relation=getMyBiz().getRelationByUserId(userId); Long bindTime=time-validTime;
if(relation==null){ //判断用户是否有有效的下线
relation=new AppUserRelation(); if (getCountByParentId(userId,bindTime)==0L){
relation.setUserId(userId); relation=getMyBiz().getRelationByUserId(userId);
relation.setParentId(parentId); if(relation==null){
relation.setBindType(type); relation=new AppUserRelation();
relation.setBindTime(time); relation.setUserId(userId);
insertSelective(relation); relation.setParentId(parentId);
}else { relation.setBindType(type);
//(B无有效上线+无有效下线) relation.setBindTime(time);
Long bindTime=time-validTime; insertSelective(relation);
log.info("----userId==="+userId+"----bindTime===="+bindTime+"----relation.getBindTime()==="+relation.getBindTime()); }else {
if((relation.getParentId()==null||relation.getParentId()==0||(relation.getIsForever()!=1&&relation.getBindTime()<bindTime))&&getCountByParentId(userId,bindTime)==0L){ //判断用户是否有有效的上线
relation.setParentId(parentId); log.info("----userId==="+userId+"----bindTime===="+bindTime+"----relation.getBindTime()==="+relation.getBindTime());
relation.setBindType(type); if(relation.getParentId()==null||relation.getParentId()==0||(relation.getIsForever()!=1&&relation.getBindTime()<bindTime)){
relation.setBindTime(time); relation.setParentId(parentId);
getMyBiz().updRelation(relation); relation.setBindType(type);
} relation.setBindTime(time);
} getMyBiz().updRelation(relation);
}
}
}
} }
//首页关系绑定 //首页关系绑定
public ObjectRestResponse appBindRelation(Integer userId,String code){ public ObjectRestResponse appBindRelation(Integer userId,String code){
......
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