¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.personnel.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.dto.DepartmentDto; |
| | | import com.ruoyi.common.core.dto.UserPageDto; |
| | | import com.ruoyi.common.utils.FileSaveUtil; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.personnel.dto.PersonBasicInfoDetailsDto; |
| | | import com.ruoyi.personnel.dto.PersonBasicInfoDto; |
| | | import com.ruoyi.personnel.pojo.Annex; |
| | | import com.ruoyi.personnel.service.AnnexService; |
| | | import com.ruoyi.personnel.service.PersonBasicInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2024-08-30 09:19:57 |
| | | */ |
| | | @Api(tags = "人å-人ååºæ¬ä¿¡æ¯") |
| | | @RestController |
| | | @RequestMapping("/personBasicInfo") |
| | | public class PersonBasicInfoController { |
| | | |
| | | @Resource |
| | | private PersonBasicInfoService personBasicInfoService; |
| | | |
| | | @Resource |
| | | private AnnexService annexService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢CNAS人åä¾§è¾¹æ ") |
| | | @GetMapping("/selectCNSAPersonTree") |
| | | public Result<List<DepartmentDto>> selectCNSAPersonTree() { |
| | | return Result.success(personBasicInfoService.selectCNSAPersonTree()); |
| | | } |
| | | |
| | | @ApiOperation(value = "è·åCNAS人ååºæ¬ä¿¡æ¯") |
| | | @GetMapping("/getCNASPersonnelInfo") |
| | | public Result getCNASPersonnelInfo(Integer userId) { |
| | | return Result.success(personBasicInfoService.getCNASPersonnelInfo(userId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¿åCNAS人ååºæ¬ä¿¡æ¯") |
| | | @PostMapping("/saveCNASPersonnelInfo") |
| | | public Result saveCNASPersonnelInfo(@RequestBody PersonBasicInfoDto personBasicInfoDto) { |
| | | personBasicInfoService.saveCNASPersonnelInfo(personBasicInfoDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "人åæç»å页æ¥è¯¢") |
| | | @GetMapping("basicInformationOfPersonnelSelectPage") |
| | | public Result<IPage<Map<String, Object>>> basicInformationOfPersonnelSelectPage(Page<List<PersonBasicInfoDetailsDto>> page, String name, Integer departmentId) { |
| | | return Result.success(personBasicInfoService.basicInformationOfPersonnelSelectPage(page, name, departmentId)); |
| | | } |
| | | |
| | | // ä¸ä¼ æä»¶æ¥å£ |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶æ¥å£") |
| | | @PostMapping("/saveCNASFile") |
| | | public Result saveFile(@RequestPart("file") MultipartFile file) { |
| | | String s = FileSaveUtil.uploadWordFile(file); |
| | | return Result.success(s); |
| | | } |
| | | |
| | | /** |
| | | * è®¾å¤æ ¡å éä»¶ä¸ä¼ |
| | | * @param file |
| | | * @param suffix |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è®¾å¤æ ¡å ä¸ä¼ æä»¶æ¥å£") |
| | | @PostMapping("/saveDeviceCalibrationFile") |
| | | public Result saveDeviceCalibrationFile(@RequestParam("file") MultipartFile file,@RequestParam("suffix")String suffix,@RequestParam("id") Integer id) { |
| | | personBasicInfoService.saveDeviceCalibrationFile(file,suffix,id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * æ¥çè®¾å¤æ ¡åéä»¶ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è®¾å¤æ ¡å éä»¶æ¥ç") |
| | | @GetMapping("/getDeviceCalibrationFile") |
| | | public Result getDeviceCalibrationFile(Integer id) { |
| | | return Result.success(personBasicInfoService.getDeviceCalibrationFile(id)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤æ ¡åéä»¶ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è®¾å¤æ ¡å éä»¶å é¤") |
| | | @DeleteMapping("/delDeviceCalibrationFile") |
| | | public Result delDeviceCalibrationFile(Integer id) { |
| | | personBasicInfoService.delDeviceCalibrationFile(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½è®¾å¤æ ¡éªéä»¶ä¸è½½ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è®¾å¤æ ¡éªéä»¶ä¸è½½") |
| | | @GetMapping("/downLoadDeviceCalibrationFile") |
| | | public Result downLoadDeviceCalibrationFile(Integer id,HttpServletResponse response) { |
| | | personBasicInfoService.downLoadDeviceCalibrationFile(id,response); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getAnnexByUserId") |
| | | public Result<List<Annex>> getAnnexByUserId(Integer userId) { |
| | | List<Annex> list = annexService.list(new LambdaQueryWrapper<Annex>().eq(Annex::getUserId, userId)); |
| | | return Result.success(list); |
| | | } |
| | | |
| | | // å 餿件 |
| | | @DeleteMapping("/deleteCNASFile") |
| | | public Result saveFile(String fileName) { |
| | | String[] split = fileName.split(","); |
| | | for (String s : split) { |
| | | FileSaveUtil.DeleteFile(s); |
| | | } |
| | | return Result.success(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 人ååºæ¬ä¿¡æ¯éä»¶æ°å¢ |
| | | */ |
| | | @PostMapping("/addAnnex") |
| | | public Result addAnnex(@RequestBody Annex annex) { |
| | | annexService.save(annex); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @GetMapping("/getAnnex") |
| | | public Result<Annex> getAnnex(Integer id) { |
| | | return Result.success(annexService.getById(id)); |
| | | } |
| | | /** |
| | | * 人ååºæ¬ä¿¡æ¯éä»¶å é¤ |
| | | */ |
| | | @DeleteMapping("/deleteAnnex/{id}") |
| | | public Result deleteAnnex(@PathVariable("id") Integer id) { |
| | | annexService.removeById(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | /** |
| | | * 人ååºæ¬ä¿¡æ¯éä»¶ä¿®æ¹ |
| | | * |
| | | */ |
| | | @PostMapping("/updateAnnex") |
| | | public Result updateAnnex(@RequestBody Annex annex) { |
| | | annexService.updateById(annex); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åºäººååºæ¬ä¿¡æ¯") |
| | | @GetMapping("/exportPersonBasicInfo") |
| | | public void exportPersonBasicInfo(UserPageDto userPageDto, HttpServletResponse response) throws Exception { |
| | | personBasicInfoService.exportPersonBasicInfo(userPageDto,response); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¸è½½äººåæ¡£æ¡å¡") |
| | | @GetMapping("/exportPersonBasicInfoById") |
| | | public Result exportPersonBasicInfoById(Integer id, HttpServletResponse response) { |
| | | return Result.success(personBasicInfoService.exportPersonBasicInfoById(id,response)); |
| | | } |
| | | |
| | | @GetMapping("/getEmployees") |
| | | @ApiOperation(value = "对æ¥äººåå¹³å° è·åææäººåä¿¡æ¯") |
| | | public Result getEmployees(Integer departId) { |
| | | personBasicInfoService.getEmployees(departId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @GetMapping("/getEmployee") |
| | | @ApiOperation(value = "对æ¥äººåå¹³å° æ ¹æ®å·¥å·è·å人åä¿¡æ¯") |
| | | public Result getEmployee(Integer userId) { |
| | | personBasicInfoService.getEmployee(userId); |
| | | return Result.success(); |
| | | } |
| | | } |