BAOLH
2026-11-10 c5dfc09145e4e10f99dbf388a4a1433b5c2973e5
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
@@ -38,6 +38,7 @@
import me.zhengjie.utils.*;
import me.zhengjie.modules.system.service.UserService;
import me.zhengjie.utils.enums.CodeEnum;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -152,7 +153,7 @@
        return new ResponseEntity<>(PageUtil.toPage(null,0),HttpStatus.OK);
    }
    @Log("新增用户")
//    @Log("新增用户")
    @ApiOperation("新增用户")
    @PostMapping
    @PreAuthorize("@el.check('user:add')")
@@ -217,6 +218,14 @@
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @ApiOperation("重置密码")
    @PostMapping(value = "/resetPass")
    public ResponseEntity<Object> resetUserPass(@RequestBody User passVo) throws Exception {
        UserDto user = userService.findByName(passVo.getUsername());
        userService.updatePass(user.getUsername(),passwordEncoder.encode("123456"));
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @ApiOperation("修改头像")
    @PostMapping(value = "/updateAvatar")
    public ResponseEntity<Object> updateUserAvatar(@RequestParam MultipartFile avatar){
@@ -274,9 +283,37 @@
        return new ResponseEntity<>(userService.getUserByTaskId(taskId),HttpStatus.OK);
    }
    @GetMapping("/getAllUser")
    public ResponseEntity<Object> getAllUserByTaskId(String taskId){
        return new ResponseEntity<>(userService.getAllUserByTaskId(taskId),HttpStatus.OK);
    }
    @GetMapping("/getUserDept")
    public ResponseEntity<Object> getAllUserDetail(){
        return new ResponseEntity<>(userService.getUserDept(),HttpStatus.OK);
    }
    @GetMapping("/getUserPidDept")
    public ResponseEntity<Object> getUserPidDept(Long[] ids) {
        List<Long[]> result = new ArrayList<>();
        for (Long id : ids) {
            result.add(userService.getUserPidDept(id));
        }
        return new ResponseEntity<>(result,HttpStatus.OK);
    }
    @GetMapping("/getPerformanceDetail")
    public ResponseEntity<Object> getPerformanceDetail(Long nextMonth) throws ParseException {
        return new ResponseEntity<>(HttpStatus.OK); // userService.getPerformanceDetail(nextMonth),
    }
    @GetMapping(value = "/getUserInfose")
    @Log("查询用户信息")
    @ApiOperation("查询用户信息")
    public ResponseEntity<Object> getUserInfos() {
        return new ResponseEntity<>(userService.getUserInfose(), HttpStatus.OK);
    }
}