fix(hrm): 后端接口权限码与菜单对齐,修复非超管账号操作 403
- 考勤/薪酬核算/薪资发放/社保/个税 等 Controller 的 @PreAuthorize 改为菜单实际使用的子模块级权限码
- 新增 SQL hrm_permission_align_init.sql:补齐菜单缺失的 30 个按钮权限点并授权现有角色
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- ============================================= |
| | | -- HRM æéç 对é½åå§åèæ¬ï¼å¯é夿§è¡ï¼ |
| | | -- èæ¯ï¼å端 @PreAuthorize 使ç¨çæéç å¨ system_menu ä¸ä¸åå¨ï¼ |
| | | -- 导è´éè¶
级管çåè°ç¨æ¥å£æ¶ä¸å¾ 403ï¼èåå¯è§ä½"没ææä½æé"ï¼ã |
| | | -- å¤çï¼ä¸ºè¿äºæéç è¡¥é½ type=3 çæé®æéç¹ï¼ä¸æ¾ç¤ºå¨ä¾§æ ï¼ï¼å¹¶ææç»ç°æè§è²ã |
| | | -- èåå¯è§æ§ä»ç±å模åç¶èåç role_menu æ§å¶ï¼ä¸ä¼å æ¤æ©å¤§å¯è§èå´ã |
| | | -- ============================================= |
| | | SET NAMES utf8mb4; |
| | | |
| | | INSERT INTO `system_menu` |
| | | (`id`,`name`,`permission`,`type`,`sort`,`parent_id`,`path`,`icon`,`component`,`component_name`, |
| | | `status`,`visible`,`keep_alive`,`always_show`,`creator`,`create_time`,`updater`,`update_time`,`deleted`) |
| | | VALUES |
| | | -- èå¤ç®¡çï¼6010 ä¸çåèåï¼ |
| | | (602800,'èå¤è§åæ¥è¯¢','hrm:attendance-rule:query',3,10,6013,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602801,'èå¤è®°å½æ¥è¯¢','hrm:attendance-record:query',3,10,6011,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602802,'èå¤å¼å¸¸æ¥è¯¢','hrm:attendance-exception:query',3,10,6012,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602803,'èå¤å¼å¸¸ä¿®æ¹','hrm:attendance-exception:update',3,11,6012,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602804,'èå¤å¼å¸¸å é¤','hrm:attendance-exception:delete',3,12,6012,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602805,'è忥é
ç½®æ¥è¯¢','hrm:attendance-holiday:query',3,10,6014,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602806,'èå¤ç»è®¡æ¥è¯¢','hrm:attendance-summary:query',3,10,6015,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- 人äºå®¡æ¹ï¼6002 ä¸çåèåï¼ |
| | | (602807,'请åç³è¯·å¯¼åº','hrm:leave:export',3,10,6003,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602808,'è°å²ç³è¯·æ¥è¯¢','hrm:transfer:query',3,10,6004,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602809,'è°å²ç³è¯·å¯¼åº','hrm:transfer:export',3,11,6004,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602810,'离èç³è¯·æ¥è¯¢','hrm:resignation:query',3,10,6005,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602811,'离èç³è¯·å¯¼åº','hrm:resignation:export',3,11,6005,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602812,'å çç³è¯·æ¥è¯¢','hrm:overtime:query',3,10,1065211,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- åå·¥åå |
| | | (602813,'åå导å
¥','hrm:employee-contract:import',3,10,1063105,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- èªé
¬æ ¸ç®ï¼6021ï¼ |
| | | (602814,'èªé
¬æ ¸ç®æ¥è¯¢','hrm:salary-calculation:query',3,10,6021,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602815,'èªé
¬æ ¸ç®å é¤','hrm:salary-calculation:delete',3,11,6021,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- èªèµåæ¾ï¼6022ï¼ |
| | | (602816,'èªèµåæ¾æ¥è¯¢','hrm:salary-payment:query',3,10,6022,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602817,'èªèµåæ¾çæ','hrm:salary-payment:generate',3,11,6022,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602818,'èªèµåæ¾å é¤','hrm:salary-payment:delete',3,12,6022,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- å工社ä¿å
¬ç§¯éæ¡£æ¡ï¼6023ï¼ |
| | | (602819,'ç¤¾ä¿æ¡£æ¡æ¥è¯¢','hrm:employee-social-security:query',3,10,6023,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- 社ä¿å
¬ç§¯éæ¹æ¡ï¼602445ï¼ |
| | | (602820,'ç¤¾ä¿æ¹æ¡æ¥è¯¢','hrm:social-security-scheme:query',3,10,602445,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- 社ä¿é
ç½®ï¼æå¨èªé
¬ç®¡ç 6020ï¼ |
| | | (602821,'社ä¿é
ç½®æ¥è¯¢','hrm:social-security-config:query',3,30,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602822,'社ä¿é
ç½®æ°å¢','hrm:social-security-config:create',3,31,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602823,'社ä¿é
置修æ¹','hrm:social-security-config:update',3,32,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602824,'社ä¿é
ç½®å é¤','hrm:social-security-config:delete',3,33,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- 个ç¨ç¨çé
ç½®ï¼6024ï¼ |
| | | (602825,'个ç¨ç¨çæ¥è¯¢','hrm:tax-rate-config:query',3,10,6024,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | -- èªé
¬ç»æï¼èå䏿æ 该页é¢ï¼æéç¹æèªé
¬ç®¡çä¸ï¼ |
| | | (602826,'èªé
¬ç»ææ¥è¯¢','hrm:salary-structure:query',3,40,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602827,'èªé
¬ç»ææ°å¢','hrm:salary-structure:create',3,41,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602828,'èªé
¬ç»æä¿®æ¹','hrm:salary-structure:update',3,42,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0'), |
| | | (602829,'èªé
¬ç»æå é¤','hrm:salary-structure:delete',3,43,6020,'','','',NULL,0,b'1',b'1',b'1','1',NOW(),'1',NOW(),b'0') |
| | | ON DUPLICATE KEY UPDATE |
| | | `name` = VALUES(`name`), `permission` = VALUES(`permission`), `type` = VALUES(`type`), |
| | | `parent_id` = VALUES(`parent_id`), `status` = VALUES(`status`), `deleted` = b'0'; |
| | | |
| | | -- ææç»ç°æå
¨é¨è§è²ï¼èåå¯è§æ§ä»ç±ç¶èåæ§å¶ï¼ä¸ä¼å æ¤æ©å¤§å¯è§èå´ï¼ |
| | | INSERT INTO `system_role_menu` (`role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) |
| | | SELECT r.id, m.id, '1', NOW(), '1', NOW(), b'0' |
| | | FROM `system_role` r |
| | | JOIN `system_menu` m ON m.id BETWEEN 602800 AND 602829 AND m.deleted = b'0' |
| | | WHERE r.deleted = b'0' |
| | | AND NOT EXISTS ( |
| | | SELECT 1 FROM `system_role_menu` rm |
| | | WHERE rm.role_id = r.id AND rm.menu_id = m.id AND rm.deleted = b'0' |
| | | ); |
| | | |
| | | SELECT 'HRM æéç 对é½åå§å宿' AS result; |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "æ°å¢èå¤å¼å¸¸ç³è¯·") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:create')") |
| | | public CommonResult<Long> createAttendanceException(@Valid @RequestBody HrmAttendanceExceptionSaveReqVO createReqVO) { |
| | | return success(attendanceExceptionService.createAttendanceException(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°èå¤å¼å¸¸ç³è¯·") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:update')") |
| | | public CommonResult<Boolean> updateAttendanceException(@Valid @RequestBody HrmAttendanceExceptionSaveReqVO updateReqVO) { |
| | | attendanceExceptionService.updateAttendanceException(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤èå¤å¼å¸¸ç³è¯·") |
| | | @Parameter(name = "id", description = "ç³è¯·ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:delete')") |
| | | public CommonResult<Boolean> deleteAttendanceException(@RequestParam("id") Long id) { |
| | | attendanceExceptionService.deleteAttendanceException(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾èå¤å¼å¸¸ç³è¯·") |
| | | @Parameter(name = "id", description = "ç³è¯·ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:query')") |
| | | public CommonResult<HrmAttendanceExceptionRespVO> getAttendanceException(@RequestParam("id") Long id) { |
| | | HrmAttendanceExceptionDO attendanceException = attendanceExceptionService.getAttendanceException(id); |
| | | if (attendanceException == null) { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èå¤å¼å¸¸ç³è¯·å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:query')") |
| | | public CommonResult<PageResult<HrmAttendanceExceptionRespVO>> getAttendanceExceptionPage(@Valid HrmAttendanceExceptionPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceExceptionDO> pageResult = attendanceExceptionService.getAttendanceExceptionPage(pageReqVO); |
| | | List<HrmAttendanceExceptionRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmAttendanceExceptionRespVO.class); |
| | |
| | | |
| | | @PostMapping("/submit") |
| | | @Operation(summary = "æäº¤èå¤å¼å¸¸ç³è¯·") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:submit')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-exception:submit')") |
| | | public CommonResult<Boolean> submitAttendanceException( |
| | | @RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "æ°å¢è忥é
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:create')") |
| | | public CommonResult<Long> createAttendanceHoliday(@Valid @RequestBody HrmAttendanceHolidaySaveReqVO createReqVO) { |
| | | return success(attendanceHolidayService.createAttendanceHoliday(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°è忥é
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:update')") |
| | | public CommonResult<Boolean> updateAttendanceHoliday(@Valid @RequestBody HrmAttendanceHolidaySaveReqVO updateReqVO) { |
| | | attendanceHolidayService.updateAttendanceHoliday(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è忥é
ç½®") |
| | | @Parameter(name = "id", description = "è忥ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:delete')") |
| | | public CommonResult<Boolean> deleteAttendanceHoliday(@RequestParam("id") Long id) { |
| | | attendanceHolidayService.deleteAttendanceHoliday(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾è忥é
ç½®") |
| | | @Parameter(name = "id", description = "è忥ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:query')") |
| | | public CommonResult<HrmAttendanceHolidayRespVO> getAttendanceHoliday(@RequestParam("id") Long id) { |
| | | HrmAttendanceHolidayDO attendanceHoliday = attendanceHolidayService.getAttendanceHoliday(id); |
| | | return success(BeanUtils.toBean(attendanceHoliday, HrmAttendanceHolidayRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾è忥é
ç½®å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:query')") |
| | | public CommonResult<PageResult<HrmAttendanceHolidayRespVO>> getAttendanceHolidayPage(@Valid HrmAttendanceHolidayPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceHolidayDO> pageResult = attendanceHolidayService.getAttendanceHolidayPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, HrmAttendanceHolidayRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºè忥é
ç½® Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-holiday:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportAttendanceHolidayExcel(@Valid HrmAttendanceHolidayPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | @PostMapping("/clock-in") |
| | | @Operation(summary = "ä¸çæå¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:clock')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockIn(@RequestParam("location") String location) { |
| | | Long loginUserId = getLoginUserId(); |
| | | HrmEmployeeDO employee = employeeService.getEmployeeByUserId(loginUserId); |
| | |
| | | |
| | | @PostMapping("/clock-out") |
| | | @Operation(summary = "ä¸çæå¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:clock')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:clock')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> clockOut(@RequestParam("location") String location) { |
| | | Long loginUserId = getLoginUserId(); |
| | | HrmEmployeeDO employee = employeeService.getEmployeeByUserId(loginUserId); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èå¤è®°å½å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:query')") |
| | | public CommonResult<PageResult<HrmAttendanceRecordRespVO>> getAttendanceRecordPage(@Valid HrmAttendanceRecordPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceRecordDO> pageResult = attendanceRecordService.getAttendanceRecordPage(pageReqVO); |
| | | // 转æ¢ä¸º VO |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾èå¤è®°å½") |
| | | @Parameter(name = "id", description = "è®°å½ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:query')") |
| | | public CommonResult<HrmAttendanceRecordRespVO> getAttendanceRecord(@RequestParam("id") Long id) { |
| | | HrmAttendanceRecordDO attendanceRecord = attendanceRecordService.getAttendanceRecord(id); |
| | | if (attendanceRecord == null) { |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºèå¤è®°å½ Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-record:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportAttendanceRecordExcel(@Valid HrmAttendanceRecordPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "æ°å¢èå¤è§å") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:create')") |
| | | public CommonResult<Long> createAttendanceRule(@Valid @RequestBody HrmAttendanceRuleSaveReqVO createReqVO) { |
| | | return success(attendanceRuleService.createAttendanceRule(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°èå¤è§å") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:update')") |
| | | public CommonResult<Boolean> updateAttendanceRule(@Valid @RequestBody HrmAttendanceRuleSaveReqVO updateReqVO) { |
| | | attendanceRuleService.updateAttendanceRule(updateReqVO); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤èå¤è§å") |
| | | @Parameter(name = "id", description = "è§åID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:delete')") |
| | | public CommonResult<Boolean> deleteAttendanceRule(@RequestParam("id") Long id) { |
| | | attendanceRuleService.deleteAttendanceRule(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾èå¤è§å") |
| | | @Parameter(name = "id", description = "è§åID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:query')") |
| | | public CommonResult<HrmAttendanceRuleRespVO> getAttendanceRule(@RequestParam("id") Long id) { |
| | | HrmAttendanceRuleDO attendanceRule = attendanceRuleService.getAttendanceRule(id); |
| | | if (attendanceRule == null) { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èå¤è§åå页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:query')") |
| | | public CommonResult<PageResult<HrmAttendanceRuleRespVO>> getAttendanceRulePage(@Valid HrmAttendanceRulePageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceRuleDO> pageResult = attendanceRuleService.getAttendanceRulePage(pageReqVO); |
| | | List<HrmAttendanceRuleRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmAttendanceRuleRespVO.class); |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å¾èå¤è§åå表") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:query')") |
| | | public CommonResult<List<HrmAttendanceRuleRespVO>> getAttendanceRuleList() { |
| | | List<HrmAttendanceRuleDO> list = attendanceRuleService.getAttendanceRuleList(); |
| | | return success(BeanUtils.toBean(list, HrmAttendanceRuleRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºèå¤è§å Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-rule:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportAttendanceRuleExcel(@Valid HrmAttendanceRulePageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èå¤ç»è®¡æ±æ»å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-summary:query')") |
| | | public CommonResult<PageResult<HrmAttendanceSummaryRespVO>> getAttendanceSummaryPage(@Valid HrmAttendanceSummaryPageReqVO pageReqVO) { |
| | | PageResult<HrmAttendanceSummaryDO> pageResult = attendanceSummaryService.getAttendanceSummaryPage(pageReqVO); |
| | | List<HrmAttendanceSummaryRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmAttendanceSummaryRespVO.class); |
| | |
| | | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾åå·¥æåº¦è夿±æ»") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-summary:query')") |
| | | public CommonResult<HrmAttendanceSummaryRespVO> getMonthlySummary( |
| | | @RequestParam("userId") Long userId, |
| | | @RequestParam("yearMonth") String yearMonth) { |
| | |
| | | @PostMapping("/generate") |
| | | @Operation(summary = "çææåº¦è夿±æ»") |
| | | @Parameter(name = "yearMonth", description = "å¹´æï¼æ ¼å¼ï¼yyyy-MM", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:calculate')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-summary:generate')") |
| | | public CommonResult<Boolean> generateMonthlySummary(@RequestParam("yearMonth") String yearMonth, |
| | | @RequestParam(value = "deptId", required = false) Long deptId, |
| | | @RequestParam(value = "userId", required = false) Long userId) { |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºèå¤ç»è®¡æ±æ» Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:attendance-summary:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportAttendanceSummaryExcel(@Valid HrmAttendanceSummaryPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建å工社ä¿å
¬ç§¯éæ¡£æ¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:create')") |
| | | public CommonResult<Long> createEmployeeSocialSecurity(@Valid @RequestBody HrmEmployeeSocialSecuritySaveReqVO createReqVO) { |
| | | HrmEmployeeSocialSecurityDO socialSecurity = BeanUtils.toBean(createReqVO, HrmEmployeeSocialSecurityDO.class); |
| | | return success(employeeSocialSecurityService.createEmployeeSocialSecurity(socialSecurity)); |
| | |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°å工社ä¿å
¬ç§¯éæ¡£æ¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:update')") |
| | | public CommonResult<Boolean> updateEmployeeSocialSecurity(@Valid @RequestBody HrmEmployeeSocialSecuritySaveReqVO updateReqVO) { |
| | | HrmEmployeeSocialSecurityDO socialSecurity = BeanUtils.toBean(updateReqVO, HrmEmployeeSocialSecurityDO.class); |
| | | employeeSocialSecurityService.updateEmployeeSocialSecurity(socialSecurity); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤å工社ä¿å
¬ç§¯éæ¡£æ¡") |
| | | @Parameter(name = "id", description = "æ¡£æ¡ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:delete')") |
| | | public CommonResult<Boolean> deleteEmployeeSocialSecurity(@RequestParam("id") Long id) { |
| | | employeeSocialSecurityService.deleteEmployeeSocialSecurity(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·åå工社ä¿å
¬ç§¯éæ¡£æ¡") |
| | | @Parameter(name = "id", description = "æ¡£æ¡ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:query')") |
| | | public CommonResult<HrmEmployeeSocialSecurityRespVO> getEmployeeSocialSecurity(@RequestParam("id") Long id) { |
| | | HrmEmployeeSocialSecurityDO socialSecurity = employeeSocialSecurityService.getEmployeeSocialSecurity(id); |
| | | if (socialSecurity == null) { |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·åå工社ä¿å
¬ç§¯éæ¡£æ¡å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:query')") |
| | | public CommonResult<PageResult<HrmEmployeeSocialSecurityRespVO>> getEmployeeSocialSecurityPage( |
| | | @Valid HrmEmployeeSocialSecurityPageReqVO pageReqVO) { |
| | | PageResult<HrmEmployeeSocialSecurityDO> pageResult = employeeSocialSecurityService.getEmployeeSocialSecurityPage(pageReqVO); |
| | |
| | | @GetMapping("/list-by-user") |
| | | @Operation(summary = "è·åå工社ä¿å
¬ç§¯éæ¡£æ¡åå²å表") |
| | | @Parameter(name = "userId", description = "ç³»ç»ç¨æ·ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:query')") |
| | | public CommonResult<List<HrmEmployeeSocialSecurityRespVO>> getEmployeeSocialSecurityList( |
| | | @RequestParam("userId") Long userId) { |
| | | List<HrmEmployeeSocialSecurityDO> list = employeeSocialSecurityService.getEmployeeSocialSecurityList(userId); |
| | |
| | | @GetMapping("/get-latest") |
| | | @Operation(summary = "è·ååå·¥ææ°çæç社ä¿å
¬ç§¯éæ¡£æ¡") |
| | | @Parameter(name = "userId", description = "ç³»ç»ç¨æ·ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:employee-social-security:query')") |
| | | public CommonResult<HrmEmployeeSocialSecurityRespVO> getLatestEmployeeSocialSecurity( |
| | | @RequestParam("userId") Long userId) { |
| | | HrmEmployeeSocialSecurityDO socialSecurity = employeeSocialSecurityService.getLatestEmployeeSocialSecurity(userId); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èªé
¬æ ¸ç®å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:query')") |
| | | public CommonResult<PageResult<HrmSalaryCalculationRespVO>> getSalaryCalculationPage(@Valid HrmSalaryCalculationPageReqVO pageReqVO) { |
| | | PageResult<HrmSalaryCalculationDO> pageResult = salaryCalculationService.getSalaryCalculationPage(pageReqVO); |
| | | // 转æ¢ä¸º VO |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾èªé
¬æ ¸ç®") |
| | | @Parameter(name = "id", description = "æ ¸ç®ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:query')") |
| | | public CommonResult<HrmSalaryCalculationRespVO> getSalaryCalculation(@RequestParam("id") Long id) { |
| | | HrmSalaryCalculationDO salaryCalculation = salaryCalculationService.getSalaryCalculation(id); |
| | | if (salaryCalculation == null) { |
| | |
| | | @Operation(summary = "æ§è¡èªé
¬æ ¸ç®") |
| | | @Parameter(name = "period", description = "æ ¸ç®å¨æ", required = true, example = "2024-01") |
| | | @Parameter(name = "deptId", description = "é¨é¨IDï¼ä¸ºç©ºåæ ¸ç®ææé¨é¨", example = "1") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:calculate')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:calculate')") |
| | | public CommonResult<Boolean> calculateSalary(@RequestParam("period") String period, |
| | | @RequestParam(value = "deptId", required = false) Long deptId) { |
| | | salaryCalculationService.calculateSalary(period, deptId); |
| | |
| | | |
| | | @PostMapping("/confirm") |
| | | @Operation(summary = "æ¹é确认èªé
¬æ ¸ç®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:confirm')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:confirm')") |
| | | public CommonResult<Boolean> confirmSalaryCalculation(@RequestBody Map<String, List<Long>> request) { |
| | | List<Long> ids = request.get("ids"); |
| | | salaryCalculationService.confirmSalaryCalculation(ids); |
| | |
| | | |
| | | @PostMapping("/revoke") |
| | | @Operation(summary = "æ¹éæ¤éèªé
¬æ ¸ç®ç¡®è®¤") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:confirm')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:confirm')") |
| | | public CommonResult<Boolean> revokeSalaryCalculation(@RequestBody Map<String, List<Long>> request) { |
| | | List<Long> ids = request.get("ids"); |
| | | salaryCalculationService.revokeSalaryCalculation(ids); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤èªé
¬æ ¸ç®è®°å½") |
| | | @Parameter(name = "id", description = "æ ¸ç®ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:delete')") |
| | | public CommonResult<Boolean> deleteSalaryCalculation(@RequestParam("id") Long id) { |
| | | salaryCalculationService.deleteSalaryCalculation(id); |
| | | return success(true); |
| | |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºèªé
¬æ ¸ç® Excel") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:export')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportSalaryCalculationExcel(@Valid HrmSalaryCalculationPageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | @Operation(summary = "é¢è§é¨é¨ä¸ææåå·¥çèªèµæ ¸ç®ä¿¡æ¯") |
| | | @Parameter(name = "period", description = "æ ¸ç®å¨æ", required = true, example = "2024-01") |
| | | @Parameter(name = "deptId", description = "é¨é¨IDï¼ä¸ºç©ºåæ¥è¯¢å
¨é¨", example = "1") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:query')") |
| | | public CommonResult<List<HrmSalaryCalculationRespVO>> previewSalaryCalculation( |
| | | @RequestParam("period") String period, |
| | | @RequestParam(value = "deptId", required = false) Long deptId) { |
| | |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "æ¹éä¿åèªé
¬æ ¸ç®è®°å½") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:calculate')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:calculate')") |
| | | public CommonResult<Boolean> saveSalaryCalculation(@Valid @RequestBody HrmSalaryCalculationSaveReqVO saveReqVO) { |
| | | // 转æ¢ä¸º DO å表 |
| | | List<HrmSalaryCalculationDO> calculationList = saveReqVO.getList().stream() |
| | |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹èªé
¬æ ¸ç®è®°å½", description = "ä»
å¾
ç¡®è®¤ç¶æå¯ä¿®æ¹ï¼å®åå·¥èµç±åç«¯ææ¶å
¥/æ£é¤é¡¹éç®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:calculate')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-calculation:calculate')") |
| | | public CommonResult<Boolean> updateSalaryCalculation(@Valid @RequestBody HrmSalaryCalculationRespVO updateReqVO) { |
| | | HrmSalaryCalculationDO calculation = BeanUtils.toBean(updateReqVO, HrmSalaryCalculationDO.class); |
| | | salaryCalculationService.updateSalaryCalculation(calculation); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾èªèµåæ¾å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')") |
| | | public CommonResult<PageResult<HrmSalaryPaymentRespVO>> getSalaryPaymentPage(@Valid HrmSalaryPaymentPageReqVO pageReqVO) { |
| | | PageResult<HrmSalaryPaymentDO> pageResult = salaryPaymentService.getSalaryPaymentPage(pageReqVO); |
| | | return success(BeanUtils.toBean(pageResult, HrmSalaryPaymentRespVO.class)); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾èªèµåæ¾") |
| | | @Parameter(name = "id", description = "åæ¾ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')") |
| | | public CommonResult<HrmSalaryPaymentRespVO> getSalaryPayment(@RequestParam("id") Long id) { |
| | | HrmSalaryPaymentDO salaryPayment = salaryPaymentService.getSalaryPayment(id); |
| | | HrmSalaryPaymentRespVO respVO = BeanUtils.toBean(salaryPayment, HrmSalaryPaymentRespVO.class); |
| | |
| | | @PostMapping("/generate") |
| | | @Operation(summary = "çæèªèµåæ¾å°è´¦") |
| | | @Parameter(name = "period", description = "æ ¸ç®å¨æ", required = true, example = "2024-01") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:generate')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:generate')") |
| | | public CommonResult<Long> generatePayment(@RequestParam("period") String period) { |
| | | return success(salaryPaymentService.generatePayment(period)); |
| | | } |
| | |
| | | @PostMapping("/pay") |
| | | @Operation(summary = "åæ¾èªèµï¼æ´ä¸ªå°è´¦ï¼") |
| | | @Parameter(name = "id", description = "åæ¾å°è´¦ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:pay')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')") |
| | | public CommonResult<Boolean> paySalary(@RequestParam("id") Long id) { |
| | | salaryPaymentService.paySalary(id); |
| | | return success(true); |
| | |
| | | |
| | | @PostMapping("/pay-detail") |
| | | @Operation(summary = "æ¹éåæ¾èªèµæç»") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:pay')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')") |
| | | public CommonResult<Boolean> paySalaryDetail(@RequestBody Map<String, List<Long>> request) { |
| | | List<Long> detailIds = request.get("detailIds"); |
| | | salaryPaymentService.paySalaryDetail(detailIds); |
| | |
| | | |
| | | @PostMapping("/revoke-detail") |
| | | @Operation(summary = "æ¹éæ¤éèªèµåæ¾æç»") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:pay')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:pay')") |
| | | public CommonResult<Boolean> revokeSalaryPaymentDetail(@RequestBody Map<String, List<Long>> request) { |
| | | List<Long> detailIds = request.get("detailIds"); |
| | | salaryPaymentService.revokeSalaryPaymentDetail(detailIds); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤èªèµåæ¾å°è´¦") |
| | | @Parameter(name = "id", description = "åæ¾å°è´¦ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:delete')") |
| | | public CommonResult<Boolean> deleteSalaryPayment(@RequestParam("id") Long id) { |
| | | salaryPaymentService.deleteSalaryPayment(id); |
| | | return success(true); |
| | |
| | | |
| | | @GetMapping("/detail/page") |
| | | @Operation(summary = "è·å¾èªèµåæ¾æç»å页") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')") |
| | | public CommonResult<PageResult<HrmSalaryPaymentDetailRespVO>> getSalaryPaymentDetailPage(@Valid HrmSalaryPaymentDetailPageReqVO pageReqVO) { |
| | | PageResult<HrmSalaryPaymentDetailDO> pageResult = salaryPaymentService.getSalaryPaymentDetailPage(pageReqVO); |
| | | List<HrmSalaryPaymentDetailRespVO> list = BeanUtils.toBean(pageResult.getList(), HrmSalaryPaymentDetailRespVO.class); |
| | |
| | | @GetMapping("/detail/list") |
| | | @Operation(summary = "è·å¾èªèµåæ¾æç»å表") |
| | | @Parameter(name = "paymentId", description = "åæ¾å°è´¦ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:salary-payment:query')") |
| | | public CommonResult<List<HrmSalaryPaymentDetailRespVO>> getSalaryPaymentDetailList(@RequestParam("paymentId") Long paymentId) { |
| | | List<HrmSalaryPaymentDetailDO> detailList = salaryPaymentService.getSalaryPaymentDetailListByPaymentId(paymentId); |
| | | List<HrmSalaryPaymentDetailRespVO> list = BeanUtils.toBean(detailList, HrmSalaryPaymentDetailRespVO.class); |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建社ä¿å
¬ç§¯éé
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:create')") |
| | | public CommonResult<Long> createSocialSecurityConfig(@Valid @RequestBody HrmSocialSecurityConfigSaveReqVO createReqVO) { |
| | | HrmSocialSecurityConfigDO config = BeanUtils.toBean(createReqVO, HrmSocialSecurityConfigDO.class); |
| | | return success(socialSecurityConfigService.createSocialSecurityConfig(config)); |
| | |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°ç¤¾ä¿å
¬ç§¯éé
ç½®") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:update')") |
| | | public CommonResult<Boolean> updateSocialSecurityConfig(@Valid @RequestBody HrmSocialSecurityConfigSaveReqVO updateReqVO) { |
| | | HrmSocialSecurityConfigDO config = BeanUtils.toBean(updateReqVO, HrmSocialSecurityConfigDO.class); |
| | | socialSecurityConfigService.updateSocialSecurityConfig(config); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤ç¤¾ä¿å
¬ç§¯éé
ç½®") |
| | | @Parameter(name = "id", description = "é
ç½®ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:delete')") |
| | | public CommonResult<Boolean> deleteSocialSecurityConfig(@RequestParam("id") Long id) { |
| | | socialSecurityConfigService.deleteSocialSecurityConfig(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å社ä¿å
¬ç§¯éé
ç½®") |
| | | @Parameter(name = "id", description = "é
ç½®ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:query')") |
| | | public CommonResult<HrmSocialSecurityConfigRespVO> getSocialSecurityConfig(@RequestParam("id") Long id) { |
| | | HrmSocialSecurityConfigDO config = socialSecurityConfigService.getSocialSecurityConfig(id); |
| | | return success(BeanUtils.toBean(config, HrmSocialSecurityConfigRespVO.class)); |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å社ä¿å
¬ç§¯éé
ç½®å表") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:query')") |
| | | public CommonResult<List<HrmSocialSecurityConfigRespVO>> getSocialSecurityConfigList() { |
| | | List<HrmSocialSecurityConfigDO> list = socialSecurityConfigService.getSocialSecurityConfigList(); |
| | | return success(BeanUtils.toBean(list, HrmSocialSecurityConfigRespVO.class)); |
| | |
| | | @GetMapping("/get-effective") |
| | | @Operation(summary = "è·åçæç社ä¿å
¬ç§¯éé
ç½®") |
| | | @Parameter(name = "effectiveDate", description = "çææ¥æ", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-config:query')") |
| | | public CommonResult<HrmSocialSecurityConfigRespVO> getEffectiveSocialSecurityConfig( |
| | | @RequestParam("effectiveDate") LocalDate effectiveDate) { |
| | | HrmSocialSecurityConfigDO config = socialSecurityConfigService.getEffectiveSocialSecurityConfig(effectiveDate); |
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建社ä¿å
¬ç§¯éæ¹æ¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:create')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-scheme:create')") |
| | | public CommonResult<Long> createScheme(@Valid @RequestBody HrmSocialSecuritySchemeSaveReqVO createReqVO) { |
| | | HrmSocialSecuritySchemeDO scheme = BeanUtils.toBean(createReqVO, HrmSocialSecuritySchemeDO.class); |
| | | return success(schemeService.createScheme(scheme)); |
| | |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°ç¤¾ä¿å
¬ç§¯éæ¹æ¡") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:update')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-scheme:update')") |
| | | public CommonResult<Boolean> updateScheme(@Valid @RequestBody HrmSocialSecuritySchemeSaveReqVO updateReqVO) { |
| | | HrmSocialSecuritySchemeDO scheme = BeanUtils.toBean(updateReqVO, HrmSocialSecuritySchemeDO.class); |
| | | schemeService.updateScheme(scheme); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤ç¤¾ä¿å
¬ç§¯éæ¹æ¡") |
| | | @Parameter(name = "id", description = "æ¹æ¡ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:delete')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-scheme:delete')") |
| | | public CommonResult<Boolean> deleteScheme(@RequestParam("id") Long id) { |
| | | schemeService.deleteScheme(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å社ä¿å
¬ç§¯éæ¹æ¡") |
| | | @Parameter(name = "id", description = "æ¹æ¡ID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-scheme:query')") |
| | | public CommonResult<HrmSocialSecuritySchemeRespVO> getScheme(@RequestParam("id") Long id) { |
| | | HrmSocialSecuritySchemeDO scheme = schemeService.getScheme(id); |
| | | return success(BeanUtils.toBean(scheme, HrmSocialSecuritySchemeRespVO.class)); |
| | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å社ä¿å
¬ç§¯éæ¹æ¡å表") |
| | | @Parameter(name = "status", description = "ç¶æ") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security:query')") |
| | | @PreAuthorize("@ss.hasPermission('hrm:social-security-scheme:query')") |
| | | public CommonResult<List<HrmSocialSecuritySchemeRespVO>> getSchemeList( |
| | | @RequestParam(value = "status", required = false) Integer status) { |
| | | List<HrmSocialSecuritySchemeDO> list = schemeService.getSchemeList(status); |
| | |
| | | |
| | | @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); |