基于springboot+mybatis+vue软件缺陷管理系统

发表于:2023-2-07 09:27

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:优选源码    来源:博客园

  一、系统介绍
  系统主要功能:
  开发人员:主页、个人中心(我的待办、我的已办)、缺陷管理(列表)。
  测试人员:主页、个人中心(我的待办、我的已办)、缺陷管理。
  系统管理员:个人中心(我的待办、我的已办)、缺陷管理、项目管理、用户管理、角色管理、菜单管理、部门管理、统计分析。
  二、功能展示
  1.主页
  2.个人中心
  3.缺陷管理
  4.项目管理
  5.系统管理
  6.统计分析
  三、代码展示
  package com.ruoyi.bug.controller;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  import java.util.List;
  import javax.servlet.http.HttpServletResponse;
  import com.alibaba.fastjson.JSONArray;
  import com.alibaba.fastjson.JSONObject;
  import com.ruoyi.bug.tools.ListToTree;
  import org.springframework.security.access.prepost.PreAuthorize;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.PostMapping;
  import org.springframework.web.bind.annotation.PutMapping;
  import org.springframework.web.bind.annotation.DeleteMapping;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  import com.ruoyi.common.annotation.Log;
  import com.ruoyi.common.core.controller.BaseController;
  import com.ruoyi.common.core.domain.AjaxResult;
  import com.ruoyi.common.enums.BusinessType;
  import com.ruoyi.bug.domain.Comment;
  import com.ruoyi.bug.service.ICommentService;
  import com.ruoyi.common.utils.poi.ExcelUtil;
  import com.ruoyi.common.core.page.TableDataInfo;
  /**
   * 评论Controller
   *
   * @author ruoyi
   * @date 2022-03-24
   */
  @RestController
  @RequestMapping("/comment/comment")
  public class CommentController extends BaseController
  {
      @Autowired
      private ICommentService commentService;
      /**
       * 查询评论列表
       */
      @GetMapping("/list")
      public TableDataInfo list(Comment comment)
      {
          startPage();
          List<Comment> list = commentService.selectCommentList(comment);
          return getDataTable(list);
      }
      /**
       * 导出评论列表
       */
      @Log(title = "评论", businessType = BusinessType.EXPORT)
      @PostMapping("/export")
      public void export(HttpServletResponse response, Comment comment)
      {
          List<Comment> list = commentService.selectCommentList(comment);
          ExcelUtil<Comment> util = new ExcelUtil<Comment>(Comment.class);
          util.exportExcel(response, list, "评论数据");
      }
      /**
       * 获取评论详细信息
       */
      @GetMapping(value = "/{id}")
      public AjaxResult getInfo(@PathVariable("id") Long id)
      {
          return AjaxResult.success(commentService.selectCommentById(id));
      }
      /**
       * 新增评论
       */
      @Log(title = "评论", businessType = BusinessType.INSERT)
      @PostMapping
      public AjaxResult add(@RequestBody Comment comment)
      {
          Date currentTime = new Date();
          SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          String dateString = formatter.format(currentTime);
          comment.setSentTime(dateString);
          return toAjax(commentService.insertComment(comment));
      }
      /**
       * 修改评论
       */
      @Log(title = "评论", businessType = BusinessType.UPDATE)
      @PutMapping
      public AjaxResult edit(@RequestBody Comment comment)
      {
          return toAjax(commentService.updateComment(comment));
      }
      /**
       * 删除评论
       */
      @Log(title = "评论", businessType = BusinessType.DELETE)
  @DeleteMapping("/{ids}")
      public AjaxResult remove(@PathVariable Long[] ids)
      {
          return toAjax(commentService.deleteCommentByIds(ids));
      }
      /**
       * 根据表单ID获取评论详细信息
       */
      @GetMapping(value = "/getCommentInfo/{formId}")
      public AjaxResult getCommentInfo(@PathVariable("formId") Long formId)
      {
          Comment comment = new Comment();
          comment.setFormId(formId.toString());
          List<Comment> list = commentService.selectCommentList(comment);
          JSONArray jsonarray= JSONArray.parseArray(JSONObject.toJSONString(list));
          JSONArray result = ListToTree.listToTree(jsonarray,"id","parentId","reply");
          return AjaxResult.success(result);
      }
  }
  本文内容不用于商业目的,如涉及知识产权问题,请权利人联系51Testing小编(021-64471599-8017),我们将立即处理
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号