|
|
@ -56,58 +56,59 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe |
|
|
|
map.put("userId" , popularizeUserId); |
|
|
|
map.put("userId" , popularizeUserId); |
|
|
|
|
|
|
|
|
|
|
|
BsDistributionUserRel popularizeUser = findDistributionUserRel(map); |
|
|
|
BsDistributionUserRel popularizeUser = findDistributionUserRel(map); |
|
|
|
|
|
|
|
if (pUser != null) { |
|
|
|
if (pUser.getIsAgent() != null) { |
|
|
|
if (pUser.getIsAgent() != null) { |
|
|
|
distributionUserRel.setAgentId(pUser.getId()); |
|
|
|
distributionUserRel.setAgentId(pUser.getId()); |
|
|
|
distributionUserRel.setAgentName(pUser.getName()); |
|
|
|
distributionUserRel.setAgentName(pUser.getName()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (popularizeUser != null) { |
|
|
|
if (popularizeUser != null) { |
|
|
|
distributionUserRel.setAgentId(popularizeUser.getAgentId()); |
|
|
|
distributionUserRel.setAgentId(popularizeUser.getAgentId()); |
|
|
|
distributionUserRel.setAgentName(popularizeUser.getAgentName()); |
|
|
|
distributionUserRel.setAgentName(popularizeUser.getAgentName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
distributionUserRel.setPopularizeUserId(popularizeUserId); |
|
|
|
|
|
|
|
distributionUserRel.setPopularizeUserName(pUser.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
distributionUserRel.setPopularizeUserId(popularizeUserId); |
|
|
|
|
|
|
|
distributionUserRel.setPopularizeUserName(pUser.getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distributionUserRel.setUserId(userId); |
|
|
|
distributionUserRel.setUserId(userId); |
|
|
|
distributionUserRel.setUserName(user.getName()); |
|
|
|
distributionUserRel.setUserName(user.getName()); |
|
|
|
distributionUserRel.setPhone(TelApiUtil.phoneDesensitization(user.getPhone())); |
|
|
|
distributionUserRel.setPhone(TelApiUtil.phoneDesensitization(user.getPhone())); |
|
|
|
distributionUserRel.setCreateTime(new Date()); |
|
|
|
distributionUserRel.setCreateTime(new Date()); |
|
|
|
distributionUserRel.setUpdateTime(new Date()); |
|
|
|
distributionUserRel.setUpdateTime(new Date()); |
|
|
|
distributionUserRel.setStatus(100); |
|
|
|
distributionUserRel.setStatus(100); |
|
|
|
|
|
|
|
|
|
|
|
bsDistributionUserRelMapper.insert(distributionUserRel); |
|
|
|
bsDistributionUserRelMapper.insert(distributionUserRel); |
|
|
|
|
|
|
|
|
|
|
|
new Thread(() -> { |
|
|
|
new Thread(() -> { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); |
|
|
|
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); |
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); |
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); |
|
|
|
|
|
|
|
|
|
|
|
// 查询注册有礼优惠券包
|
|
|
|
// 查询注册有礼优惠券包
|
|
|
|
HighDiscountPackage discountPackage = highDiscountPackageService.getCallExclusive(3 , bsCompany.getId().intValue()); |
|
|
|
HighDiscountPackage discountPackage = highDiscountPackageService.getCallExclusive(3 , bsCompany.getId().intValue()); |
|
|
|
Map<String, Object> freeMap = new HashMap<>(); |
|
|
|
Map<String, Object> freeMap = new HashMap<>(); |
|
|
|
freeMap.put("discountPackageId", discountPackage.getId()); |
|
|
|
freeMap.put("discountPackageId", discountPackage.getId()); |
|
|
|
freeMap.put("userId", userId); |
|
|
|
freeMap.put("userId", userId); |
|
|
|
freeMap.put("userPhone", user.getPhone()); |
|
|
|
freeMap.put("userPhone", user.getPhone()); |
|
|
|
highDiscountPackageService.freeUserDiscountPackage(freeMap); |
|
|
|
highDiscountPackageService.freeUserDiscountPackage(freeMap); |
|
|
|
|
|
|
|
|
|
|
|
if (pUser.getIsAgent() == null) { |
|
|
|
if (pUser.getIsAgent() == null) { |
|
|
|
// 查询推广有礼优惠券包
|
|
|
|
// 查询推广有礼优惠券包
|
|
|
|
HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); |
|
|
|
HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); |
|
|
|
Map<String, Object> freeMap1 = new HashMap<>(); |
|
|
|
Map<String, Object> freeMap1 = new HashMap<>(); |
|
|
|
freeMap1.put("discountPackageId", promoteDiscountPackage.getId()); |
|
|
|
freeMap1.put("discountPackageId", promoteDiscountPackage.getId()); |
|
|
|
freeMap1.put("userId", pUser.getId()); |
|
|
|
freeMap1.put("userId", pUser.getId()); |
|
|
|
freeMap1.put("userPhone", pUser.getPhone()); |
|
|
|
freeMap1.put("userPhone", pUser.getPhone()); |
|
|
|
highDiscountPackageService.freeUserDiscountPackage(freeMap1); |
|
|
|
highDiscountPackageService.freeUserDiscountPackage(freeMap1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).start(); |
|
|
|
}).start(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|