New file |
| | |
| | | package com.zt.life.modules.testReviewComment.controller; |
| | | |
| | | |
| | | import com.zt.common.annotation.LogOperation; |
| | | import com.zt.common.constant.Constant; |
| | | import com.zt.common.annotation.QueryParam; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import com.zt.common.servlet.Result; |
| | | import com.zt.common.servlet.PageResult; |
| | | import com.zt.common.validator.AssertUtils; |
| | | import com.zt.common.validator.ValidatorUtils; |
| | | import com.zt.common.validator.group.AddGroup; |
| | | import com.zt.common.validator.group.DefaultGroup; |
| | | import com.zt.common.validator.group.UpdateGroup; |
| | | import com.zt.life.modules.baselineRelease.dto.BaselineDto; |
| | | import com.zt.life.modules.testReviewComment.dto.ReviewCommentDto; |
| | | import com.zt.life.modules.testReviewComment.model.TestReviewComment; |
| | | import com.zt.life.modules.testReviewComment.service.TestReviewCommentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * test_review_comment |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-28 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/testReviewComment/TestReviewComment/") |
| | | @Api(tags="test_review_comment") |
| | | public class TestReviewCommentController { |
| | | @Autowired |
| | | private TestReviewCommentService testReviewCommentService; |
| | | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "code", value = "测试评审编号", dataType = Constant.QT.STRING, format = "a.code^LK"), |
| | | @ApiImplicitParam(name = "softwareName", value = "项目名称", dataType = Constant.QT.STRING, format = "p.software_name^LK"), |
| | | @ApiImplicitParam(name = "pageCode", value = "配置项标识", dataType = Constant.QT.STRING, format = "a.page_code^LK") |
| | | }) |
| | | public PageResult<TestReviewComment> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | return PageResult.ok(testReviewCommentService.page(queryFilter)); |
| | | } |
| | | |
| | | @GetMapping("getDto") |
| | | @ApiOperation("信息") |
| | | public Result<ReviewCommentDto> getDto(Long commentId, Long projectId, String pageCode) { |
| | | ReviewCommentDto data = testReviewCommentService.getDto(commentId, projectId, pageCode); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result<Long> insert(@RequestBody ReviewCommentDto reviewCommentDto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(reviewCommentDto, AddGroup.class, DefaultGroup.class); |
| | | Long result = testReviewCommentService.save(reviewCommentDto); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result<Long> update(@RequestBody ReviewCommentDto reviewCommentDto) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(reviewCommentDto, UpdateGroup.class, DefaultGroup.class); |
| | | Long result = testReviewCommentService.save(reviewCommentDto); |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @DeleteMapping("deleteReviewComment") |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | testReviewCommentService.delete(ids); |
| | | return Result.ok(); |
| | | } |
| | | @GetMapping("exportReviewComment") |
| | | @ApiOperation("打印基线发布书") |
| | | @LogOperation("打印基线发布书") |
| | | public void exportBaseline(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | testReviewCommentService.exportReviewComment(id,pageCode, request, response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.testReviewComment.dao; |
| | | |
| | | import com.zt.common.dao.BaseDao; |
| | | import com.zt.life.modules.testReviewComment.model.TestReviewComment; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * test_review_comment |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-28 |
| | | */ |
| | | @Mapper |
| | | public interface TestReviewCommentDao extends BaseDao<TestReviewComment> { |
| | | |
| | | List<TestReviewComment> getList(Map<String, Object> params); |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.testReviewComment.dto; |
| | | |
| | | import com.zt.life.modules.baselineRelease.model.BaselineRelease; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineReleaseRemark; |
| | | import com.zt.life.modules.project.model.Project; |
| | | import com.zt.life.modules.testReviewComment.model.TestReviewComment; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ReviewCommentDto { |
| | | private Long id;//ID |
| | | private Long projectId;//项目ID |
| | | private String pageCode;//配置项类型 |
| | | |
| | | |
| | | @ApiModelProperty(value = "测试评审意见") |
| | | private TestReviewComment reviewComment; |
| | | @ApiModelProperty(value = "测试项目基本信息") |
| | | private Project project; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.testReviewComment.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.zt.common.entity.BusiEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * test_review_comment |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-28 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper=false) |
| | | @TableName("test_review_comment") |
| | | public class TestReviewComment extends BusiEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "项目ID") |
| | | private Long projectId; |
| | | |
| | | @ApiModelProperty(value = "页面标识") |
| | | private String pageCode; |
| | | |
| | | @ApiModelProperty(value = "测试评审编号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "评审日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date reviewDate; |
| | | |
| | | @ApiModelProperty(value = "评审人数") |
| | | private Integer reviewerNum; |
| | | |
| | | } |
New file |
| | |
| | | package com.zt.life.modules.testReviewComment.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.life.export.dto.WordFile; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.baselineRelease.dto.BaselineDto; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineRelease; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineReleaseRemark; |
| | | import com.zt.life.modules.baselineRelease.service.BaselineReleaseRemarkService; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.testReviewComment.dao.TestReviewCommentDao; |
| | | import com.zt.life.modules.testReviewComment.dto.ReviewCommentDto; |
| | | import com.zt.life.modules.testReviewComment.model.TestReviewComment; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * test_review_comment |
| | | * |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-28 |
| | | */ |
| | | @Service |
| | | public class TestReviewCommentService extends BaseService<TestReviewCommentDao, TestReviewComment> { |
| | | |
| | | @Autowired |
| | | private SysOssService sysOssService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param queryFilter |
| | | * @return |
| | | */ |
| | | public List<TestReviewComment> page(QueryFilter queryFilter) { |
| | | List<TestReviewComment> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | sysOssService.setListOsses(list, "test_review_comment"); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids |
| | | */ |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | |
| | | |
| | | public ReviewCommentDto getDto(Long commentId, Long projectId, String pageCode) { |
| | | ReviewCommentDto data = new ReviewCommentDto(); |
| | | data.setPageCode(pageCode); |
| | | if (commentId != null) { |
| | | data.setId(commentId); |
| | | TestReviewComment reviewComment = this.get(commentId); |
| | | data.setReviewComment(reviewComment); |
| | | if (reviewComment != null && projectId == null) { |
| | | projectId = reviewComment.getProjectId(); |
| | | } |
| | | } else { |
| | | TestReviewComment reviewComment = new TestReviewComment(); |
| | | reviewComment.setPageCode(pageCode); |
| | | data.setReviewComment(reviewComment); |
| | | } |
| | | if (projectId != null) { |
| | | data.setProjectId(projectId); |
| | | data.setProject(projectService.get(projectId)); |
| | | } |
| | | return data; |
| | | } |
| | | public Long save(ReviewCommentDto reviewCommentDto) { |
| | | Long commentId = reviewCommentDto.getReviewComment().getId(); |
| | | if (commentId != null) |
| | | baseDao.updateById(reviewCommentDto.getReviewComment()); |
| | | else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | String pagecode = reviewCommentDto.getPageCode(); |
| | | map.put("funCode", "test_review_comment_" + pagecode); |
| | | map.put("projectId", reviewCommentDto.getProjectId().toString()); |
| | | reviewCommentDto.getReviewComment().setProjectId(reviewCommentDto.getProjectId()); |
| | | reviewCommentDto.getReviewComment().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(reviewCommentDto.getReviewComment()); |
| | | commentId = reviewCommentDto.getReviewComment().getId(); |
| | | } |
| | | return commentId; |
| | | } |
| | | |
| | | public void exportReviewComment(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ReviewCommentDto dataObj = this.getDto(id, null, pageCode); |
| | | WordFile wordFile = new WordFile(); |
| | | wordFile.setModulePath("基线发布书.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_基线发布书.docx"); |
| | | wordFileService.exportWordFile(request, dataObj, wordFile, response); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.zt.life.modules.testReviewComment.dao.TestReviewCommentDao"> |
| | | |
| | | <select id="getList" resultType="com.zt.life.modules.testReviewComment.model.TestReviewComment"> |
| | | select a.*,p.software_name |
| | | from test_review_comment a |
| | | INNER JOIN project p ON p.id = a.project_id |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="whereSql!=null"> |
| | | and ${whereSql} |
| | | </if> |
| | | </where> |
| | | <if test="orderBySql!=null"> |
| | | ORDER BY ${orderBySql} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="项目ID" prop="projectId" rules="required"> |
| | | <el-input v-model="dataForm.projectId"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="页面标识" prop="pageCode" rules="required"> |
| | | <el-input v-model="dataForm.pageCode"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="测试评审编号" prop="code" rules="required"> |
| | | <el-input v-model="dataForm.code"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="评审日期" prop="reviewDate" rules="required"> |
| | | <el-input v-model="dataForm.reviewDate"></el-input> |
| | | </zt-form-item> |
| | | <zt-form-item label="评审人数" prop="reviewerNum" rules="required"> |
| | | <el-input v-model="dataForm.reviewerNum"></el-input> |
| | | </zt-form-item> |
| | | </el-form> |
| | | <template v-slot:footer> |
| | | <el-button v-if="dataForm.disabled" type="primary" @click="print()">打印</el-button> |
| | | </template> |
| | | </zt-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import qs from "qs"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageCode: '', |
| | | subtitle: '', |
| | | pageName: { |
| | | plan: '测试计划', explain: '测试就绪', record: '测试总结' |
| | | }, |
| | | dataForm: { |
| | | id: '', |
| | | project: { |
| | | softwareName: '', |
| | | }, |
| | | reviewComment: { |
| | | code: '', |
| | | reviewDate: '', |
| | | reviewerNum: '' |
| | | }, |
| | | projectId: '', |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | init(id, row) { |
| | | if (id) { |
| | | this.dataForm.id = id |
| | | } else { |
| | | this.dataForm.id = row.id |
| | | } |
| | | this.pageCode = row.pageCode |
| | | if (row.projectId) { |
| | | this.dataForm.projectId = row.projectId |
| | | } |
| | | this.getInfo() |
| | | //console.log(this.dataForm.id, this.dataForm.projectId, this.stepMarker, 'this.dataForm.id, this.dataForm.projectId,this.stepMarker') |
| | | }, |
| | | // 获取信息 |
| | | async getInfo() { |
| | | let params = { |
| | | commentId: this.dataForm.id, |
| | | projectId: this.dataForm.projectId, |
| | | pageCode: this.pageCode |
| | | } |
| | | console.log(this.pageCode, "getInfo pageCode") |
| | | let res = await this.$http.get(`/testReviewComment/TestReviewComment/getDto`, {params: params}) |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | console.log(this.dataForm, 'this.dataForm this.dataForm') |
| | | }, |
| | | async print() { |
| | | var params = qs.stringify({ |
| | | token: Cookies.get('token'), |
| | | id: this.dataForm.id, |
| | | pageCode: this.pageCode |
| | | }) |
| | | let apiURL = `/testReviewComment/TestReviewComment/exportComment` |
| | | window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}` |
| | | }, |
| | | // 表单提交 |
| | | async formSubmit() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/testReviewComment/TestReviewComment/', this.dataForm) |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <el-card shadow="never" class="aui-card--fill"> |
| | | <div class="mod-testReviewComment-testReviewComment}"> |
| | | <zt-table-wraper query-url="/testReviewComment/TestReviewComment/page" delete-url="/testReviewComment/TestReviewComment" v-slot="{ table }"> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <el-input v-model="dataForm.code" placeholder="请输入测试评审编号" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input v-model="dataForm.softwareName" placeholder="请输入项目名称" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <zt-button type="query" @click="table.query()"/> |
| | | <zt-button type="primary" class="el-icon-edit" @click="add()">新增</zt-button> |
| | | <zt-button type="delete" perm="testReviewComment:delete" @click="table.deleteHandle()"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}" border @selection-change="table.selectionChangeHandle"> |
| | | <el-table-column type="selection" width="40"/> |
| | | <el-table-column prop="code" label="测试评审编号"/> |
| | | <el-table-column prop="reviewDate" label="评审日期"/> |
| | | <el-table-column prop="softwareName" label="项目名称"/> |
| | | <zt-table-column-handle :table="table" :hasEdit='false' edit-perm="testReviewComment:update" |
| | | delete-perm="testCheckOrder::delete"> |
| | | <template v-slot="{row}"> |
| | | <zt-table-button type="primary" @click="openEditWin(row)">修改</zt-table-button> |
| | | </template> |
| | | |
| | | </zt-table-column-handle> |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update ref="addOrUpdate" @recall="table.query"/> |
| | | <ProjectSelect :pageCode="pageCode" ref="projectSelect" |
| | | @refreshDataList="table.query" |
| | | @setProjectInfo="openAddWin"> |
| | | </ProjectSelect> |
| | | <Preview ref="view"></Preview> |
| | | </zt-table-wraper> |
| | | </div> |
| | | </el-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './TestReviewComment-AddOrUpdate' |
| | | import ProjectSelect from "../project/Project-select.vue" |
| | | import Preview from '@/views/pages/view' |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageCode: '', |
| | | dataForm: { |
| | | code: '', |
| | | softwareName: '', |
| | | pageCode:this.$route.query.pageCode |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.pageCode = this.$route.query.pageCode |
| | | this.dataForm.pageCode = this.$route.query.pageCode |
| | | console.log(this.pageCode,'this.pageCode this.pageCode') |
| | | }, |
| | | components: { |
| | | AddOrUpdate, |
| | | ProjectSelect, |
| | | Preview |
| | | }, |
| | | methods: { |
| | | add() { |
| | | console.log(this.pageCode, 'this.pageCode') |
| | | this.$refs.projectSelect.$refs.dialog.init("test_review_comment", {pageCode: this.pageCode}) |
| | | }, |
| | | openAddWin(projectRow) { |
| | | console.log(projectRow, 'openAddWin(projectRow) projectRow') |
| | | this.$refs.addOrUpdate.$refs.dialog.init(null, {id: null, projectId: projectRow.id, pageCode: this.pageCode}) |
| | | }, |
| | | openEditWin(row){ |
| | | console.log(row,'openEditWin(checkOrderRow)') |
| | | this.$refs.addOrUpdate.$refs.dialog.init(row.id, {id: row.id, projectId: row.projectId, pageCode: this.pageCode}) |
| | | }, |
| | | preview(row) { |
| | | this.$refs.view.openAccessoryFormatSingle(row) |
| | | } |
| | | } |
| | | } |
| | | </script> |