diff --git a/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java index 09fa920b..49597167 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java @@ -45,6 +45,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe @Override public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) { + HighUser user = highUserService.findByUserId(userId); HighUser pUser = highUserService.findByUserId(popularizeUserId); @@ -78,10 +79,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe bsDistributionUserRelMapper.insert(distributionUserRel); - new Thread(() -> { + } + + new Thread(() -> { - try { + try { + if (regionId != null) { SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); @@ -93,7 +97,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe freeMap.put("userPhone", user.getPhone()); highDiscountPackageService.freeUserDiscountPackage(freeMap); - if (pUser.getIsAgent() == null) { + if (pUser != null && pUser.getIsAgent() == null) { // 查询推广有礼优惠券包 HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); Map freeMap1 = new HashMap<>(); @@ -102,13 +106,13 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe freeMap1.put("userPhone", pUser.getPhone()); highDiscountPackageService.freeUserDiscountPackage(freeMap1); } - - } catch (Exception e) { - e.printStackTrace(); } - }).start(); - } + } catch (Exception e) { + e.printStackTrace(); + } + + }).start(); } diff --git a/v1/hai-v1.iml b/v1/hai-v1.iml deleted file mode 100644 index 9ecb2698..00000000 --- a/v1/hai-v1.iml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file