From e66833057c20f382c0af0d2e62fdb9b1920e0e0d Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Mon, 22 Aug 2022 17:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=94=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/dev/config.properties | 2 +- .../resources/prod-9401/config.properties | 2 +- .../src/main/resources/prod/config.properties | 2 +- .../com/hai/schedule/HighOrderSchedule.java | 8 ++ .../BsDistributionUserRelServiceImpl.java | 97 ++++++++++--------- .../impl/BsIntegralRebateServiceImpl.java | 11 +-- .../service/impl/HighOrderServiceImpl.java | 6 +- 7 files changed, 66 insertions(+), 62 deletions(-) diff --git a/hai-cweb/src/main/resources/dev/config.properties b/hai-cweb/src/main/resources/dev/config.properties index 53a3b59d..64ff8af1 100644 --- a/hai-cweb/src/main/resources/dev/config.properties +++ b/hai-cweb/src/main/resources/dev/config.properties @@ -24,4 +24,4 @@ fileUrl=/home/project/hsg/filesystem cmsPath=/home/project/hsg/filesystem/cmsPath couponCodePath=/home/project/hsg/filesystem/couponCode -qrCodeUrl=https://hsgcs.dctpay.com/hsgH5?accountId=000009&key=&code= +qrCodeUrl=https://hsgcs.dctpay.com/hsgH5?accountId=0000010&key=&code= diff --git a/hai-cweb/src/main/resources/prod-9401/config.properties b/hai-cweb/src/main/resources/prod-9401/config.properties index d60d2170..d44e4cd4 100644 --- a/hai-cweb/src/main/resources/prod-9401/config.properties +++ b/hai-cweb/src/main/resources/prod-9401/config.properties @@ -23,4 +23,4 @@ cmsPath=/home/project/hsg/filesystem/cmsPath couponCodePath=/home/project/hsg/filesystem/couponCode -qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=000009&key=&code= +qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=0000010&key=&code= diff --git a/hai-cweb/src/main/resources/prod/config.properties b/hai-cweb/src/main/resources/prod/config.properties index 783d4ab4..a6895eca 100644 --- a/hai-cweb/src/main/resources/prod/config.properties +++ b/hai-cweb/src/main/resources/prod/config.properties @@ -25,4 +25,4 @@ cmsPath=/home/project/hsg/filesystem/cmsPath couponCodePath=/home/project/hsg/filesystem/couponCode -qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=000009&key=&code= +qrCodeUrl=https://hsg.dctpay.com/hsgH5?accountId=0000010&key=&code= diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index 0a9ff1f5..eb9e7af7 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -431,6 +431,14 @@ public class HighOrderSchedule { } } } + /** + * @Author Sum1Dream + * @name integralRebateOrder.java + * @Description // 执行返利操作 + * @Date 15:13 2022/8/22 + * @Param [] + * @return void + */ @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 public void integralRebateOrder() { List order = highOrderService.integralRebateOrder(); 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 9e0eaa6a..09fa920b 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 @@ -56,58 +56,59 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe map.put("userId" , popularizeUserId); BsDistributionUserRel popularizeUser = findDistributionUserRel(map); - - if (pUser.getIsAgent() != null) { - distributionUserRel.setAgentId(pUser.getId()); - distributionUserRel.setAgentName(pUser.getName()); - } else { - if (popularizeUser != null) { - distributionUserRel.setAgentId(popularizeUser.getAgentId()); - distributionUserRel.setAgentName(popularizeUser.getAgentName()); + if (pUser != null) { + if (pUser.getIsAgent() != null) { + distributionUserRel.setAgentId(pUser.getId()); + distributionUserRel.setAgentName(pUser.getName()); + } else { + if (popularizeUser != null) { + distributionUserRel.setAgentId(popularizeUser.getAgentId()); + distributionUserRel.setAgentName(popularizeUser.getAgentName()); + } + distributionUserRel.setPopularizeUserId(popularizeUserId); + distributionUserRel.setPopularizeUserName(pUser.getName()); } - distributionUserRel.setPopularizeUserId(popularizeUserId); - distributionUserRel.setPopularizeUserName(pUser.getName()); - } - distributionUserRel.setUserId(userId); - distributionUserRel.setUserName(user.getName()); - distributionUserRel.setPhone(TelApiUtil.phoneDesensitization(user.getPhone())); - distributionUserRel.setCreateTime(new Date()); - distributionUserRel.setUpdateTime(new Date()); - distributionUserRel.setStatus(100); - - bsDistributionUserRelMapper.insert(distributionUserRel); - - new Thread(() -> { - - try { - - SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); - BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); - - // 查询注册有礼优惠券包 - HighDiscountPackage discountPackage = highDiscountPackageService.getCallExclusive(3 , bsCompany.getId().intValue()); - Map freeMap = new HashMap<>(); - freeMap.put("discountPackageId", discountPackage.getId()); - freeMap.put("userId", userId); - freeMap.put("userPhone", user.getPhone()); - highDiscountPackageService.freeUserDiscountPackage(freeMap); - - if (pUser.getIsAgent() == null) { - // 查询推广有礼优惠券包 - HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); - Map freeMap1 = new HashMap<>(); - freeMap1.put("discountPackageId", promoteDiscountPackage.getId()); - freeMap1.put("userId", pUser.getId()); - freeMap1.put("userPhone", pUser.getPhone()); - highDiscountPackageService.freeUserDiscountPackage(freeMap1); - } + distributionUserRel.setUserId(userId); + distributionUserRel.setUserName(user.getName()); + distributionUserRel.setPhone(TelApiUtil.phoneDesensitization(user.getPhone())); + distributionUserRel.setCreateTime(new Date()); + distributionUserRel.setUpdateTime(new Date()); + distributionUserRel.setStatus(100); + + bsDistributionUserRelMapper.insert(distributionUserRel); + + new Thread(() -> { + + try { + + SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); + BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); + + // 查询注册有礼优惠券包 + HighDiscountPackage discountPackage = highDiscountPackageService.getCallExclusive(3 , bsCompany.getId().intValue()); + Map freeMap = new HashMap<>(); + freeMap.put("discountPackageId", discountPackage.getId()); + freeMap.put("userId", userId); + freeMap.put("userPhone", user.getPhone()); + highDiscountPackageService.freeUserDiscountPackage(freeMap); + + if (pUser.getIsAgent() == null) { + // 查询推广有礼优惠券包 + HighDiscountPackage promoteDiscountPackage = highDiscountPackageService.getCallExclusive(4 , bsCompany.getId().intValue()); + Map freeMap1 = new HashMap<>(); + freeMap1.put("discountPackageId", promoteDiscountPackage.getId()); + freeMap1.put("userId", pUser.getId()); + freeMap1.put("userPhone", pUser.getPhone()); + highDiscountPackageService.freeUserDiscountPackage(freeMap1); + } - } catch (Exception e) { - e.printStackTrace(); - } + } catch (Exception e) { + e.printStackTrace(); + } - }).start(); + }).start(); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java index 95ddb861..a3eef794 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsIntegralRebateServiceImpl.java @@ -118,16 +118,8 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { BigDecimal integralNumFirst = object.getBigDecimal("price").multiply(bsIntegralRebate.getFirstDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP ); BigDecimal integralNumSecond = object.getBigDecimal("price").multiply(bsIntegralRebate.getSecondDistribution()).setScale( 0, BigDecimal.ROUND_HALF_UP ); -/* - HighOrder order = highOrderService.getOrderById(object.getLong("orderId")); -*/ - order.setWhetherRebate(true); - highOrderService.updateOrder(order); - - highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); - JSONObject jsonObject = new JSONObject(); jsonObject.put("integralNumFirst" , integralNumFirst); @@ -138,6 +130,9 @@ public class BsIntegralRebateServiceImpl implements BsIntegralRebateService { jsonObject.put("logoImg" , object.getString("logoImg")); bsDistributionUserRelService.distributionRebate(jsonObject); + highOrderService.updateOrder(order); + highUserService.goldHandle(object.getLong("userId"), integralNum.intValue(), 1, 4, object.getLong("orderId") , object.getString("remark") + integralNum); + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 76ca0520..629d68be 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -3013,10 +3013,10 @@ public class HighOrderServiceImpl implements HighOrderService { HighCoupon coupon = highCouponService.getCouponById(goodsId); object.put("type" , 1); - object.put("productId", coupon.getCouponSource()); + object.put("productId", 1); object.put("companyId", coupon.getCompanyId()); - object.put("remark" , "卡券订单:"+ coupon + "-" + orderNo + "积分返利:"); - object.put("name" , "购买卡券产品:"+ coupon); + object.put("remark" , "卡券订单:"+ coupon.getCouponName() + "-" + orderNo + "积分返利:"); + object.put("name" , "购买卡券产品:"+ coupon.getCouponName()); } if (goodsType == 3) {