Commit 00825634 authored by hezhen's avatar hezhen

修改店铺推荐人

parent b1751bf0
......@@ -54,6 +54,9 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
@Autowired
GroupBiz groupBiz;
@Autowired
AppUserRelationBiz userRelationBiz;
public static final String CODE="SHOP-";
......@@ -76,6 +79,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
//初始化商家账号
addUser(id);
//初始化店铺
setInviterAccount(companyInfoApply);
BranchCompany branchCompany = getBranchCompanyInfo();
branchCompany.setCompanyId(id);
branchCompany.setInviterAccount(companyInfoApply.getInviterAccount());
......@@ -86,6 +90,21 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
return id;
}
//app上级用户为店铺推荐人
public void setInviterAccount(CompanyInfoApply companyInfoApply){
Integer inviterAccount = companyInfoApply.getInviterAccount() == null ? 0 : companyInfoApply.getInviterAccount();
if (inviterAccount == 0){
Integer appUserId = companyInfoApply.getAppUserId() == null ? 0 : companyInfoApply.getAppUserId();
if (appUserId > 0){
AppUserRelation appUserRelation = userRelationBiz.getRelationByUserId(appUserId);
if (appUserRelation != null ){
companyInfoApply.setInviterAccount(appUserRelation.getParentId());
}
}
}
}
//初始化店铺信息
......
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