浏览代码

部门修改

anderx 2 年之前
父节点
当前提交
0fe5fd25eb
共有 1 个文件被更改,包括 23 次插入0 次删除
  1. 23 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

+ 23 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ProjectTaskController.java

@@ -20,6 +20,8 @@ import com.ruoyi.project.domain.ProjectTask;
 import com.ruoyi.project.service.ProjectStaffRecordService;
 import com.ruoyi.project.service.ProjectStaffService;
 import com.ruoyi.project.service.ProjectTaskService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -31,6 +33,7 @@ import java.util.List;
 /**
  *  项目管理
  */
+@Api("项目管理")
 @RestController
 @RequestMapping("/api/project")
 public class ProjectTaskController extends BaseController {
@@ -48,6 +51,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/add")
+    @ApiOperation("新增项目")
     public AjaxResult add( @RequestBody ProjectTask projectTask){
         if (projectTask.getAid()== null){
             return error("负责人不能为空");
@@ -61,6 +65,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PutMapping("/update")
+    @ApiOperation("修改项目")
     public AjaxResult update( @RequestBody ProjectTask projectTask){
         if (projectTask.getAid()== null){
             return error("负责人不能为空");
@@ -74,6 +79,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/addStaff")
+    @ApiOperation("新增项目成员")
     public AjaxResult addStaff( @RequestBody ProjectStaff in){
         if (in.getAid()== null){
             return error("项目成员不能为空");
@@ -87,6 +93,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/addRecord")
+    @ApiOperation("新增项目打卡")
     public AjaxResult addRecord( @RequestBody ProjectStaffRecord in){
         if (in.getRecordTime()==null){
             in.setRecordTime(new Date());
@@ -107,6 +114,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/updateRecord")
+    @ApiOperation("修改成员打卡")
     public AjaxResult updateRecord( @RequestBody ProjectStaffRecord in){
         Long userId = SecurityUtils.getUserId();
         in.setAid(userId);
@@ -123,6 +131,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping("/recordDetails")
+    @ApiOperation("打卡日志详情")
     public AjaxResult recordDetails( Long id){
 
         return projectStaffRecordService.recordDetails(id);
@@ -135,6 +144,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/examineRecord")
+    @ApiOperation("审核成员打卡")
     public AjaxResult examineRecord( @RequestBody ProjectStaffRecord in){
         if (in.getProcessStatus()!=2 && in.getProcessStatus()!=3){
             return AjaxResult.error("审核状态错误");
@@ -148,6 +158,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping("/listRecord")
+    @ApiOperation("成员打卡列表")
     public TableDataInfo listRecord( ProjectStaffRecordInput in){
         startPage();
         List<ProjectStaffRecordOut> list = projectStaffRecordService.listRecord(in);
@@ -160,6 +171,7 @@ public class ProjectTaskController extends BaseController {
      * @param response
      */
     @PostMapping("/listRecord/export")
+    @ApiOperation("导出项目打卡列表")
     public void listRecordExport(HttpServletResponse response, ProjectStaffRecordInput in){
         List<ProjectStaffRecordOut> list=projectStaffRecordService.listRecord(in);
         ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<>(ProjectStaffRecordOut.class);
@@ -174,6 +186,7 @@ public class ProjectTaskController extends BaseController {
      * @throws Exception
      */
     @PostMapping("/listRecord/importData")
+    @ApiOperation("导入项目打卡数据")
     public AjaxResult listRecordImportData(MultipartFile file, boolean isUpdateSupport) throws Exception
     {
         ExcelUtil<ProjectStaffRecordOut> util = new ExcelUtil<>(ProjectStaffRecordOut.class);
@@ -189,6 +202,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/deleteStaff")
+    @ApiOperation("删除项目成员")
     public AjaxResult deleteStaff( @RequestBody ProjectStaff in){
         if (in.getId()== null){
             return error("项目成员编号不能为空");
@@ -203,6 +217,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @PostMapping("/deleteProject")
+    @ApiOperation("删除项目")
     public AjaxResult deleteProject( @RequestBody ProjectTask in){
         if (in.getId()== null){
             return error("项目编号不能为空");
@@ -216,6 +231,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping ("/details")
+    @ApiOperation("项目详情")
     public AjaxResult details( Long id){
         if (id== null){
             return error("项目编号不能为空");
@@ -230,6 +246,7 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping ("/list")
+    @ApiOperation("项目列表")
     public TableDataInfo list(ProjectListInput in){
         startPage();
         List<ProjectTaskListOut> list=projectTaskService.list(in);
@@ -241,6 +258,7 @@ public class ProjectTaskController extends BaseController {
      * @param response
      */
     @PostMapping("/export")
+    @ApiOperation("导出项目列表")
     public void export(HttpServletResponse response,ProjectListInput in)
     {
         List<ProjectTaskListOut> list=projectTaskService.list(in);
@@ -256,6 +274,7 @@ public class ProjectTaskController extends BaseController {
      * @throws Exception
      */
     @PostMapping("/importData")
+    @ApiOperation("导入项目列表")
     public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
     {
         ExcelUtil<ProjectTaskListOut> util = new ExcelUtil<>(ProjectTaskListOut.class);
@@ -266,6 +285,7 @@ public class ProjectTaskController extends BaseController {
     }
 
     @PostMapping("/importTemplate")
+    @ApiOperation("项目导出模版")
     public void importTemplate(HttpServletResponse response)
     {
         ExcelUtil<ProjectTaskListOut> util = new ExcelUtil<ProjectTaskListOut>(ProjectTaskListOut.class);
@@ -280,6 +300,7 @@ public class ProjectTaskController extends BaseController {
      * @throws Exception
      */
     @PostMapping("/upload")
+    @ApiOperation("上传文件")
     public AjaxResult upload(@RequestParam("file") MultipartFile file) throws Exception{
         if (!file.isEmpty()){
             String avatar = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
@@ -297,12 +318,14 @@ public class ProjectTaskController extends BaseController {
      * @return
      */
     @GetMapping("/myDuration")
+    @ApiOperation("查询剩余打卡时间")
     public AjaxResult myDuration(Long id,String recordTime){
         return projectStaffRecordService.myDuration(id,recordTime);
     }
 
 
     @GetMapping("/myDurationMonth")
+    @ApiOperation("查询我的月份数据")
     public AjaxResult myDurationMonth(Long id){
         return projectStaffRecordService.myDurationMonth(id);
     }