From b5d5b7676c92eee961ca34259848bfcb97115c7b Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 21 四月 2026 15:56:00 +0800
Subject: [PATCH] 奖惩记录迁移到绩效模块
---
cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonRewardPunishmentRecordController.java | 49 +++++++------------------------------------------
1 files changed, 7 insertions(+), 42 deletions(-)
diff --git a/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonRewardPunishmentRecordController.java b/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonRewardPunishmentRecordController.java
index a60c9ac..a012c3d 100644
--- a/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonRewardPunishmentRecordController.java
+++ b/cnas-personnel/src/main/java/com/ruoyi/personnel/controller/PersonRewardPunishmentRecordController.java
@@ -10,6 +10,7 @@
import com.ruoyi.personnel.excel.PersonRewardPunishmentRecordExcel;
import com.ruoyi.personnel.pojo.PersonRewardPunishmentRecord;
import com.ruoyi.personnel.service.PersonRewardPunishmentRecordService;
+import com.ruoyi.personnel.vo.PersonRewardPunishmentRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
@@ -40,61 +41,25 @@
@ApiOperation(value = "鏂板/鏇存柊 濂栨儵璁板綍")
@PostMapping("/addOrUpdateRewardPunishment")
public Result<?> PersonTrainingSave(@RequestBody PersonRewardPunishmentRecord personRewardPunishmentRecord) {
- personRewardPunishmentRecordService.saveOrUpdate(personRewardPunishmentRecord);
- return Result.success();
+ return Result.success(personRewardPunishmentRecordService.saveOrUpdate(personRewardPunishmentRecord));
}
@ApiOperation(value = "鍒犻櫎濂栨儵璁板綍")
@DeleteMapping("/deleteRewardPunishment")
public Result<?> deleteRewardPunishment(@RequestParam("id") Integer id) {
- personRewardPunishmentRecordService.removeById(id);
- return Result.success();
+ return Result.success(personRewardPunishmentRecordService.removeById(id));
}
@ApiOperation(value = "鏌ヨ 濂栨儵璁板綍")
@GetMapping("/rewardPunishmentPage")
@SneakyThrows
- public Result<IPage<PersonRewardPunishmentRecordDto>> rewardPunishmentPage(Page page,
- Integer userId,
- Integer departmentId,
- String userName,
- @RequestParam(value = "startTime",required = false) String startTimeStr,
- @RequestParam(value = "endTime",required = false) String endTimeStr) {
- Date startTime = null;
- Date endTime = null;
- if (StringUtils.isNotEmpty(startTimeStr) || StringUtils.isNotEmpty(endTimeStr)) {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- startTime = formatter.parse(startTimeStr);
- endTime = formatter.parse(endTimeStr);
- }
- return Result.success(personRewardPunishmentRecordService.rewardPunishmentPage(page, userId, userName, startTime, endTime, departmentId));
+ public Result<IPage<PersonRewardPunishmentRecordVO>> rewardPunishmentPage(Page page,PersonRewardPunishmentRecordDto punishmentRecordDto) {
+ return Result.success(personRewardPunishmentRecordService.rewardPunishmentPage(page, punishmentRecordDto));
}
@ApiOperation(value = "濂栨儵璁板綍瀵煎嚭")
@GetMapping("/rewardPunishmentExport")
- public void rewardPunishmentExport(Integer userId,
- Integer departmentId,
- String userName,
- @RequestParam(value = "startTime",required = false) String startTimeStr,
- @RequestParam(value = "endTime",required = false) String endTimeStr,
- HttpServletResponse response) throws Exception {
- Date startTime = null;
- Date endTime = null;
- if (StringUtils.isNotEmpty(startTimeStr) || StringUtils.isNotEmpty(endTimeStr)) {
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
- startTime = formatter.parse(startTimeStr);
- endTime = formatter.parse(endTimeStr);
- }
- List<PersonRewardPunishmentRecordExcel> data = personRewardPunishmentRecordService.rewardPunishmentExport(userId, departmentId, userName, startTime, endTime);
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
- response.setHeader("requestType", "excel");
- response.setHeader("Access-Control-Expose-Headers", "requestType");
- // 璁剧疆鍗曞厓鏍兼牱寮�
- // 淇濆瓨鍒扮涓�涓猻heet涓�
- EasyExcel.write(response.getOutputStream())
- .head(PersonRewardPunishmentRecordExcel.class)
- .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 鑷�傚簲鍒楀
- .sheet()
- .doWrite(data);
+ public void rewardPunishmentExport(PersonRewardPunishmentRecordDto punishmentRecordDto,HttpServletResponse response) {
+ personRewardPunishmentRecordService.exportExcel(punishmentRecordDto,response);
}
}
--
Gitblit v1.9.3