feat:增加钱包类型下拉
This commit is contained in:
1 parent
20e1845387
commit
05d3dcd6ce
3 files changed
+49
-30
No files matched your search
+2
-1
@@ -120,7 +120,8 @@ public class WalletTransactionController {
|
||||
|
||||
@Operation(summary = "分页查询复杂查询", description = "分页查询复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletTransaction_view')")
|
||||
// TODO 这个比较公用先不加权限
|
||||
// @PreAuthorize("@pms.hasPermission('wallet_walletTransaction_view')")
|
||||
public R getWalletTransactionPageJoin(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) {
|
||||
DataScope dataScope = new DataScope();
|
||||
return R.ok(walletTransactionService.scopePageList(page, dto, dataScope));
|
||||
|
||||
+40
-23
@@ -30,50 +30,64 @@ import java.util.Objects;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/walletType" )
|
||||
@Tag(description = "walletType" , name = "钱包类型管理" )
|
||||
@RequestMapping("/walletType")
|
||||
@Tag(description = "walletType", name = "钱包类型管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletTypeController {
|
||||
|
||||
private final WalletTypeService walletTypeService;
|
||||
private final WalletTypeService walletTypeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param walletType 钱包类型
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')" )
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')")
|
||||
public R getWalletTypePage(@ParameterObject Page page, @ParameterObject WalletTypeEntity walletType) {
|
||||
LambdaQueryWrapper<WalletTypeEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.orderByDesc(WalletTypeEntity::getCreateTime);
|
||||
return R.ok(walletTypeService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询下拉
|
||||
*/
|
||||
@Operation(summary = "查询下拉", description = "查询下拉")
|
||||
@GetMapping("/select")
|
||||
public R<List<WalletTypeEntity>> walletList() {
|
||||
LambdaQueryWrapper<WalletTypeEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.orderByDesc(WalletTypeEntity::getCreateTime);
|
||||
return R.ok(walletTypeService.list(wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询钱包类型
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(walletTypeService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增钱包类型
|
||||
*
|
||||
* @param dto 钱包类型
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增钱包类型" , description = "新增钱包类型" )
|
||||
@SysLog("新增钱包类型" )
|
||||
@Operation(summary = "新增钱包类型", description = "新增钱包类型")
|
||||
@SysLog("新增钱包类型")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_add')")
|
||||
public R save(@RequestBody WalletTypeEntity dto) {
|
||||
walletTypeService.create(dto);
|
||||
return R.ok(true);
|
||||
@@ -81,13 +95,14 @@ public class WalletTypeController {
|
||||
|
||||
/**
|
||||
* 修改钱包类型
|
||||
*
|
||||
* @param dto 钱包类型
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改钱包类型" , description = "修改钱包类型" )
|
||||
@SysLog("修改钱包类型" )
|
||||
@Operation(summary = "修改钱包类型", description = "修改钱包类型")
|
||||
@SysLog("修改钱包类型")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_edit')")
|
||||
public R updateById(@RequestBody WalletTypeEntity dto) {
|
||||
walletTypeService.edit(dto);
|
||||
return R.ok(true);
|
||||
@@ -95,13 +110,14 @@ public class WalletTypeController {
|
||||
|
||||
/**
|
||||
* 通过id删除钱包类型
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除钱包类型" , description = "通过id删除钱包类型" )
|
||||
@SysLog("通过id删除钱包类型" )
|
||||
@Operation(summary = "通过id删除钱包类型", description = "通过id删除钱包类型")
|
||||
@SysLog("通过id删除钱包类型")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_del')" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletTypeService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
@@ -109,14 +125,15 @@ public class WalletTypeController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param walletType 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_export')" )
|
||||
public List<WalletTypeEntity> export(WalletTypeEntity walletType,Long[] ids) {
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletType_export')")
|
||||
public List<WalletTypeEntity> export(WalletTypeEntity walletType, Long[] ids) {
|
||||
return walletTypeService.list(Wrappers.lambdaQuery(walletType).in(ArrayUtil.isNotEmpty(ids), WalletTypeEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user