From 1f09f6daaf73bc83cceb4ae22b862b7b365635cf Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 03 四月 2025 19:59:17 +0800 Subject: [PATCH] 修改反馈文档bug --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java | 60 ++++++++++++++++++++++++++++++++---------------------------- 1 files changed, 32 insertions(+), 28 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java index cd3fc24..14a362b 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/CommissionServiceImpl.java @@ -185,8 +185,11 @@ changeRecord.setId(null); balanceChangeRecordClient.saveBalanceChangeRecord(changeRecord); } + if(data2.size() > 0){ + List<Long> ids = data2.stream().map(BalanceChangeRecordCopy::getId).collect(Collectors.toList()); + balanceChangeRecordClient.deleteBalanceChangeRecordCopyByIds(ids); + } } - balanceChangeRecordClient.deleteBalanceChangeRecordCopy(order.getId(), Arrays.asList(4)); List<UserPointCopy> data3 = userPointClient.getUserPointCopy(order.getId(), Arrays.asList(2,8,9,10,14)).getData(); if(null != data3){ @@ -196,8 +199,11 @@ userPoint.setId(null); userPointClient.saveUserPoint(userPoint); } + if(data3.size() > 0){ + List<Long> ids = data3.stream().map(UserPointCopy::getId).collect(Collectors.toList()); + userPointClient.deleteUserPointCopyByIds(ids); + } } - userPointClient.deleteUserPointCopy(order.getId(), Arrays.asList(2,8,9,10,14)); List<ShopBalanceStatementCopy> data4 = shopBalanceStatementClient.getShopBalanceStatementCopy(order.getId(), Arrays.asList(1,2,3)).getData(); @@ -208,8 +214,11 @@ shopBalanceStatement.setId(null); shopBalanceStatementClient.saveShopBalanceStatement(shopBalanceStatement); } + if(data4.size() > 0){ + List<Long> ids = data4.stream().map(ShopBalanceStatementCopy::getId).collect(Collectors.toList()); + shopBalanceStatementClient.deleteShopBalanceStatementCopyByIds(ids); + } } - shopBalanceStatementClient.deleteShopBalanceStatementCopy(order.getId(), Arrays.asList(1,2,3)); List<ShopPointCopy> data5 = shopPointClient.getShopPointCopy(order.getId(), Arrays.asList(1,2,3)).getData(); if(null != data5){ @@ -219,8 +228,11 @@ shopPoint.setId(null); shopPointClient.saveShopPoint(shopPoint); } + if(data5.size() > 0){ + List<Long> ids = data5.stream().map(ShopPointCopy::getId).collect(Collectors.toList()); + shopPointClient.deleteShopPointCopyByIds(ids); + } } - shopPointClient.deleteShopPointCopy(order.getId(), Arrays.asList(1,2,3)); order.setIsCommission(3); orderService.updateById(order); @@ -335,24 +347,22 @@ balanceChangeRecordCopy.setVipId(superiorLeader.getVipId()); balanceChangeRecordCopy.setOrderId(order.getId()); balanceChangeRecordCopy.setChangeType(4); - balanceChangeRecordCopy.setBeforeAmount(balance); balanceChangeRecordCopy.setChangeAmount(zdls_price); - balanceChangeRecordCopy.setAfterAmount(superiorLeader.getBalance()); balanceChangeRecordCopy.setDelFlag(0); balanceChangeRecordCopy.setCreateTime(LocalDateTime.now()); + balanceChangeRecordCopy.setChangeDirection(1); balanceChangeRecordClient.saveBalanceChangeRecordCopy(balanceChangeRecordCopy); } //添加积分明细 if(zdls_point > 0){ UserPointCopy userPointCopy = new UserPointCopy(); userPointCopy.setType(2); - userPointCopy.setHistoricalPoint(lavePoint); userPointCopy.setVariablePoint(zdls_point); - userPointCopy.setBalance(superiorLeader.getLavePoint()); userPointCopy.setCreateTime(LocalDateTime.now()); userPointCopy.setAppUserId(superiorLeader.getId()); userPointCopy.setObjectId(order.getId()); userPointCopy.setExtention(order.getOrderNumber()); + userPointCopy.setChangeDirection(1); userPointClient.saveUserPointCopy(userPointCopy); //变更等级 // appUserClient.vipUpgrade(superiorLeader.getId()); @@ -440,26 +450,24 @@ ShopBalanceStatementCopy shopBalanceStatementCopy = new ShopBalanceStatementCopy(); shopBalanceStatementCopy.setShopId(shop1.getId()); shopBalanceStatementCopy.setType(1); - shopBalanceStatementCopy.setHistoricalBalance(shopBalance); shopBalanceStatementCopy.setVariableAmount(fws_price); - shopBalanceStatementCopy.setBalance(shop1.getBalance()); shopBalanceStatementCopy.setCreateTime(LocalDateTime.now()); shopBalanceStatementCopy.setCreateUserId(order.getAppUserId()); shopBalanceStatementCopy.setObjectId(order.getId()); shopBalanceStatementCopy.setExtension(order.getOrderNumber()); + shopBalanceStatementCopy.setChangeDirection(1); shopBalanceStatementClient.saveShopBalanceStatementCopy(shopBalanceStatementCopy); } //添加积分明细 if(fws_point > 0){ UserPointCopy userPointCopy = new UserPointCopy(); userPointCopy.setType(9); - userPointCopy.setHistoricalPoint(lavePoint); userPointCopy.setVariablePoint(fws_point); - userPointCopy.setBalance(bdShopAppUser.getLavePoint()); userPointCopy.setCreateTime(LocalDateTime.now()); userPointCopy.setAppUserId(bdShopAppUser.getId()); userPointCopy.setObjectId(order.getId()); userPointCopy.setExtention(order.getOrderNumber()); + userPointCopy.setChangeDirection(1); userPointClient.saveUserPointCopy(userPointCopy); //变更等级 // appUserClient.vipUpgrade(bdShopAppUser.getId()); @@ -469,13 +477,12 @@ ShopPointCopy shopPointCopy = new ShopPointCopy(); shopPointCopy.setShopId(shop1.getId()); shopPointCopy.setType(2); - shopPointCopy.setHistoricalPoint(shopLavePoint); shopPointCopy.setVariablePoint(fws_point); - shopPointCopy.setBalance(shop1.getLavePoint()); shopPointCopy.setCreateTime(LocalDateTime.now()); shopPointCopy.setCreateUserId(order.getAppUserId()); shopPointCopy.setObjectId(order.getId()); shopPointCopy.setOrderNum(order.getOrderNumber()); + shopPointCopy.setChangeDirection(1); shopPointClient.saveShopPointCopy(shopPointCopy); } } @@ -566,26 +573,24 @@ ShopBalanceStatementCopy shopBalanceStatementCopy = new ShopBalanceStatementCopy(); shopBalanceStatementCopy.setShopId(shop2.getId()); shopBalanceStatementCopy.setType(2); - shopBalanceStatementCopy.setHistoricalBalance(shopBalance); shopBalanceStatementCopy.setVariableAmount(gjfws_price); - shopBalanceStatementCopy.setBalance(shop2.getBalance()); shopBalanceStatementCopy.setCreateTime(LocalDateTime.now()); shopBalanceStatementCopy.setCreateUserId(order.getAppUserId()); shopBalanceStatementCopy.setObjectId(order.getId()); shopBalanceStatementCopy.setExtension(order.getOrderNumber()); + shopBalanceStatementCopy.setChangeDirection(1); shopBalanceStatementClient.saveShopBalanceStatementCopy(shopBalanceStatementCopy); } //添加积分明细 if(gjfws_point > 0){ UserPointCopy userPointCopy = new UserPointCopy(); userPointCopy.setType(14); - userPointCopy.setHistoricalPoint(lavePoint); userPointCopy.setVariablePoint(gjfws_point); - userPointCopy.setBalance(sjShopAppUser.getLavePoint()); userPointCopy.setCreateTime(LocalDateTime.now()); userPointCopy.setAppUserId(sjShopAppUser.getId()); userPointCopy.setObjectId(order.getId()); userPointCopy.setExtention(order.getOrderNumber()); + userPointCopy.setChangeDirection(1); userPointClient.saveUserPointCopy(userPointCopy); //变更等级 // appUserClient.vipUpgrade(sjShopAppUser.getId()); @@ -595,13 +600,12 @@ ShopPointCopy shopPointCopy = new ShopPointCopy(); shopPointCopy.setShopId(shop2.getId()); shopPointCopy.setType(3); - shopPointCopy.setHistoricalPoint(shopLavePoint); shopPointCopy.setVariablePoint(gjfws_point); - shopPointCopy.setBalance(shop2.getLavePoint()); shopPointCopy.setCreateTime(LocalDateTime.now()); shopPointCopy.setCreateUserId(order.getAppUserId()); shopPointCopy.setObjectId(order.getId()); shopPointCopy.setOrderNum(order.getOrderNumber()); + shopPointCopy.setChangeDirection(1); shopPointClient.saveShopPointCopy(shopPointCopy); } } @@ -621,6 +625,10 @@ @Transactional(rollbackFor = Exception.class) public void calculationCommissionShop(Long orderId) { Order order = orderService.getById(orderId); + //快递单品不进行分佣 + if(order.getOrderType() == 2 && order.getDistributionMode() == 2){ + return; + } List<OrderGood> orderGoods = orderGoodService.list(new LambdaQueryWrapper<OrderGood>() .eq(OrderGood::getOrderId, order.getId())); AppUser appUser = appUserClient.getAppUserById(order.getAppUserId()); @@ -723,26 +731,24 @@ ShopBalanceStatementCopy shopBalanceStatementCopy = new ShopBalanceStatementCopy(); shopBalanceStatementCopy.setShopId(shop.getId()); shopBalanceStatementCopy.setType(3); - shopBalanceStatementCopy.setHistoricalBalance(shopBalance); shopBalanceStatementCopy.setVariableAmount(hxmd_price); - shopBalanceStatementCopy.setBalance(shop.getBalance()); shopBalanceStatementCopy.setCreateTime(LocalDateTime.now()); shopBalanceStatementCopy.setCreateUserId(order.getAppUserId()); shopBalanceStatementCopy.setObjectId(order.getId()); shopBalanceStatementCopy.setExtension(order.getOrderNumber()); + shopBalanceStatementCopy.setChangeDirection(1); shopBalanceStatementClient.saveShopBalanceStatementCopy(shopBalanceStatementCopy); } //添加积分明细 if(hxmd_point > 0){ UserPointCopy userPointCopy = new UserPointCopy(); userPointCopy.setType(8); - userPointCopy.setHistoricalPoint(lavePoint); userPointCopy.setVariablePoint(hxmd_point); - userPointCopy.setBalance(shopAppUser.getLavePoint()); userPointCopy.setCreateTime(LocalDateTime.now()); userPointCopy.setAppUserId(shopAppUser.getId()); userPointCopy.setObjectId(order.getId()); userPointCopy.setExtention(order.getOrderNumber()); + userPointCopy.setChangeDirection(1); userPointClient.saveUserPointCopy(userPointCopy); //变更等级 // appUserClient.vipUpgrade(shopAppUser.getId()); @@ -752,13 +758,12 @@ ShopPointCopy shopPointCopy = new ShopPointCopy(); shopPointCopy.setShopId(shop.getId()); shopPointCopy.setType(1); - shopPointCopy.setHistoricalPoint(shopLavePoint); shopPointCopy.setVariablePoint(hxmd_point); - shopPointCopy.setBalance(shop.getLavePoint()); shopPointCopy.setCreateTime(LocalDateTime.now()); shopPointCopy.setCreateUserId(order.getAppUserId()); shopPointCopy.setObjectId(order.getId()); shopPointCopy.setOrderNum(order.getOrderNumber()); + shopPointCopy.setChangeDirection(1); shopPointClient.saveShopPointCopy(shopPointCopy); } } @@ -809,13 +814,12 @@ if(js_point > 0){ UserPointCopy userPointCopy = new UserPointCopy(); userPointCopy.setType(10); - userPointCopy.setHistoricalPoint(lavePoint); userPointCopy.setVariablePoint(js_point); - userPointCopy.setBalance(technicianAppUser.getLavePoint()); userPointCopy.setCreateTime(LocalDateTime.now()); userPointCopy.setAppUserId(technicianAppUser.getId()); userPointCopy.setObjectId(order.getId()); userPointCopy.setExtention(order.getOrderNumber()); + userPointCopy.setChangeDirection(1); userPointClient.saveUserPointCopy(userPointCopy); //变更等级 // appUserClient.vipUpgrade(technicianAppUser.getId()); -- Gitblit v1.7.1