fix: 解决冲突

This commit is contained in:
chenjianxing 2021-05-21 14:21:49 +08:00 committed by jianxing
parent 67828c2a05
commit dd3860c138
12 changed files with 15 additions and 128 deletions

View File

@ -21,7 +21,5 @@ public class CustomFieldTemplate implements Serializable {
private String customData; private String customData;
private Boolean isThirdPart;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -643,66 +643,6 @@ public class CustomFieldTemplateExample {
addCriterion("custom_data not between", value1, value2, "customData"); addCriterion("custom_data not between", value1, value2, "customData");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIsThirdPartIsNull() {
addCriterion("is_third_part is null");
return (Criteria) this;
}
public Criteria andIsThirdPartIsNotNull() {
addCriterion("is_third_part is not null");
return (Criteria) this;
}
public Criteria andIsThirdPartEqualTo(Boolean value) {
addCriterion("is_third_part =", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartNotEqualTo(Boolean value) {
addCriterion("is_third_part <>", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartGreaterThan(Boolean value) {
addCriterion("is_third_part >", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_third_part >=", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartLessThan(Boolean value) {
addCriterion("is_third_part <", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartLessThanOrEqualTo(Boolean value) {
addCriterion("is_third_part <=", value, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartIn(List<Boolean> values) {
addCriterion("is_third_part in", values, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartNotIn(List<Boolean> values) {
addCriterion("is_third_part not in", values, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartBetween(Boolean value1, Boolean value2) {
addCriterion("is_third_part between", value1, value2, "isThirdPart");
return (Criteria) this;
}
public Criteria andIsThirdPartNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_third_part not between", value1, value2, "isThirdPart");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

View File

@ -10,7 +10,6 @@
<result column="order" jdbcType="INTEGER" property="order" /> <result column="order" jdbcType="INTEGER" property="order" />
<result column="default_value" jdbcType="VARCHAR" property="defaultValue" /> <result column="default_value" jdbcType="VARCHAR" property="defaultValue" />
<result column="custom_data" jdbcType="VARCHAR" property="customData" /> <result column="custom_data" jdbcType="VARCHAR" property="customData" />
<result column="is_third_part" jdbcType="BIT" property="isThirdPart" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -71,8 +70,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, field_id, template_id, scene, required, `order`, default_value, custom_data, id, field_id, template_id, scene, required, `order`, default_value, custom_data
is_third_part
</sql> </sql>
<select id="selectByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultMap="BaseResultMap">
select select
@ -107,12 +105,10 @@
<insert id="insert" parameterType="io.metersphere.base.domain.CustomFieldTemplate"> <insert id="insert" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
insert into custom_field_template (id, field_id, template_id, insert into custom_field_template (id, field_id, template_id,
scene, required, `order`, scene, required, `order`,
default_value, custom_data, is_third_part default_value, custom_data)
)
values (#{id,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{templateId,jdbcType=VARCHAR},
#{scene,jdbcType=VARCHAR}, #{required,jdbcType=BIT}, #{order,jdbcType=INTEGER}, #{scene,jdbcType=VARCHAR}, #{required,jdbcType=BIT}, #{order,jdbcType=INTEGER},
#{defaultValue,jdbcType=VARCHAR}, #{customData,jdbcType=VARCHAR}, #{isThirdPart,jdbcType=BIT} #{defaultValue,jdbcType=VARCHAR}, #{customData,jdbcType=VARCHAR})
)
</insert> </insert>
<insert id="insertSelective" parameterType="io.metersphere.base.domain.CustomFieldTemplate"> <insert id="insertSelective" parameterType="io.metersphere.base.domain.CustomFieldTemplate">
insert into custom_field_template insert into custom_field_template
@ -141,9 +137,6 @@
<if test="customData != null"> <if test="customData != null">
custom_data, custom_data,
</if> </if>
<if test="isThirdPart != null">
is_third_part,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -170,9 +163,6 @@
<if test="customData != null"> <if test="customData != null">
#{customData,jdbcType=VARCHAR}, #{customData,jdbcType=VARCHAR},
</if> </if>
<if test="isThirdPart != null">
#{isThirdPart,jdbcType=BIT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.metersphere.base.domain.CustomFieldTemplateExample" resultType="java.lang.Long">
@ -208,9 +198,6 @@
<if test="record.customData != null"> <if test="record.customData != null">
custom_data = #{record.customData,jdbcType=VARCHAR}, custom_data = #{record.customData,jdbcType=VARCHAR},
</if> </if>
<if test="record.isThirdPart != null">
is_third_part = #{record.isThirdPart,jdbcType=BIT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -225,8 +212,7 @@
required = #{record.required,jdbcType=BIT}, required = #{record.required,jdbcType=BIT},
`order` = #{record.order,jdbcType=INTEGER}, `order` = #{record.order,jdbcType=INTEGER},
default_value = #{record.defaultValue,jdbcType=VARCHAR}, default_value = #{record.defaultValue,jdbcType=VARCHAR},
custom_data = #{record.customData,jdbcType=VARCHAR}, custom_data = #{record.customData,jdbcType=VARCHAR}
is_third_part = #{record.isThirdPart,jdbcType=BIT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -255,9 +241,6 @@
<if test="customData != null"> <if test="customData != null">
custom_data = #{customData,jdbcType=VARCHAR}, custom_data = #{customData,jdbcType=VARCHAR},
</if> </if>
<if test="isThirdPart != null">
is_third_part = #{isThirdPart,jdbcType=BIT},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
@ -269,8 +252,7 @@
required = #{required,jdbcType=BIT}, required = #{required,jdbcType=BIT},
`order` = #{order,jdbcType=INTEGER}, `order` = #{order,jdbcType=INTEGER},
default_value = #{defaultValue,jdbcType=VARCHAR}, default_value = #{defaultValue,jdbcType=VARCHAR},
custom_data = #{customData,jdbcType=VARCHAR}, custom_data = #{customData,jdbcType=VARCHAR}
is_third_part = #{isThirdPart,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>

View File

@ -10,7 +10,7 @@
<select id="list" resultType="io.metersphere.dto.CustomFieldTemplateDao"> <select id="list" resultType="io.metersphere.dto.CustomFieldTemplateDao">
select select
field_id, template_id, required, default_value, custom_data, field_id, template_id, required, default_value, custom_data,
cft.id as id, is_third_part, cft.id as id,
cf.name as name, cf.type as type, cf.remark as remark, cf.`system` as system, cf.options as options cf.name as name, cf.type as type, cf.remark as remark, cf.`system` as system, cf.options as options
from custom_field_template cft from custom_field_template cft
inner join custom_field cf inner join custom_field cf

View File

@ -12,6 +12,4 @@ public class CustomFieldDao extends CustomField {
private String defaultValue; private String defaultValue;
private String customData; private String customData;
private Boolean isThirdPart;
} }

View File

@ -8,5 +8,4 @@ public class CustomFieldItemDTO {
private String name; private String name;
private String value; private String value;
private String customData; private String customData;
private Boolean isThirdPart;
} }

View File

@ -16,6 +16,4 @@ public class CustomFieldTemplateDao extends CustomFieldTemplate {
private String options; private String options;
private Boolean system; private Boolean system;
private Boolean isThirdPart;
} }

View File

@ -252,7 +252,7 @@ public class JiraPlatform extends AbstractIssuePlatform {
// collect(Collectors.toMap(JiraField::getId, JiraField::isCustom)); // collect(Collectors.toMap(JiraField::getId, JiraField::isCustom));
customFields.forEach(item -> { customFields.forEach(item -> {
if (StringUtils.isNotBlank(item.getCustomData()) && item.getIsThirdPart() != null && item.getIsThirdPart()) { if (StringUtils.isNotBlank(item.getCustomData())) {
// if (isCustomMap.get(item.getCustomData())) { // if (isCustomMap.get(item.getCustomData())) {
// fields.put(item.getCustomData(), item.getValue()); // fields.put(item.getCustomData(), item.getValue());
// } else { // } else {

View File

@ -177,7 +177,7 @@ public class TapdPlatform extends AbstractIssuePlatform {
paramMap.add("current_owner", usersStr); paramMap.add("current_owner", usersStr);
customFields.forEach(item -> { customFields.forEach(item -> {
if (StringUtils.isNotBlank(item.getCustomData()) && item.getIsThirdPart() != null && item.getIsThirdPart()) { if (StringUtils.isNotBlank(item.getCustomData())) {
paramMap.add(item.getCustomData(), item.getValue()); paramMap.add(item.getCustomData(), item.getValue());
} }
}); });

View File

@ -57,16 +57,6 @@
</template> </template>
</ms-table-column> </ms-table-column>
<ms-table-column
v-if="platform !== 'metersphere'"
:label="platform + $t('custom_field.field')"
width="100"
prop="thirdPart">
<template v-slot="scope">
<el-checkbox v-model="scope.row.isThirdPart"/>
</template>
</ms-table-column>
<ms-table-column <ms-table-column
:label="$t('commons.remark')" :label="$t('commons.remark')"
prop="remark"> prop="remark">
@ -139,7 +129,6 @@ export default {
} }
item.fieldId = item.id; item.fieldId = item.id;
item.id = null; item.id = null;
item.isThirdPart = false;
item.options = JSON.parse(item.options); item.options = JSON.parse(item.options);
if (item.type === 'checkbox') { if (item.type === 'checkbox') {
item.defaultValue = []; item.defaultValue = [];

View File

@ -7,17 +7,6 @@
<el-input v-model="form.title" autocomplete="off"></el-input> <el-input v-model="form.title" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('custom_field.issue_creator')" prop="title">
<el-select filterable v-model="form.creator" :placeholder="$t('custom_field.issue_creator')">
<el-option
v-for="(item) in memberOptions"
:key="item.id"
:label="item.id + ' (' + item.name + ')'"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<!-- 自定义字段 --> <!-- 自定义字段 -->
<el-form v-if="isFormAlive" :model="customFieldForm" :rules="customFieldRules" ref="customFieldForm" <el-form v-if="isFormAlive" :model="customFieldForm" :rules="customFieldRules" ref="customFieldForm"
class="case-form"> class="case-form">
@ -130,8 +119,7 @@ export default {
zentaoUsers: [], zentaoUsers: [],
Builds: [], Builds: [],
hasTapdId: false, hasTapdId: false,
hasZentaoId: false, hasZentaoId: false
memberOptions: []
}; };
}, },
props: { props: {
@ -157,7 +145,6 @@ export default {
methods: { methods: {
open(data) { open(data) {
let initAddFuc = this.initEdit; let initAddFuc = this.initEdit;
this.getMemberOptions();
getTemplate('field/template/issue/get/relate/', this) getTemplate('field/template/issue/get/relate/', this)
.then((template) => { .then((template) => {
this.issueTemplate = template; this.issueTemplate = template;
@ -165,11 +152,6 @@ export default {
initAddFuc(data); initAddFuc(data);
}); });
}, },
getMemberOptions() {
this.$post('/user/ws/member/tester/list', {workspaceId: getCurrentWorkspaceId()}, response => {
this.memberOptions = response.data;
});
},
getThirdPartyInfo() { getThirdPartyInfo() {
let platform = this.issueTemplate.platform; let platform = this.issueTemplate.platform;
if (platform === 'Zentao') { if (platform === 'Zentao') {
@ -200,6 +182,9 @@ export default {
} else { } else {
//copy //copy
this.url = 'issues/add'; this.url = 'issues/add';
if (!this.form.creator) {
this.form.creator = getCurrentUserId();
}
this.form.title = data.title + '_copy'; this.form.title = data.title + '_copy';
} }
} else { } else {
@ -208,10 +193,10 @@ export default {
description: this.issueTemplate.content description: this.issueTemplate.content
} }
this.url = 'issues/add'; this.url = 'issues/add';
}
if (!this.form.creator) { if (!this.form.creator) {
this.form.creator = getCurrentUserId(); this.form.creator = getCurrentUserId();
} }
}
parseCustomField(this.form, this.issueTemplate, this.customFieldForm, this.customFieldRules, null); parseCustomField(this.form, this.issueTemplate, this.customFieldForm, this.customFieldRules, null);
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.testCaseIssueList) { if (this.$refs.testCaseIssueList) {

View File

@ -93,7 +93,6 @@ export function buildCustomFields(data, param, template) {
hasField = true; hasField = true;
customFields[index].name = item.name; customFields[index].name = item.name;
customFields[index].value = item.defaultValue; customFields[index].value = item.defaultValue;
customFields[index].isThirdPart = item.isThirdPart;
break; break;
} }
} }
@ -103,7 +102,6 @@ export function buildCustomFields(data, param, template) {
name: item.name, name: item.name,
value: item.defaultValue, value: item.defaultValue,
customData: item.customData, customData: item.customData,
isThirdPart: item.isThirdPart
}; };
customFields.push(customField); customFields.push(customField);
} }