- 修改所有实体类中的ID字段类型从String改为Long - 更新所有服务接口和实现类的方法参数类型 - 调整控制器中的路径变量类型以匹配新的ID类型 - 修正查询条件判断逻辑,从字符串非空检查改为数值非空检查 - 更新数据传输对象中的ID字段类型保持一致性
100 lines
3.3 KiB
Java
100 lines
3.3 KiB
Java
package com.klp.perf.controller;
|
|
|
|
import java.util.List;
|
|
import java.util.Arrays;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.constraints.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import com.klp.common.annotation.RepeatSubmit;
|
|
import com.klp.common.annotation.Log;
|
|
import com.klp.common.core.controller.BaseController;
|
|
import com.klp.common.core.domain.PageQuery;
|
|
import com.klp.common.core.domain.R;
|
|
import com.klp.common.core.validate.AddGroup;
|
|
import com.klp.common.core.validate.EditGroup;
|
|
import com.klp.common.enums.BusinessType;
|
|
import com.klp.common.utils.poi.ExcelUtil;
|
|
import com.klp.perf.domain.vo.PerfEmployeeInfoVo;
|
|
import com.klp.perf.domain.bo.PerfEmployeeInfoBo;
|
|
import com.klp.perf.service.IPerfEmployeeInfoService;
|
|
import com.klp.common.core.page.TableDataInfo;
|
|
|
|
/**
|
|
* 员工绩效薪资基本信息
|
|
*
|
|
* @author klp
|
|
* @date 2026-07-07
|
|
*/
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RequestMapping("/perf/employeeInfo")
|
|
public class PerfEmployeeInfoController extends BaseController {
|
|
|
|
private final IPerfEmployeeInfoService iPerfEmployeeInfoService;
|
|
|
|
/**
|
|
* 查询员工绩效薪资基本信息列表
|
|
*/
|
|
@GetMapping("/list")
|
|
public TableDataInfo<PerfEmployeeInfoVo> list(PerfEmployeeInfoBo bo, PageQuery pageQuery) {
|
|
return iPerfEmployeeInfoService.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
/**
|
|
* 导出员工绩效薪资基本信息列表
|
|
*/
|
|
@Log(title = "员工绩效薪资基本信息", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/export")
|
|
public void export(PerfEmployeeInfoBo bo, HttpServletResponse response) {
|
|
List<PerfEmployeeInfoVo> list = iPerfEmployeeInfoService.queryList(bo);
|
|
ExcelUtil.exportExcel(list, "员工绩效薪资基本信息", PerfEmployeeInfoVo.class, response);
|
|
}
|
|
|
|
/**
|
|
* 获取员工绩效薪资基本信息详细信息
|
|
*
|
|
* @param id 主键
|
|
*/
|
|
@GetMapping("/{id}")
|
|
public R<PerfEmployeeInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
|
@PathVariable Long id) {
|
|
return R.ok(iPerfEmployeeInfoService.queryById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增员工绩效薪资基本信息
|
|
*/
|
|
@Log(title = "员工绩效薪资基本信息", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@PostMapping()
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PerfEmployeeInfoBo bo) {
|
|
return toAjax(iPerfEmployeeInfoService.insertByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 修改员工绩效薪资基本信息
|
|
*/
|
|
@Log(title = "员工绩效薪资基本信息", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@PutMapping()
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PerfEmployeeInfoBo bo) {
|
|
return toAjax(iPerfEmployeeInfoService.updateByBo(bo));
|
|
}
|
|
|
|
/**
|
|
* 删除员工绩效薪资基本信息
|
|
*
|
|
* @param ids 主键串
|
|
*/
|
|
@Log(title = "员工绩效薪资基本信息", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{ids}")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
@PathVariable Long[] ids) {
|
|
return toAjax(iPerfEmployeeInfoService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
}
|
|
}
|