优化用例名称重复的限制,只限制在同项目下不能重复

增加生产事故数据迁移脚本
This commit is contained in:
seagull 2019-10-08 16:10:19 +08:00
parent 981d8d273b
commit b8feaefe86
7 changed files with 445 additions and 399 deletions

View File

@ -0,0 +1,27 @@
/*
* LuckyFrame SQL脚本从V2.7.2V3.1
* Version 3.1
* Author Seagull
* Date 2019-08-27
************ WARNING ************
V2.7.2V3.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!='跟踪处理完成'

View File

@ -79,12 +79,12 @@ public interface ProjectCaseMapper
/**
* 检查测试用例名称唯一性
* @param caseName
* @param projectCase
* @return
* @author Seagull
* @date 2019年2月28日
* @date 2019年10月8日
*/
public ProjectCase checkProjectCaseNameUnique(String caseName);
public List<ProjectCase> checkProjectCaseNameUnique(ProjectCase projectCase);
/**
* 查询测试用例项目序号

View File

@ -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<ProjectCase> info = projectCaseMapper.checkProjectCaseNameUnique(projectCase);
if (info.size()>0 && (info.get(0).getCaseId().longValue() != caseId.longValue() || projectCase.getPriority()==99999999))
{
return ProjectCaseConstants.PROJECTCASE_NAME_NOT_UNIQUE;
}

View File

@ -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}
</select>
<select id="checkProjectCaseNameUnique" parameterType="String" resultMap="ProjectCaseResult">
<select id="checkProjectCaseNameUnique" parameterType="ProjectCase" resultMap="ProjectCaseResult">
<include refid="selectProjectCaseVo"/>
where pc.case_name=#{case_name}
<where>
<if test="caseName != null and caseName != '' "> and pc.case_name = #{caseName}</if>
<if test="projectId != null and projectId != 0"> and pc.project_id = #{projectId}</if>
</where>
</select>
<insert id="insertProjectCase" parameterType="ProjectCase" useGeneratedKeys="true" keyProperty="caseId">

View File

@ -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,

View File

@ -74,9 +74,15 @@
data: {
"caseId": function() {
return $("#caseId").val();
},
"projectId": function() {
return $("#projectId").val();
},
name: function () {
return $.common.trim($("#caseName").val());
},
priority: function () {
return 99999999;
}
},
dataFilter: function (data, type) {
@ -121,6 +127,8 @@
/*选择项目初始化模块树*/
function initializeModuleTree() {
$.validate.resetForm();
$.validate.form();
var projectId=$("#projectId").val();
$.ajax({
cache : true,

View File

@ -72,6 +72,9 @@
data: {
"caseId": function() {
return $("#caseId").val();
},
"projectId": function() {
return $("#projectId").val();
},
name: function () {
return $.common.trim($("#caseName").val());