diff --git a/mysqldb/initialization(create table)/V2.7.2 初始化.sql b/mysqldb/initialization(create table)/V2.7.2 初始化.sql index 21587a1..aa2219f 100644 --- a/mysqldb/initialization(create table)/V2.7.2 初始化.sql +++ b/mysqldb/initialization(create table)/V2.7.2 初始化.sql @@ -331,7 +331,7 @@ create table project_casesteps steptype int(2) not null COMMENT '0 接口 1 UI', time VARCHAR(30) COMMENT '最后更新时间', operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', + extend VARCHAR(200) COMMENT '扩展字段,可用于备注、存储HTTP模板等', primary key (ID) )default character set utf8; diff --git a/mysqldb/upgrade(alter table)/V2.7.1 upgrade V2.7.2/V2.7.2.sql b/mysqldb/upgrade(alter table)/V2.7.1 upgrade V2.7.2/V2.7.2.sql index 03f7f20..6b1b319 100644 --- a/mysqldb/upgrade(alter table)/V2.7.1 upgrade V2.7.2/V2.7.2.sql +++ b/mysqldb/upgrade(alter table)/V2.7.1 upgrade V2.7.2/V2.7.2.sql @@ -5,6 +5,11 @@ alter table project_protocoltemplate add column responsehead int(2) DEFAULT '0' alter table project_protocoltemplate add column responsecode int(2) DEFAULT '0' not null COMMENT '请求响应返回值是否带状态码 0不带 1带'; alter table userinfo add column status varchar(2) DEFAULT '0' not null COMMENT '状态:(0:正常,1:注销)'; /* 新增加项目ID字段*/ -alter table test_Taskexcute add column projectid int(10) not null COMMENT '项目ID'; +alter table test_taskexcute add column projectid int(10) not null COMMENT '项目ID'; /*历史数据项目ID初始化*/ update test_taskexcute t, test_jobs ts set t.projectid= ts.projectid where ts.id = t.jobid and t.projectid =0; +/*修改步骤表中备注字段的用处,升级为扩展字段,暂时用于HTTP模板的存储*/ +ALTER TABLE project_casesteps change remark extend varchar(200) COMMENT '扩展字段,可用于备注、存储HTTP模板等'; +/*把在action中存储的模板信息移到EXTEND字段中进行管理*/ +update project_casesteps set extend=action where action like "【%" and action like "%】%"; +update project_casesteps set action="" where action like "【%" and action like "%】%"; \ No newline at end of file diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java index 641905a..8326c83 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java @@ -29,7 +29,7 @@ public class ProjectCasesteps implements java.io.Serializable{ private int steptype; private String time; private String operationer; - private String remark; + private String extend; public int getId() { return id; @@ -104,10 +104,11 @@ public class ProjectCasesteps implements java.io.Serializable{ public void setOperationer(String operationer) { this.operationer = operationer; } - public String getRemark() { - return remark; + public String getExtend() { + return extend; } - public void setRemark(String remark) { - this.remark = remark; + public void setExtend(String extend) { + this.extend = extend; } + } diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java index 56158de..f3d4b60 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java @@ -125,7 +125,7 @@ public class ProjectCasestepsController { step.setExpectedresult(""); step.setProjectid(prcase.getProjectid()); step.setSteptype(prcase.getCasetype()); - step.setRemark(""); + step.setExtend(""); steps.add(step); } @@ -211,7 +211,7 @@ public class ProjectCasestepsController { step.setParameters(step.getParameters().replace(""", "\"")); step.setAction(step.getAction().replace(""", "\"")); step.setExpectedresult(step.getExpectedresult().replace(""", "\"")); - step.setRemark(step.getRemark().replace(""", "\"")); + step.setExtend(step.getExtend().replace(""", "\"")); casestepsservice.add(step); } projectcase.setOperationer(usercode); @@ -485,6 +485,7 @@ public class ProjectCasestepsController { steps.setExpectedresult(expectedresult); steps.setProjectid(Integer.valueOf(projectid)); steps.setSteptype(Integer.valueOf(steptype)); + steps.setExtend(""); Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); diff --git a/src/main/resources/ProjectCasesteps.hbm.xml b/src/main/resources/ProjectCasesteps.hbm.xml index 8cb9bdb..bf19ec2 100644 --- a/src/main/resources/ProjectCasesteps.hbm.xml +++ b/src/main/resources/ProjectCasesteps.hbm.xml @@ -42,8 +42,8 @@ - - + + \ No newline at end of file diff --git a/src/main/webapp/jsp/plancase/projectcase.jsp b/src/main/webapp/jsp/plancase/projectcase.jsp index 619c7cd..e8b6f25 100644 --- a/src/main/webapp/jsp/plancase/projectcase.jsp +++ b/src/main/webapp/jsp/plancase/projectcase.jsp @@ -515,19 +515,8 @@ field : 'operationer', title : '更新人员' }, { - field : 'remark', - title : '备注', - editable : { - type : 'text', - title : '备注', - emptytext : "【备注】为空", - validate : function(value) { - if (value.length > 200) - return '备注不能超过200个字符'; -// if (value.length < 2) -// return '备注不能小于2个字符'; - } - } + field : 'extend', + title : '扩展字段', }, { field : 'id', title : 'id', diff --git a/src/main/webapp/jsp/plancase/step_add.jsp b/src/main/webapp/jsp/plancase/step_add.jsp index fef16d6..306f30b 100644 --- a/src/main/webapp/jsp/plancase/step_add.jsp +++ b/src/main/webapp/jsp/plancase/step_add.jsp @@ -84,7 +84,7 @@ 步骤动作 预期结果 类型 - 备注 + 扩展字段 操作 @@ -95,10 +95,10 @@ -
+
-
+
@@ -108,23 +108,24 @@
-
+
-
-
+
+ +<%--
-
+
--%>
-
+
-
+
                            @@ -135,7 +136,14 @@
-
+
+
+ +
+ +
+
+
@@ -284,10 +292,10 @@ message: '【步骤动作】无效!', validators: { stringLength: { - min: 2, + min: 0, max: 50, message: '【步骤动作】长度必须小于50个字符' - }, + }/* , callback: { message: '类型是HTTP,请选择协议模板', callback:function(value,validator,$field){ @@ -308,7 +316,7 @@ return true; } } - } + } */ } }, expectedresult: { @@ -347,13 +355,34 @@ } } }, - remark: { - message: '【备注】无效!', + extend: { + message: '【扩展字段】无效!', validators: { stringLength: { min: 0, max: 200, - message: '【备注】长度必须小于200个字符' + message: '【扩展字段】长度必须小于200个字符' + }, + callback: { + message: '类型是HTTP,请选择协议模板', + callback:function(value,validator,$field){ + var num=$field.attr("id").substring(6); + var steps; + if(casesteps.steptype.size==0){ + steps=casesteps.steptype.value + }else{ + steps=casesteps.steptype[num-1].value + } + + if(steps=="2" && value==""){ + return { + valid: false, + message: 'HTTP必须选择协议模板' + }; + }else{ + return true; + } + } } } } @@ -415,7 +444,7 @@ json = json + "\"id\":" + $("#id" + index).val() + ","; json = json + "\"caseid\":\"" + '${caseid}' + "\","; json = json + "\"projectid\":\"" + '${projectid}' + "\","; - json = json + "\"remark\":\"" + $("#remark" + index).val().replaceAll("\"", """) + "\"}"; + json = json + "\"extend\":\"" + $("#extend" + index).val().replaceAll("\"", """) + "\"}"; if (i !== oTable.rows.length - 1) { json = json + ","; } @@ -474,15 +503,15 @@ opob.children[1].setAttribute("id", "operation" + index); } oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index); - var aob = oTable.rows[i].cells[4].children[0].children[0]; - if (aob.children[0].tagName.toLocaleLowerCase() === 'input') { - aob.children[0].setAttribute("id", "action" + index); - } else { - aob.children[1].setAttribute("id", "action" + index); - } + oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index); oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index); - oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index); - oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index); + oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index); + var eob = oTable.rows[i].cells[7].children[0].children[0]; + if (eob.children[0].tagName.toLocaleLowerCase() === 'input') { + eob.children[0].setAttribute("id", "extend" + index); + } else { + eob.children[1].setAttribute("id", "extend" + index); + } } initSuggest(begin + 1); if(iscopy==0){ @@ -518,15 +547,16 @@ opob.children[1].setAttribute("id", "operation" + index); } oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index); - var aob = oTable.rows[i].cells[4].children[0].children[0]; - if (aob.children[0].tagName.toLocaleLowerCase() === 'input') { - aob.children[0].setAttribute("id", "action" + index); - } else { - aob.children[1].setAttribute("id", "action" + index); - } + oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index); oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index); oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index); - oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index); + + var eob = oTable.rows[i].cells[7].children[0].children[0]; + if (eob.children[0].tagName.toLocaleLowerCase() === 'input') { + eob.children[0].setAttribute("id", "extend" + index); + } else { + eob.children[1].setAttribute("id", "extend" + index); + } } $('#casesteps').data('bootstrapValidator').resetForm(); $('#casesteps').data('bootstrapValidator').validate(); @@ -554,15 +584,15 @@ opob.children[1].setAttribute("id", "operation" + index); } oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index); - var aob = oTable.rows[i].cells[4].children[0].children[0]; - if (aob.children[0].tagName.toLocaleLowerCase() === 'input') { - aob.children[0].setAttribute("id", "action" + index); - } else { - aob.children[1].setAttribute("id", "action" + index); - } + oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index); oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index); oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index); - oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index); + var eob = oTable.rows[i].cells[7].children[0].children[0]; + if (eob.children[0].tagName.toLocaleLowerCase() === 'input') { + eob.children[0].setAttribute("id", "extend" + index); + } else { + eob.children[1].setAttribute("id", "extend" + index); + } } } } @@ -589,15 +619,15 @@ opob.children[1].setAttribute("id", "operation" + index); } oTable.rows[i].cells[3].children[0].children[0].setAttribute("id", "parameters" + index); - var aob = oTable.rows[i].cells[4].children[0].children[0]; - if (aob.children[0].tagName.toLocaleLowerCase() === 'input') { - aob.children[0].setAttribute("id", "action" + index); - } else { - aob.children[1].setAttribute("id", "action" + index); - } + oTable.rows[i].cells[4].children[0].children[0].setAttribute("id", "action" + index); oTable.rows[i].cells[5].children[0].children[0].setAttribute("id", "expectedresult" + index); oTable.rows[i].cells[6].children[0].children[0].setAttribute("id", "steptype" + index); - oTable.rows[i].cells[7].children[0].children[0].setAttribute("id", "remark" + index); + var eob = oTable.rows[i].cells[7].children[0].children[0]; + if (eob.children[0].tagName.toLocaleLowerCase() === 'input') { + eob.children[0].setAttribute("id", "extend" + index); + } else { + eob.children[1].setAttribute("id", "extend" + index); + } } } } @@ -615,7 +645,7 @@ $("#parameters" + index).val(''); $("#action" + index).val(''); $("#expectedresult" + index).val(''); - $("#remark" + index).val(''); + $("#extend" + index).val(''); } function initSuggest(index) { @@ -626,11 +656,11 @@ initSuggestOperation(index, steptype); initSuggestAction(index, steptypetext); } else if (steptype === '1' || steptype === '4') { - $("#action" + index).bsSuggest("destroy"); + $("#extend" + index).bsSuggest("destroy"); initSuggestOperation(index, steptype); } else { $("#operation" + index).bsSuggest("destroy"); - $("#action" + index).bsSuggest("destroy"); + $("#extend" + index).bsSuggest("destroy"); } } @@ -641,7 +671,7 @@ casesteps.bootstrapValidator('addField', 'parameters'); casesteps.bootstrapValidator('addField', 'action'); casesteps.bootstrapValidator('addField', 'expectedresult'); - casesteps.bootstrapValidator('addField', 'remark'); + casesteps.bootstrapValidator('addField', 'extend'); casesteps.data('bootstrapValidator').validate(); } @@ -653,9 +683,9 @@ } function initSuggestAction(index, steptypetext) { - var actionindex = $("#action" + index); - actionindex.bsSuggest("destroy"); - actionindex.bsSuggest({ + var extendindex = $("#extend" + index); + extendindex.bsSuggest("destroy"); + extendindex.bsSuggest({ url: "/projectprotocolTemplate/cgetPTemplateList.do?projectid=${projectid}&steptype=" + steptypetext, /*effectiveFields: ["userName", "shortAccount"], searchFields: [ "shortAccount"],*/ @@ -670,7 +700,7 @@ }).on('onDataRequestSuccess', function (e, result) { }).on('onSetSelectValue', function (e, keyword, data) { - $('#casesteps').data('bootstrapValidator').updateStatus(actionindex, 'NOT_VALIDATED', null).validateField(actionindex); + $('#casesteps').data('bootstrapValidator').updateStatus(extendindex, 'NOT_VALIDATED', null).validateField(extendindex); }).on('onUnsetSelectValue', function () { });