diff --git a/mysqldb/upgrade(alter table)/V3.0 upgrade V3.1/V2.7.2至V3.1生产事故数据迁移.sql b/mysqldb/upgrade(alter table)/V3.0 upgrade V3.1/V2.7.2至V3.1生产事故数据迁移.sql new file mode 100644 index 0000000..9aaf0b6 --- /dev/null +++ b/mysqldb/upgrade(alter table)/V3.0 upgrade V3.1/V2.7.2至V3.1生产事故数据迁移.sql @@ -0,0 +1,27 @@ +/* + * LuckyFrame 自动化测试平台 SQL脚本从V2.7.2升级至V3.1的生产事故数据迁移 + * Version 3.1 + * Author Seagull + * Date 2019-08-27 + + ************ WARNING ************ + 执行此脚本会将V2.7.2中生产事故的相关数据迁移到最新V3.1的表中 + 如果你没有V2.7.2这个版本,不用执行此脚本 +*/ +-- ---------------------------- +-- 质量管理-生产事故登记数据迁移 +-- ---------------------------- +insert into qa_accident (accident_id,project_id,accident_status,accident_time,report_time,accident_description,accident_level,accident_analysis,accident_type,accident_consequence,corrective_action,resolution_time,resolutioner,preventive_action,preventiver,preventive_plan_date,preventive_over_date,duration_time,impact_time,accident_file_name,create_by) +select id,projectid,accstatus,eventtime,reporttime,accdescription,acclevel,causalanalysis,causaltype,consequenceanalysis,correctiveaction,resolutiontime,resolutioner,preventiveaction,preventiver,preventiveplandate,preventiveaccdate,trouble_duration,impact_time,filename,reporter from luckyframedb.qa_accident qa +where 1=1 and NOT EXISTS(select 1 from qa_accident where accident_id = qa.id); + +/*修改NULL字符串为空*/ +update qa_accident t set t.resolution_time='' where t.resolution_time='NULL'; +update qa_accident t set t.resolutioner='' where t.resolutioner='NULL'; +update qa_accident t set t.preventive_plan_date='' where t.preventive_plan_date='NULL'; +update qa_accident t set t.preventive_over_date='' where t.preventive_over_date='NULL'; +update qa_accident t set t.preventiver='' where t.preventiver='NULL'; +update qa_accident t set t.report_time='' where t.report_time='NULL'; + +/*不是跟踪处理完成状态的记录,把解决时间跟解决人员修改成NULL*/ +update qa_accident t set t.resolution_time=null,t.resolutioner=null where t.accident_status!='跟踪处理完成' \ No newline at end of file diff --git a/src/main/java/com/luckyframe/project/testmanagmt/projectCase/mapper/ProjectCaseMapper.java b/src/main/java/com/luckyframe/project/testmanagmt/projectCase/mapper/ProjectCaseMapper.java index f63f134..8fd379d 100644 --- a/src/main/java/com/luckyframe/project/testmanagmt/projectCase/mapper/ProjectCaseMapper.java +++ b/src/main/java/com/luckyframe/project/testmanagmt/projectCase/mapper/ProjectCaseMapper.java @@ -1,132 +1,132 @@ -package com.luckyframe.project.testmanagmt.projectCase.mapper; - -import java.util.List; - -import com.luckyframe.project.testmanagmt.projectCase.domain.ProjectCase; - -/** - * 项目测试用例管理 数据层 - * - * @author luckyframe - * @date 2019-02-26 - */ -public interface ProjectCaseMapper -{ - /** - * 查询项目测试用例管理信息 - * - * @param caseId 项目测试用例管理ID - * @return 项目测试用例管理信息 - */ - public ProjectCase selectProjectCaseById(Integer caseId); - - /** - * 通过用例编号查询项目测试用例管理信息 - * - * @param caseId 项目测试用例管理ID - * @return 项目测试用例管理信息 - */ - public ProjectCase selectProjectCaseByCaseSign(String caseSign); - - /** - * 查询项目测试用例管理列表 - * - * @param projectCase 项目测试用例管理信息 - * @return 项目测试用例管理集合 - */ - public List selectProjectCaseList(ProjectCase projectCase); - - /** - * 查询计划中的用例列表 - * @param projectCase - * @return - * @author Seagull - * @date 2019年4月10日 - */ - public List selectProjectCaseListForPlan(ProjectCase projectCase); - - /** - * 新增项目测试用例管理 - * - * @param projectCase 项目测试用例管理信息 - * @return 结果 - */ - public int insertProjectCase(ProjectCase projectCase); - - /** - * 修改项目测试用例管理 - * - * @param projectCase 项目测试用例管理信息 - * @return 结果 - */ - public int updateProjectCase(ProjectCase projectCase); - - /** - * 删除项目测试用例管理 - * - * @param caseId 项目测试用例管理ID - * @return 结果 - */ - public int deleteProjectCaseById(Integer caseId); - - /** - * 批量删除项目测试用例管理 - * - * @param caseIds 需要删除的数据ID - * @return 结果 - */ - public int deleteProjectCaseByIds(String[] caseIds); - - /** - * 检查测试用例名称唯一性 - * @param caseName - * @return - * @author Seagull - * @date 2019年2月28日 - */ - public ProjectCase checkProjectCaseNameUnique(String caseName); - - /** - * 查询测试用例项目序号 - * @param projectId - * @return - * @author Seagull - * @date 2019年3月1日 - */ - public int selectMaxCaseSerialNumberByProjectId(Integer projectId); - - /** - * 查询项目下有没有测试用例 - * @param projectId - * @return - * @author Seagull - * @date 2019年3月4日 - */ - public int selectProjectCaseCountByProjectId(Integer projectId); - - /** - * 查询用例模块下有没有测试用例 - * @param projectId - * @return - * @author Seagull - * @date 2019年3月4日 - */ - public int selectProjectCaseCountByModuleId(Integer moduleId); - - /** - * 查询总用例数 - * @return - * @author Seagull - * @date 2019年4月28日 - */ - public int selectProjectCaseCount(); - - /** - * 查询指定天数内更新的用例 - * @param projectCase - * @return - * @author Seagull - * @date 2019年4月28日 - */ - public int selectProjectCaseCountForThirtyDays(String updateTime); +package com.luckyframe.project.testmanagmt.projectCase.mapper; + +import java.util.List; + +import com.luckyframe.project.testmanagmt.projectCase.domain.ProjectCase; + +/** + * 项目测试用例管理 数据层 + * + * @author luckyframe + * @date 2019-02-26 + */ +public interface ProjectCaseMapper +{ + /** + * 查询项目测试用例管理信息 + * + * @param caseId 项目测试用例管理ID + * @return 项目测试用例管理信息 + */ + public ProjectCase selectProjectCaseById(Integer caseId); + + /** + * 通过用例编号查询项目测试用例管理信息 + * + * @param caseId 项目测试用例管理ID + * @return 项目测试用例管理信息 + */ + public ProjectCase selectProjectCaseByCaseSign(String caseSign); + + /** + * 查询项目测试用例管理列表 + * + * @param projectCase 项目测试用例管理信息 + * @return 项目测试用例管理集合 + */ + public List selectProjectCaseList(ProjectCase projectCase); + + /** + * 查询计划中的用例列表 + * @param projectCase + * @return + * @author Seagull + * @date 2019年4月10日 + */ + public List selectProjectCaseListForPlan(ProjectCase projectCase); + + /** + * 新增项目测试用例管理 + * + * @param projectCase 项目测试用例管理信息 + * @return 结果 + */ + public int insertProjectCase(ProjectCase projectCase); + + /** + * 修改项目测试用例管理 + * + * @param projectCase 项目测试用例管理信息 + * @return 结果 + */ + public int updateProjectCase(ProjectCase projectCase); + + /** + * 删除项目测试用例管理 + * + * @param caseId 项目测试用例管理ID + * @return 结果 + */ + public int deleteProjectCaseById(Integer caseId); + + /** + * 批量删除项目测试用例管理 + * + * @param caseIds 需要删除的数据ID + * @return 结果 + */ + public int deleteProjectCaseByIds(String[] caseIds); + + /** + * 检查测试用例名称唯一性 + * @param projectCase + * @return + * @author Seagull + * @date 2019年10月8日 + */ + public List checkProjectCaseNameUnique(ProjectCase projectCase); + + /** + * 查询测试用例项目序号 + * @param projectId + * @return + * @author Seagull + * @date 2019年3月1日 + */ + public int selectMaxCaseSerialNumberByProjectId(Integer projectId); + + /** + * 查询项目下有没有测试用例 + * @param projectId + * @return + * @author Seagull + * @date 2019年3月4日 + */ + public int selectProjectCaseCountByProjectId(Integer projectId); + + /** + * 查询用例模块下有没有测试用例 + * @param projectId + * @return + * @author Seagull + * @date 2019年3月4日 + */ + public int selectProjectCaseCountByModuleId(Integer moduleId); + + /** + * 查询总用例数 + * @return + * @author Seagull + * @date 2019年4月28日 + */ + public int selectProjectCaseCount(); + + /** + * 查询指定天数内更新的用例 + * @param projectCase + * @return + * @author Seagull + * @date 2019年4月28日 + */ + public int selectProjectCaseCountForThirtyDays(String updateTime); } \ No newline at end of file diff --git a/src/main/java/com/luckyframe/project/testmanagmt/projectCase/service/ProjectCaseServiceImpl.java b/src/main/java/com/luckyframe/project/testmanagmt/projectCase/service/ProjectCaseServiceImpl.java index 85f44ca..6247afa 100644 --- a/src/main/java/com/luckyframe/project/testmanagmt/projectCase/service/ProjectCaseServiceImpl.java +++ b/src/main/java/com/luckyframe/project/testmanagmt/projectCase/service/ProjectCaseServiceImpl.java @@ -212,8 +212,8 @@ public class ProjectCaseServiceImpl implements IProjectCaseService public String checkProjectCaseNameUnique(ProjectCase projectCase) { Long caseId = StringUtils.isNull(projectCase.getCaseId()) ? -1L : projectCase.getCaseId(); - ProjectCase info = projectCaseMapper.checkProjectCaseNameUnique(projectCase.getCaseName()); - if (StringUtils.isNotNull(info) && info.getCaseId().longValue() != caseId.longValue()) + List info = projectCaseMapper.checkProjectCaseNameUnique(projectCase); + if (info.size()>0 && (info.get(0).getCaseId().longValue() != caseId.longValue() || projectCase.getPriority()==99999999)) { return ProjectCaseConstants.PROJECTCASE_NAME_NOT_UNIQUE; } diff --git a/src/main/resources/mybatis/testmanagmt/ProjectCaseMapper.xml b/src/main/resources/mybatis/testmanagmt/ProjectCaseMapper.xml index aa2b658..687af25 100644 --- a/src/main/resources/mybatis/testmanagmt/ProjectCaseMapper.xml +++ b/src/main/resources/mybatis/testmanagmt/ProjectCaseMapper.xml @@ -112,9 +112,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select IFNULL(MAX(case_serial_number),0) from project_case where project_id=#{project_id} - - where pc.case_name=#{case_name} + + and pc.case_name = #{caseName} + and pc.project_id = #{projectId} + diff --git a/src/main/resources/templates/testmanagmt/projectCase/add.html b/src/main/resources/templates/testmanagmt/projectCase/add.html index 48ce807..7d2e9fc 100644 --- a/src/main/resources/templates/testmanagmt/projectCase/add.html +++ b/src/main/resources/templates/testmanagmt/projectCase/add.html @@ -65,7 +65,7 @@ } }); - $("#form-projectCase-add").validate({ + myEditValidate = $("#form-projectCase-add").validate({ rules:{ projectId:{ required:true, @@ -79,6 +79,9 @@ type: "post", dataType: "json", data: { + "projectId": function() { + return $("#projectId").val(); + }, name: function () { return $.common.trim($("#caseName").val()); } @@ -125,6 +128,8 @@ /*选择项目初始化模块树*/ function initializeModuleTree() { + $.validate.resetForm(); + $.validate.form(); var projectId=$("#projectId").val(); $.ajax({ cache : true, diff --git a/src/main/resources/templates/testmanagmt/projectCase/copy.html b/src/main/resources/templates/testmanagmt/projectCase/copy.html index b2232e8..f5cb665 100644 --- a/src/main/resources/templates/testmanagmt/projectCase/copy.html +++ b/src/main/resources/templates/testmanagmt/projectCase/copy.html @@ -1,142 +1,150 @@ - - - - - -
-
- - - - -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- - -
-
-
-
- -
- -
-
-
-
-
- - - + + + + + +
+
+ + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/src/main/resources/templates/testmanagmt/projectCase/edit.html b/src/main/resources/templates/testmanagmt/projectCase/edit.html index ed80e61..7a06c9b 100644 --- a/src/main/resources/templates/testmanagmt/projectCase/edit.html +++ b/src/main/resources/templates/testmanagmt/projectCase/edit.html @@ -1,121 +1,124 @@ - - - - - -
-
- - - - - -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- - -
-
-
-
- -
- -
-
-
-
-
- - - + + + + + +
+
+ + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+
+
+ + +