feat 默认分账组功能

This commit is contained in:
xxm1995
2024-04-08 10:21:15 +08:00
parent d1010c2572
commit ccbc09cb84
3 changed files with 27 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
- [x] 分账组管理
- [x] 管理
- [x] 绑定
- [ ] 默认分账组
- [x] 默认分账组
- [ ] 分账订单管理
- [x] 订单创建
- [ ] 发起分账

View File

@@ -98,4 +98,18 @@ public class AllocationGroupController {
return Res.ok();
}
@Operation(summary = "设置默认分账组")
@PostMapping("/setDefault")
public ResResult<Void> setDefault(Long id){
allocationGroupService.setUpDefault(id);
return Res.ok();
}
@Operation(summary = "清除默认分账组")
@PostMapping("/clearDefault")
public ResResult<Void> clearDefault(Long id){
allocationGroupService.clearDefault(id);
return Res.ok();
}
}

View File

@@ -104,7 +104,7 @@ public class AllocationGroupService {
* 设置默认分账组
*/
@Transactional(rollbackFor = Exception.class)
public void setDefault(Long id){
public void setUpDefault(Long id){
// 分账组
AllocationGroup group = groupManager.findById(id)
.orElseThrow(() -> new DataNotExistException("未找到分账组"));
@@ -113,6 +113,17 @@ public class AllocationGroupService {
groupManager.updateById(group);
}
/**
* 清除默认分账组
*/
@Transactional(rollbackFor = Exception.class)
public void clearDefault(Long id){
AllocationGroup group = groupManager.findById(id)
.orElseThrow(() -> new DataNotExistException("未找到分账组"));
group.setDefaultGroup(false);
groupManager.updateById(group);
}
/**
* 更新分账组
*/