¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.personnel.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.personnel.dto.PersonPersonnelCapacityDto; |
| | | import com.ruoyi.personnel.pojo.PersonPersonnelCapacity; |
| | | import com.ruoyi.personnel.service.PersonPersonnelCapacityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * 人åè½å å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-10-10 11:26:18 |
| | | */ |
| | | @Api(tags = "人å - 人åè½å") |
| | | @RestController |
| | | @RequestMapping("/personPersonnelCapacity") |
| | | public class PersonPersonnelCapacityController { |
| | | |
| | | @Autowired |
| | | private PersonPersonnelCapacityService personPersonnelCapacityService; |
| | | |
| | | |
| | | @ApiOperation(value = "æ°å¢/æ´æ° 人åè½å") |
| | | @PostMapping("addOrUpdatePersonPersonnelCapacity") |
| | | public Result<?> addOrUpdatePersonPersonnelCapacity(@RequestBody PersonPersonnelCapacity personPersonnelCapacity) { |
| | | personPersonnelCapacityService.saveOrUpdate(personPersonnelCapacity); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "å é¤ äººåè½å") |
| | | @DeleteMapping("deletePersonPersonnelCapacity") |
| | | public Result<?> deletePersonPersonnelCapacity(@RequestParam("id") Integer id) { |
| | | // å 餿°æ® |
| | | personPersonnelCapacityService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ 人åè½å") |
| | | @GetMapping("personPersonnelCapacityPage") |
| | | public Result<IPage<PersonPersonnelCapacityDto>> personPersonnelCapacityPage(Page page, |
| | | Integer departmentId, |
| | | Integer userId, |
| | | String userName) { |
| | | return Result.success(personPersonnelCapacityService.personPersonnelCapacityPage(page, departmentId, userId, userName)); |
| | | } |
| | | |
| | | @ApiOperation(value = "确认 人åè½å") |
| | | @GetMapping("confirmPersonnelCapability") |
| | | public Result<?> confirmPersonnelCapability(@RequestParam("id") Integer id) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | personPersonnelCapacityService.update(Wrappers.<PersonPersonnelCapacity>lambdaUpdate() |
| | | .eq(PersonPersonnelCapacity::getId, id) |
| | | .set(PersonPersonnelCapacity::getConfirmOperatingPersonnelId, userId) |
| | | .set(PersonPersonnelCapacity::getConfirmDate, LocalDateTime.now())); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 导åºäººåè½å |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "导åºäººåè½å") |
| | | @GetMapping("/exportPersonnelCapacity") |
| | | public void exportPersonnelCapacity(Integer id, HttpServletResponse response){ |
| | | personPersonnelCapacityService.exportPersonnelCapacity(id, response); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤ç¡®è®¤äººåè½å |
| | | * @param personPersonnelCapacity |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "æäº¤") |
| | | @PostMapping("submitConfirmPersonnelCapability") |
| | | public Result<?> submitConfirmPersonnelCapability(@RequestBody PersonPersonnelCapacity personPersonnelCapacity) { |
| | | personPersonnelCapacityService.submitConfirmPersonnelCapability(personPersonnelCapacity); |
| | | return Result.success(); |
| | | } |
| | | } |