| | |
| | | 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; |
| | | import org.springframework.data.domain.Pageable; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | |
| | | @Log("修改任务分配") |
| | | @ApiOperation("修改任务分配") |
| | | @PreAuthorize("@el.check('taskUser:edit')") |
| | | public ResponseEntity<Object> updateTaskUser(@Validated @RequestBody TaskUserMongo resources) throws Exception { |
| | | public ResponseEntity<Object> updateTaskUser(@Validated @RequestBody TaskUserMongoDto resources) throws Exception { |
| | | taskUserService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | |
| | | @GetMapping("/addTaskUser") |
| | | @Log("用户自己认领任务") |
| | | @ApiOperation("用户自己认领任务") |
| | | public ResponseEntity<Object> addTaskUser(String TaskId){ |
| | | taskUserService.addTaskUser(TaskId); |
| | | public ResponseEntity<Object> addTaskUser(Long projectId,String TaskId){ |
| | | taskUserService.addTaskUser(projectId,TaskId); |
| | | return new ResponseEntity<>(1,HttpStatus.OK); |
| | | } |
| | | |
| | |
| | | |
| | | @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") |
| | | public ResponseEntity<Object> changeStatus(String[] changesId){ |
| | | 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 ParseException { |
| | | taskUserService.generate(taskGenerateDto); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/exportUser") |
| | | public void exportUser(HttpServletResponse response) throws IOException { |
| | | taskUserService.exportUser(response); |
| | | } |
| | | } |