zouyu
2026-04-21 b5d5b7676c92eee961ca34259848bfcb97115c7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.ruoyi.personnel.controller;
 
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.Result;
import com.ruoyi.personnel.dto.PersonRewardPunishmentRecordDto;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
 
/**
 * <p>
 * 奖惩记录 前端控制器
 * </p>
 *
 * @author
 * @since 2024-10-08 11:25:02
 */
@Api(tags = "人员 - 奖惩记录")
@RestController
@RequestMapping("/personRewardPunishmentRecord")
public class PersonRewardPunishmentRecordController {
 
    @Autowired
    private PersonRewardPunishmentRecordService personRewardPunishmentRecordService;
 
    @ApiOperation(value = "新增/更新 奖惩记录")
    @PostMapping("/addOrUpdateRewardPunishment")
    public Result<?> PersonTrainingSave(@RequestBody PersonRewardPunishmentRecord personRewardPunishmentRecord) {
        return Result.success(personRewardPunishmentRecordService.saveOrUpdate(personRewardPunishmentRecord));
    }
 
    @ApiOperation(value = "删除奖惩记录")
    @DeleteMapping("/deleteRewardPunishment")
    public Result<?> deleteRewardPunishment(@RequestParam("id") Integer id) {
        return Result.success(personRewardPunishmentRecordService.removeById(id));
    }
 
    @ApiOperation(value = "查询 奖惩记录")
    @GetMapping("/rewardPunishmentPage")
    @SneakyThrows
    public Result<IPage<PersonRewardPunishmentRecordVO>> rewardPunishmentPage(Page page,PersonRewardPunishmentRecordDto punishmentRecordDto) {
        return Result.success(personRewardPunishmentRecordService.rewardPunishmentPage(page, punishmentRecordDto));
    }
 
    @ApiOperation(value = "奖惩记录导出")
    @GetMapping("/rewardPunishmentExport")
    public void rewardPunishmentExport(PersonRewardPunishmentRecordDto punishmentRecordDto,HttpServletResponse response) {
        personRewardPunishmentRecordService.exportExcel(punishmentRecordDto,response);
    }
}