feat:增加钱包类型下拉

This commit is contained in:
dzc committed 2025-03-07 17:16:42 +08:00
1 parent 20e1845387
commit 05d3dcd6ce
3 files changed
+49 -30

No files matched your search

@@ -44,19 +44,20 @@ oauth2:
# 正元智慧 # 正元智慧
# https://gwyc.zj.gov.cn/API/%E7%9C%81%E5%B9%B3%E5%8F%B0API%E5%AF%B9%E6%8E%A5%E6%8E%A5%E5%8F%A3.html # https://gwyc.zj.gov.cn/API/%E7%9C%81%E5%B9%B3%E5%8F%B0API%E5%AF%B9%E6%8E%A5%E6%8E%A5%E5%8F%A3.html
zy: zy:
# base-url: http://60.191.37.212:18079
# 测试1 # 测试1
# app-id: 689C8D6F5059A6F85B8BE45A49001ACB base-url: http://60.191.37.212:18079
# app-secret: BD21DA0DEB8F0FC43246B0BD2FCAE6FF app-id: 689C8D6F5059A6F85B8BE45A49001ACB
app-secret: BD21DA0DEB8F0FC43246B0BD2FCAE6FF
# 测试2 # 测试2
# base-url: http://60.191.37.212:18079
# app-id: FC455B0A788E334AC08FB3E1D8385C75 # app-id: FC455B0A788E334AC08FB3E1D8385C75
# app-secret: E9131D0BCC9054808675DA1E2E199023 # app-secret: E9131D0BCC9054808675DA1E2E199023
# 正式 # 正式
base-url: https://gwycport.zj.gov.cn # base-url: https://gwycport.zj.gov.cn
app-id: 0BBF0D9A7F1B4BD5280E59197E259AC6 # app-id: 0BBF0D9A7F1B4BD5280E59197E259AC6
app-secret: 434752786ACBB37214F6617CC37AD0E9 # app-secret: 434752786ACBB37214F6617CC37AD0E9
self-base-url: http://60.191.37.212:18079 self-base-url: http://60.191.37.212:18079
@@ -120,7 +120,8 @@ public class WalletTransactionController {
@Operation(summary = "分页查询复杂查询", description = "分页查询复杂查询") @Operation(summary = "分页查询复杂查询", description = "分页查询复杂查询")
@GetMapping("/page-join") @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) { public R getWalletTransactionPageJoin(@ParameterObject Page page, @ParameterObject WalletTransactionDto dto) {
DataScope dataScope = new DataScope(); DataScope dataScope = new DataScope();
return R.ok(walletTransactionService.scopePageList(page, dto, dataScope)); return R.ok(walletTransactionService.scopePageList(page, dto, dataScope));
@@ -30,50 +30,64 @@ import java.util.Objects;
*/ */
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/walletType" ) @RequestMapping("/walletType")
@Tag(description = "walletType" , name = "钱包类型管理" ) @Tag(description = "walletType", name = "钱包类型管理")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) @SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class WalletTypeController { public class WalletTypeController {
private final WalletTypeService walletTypeService; private final WalletTypeService walletTypeService;
/** /**
* 分页查询 * 分页查询
* @param page 分页对象 *
* @param page 分页对象
* @param walletType 钱包类型 * @param walletType 钱包类型
* @return * @return
*/ */
@Operation(summary = "分页查询" , description = "分页查询" ) @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page")
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_view')")
public R getWalletTypePage(@ParameterObject Page page, @ParameterObject WalletTypeEntity walletType) { public R getWalletTypePage(@ParameterObject Page page, @ParameterObject WalletTypeEntity walletType) {
LambdaQueryWrapper<WalletTypeEntity> wrapper = Wrappers.lambdaQuery(); LambdaQueryWrapper<WalletTypeEntity> wrapper = Wrappers.lambdaQuery();
wrapper.orderByDesc(WalletTypeEntity::getCreateTime); wrapper.orderByDesc(WalletTypeEntity::getCreateTime);
return R.ok(walletTypeService.page(page, wrapper)); 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查询钱包类型 * 通过id查询钱包类型
*
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询" , description = "通过id查询" ) @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" ) @GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('wallet_walletType_view')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_view')")
public R getById(@PathVariable("id" ) Long id) { public R getById(@PathVariable("id") Long id) {
return R.ok(walletTypeService.getById(id)); return R.ok(walletTypeService.getById(id));
} }
/** /**
* 新增钱包类型 * 新增钱包类型
*
* @param dto 钱包类型 * @param dto 钱包类型
* @return R * @return R
*/ */
@Operation(summary = "新增钱包类型" , description = "新增钱包类型" ) @Operation(summary = "新增钱包类型", description = "新增钱包类型")
@SysLog("新增钱包类型" ) @SysLog("新增钱包类型")
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('wallet_walletType_add')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_add')")
public R save(@RequestBody WalletTypeEntity dto) { public R save(@RequestBody WalletTypeEntity dto) {
walletTypeService.create(dto); walletTypeService.create(dto);
return R.ok(true); return R.ok(true);
@@ -81,13 +95,14 @@ public class WalletTypeController {
/** /**
* 修改钱包类型 * 修改钱包类型
*
* @param dto 钱包类型 * @param dto 钱包类型
* @return R * @return R
*/ */
@Operation(summary = "修改钱包类型" , description = "修改钱包类型" ) @Operation(summary = "修改钱包类型", description = "修改钱包类型")
@SysLog("修改钱包类型" ) @SysLog("修改钱包类型")
@PutMapping @PutMapping
@PreAuthorize("@pms.hasPermission('wallet_walletType_edit')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_edit')")
public R updateById(@RequestBody WalletTypeEntity dto) { public R updateById(@RequestBody WalletTypeEntity dto) {
walletTypeService.edit(dto); walletTypeService.edit(dto);
return R.ok(true); return R.ok(true);
@@ -95,13 +110,14 @@ public class WalletTypeController {
/** /**
* 通过id删除钱包类型 * 通过id删除钱包类型
*
* @param ids id列表 * @param ids id列表
* @return R * @return R
*/ */
@Operation(summary = "通过id删除钱包类型" , description = "通过id删除钱包类型" ) @Operation(summary = "通过id删除钱包类型", description = "通过id删除钱包类型")
@SysLog("通过id删除钱包类型" ) @SysLog("通过id删除钱包类型")
@DeleteMapping @DeleteMapping
@PreAuthorize("@pms.hasPermission('wallet_walletType_del')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_del')")
public R removeById(@RequestBody Long[] ids) { public R removeById(@RequestBody Long[] ids) {
return R.ok(walletTypeService.removeBatchByIds(CollUtil.toList(ids))); return R.ok(walletTypeService.removeBatchByIds(CollUtil.toList(ids)));
} }
@@ -109,14 +125,15 @@ public class WalletTypeController {
/** /**
* 导出excel 表格 * 导出excel 表格
*
* @param walletType 查询条件 * @param walletType 查询条件
* @param ids 导出指定ID * @param ids 导出指定ID
* @return excel 文件流 * @return excel 文件流
*/ */
@ResponseExcel @ResponseExcel
@GetMapping("/export") @GetMapping("/export")
@PreAuthorize("@pms.hasPermission('wallet_walletType_export')" ) @PreAuthorize("@pms.hasPermission('wallet_walletType_export')")
public List<WalletTypeEntity> export(WalletTypeEntity walletType,Long[] ids) { public List<WalletTypeEntity> export(WalletTypeEntity walletType, Long[] ids) {
return walletTypeService.list(Wrappers.lambdaQuery(walletType).in(ArrayUtil.isNotEmpty(ids), WalletTypeEntity::getId, ids)); return walletTypeService.list(Wrappers.lambdaQuery(walletType).in(ArrayUtil.isNotEmpty(ids), WalletTypeEntity::getId, ids));
} }
} }