| | |
| | | |
| | | @PostMapping("/create-list") |
| | | @Operation(summary = "批量创建个税税率配置(一个税率表包含7个档位)") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:create')") |
| | | public CommonResult<Boolean> createTaxRateConfigList(@Valid @RequestBody List<HrmTaxRateConfigSaveReqVO> createReqVOList) { |
| | | List<HrmTaxRateConfigDO> configList = BeanUtils.toBean(createReqVOList, HrmTaxRateConfigDO.class); |
| | | taxRateConfigService.createTaxRateConfigList(configList); |
| | |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新个税税率配置") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:update')") |
| | | public CommonResult<Boolean> updateTaxRateConfig(@Valid @RequestBody HrmTaxRateConfigSaveReqVO updateReqVO) { |
| | | HrmTaxRateConfigDO config = BeanUtils.toBean(updateReqVO, HrmTaxRateConfigDO.class); |
| | | taxRateConfigService.updateTaxRateConfig(config); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除个税税率配置") |
| | | @Parameter(name = "id", description = "配置ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:delete')") |
| | | public CommonResult<Boolean> deleteTaxRateConfig(@RequestParam("id") Long id) { |
| | | taxRateConfigService.deleteTaxRateConfig(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "获取个税税率配置") |
| | | @Parameter(name = "id", description = "配置ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:query')") |
| | | public CommonResult<HrmTaxRateConfigRespVO> getTaxRateConfig(@RequestParam("id") Long id) { |
| | | HrmTaxRateConfigDO config = taxRateConfigService.getTaxRateConfig(id); |
| | | return success(BeanUtils.toBean(config, HrmTaxRateConfigRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "获取个税税率配置列表") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:query')") |
| | | public CommonResult<List<HrmTaxRateConfigRespVO>> getTaxRateConfigList() { |
| | | List<HrmTaxRateConfigDO> list = taxRateConfigService.getTaxRateConfigList(); |
| | | return success(BeanUtils.toBean(list, HrmTaxRateConfigRespVO.class)); |
| | |
| | | @GetMapping("/get-effective") |
| | | @Operation(summary = "获取生效的个税税率配置列表(按级数排序)") |
| | | @Parameter(name = "effectiveDate", description = "生效日期", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:tax-rate-config:query')") |
| | | public CommonResult<List<HrmTaxRateConfigRespVO>> getEffectiveTaxRateConfigList( |
| | | @RequestParam("effectiveDate") LocalDate effectiveDate) { |
| | | List<HrmTaxRateConfigDO> list = taxRateConfigService.getEffectiveTaxRateConfigList(effectiveDate); |