1 #8

Merged
pxf8gw7s3 merged 17 commits from hrm/wlk into develop 3 months ago

@ -2,7 +2,6 @@ package com.qiujie.controller;
import com.qiujie.service.AttendanceService;
import com.qiujie.entity.Attendance;
import com.qiujie.dto.ResponseDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,91 +14,156 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
*
* </p>
*
*
* HTTP
*
* @author qiujie
* @since 2022-03-29
*/
@RestController
@RequestMapping("/attendance")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/attendance") // 定义基础请求路径为/attendance
public class AttendanceController {
@Autowired
@Autowired // 自动注入考勤服务类
private AttendanceService attendanceService;
/**
*
* @param attendance
* @return
*/
@ApiOperation("新增")
@PostMapping
@PostMapping // 处理POST请求路径为/attendance
public ResponseDTO add(@RequestBody Attendance attendance) {
return this.attendanceService.add(attendance);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/attendance/{id}
public ResponseDTO delete(@PathVariable Integer id) {
return this.attendanceService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/attendance/batch/{ids}
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.attendanceService.deleteBatch(ids);
}
/**
*
* @param attendance
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PutMapping // 处理PUT请求路径为/attendance
public ResponseDTO edit(@RequestBody Attendance attendance) {
return this.attendanceService.edit(attendance);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/attendance/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.attendanceService.query(id);
}
/**
*
* @param current 1
* @param size 10
* @param name
* @param deptId ID
* @param month 2024-01
* @return
*/
@ApiOperation("条件查询")
@GetMapping
@PreAuthorize("hasAnyAuthority('performance:attendance:list','performance:attendance:search')")
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId, String month) {
@GetMapping // 处理GET请求路径为/attendance
@PreAuthorize("hasAnyAuthority('performance:attendance:list','performance:attendance:search')") // 需要具备考勤列表查看或搜索权限
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
String name,
Integer deptId,
String month) {
return this.attendanceService.list(current, size, name, deptId, month);
}
/**
*
* @param response HTTPExcel
* @param month
* @param filename
* @throws IOException IO
*/
@ApiOperation("数据导出接口")
@GetMapping("/export/{month}/{filename}")
@PreAuthorize("hasAnyAuthority('performance:attendance:export')")
public void export(HttpServletResponse response, @PathVariable String month,@PathVariable String filename) throws IOException {
this.attendanceService.export(response, month,filename);
@GetMapping("/export/{month}/{filename}") // 处理GET请求路径为/attendance/export/{month}/{filename}
@PreAuthorize("hasAnyAuthority('performance:attendance:export')") // 需要具备考勤数据导出权限
public void export(HttpServletResponse response,
@PathVariable String month,
@PathVariable String filename) throws IOException {
this.attendanceService.export(response, month, filename);
}
/**
*
* @param file Excel
* @return
* @throws IOException IO
*/
@ApiOperation("数据导入接口")
@PostMapping("/import")
@PreAuthorize("hasAnyAuthority('performance:attendance:import')")
@PostMapping("/import") // 处理POST请求路径为/attendance/import
@PreAuthorize("hasAnyAuthority('performance:attendance:import')") // 需要具备考勤数据导入权限
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.attendanceService.imp(file);
}
/**
* ID
* @param id ID
* @param date 2024-01-15
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}/{date}")
@GetMapping("/{id}/{date}") // 处理GET请求路径为/attendance/{id}/{date}
public ResponseDTO queryByStaffIdAndDate(@PathVariable Integer id, @PathVariable String date) {
return this.attendanceService.queryByStaffIdAndDate(id, date);
}
/**
*
*
* @param attendance
* @return
*/
@ApiOperation("保存或更新")
@PutMapping("/set")
@PreAuthorize("hasAnyAuthority('performance:attendance:set')")
@PutMapping("/set") // 处理PUT请求路径为/attendance/set
@PreAuthorize("hasAnyAuthority('performance:attendance:set')") // 需要具备设置考勤权限
public ResponseDTO setAttendance(@RequestBody Attendance attendance) {
return this.attendanceService.setAttendance(attendance);
}
/**
*
* @return
*/
@ApiOperation("获取所有")
@GetMapping("/all")
@GetMapping("/all") // 处理GET请求路径为/attendance/all
public ResponseDTO queryAll() {
return this.attendanceService.queryAll();
}
}
}

@ -14,83 +14,129 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
*
* </p>
*
*
* HTTP
*
*
* @author qiujie
* @since 2022-03-23
*/
@RestController
@RequestMapping("/city")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/city") // 定义基础请求路径为/city
public class CityController {
@Autowired
@Autowired // 自动注入城市服务类
private CityService cityService;
/**
*
* @param city
* @return
*/
@ApiOperation("新增")
@PostMapping
@PreAuthorize("hasAnyAuthority('money:city:add')")
@PostMapping // 处理POST请求路径为/city
@PreAuthorize("hasAnyAuthority('money:city:add')") // 需要具备新增城市权限money权限域
public ResponseDTO add(@RequestBody City city) {
return this.cityService.add(city);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@PreAuthorize("hasAnyAuthority('money:city:delete')")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/city/{id}
@PreAuthorize("hasAnyAuthority('money:city:delete')") // 需要具备删除城市权限
public ResponseDTO delete(@PathVariable Integer id) {
return this.cityService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@PreAuthorize("hasAnyAuthority('money:city:delete')")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/city/batch/{ids}
@PreAuthorize("hasAnyAuthority('money:city:delete')") // 需要具备删除城市权限
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.cityService.deleteBatch(ids);
}
/**
*
* @param city
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PreAuthorize("hasAnyAuthority('money:city:edit')")
@PutMapping // 处理PUT请求路径为/city
@PreAuthorize("hasAnyAuthority('money:city:edit')") // 需要具备编辑城市权限
public ResponseDTO edit(@RequestBody City city) {
return this.cityService.edit(city);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/city/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.cityService.query(id);
}
/**
*
* @return
*/
@ApiOperation("查询所有")
@GetMapping("/all")
@GetMapping("/all") // 处理GET请求路径为/city/all
public ResponseDTO queryAll() {
return this.cityService.queryAll();
}
/**
*
* @param current 1
* @param size 10
* @param name
* @return
*/
@ApiOperation("条件查询")
@GetMapping
@PreAuthorize("hasAnyAuthority('money:city:list','money:city:search')")
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name) {
@GetMapping // 处理GET请求路径为/city
@PreAuthorize("hasAnyAuthority('money:city:list','money:city:search')") // 需要具备城市列表查看或搜索权限
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
String name) {
return this.cityService.list(current, size, name);
}
/**
*
* @param response HTTPExcel
* @param filename
* @throws IOException IO
*/
@ApiOperation("数据导出接口")
@GetMapping("/export/{filename}")
@PreAuthorize("hasAnyAuthority('money:city:export')")
@GetMapping("/export/{filename}") // 处理GET请求路径为/city/export/{filename}
@PreAuthorize("hasAnyAuthority('money:city:export')") // 需要具备城市数据导出权限
public void export(HttpServletResponse response, @PathVariable String filename) throws IOException {
this.cityService.export(response, filename);
}
/**
*
* @param file Excel
* @return
* @throws IOException IO
*/
@ApiOperation("数据导入接口")
@PostMapping("/import")
@PreAuthorize("hasAnyAuthority('money:city:import')")
@PostMapping("/import") // 处理POST请求路径为/city/import
@PreAuthorize("hasAnyAuthority('money:city:import')") // 需要具备城市数据导入权限
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.cityService.imp(file);
}
}
}

@ -3,7 +3,6 @@ package com.qiujie.controller;
import com.qiujie.entity.Staff;
import com.qiujie.service.InsuranceService;
import com.qiujie.entity.Insurance;
import com.qiujie.dto.ResponseDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,83 +15,141 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
*
* </p>
*
*
*
*
*
* @author qiujie
* @since 2022-03-23
*/
@RestController
@RequestMapping("/insurance")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/insurance") // 定义基础请求路径为/insurance
public class InsuranceController {
@Autowired
@Autowired // 自动注入社保服务类
private InsuranceService insuranceService;
/**
*
* @param insurance
* @return
*/
@ApiOperation("新增")
@PostMapping
@PostMapping // 处理POST请求路径为/insurance
public ResponseDTO add(@RequestBody Insurance insurance) {
return this.insuranceService.add(insurance);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/insurance/{id}
public ResponseDTO delete(@PathVariable Integer id) {
return this.insuranceService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/insurance/batch/{ids}
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.insuranceService.deleteBatch(ids);
}
/**
*
* @param insurance
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PutMapping // 处理PUT请求路径为/insurance
public ResponseDTO edit(@RequestBody Insurance insurance) {
return this.insuranceService.edit(insurance);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/insurance/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.insuranceService.query(id);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/staff/{id}")
@GetMapping("/staff/{id}") // 处理GET请求路径为/insurance/staff/{id}
public ResponseDTO queryByStaffId(@PathVariable Integer id) {
return this.insuranceService.queryByStaffId(id);
}
/**
*
* @param current 1
* @param size 10
* @param name
* @param deptId ID
* @return
*/
@ApiOperation("多条件分页查询")
@GetMapping
@PreAuthorize("hasAnyAuthority('money:insurance:list','money:insurance:search')")
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId){
return this.insuranceService.list(current, size, name,deptId);
@GetMapping // 处理GET请求路径为/insurance
@PreAuthorize("hasAnyAuthority('money:insurance:list','money:insurance:search')") // 需要具备社保列表查看或搜索权限
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
String name,
Integer deptId) {
return this.insuranceService.list(current, size, name, deptId);
}
/**
*
* @param response HTTPExcel
* @param filename
* @throws IOException IO
*/
@ApiOperation("数据导出接口")
@GetMapping("/export/{filename}")
@PreAuthorize("hasAnyAuthority('money:insurance:export')")
public void export(HttpServletResponse response,@PathVariable String filename) throws IOException {
this.insuranceService.export(response,filename);
@GetMapping("/export/{filename}") // 处理GET请求路径为/insurance/export/{filename}
@PreAuthorize("hasAnyAuthority('money:insurance:export')") // 需要具备社保数据导出权限
public void export(HttpServletResponse response, @PathVariable String filename) throws IOException {
this.insuranceService.export(response, filename);
}
/**
*
* @param file Excel
* @return
* @throws IOException IO
*/
@ApiOperation("数据导入接口")
@PostMapping("/import")
@PreAuthorize("hasAnyAuthority('money:insurance:import')")
@PostMapping("/import") // 处理POST请求路径为/insurance/import
@PreAuthorize("hasAnyAuthority('money:insurance:import')") // 需要具备社保数据导入权限
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.insuranceService.imp(file);
}
/**
*
*
* @param insurance
* @return
*/
@ApiOperation("为员工设置社保")
@PostMapping("/set")
@PreAuthorize("hasAnyAuthority('money:insurance:set')")
@PostMapping("/set") // 处理POST请求路径为/insurance/set
@PreAuthorize("hasAnyAuthority('money:insurance:set')") // 需要具备设置社保权限
public ResponseDTO setInsurance(@RequestBody Insurance insurance) {
return this.insuranceService.setInsurance(insurance);
}
}
}

@ -11,77 +11,119 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
*
* </p>
*
*
* HTTP
*
*
* @author qiujie
* @since 2022-03-27
*/
@RestController
@RequestMapping("/leave")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/leave") // 定义基础请求路径为/leave
public class LeaveController {
@Autowired
@Autowired // 自动注入请假服务类
private LeaveService leaveService;
/**
*
* @param leave
* @return
*/
@ApiOperation("新增")
@PostMapping
@PostMapping // 处理POST请求路径为/leave
public ResponseDTO add(@RequestBody Leave leave) {
return this.leaveService.add(leave);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/leave/{id}
public ResponseDTO delete(@PathVariable Integer id) {
return this.leaveService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/leave/batch/{ids}
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.leaveService.deleteBatch(ids);
}
/**
*
* @param leave
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PutMapping // 处理PUT请求路径为/leave
public ResponseDTO edit(@RequestBody Leave leave) {
return this.leaveService.edit(leave);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/leave/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.leaveService.query(id);
}
/**
* ID
* @param deptId ID
* @param typeNum
* @return
*/
@ApiOperation("获取")
@GetMapping("/{deptId}/{typeNum}")
@GetMapping("/{deptId}/{typeNum}") // 处理GET请求路径为/leave/{deptId}/{typeNum}
public ResponseDTO queryByDeptIdAndTypeNum(@PathVariable Integer deptId, @PathVariable Integer typeNum) {
return this.leaveService.queryByDeptIdAndTypeNum(deptId, typeNum);
}
/**
*
*
* @param leave
* @return
*/
@ApiOperation("设置假期")
@PostMapping("/set")
@PreAuthorize("hasAnyAuthority('system:department:setting')")
@PostMapping("/set") // 处理POST请求路径为/leave/set
@PreAuthorize("hasAnyAuthority('system:department:setting')") // 需要具备部门设置权限
public ResponseDTO setLeave(@RequestBody Leave leave) {
return this.leaveService.setLeave(leave);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/dept/{id}")
@GetMapping("/dept/{id}") // 处理GET请求路径为/leave/dept/{id}
public ResponseDTO queryByDeptId(@PathVariable Integer id) {
return this.leaveService.queryByDeptId(id);
}
/**
*
* @return
*/
@ApiOperation("获取所有")
@GetMapping("/all")
@GetMapping("/all") // 处理GET请求路径为/leave/all
public ResponseDTO queryAll() {
return this.leaveService.queryAll();
}
}
}

@ -13,24 +13,40 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
*
*
*
*
* @Author : qiujie
* @Date : 2022/1/30
*/
@RestController
@RestController // 标识为RESTful控制器返回数据均为JSON格式
public class LoginController {
@Autowired
@Autowired // 自动注入登录服务类
private LoginService loginService;
@PostMapping("/login/{validateCode}")
/**
*
* /
*
* @param staff
* @param validateCode
* @return
*/
@PostMapping("/login/{validateCode}") // 处理POST请求路径为/login/{validateCode}
public ResponseDTO login(@RequestBody Staff staff, @PathVariable String validateCode) {
return this.loginService.login(staff, validateCode);
}
@GetMapping("/validate/code")
/**
*
* HTTP
*
* @param response HTTP
* @throws IOException IO
*/
@GetMapping("/validate/code") // 处理GET请求路径为/validate/code
public void getValidateCode(HttpServletResponse response) throws IOException {
this.loginService.getValidateCode(response);
}
}
}

@ -14,80 +14,135 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* <p>
*
* </p>
*
*
*
*
*
* @author qiujie
* @since 2022-04-06
*/
@RestController
@RequestMapping("/salary")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/salary") // 定义基础请求路径为/salary
public class SalaryController {
@Autowired
@Autowired // 自动注入薪资服务类
private SalaryService salaryService;
/**
*
* @param salary
* @return
*/
@ApiOperation("新增")
@PostMapping
@PostMapping // 处理POST请求路径为/salary
public ResponseDTO add(@RequestBody Salary salary) {
return this.salaryService.add(salary);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/salary/{id}
public ResponseDTO delete(@PathVariable Integer id) {
return this.salaryService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/salary/batch/{ids}
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.salaryService.deleteBatch(ids);
}
/**
*
* @param salary
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PutMapping // 处理PUT请求路径为/salary
public ResponseDTO edit(@RequestBody Salary salary) {
return this.salaryService.edit(salary);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/salary/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.salaryService.query(id);
}
/**
*
* @param current 1
* @param size 10
* @param name
* @param deptId ID
* @param month 2024-01
* @return
*/
@ApiOperation("分页条件查询")
@GetMapping
@PreAuthorize("hasAnyAuthority('money:salary:list','money:salary:search')")
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current, @RequestParam(defaultValue = "10") Integer size, String name, Integer deptId, String month) {
@GetMapping // 处理GET请求路径为/salary
@PreAuthorize("hasAnyAuthority('money:salary:list','money:salary:search')") // 需要具备薪资列表查看或搜索权限
public ResponseDTO list(@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
String name,
Integer deptId,
String month) {
return this.salaryService.list(current, size, name, deptId, month);
}
/**
*
* @param response HTTPExcel
* @param month
* @param filename
* @throws IOException IO
*/
@ApiOperation("数据导出接口")
@GetMapping("/export/{month}/{filename}")
@PreAuthorize("hasAnyAuthority('money:salary:export')")
public void export(HttpServletResponse response, @PathVariable String month,@PathVariable String filename) throws IOException {
this.salaryService.export(response, month,filename);
@GetMapping("/export/{month}/{filename}") // 处理GET请求路径为/salary/export/{month}/{filename}
@PreAuthorize("hasAnyAuthority('money:salary:export')") // 需要具备薪资数据导出权限
public void export(HttpServletResponse response,
@PathVariable String month,
@PathVariable String filename) throws IOException {
this.salaryService.export(response, month, filename);
}
/**
*
* @param file Excel
* @return
* @throws IOException IO
*/
@ApiOperation("数据导入接口")
@PostMapping("/import")
@PreAuthorize("hasAnyAuthority('money:salary:import')")
@PostMapping("/import") // 处理POST请求路径为/salary/import
@PreAuthorize("hasAnyAuthority('money:salary:import')") // 需要具备薪资数据导入权限
public ResponseDTO imp(MultipartFile file) throws IOException {
return this.salaryService.imp(file);
}
/**
*
*
* @param salary
* @return
*/
@ApiOperation("设置工资")
@PostMapping("/set")
@PreAuthorize("hasAnyAuthority('money:salary:set')")
@PostMapping("/set") // 处理POST请求路径为/salary/set
@PreAuthorize("hasAnyAuthority('money:salary:set')") // 需要具备设置薪资权限
public ResponseDTO setSalary(@RequestBody Salary salary) {
return this.salaryService.setSalary(salary);
}
}
}

@ -11,69 +11,108 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* <p>
*
* </p>
*
*
*
*
*
* @author qiujie
* @since 2022-03-27
*/
@RestController
@RequestMapping("/salary-deduct")
@RestController // 标识为RESTful控制器返回数据均为JSON格式
@RequestMapping("/salary-deduct") // 定义基础请求路径为/salary-deduct
public class SalaryDeductController {
@Autowired
@Autowired // 自动注入工资扣款服务类
private SalaryDeductService salaryDeductService;
/**
*
* @param salaryDeduct
* @return
*/
@ApiOperation("新增")
@PostMapping
@PostMapping // 处理POST请求路径为/salary-deduct
public ResponseDTO add(@RequestBody SalaryDeduct salaryDeduct) {
return this.salaryDeductService.add(salaryDeduct);
}
/**
*
* @param id ID
* @return
*/
@ApiOperation("逻辑删除")
@DeleteMapping("/{id}")
@DeleteMapping("/{id}") // 处理DELETE请求路径为/salary-deduct/{id}
public ResponseDTO delete(@PathVariable Integer id) {
return this.salaryDeductService.delete(id);
}
/**
*
* @param ids ID
* @return
*/
@ApiOperation("批量逻辑删除")
@DeleteMapping("/batch/{ids}")
@DeleteMapping("/batch/{ids}") // 处理DELETE请求路径为/salary-deduct/batch/{ids}
public ResponseDTO deleteBatch(@PathVariable List<Integer> ids) {
return this.salaryDeductService.deleteBatch(ids);
}
/**
*
* @param salaryDeduct
* @return
*/
@ApiOperation("编辑更新")
@PutMapping
@PutMapping // 处理PUT请求路径为/salary-deduct
public ResponseDTO edit(@RequestBody SalaryDeduct salaryDeduct) {
return this.salaryDeductService.edit(salaryDeduct);
}
/**
* ID
* @param id ID
* @return
*/
@ApiOperation("查询")
@GetMapping("/{id}")
@GetMapping("/{id}") // 处理GET请求路径为/salary-deduct/{id}
public ResponseDTO query(@PathVariable Integer id) {
return this.salaryDeductService.query(id);
}
/**
* ID
* @param deptId ID
* @param typeNum
* @return
*/
@ApiOperation("获取")
@GetMapping("/{deptId}/{typeNum}")
@GetMapping("/{deptId}/{typeNum}") // 处理GET请求路径为/salary-deduct/{deptId}/{typeNum}
public ResponseDTO queryByDeptIdAndTypeNum(@PathVariable Integer deptId, @PathVariable Integer typeNum) {
return this.salaryDeductService.queryByDeptIdAndTypeNum(deptId, typeNum);
}
/**
*
*
* @param salaryDeduct
* @return
*/
@ApiOperation("设置罚款")
@PostMapping("/set")
@PreAuthorize("hasAnyAuthority('system:department:setting')")
@PostMapping("/set") // 处理POST请求路径为/salary-deduct/set
@PreAuthorize("hasAnyAuthority('system:department:setting')") // 需要具备部门设置权限
public ResponseDTO setSalaryDeduct(@RequestBody SalaryDeduct salaryDeduct) {
return this.salaryDeductService.setSalaryDeduct(salaryDeduct);
}
/**
*
* @return
*/
@ApiOperation("获取所有")
@GetMapping("/all")
@GetMapping("/all") // 处理GET请求路径为/salary-deduct/all
public ResponseDTO queryAll() {
return this.salaryDeductService.queryAll();
}
}
}
Loading…
Cancel
Save