BAOLH
2025-06-06 46ee062359b677be53cea7b0bbabf3cd607c8da3
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskUserController.java
@@ -18,6 +18,7 @@
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.TaskUserService;
import me.zhengjie.modules.task.service.dto.TaskGenerateDto;
import me.zhengjie.modules.task.service.dto.TaskUserMongoDto;
import me.zhengjie.modules.task.service.dto.TaskUserQueryCriteria;
import me.zhengjie.utils.SecurityUtils;
@@ -30,7 +31,7 @@
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import java.util.Arrays;
import java.text.ParseException;
import javax.servlet.http.HttpServletResponse;
/**
@@ -51,7 +52,7 @@
    @GetMapping(value = "/download")
    @PreAuthorize("@el.check('taskUser:download')")
    public void exportTaskUser(HttpServletResponse response, TaskUserQueryCriteria criteria) throws IOException {
        //taskUserService.download(taskUserService.queryAll(criteria), response);
        taskUserService.download(taskUserService.queryAll(criteria), response);
    }
    @GetMapping
@@ -81,7 +82,8 @@
    @ApiOperation("新增任务分配")
    @PreAuthorize("@el.check('taskUser:add')")
    public ResponseEntity<Object> createTaskUser(@Validated @RequestBody TaskUserMongo resources) throws Exception {
        return new ResponseEntity<>(taskUserService.create(resources),HttpStatus.CREATED);
        taskUserService.create(resources);
        return new ResponseEntity<>(HttpStatus.CREATED);
    }
    @PutMapping
@@ -150,8 +152,8 @@
    @GetMapping("/getAllTaskUser")
    @Log("先将所有的分配任务都缓存起来")
    public ResponseEntity<Object> getAllTaskUser(){
        return new ResponseEntity<>(taskUserService.getAllTaskUser(SecurityUtils.getCurrentUserId()),HttpStatus.OK);
    public ResponseEntity<Object> getAllTaskUser(String taskUserMongoId){
        return new ResponseEntity<>(taskUserService.getAllTaskUser(SecurityUtils.getCurrentUserId(),taskUserMongoId),HttpStatus.OK);
    }
    @GetMapping("/changeStatus")
@@ -159,4 +161,35 @@
        taskUserService.changeStatus(changesId);
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @GetMapping("/getTaskUserDetail")
    public ResponseEntity<Object> getTaskUserDetail(String taskUserMongoId){
        return new ResponseEntity<>(taskUserService.getTaskUserDetail(taskUserMongoId),HttpStatus.OK);
    }
    @GetMapping("/getTaskDetail")
    public ResponseEntity<Object> getTaskDetail(String taskMongoId) {
        return new ResponseEntity<>(taskUserService.getTaskDetail(taskMongoId),HttpStatus.OK);
    }
    @GetMapping("/getPerformanceg")
    public ResponseEntity<Object> getPerformanceg(String taskHours, Long userId){
        return new ResponseEntity<>(taskUserService.getPerformanceg(taskHours, userId),HttpStatus.OK);
    }
    @GetMapping("/getTaskUserAdvent")
    public ResponseEntity<Object> getTaskUserAdvent(String taskUserMongoId,int page, int size){
        return new ResponseEntity<>(taskUserService.getTaskUserAdvent(taskUserMongoId,page,size),HttpStatus.OK);
    }
    @PostMapping("/generate")
    public ResponseEntity<Object> generate(@RequestBody TaskGenerateDto taskGenerateDto) throws Exception {
        taskUserService.generate(taskGenerateDto);
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @GetMapping("/exportUser")
    public void exportUser(HttpServletResponse response, String taskId) throws IOException {
        taskUserService.exportUser(response, taskId);
    }
}