| | |
| | | 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.sysBaseInfo.service.TestAgencyInfoService; |
| | | 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.life.sys.service.SysOssConfigService; |
| | | 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.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | |
| | | /** |
| | | * test_review_comment |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-12-28 |
| | | */ |
| | | @Service |
| | | public class TestReviewCommentService extends BaseService<TestReviewCommentDao, TestReviewComment> { |
| | | public class TestReviewCommentService extends BaseService<TestReviewCommentDao, TestReviewComment> { |
| | | |
| | | @Autowired |
| | | private SysOssService sysOssService; |
| | |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | @Autowired |
| | | private TestAgencyInfoService testAgencyInfoService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | * @return |
| | | */ |
| | | public List<TestReviewComment> page(QueryFilter queryFilter) { |
| | | String pageCode = String.valueOf(queryFilter.getParams().get("pageCode")); |
| | | pageCode=pageCode.replace("%",""); |
| | | List<TestReviewComment> list = baseDao.getList(queryFilter.getQueryParams()); |
| | | if (list.size() > 0) { |
| | | sysOssService.setListOsses(list, "test_review_comment"); |
| | | sysOssService.setListOsses(list, "test_review_comment_" + pageCode); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | |
| | | 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); |
| | |
| | | } |
| | | 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(); |
| | | } |
| | | sysOssConfigService.updateOss(reviewCommentDto.getId(), reviewCommentDto.getFiles());// 保存附件 |
| | | return commentId; |
| | | } |
| | | |
| | | public void exportReviewComment(Long id, String pageCode, HttpServletRequest request, HttpServletResponse response) { |
| | | try { |
| | | ReviewCommentDto dataObj = this.getDto(id, null, pageCode); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("plan", "计划"); |
| | | map.put("ready", "就绪"); |
| | | map.put("summary", "测试总结"); |
| | | String type = map.get(pageCode); |
| | | dataObj.setPageCode(type); |
| | | WordFile wordFile = new WordFile(); |
| | | wordFile.setModulePath("基线发布书.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_基线发布书.docx"); |
| | | wordFile.setModulePath("测试" + type + "评审意见.docx"); |
| | | wordFile.setWordName(dataObj.getProject().getSoftwareName() + "_测试" + type + "评审意见.docx"); |
| | | wordFileService.exportWordFile(request, dataObj, wordFile, response); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |