diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/BonusService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/BonusService.java index a297a9a9..1927ff4a 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/BonusService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/BonusService.java @@ -153,4 +153,9 @@ public interface BonusService * 查询待分成金额,以到账方分组统计 */ List selectWaitAmountGroupByArrival(BonusQuery query); + + /** + * 根据ID支付分成 + */ + int payBonusById(Long id); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/impl/BonusServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/impl/BonusServiceImpl.java index 249d5e23..97b15c0a 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/impl/BonusServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/service/impl/BonusServiceImpl.java @@ -416,6 +416,12 @@ public class BonusServiceImpl implements BonusService return bonusMapper.selectWaitAmountGroupByArrival(query); } + @Override + public int payBonusById(Long id) { + BonusVO bonus = this.selectBonusById(id); + return this.payBonus(bonus); + } + private int batchUpdateAmount(List list) { if (CollectionUtils.isEmptyElement(list)) { return 0; diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/BonusController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/BonusController.java index d09f0754..f7898866 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/BonusController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/BonusController.java @@ -82,4 +82,11 @@ public class BonusController extends BaseController return success(bonusService.selectBonusById(id)); } + @Log(title = "支付分成", businessType = BusinessType.OTHER) + @PreAuthorize("@ss.hasPermi('ss:bonus:pay')") + @PutMapping("/{id}/pay") + public AjaxResult pay(@PathVariable Long id) { + return toAjax(bonusService.payBonusById(id)); + } + }