Commit 7cb0cbdc authored by hezhen's avatar hezhen

123

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