Commit 1c988e91 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/dev-chw' into dev-chw

parents 146d899f 719c00c2
...@@ -54,6 +54,9 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{ ...@@ -54,6 +54,9 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
@Autowired @Autowired
GroupBiz groupBiz; GroupBiz groupBiz;
@Autowired
AppUserRelationBiz userRelationBiz;
public static final String CODE="SHOP-"; public static final String CODE="SHOP-";
...@@ -76,6 +79,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{ ...@@ -76,6 +79,7 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
//初始化商家账号 //初始化商家账号
addUser(id); addUser(id);
//初始化店铺 //初始化店铺
setInviterAccount(companyInfoApply);
BranchCompany branchCompany = getBranchCompanyInfo(); BranchCompany branchCompany = getBranchCompanyInfo();
branchCompany.setCompanyId(id); branchCompany.setCompanyId(id);
branchCompany.setInviterAccount(companyInfoApply.getInviterAccount()); branchCompany.setInviterAccount(companyInfoApply.getInviterAccount());
...@@ -86,6 +90,21 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{ ...@@ -86,6 +90,21 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
return id; 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