Browse Source

供应商表索引增加servicerswitch字段

dongbw 8 years ago
parent
commit
4d4f999825

+ 21 - 3
search-console-b2b/src/main/java/com/uas/search/console/b2b/model/CustmerSimpleInfo.java

@@ -43,6 +43,8 @@ public class CustmerSimpleInfo {
 
 	public static final String CUSTSWITCH_FIELD = "ve_custswitch";
 
+	public static final String SERVICERSWITCH_FIELD = "ve_servicerswitch";
+
 	@Id
 	@Column(name = ID_FIELD)
 	private Long id;
@@ -81,6 +83,14 @@ public class CustmerSimpleInfo {
 	@JoinColumn(name = VEND_FIELD, insertable = false, updatable = false)
 	private EnterpriseSimpleInfo vend;
 
+	/**
+	 * 服务商开关,供应商操作,因为是相对的,如果一个条件不能构成约束<br>
+	 * 1. 启用<br>
+	 * 0. 禁用
+	 */
+	@Column(name = SERVICERSWITCH_FIELD)
+	private Short servicerswitch;
+
 	/**
 	 * 供应商开关,客户操作,因为是相对的,如果一个条件不能构成约束<br>
 	 * 1. 启用<br>
@@ -161,6 +171,14 @@ public class CustmerSimpleInfo {
 		this.custswitch = custswitch;
 	}
 
+	public Short getServicerswitch() {
+		return servicerswitch;
+	}
+
+	public void setServicerswitch(Short servicerswitch) {
+		this.servicerswitch = servicerswitch;
+	}
+
 	/**
 	 * 获取所有可以搜索的字段列名(索引的field名)
 	 * 
@@ -177,9 +195,9 @@ public class CustmerSimpleInfo {
 
 	@Override
 	public String toString() {
-		return "VendorSimpleInfo [id=" + id + ", status=" + status + ", myUser=" + myUser + ", vendUser=" + vendUser
-				+ ", enterprise=" + enterprise + ", vend=" + vend + ", vendswitch=" + vendswitch + ", custswitch="
-				+ custswitch + "]";
+		return "CustmerSimpleInfo [id=" + id + ", status=" + status + ", myUser=" + myUser + ", vendUser=" + vendUser
+				+ ", enterprise=" + enterprise + ", vend=" + vend + ", servicerswitch=" + servicerswitch
+				+ ", vendswitch=" + vendswitch + ", custswitch=" + custswitch + "]";
 	}
 
 

+ 20 - 2
search-console-b2b/src/main/java/com/uas/search/console/b2b/model/VendorSimpleInfo.java

@@ -43,6 +43,8 @@ public class VendorSimpleInfo {
 
 	public static final String CUSTSWITCH_FIELD = "ve_custswitch";
 
+	public static final String SERVICERSWITCH_FIELD = "ve_servicerswitch";
+
 	@Id
 	@Column(name = ID_FIELD)
 	private Long id;
@@ -89,6 +91,14 @@ public class VendorSimpleInfo {
 	@Column(name = VENDSWITCH_FIELD)
 	private Short vendswitch;
 
+	/**
+	 * 服务商开关,供应商操作,因为是相对的,如果一个条件不能构成约束<br>
+	 * 1. 启用<br>
+	 * 0. 禁用
+	 */
+	@Column(name = SERVICERSWITCH_FIELD)
+	private Short servicerswitch;
+
 	/**
 	 * 客户开关,供应商操作,因为是相对的,如果一个条件不能构成约束<br>
 	 * 1. 启用<br>
@@ -161,6 +171,14 @@ public class VendorSimpleInfo {
 		this.custswitch = custswitch;
 	}
 
+	public Short getServicerswitch() {
+		return servicerswitch;
+	}
+
+	public void setServicerswitch(Short servicerswitch) {
+		this.servicerswitch = servicerswitch;
+	}
+
 	/**
 	 * 获取所有可以搜索的字段列名(索引的field名)
 	 * 
@@ -178,8 +196,8 @@ public class VendorSimpleInfo {
 	@Override
 	public String toString() {
 		return "VendorSimpleInfo [id=" + id + ", status=" + status + ", myUser=" + myUser + ", vendUser=" + vendUser
-				+ ", enterprise=" + enterprise + ", vend=" + vend + ", vendswitch=" + vendswitch + ", custswitch="
-				+ custswitch + "]";
+				+ ", enterprise=" + enterprise + ", vend=" + vend + ", vendswitch=" + vendswitch + ", servicerswitch="
+				+ servicerswitch + ", custswitch=" + custswitch + "]";
 	}
 
 

+ 14 - 0
search-console-b2b/src/main/java/com/uas/search/console/b2b/util/DocumentToObjectUtils.java

@@ -2221,6 +2221,13 @@ public class DocumentToObjectUtils {
 		} else {
 			vendorSimpleInfo.setVendswitch((short) 1);
 		}
+		if (null != document
+				.get(ClassAndTableNameUtils.combineField(tableName, VendorSimpleInfo.SERVICERSWITCH_FIELD))) {
+			vendorSimpleInfo.setServicerswitch(Short.valueOf(document
+					.get(ClassAndTableNameUtils.combineField(tableName, VendorSimpleInfo.SERVICERSWITCH_FIELD))));
+		} else {
+			vendorSimpleInfo.setServicerswitch((short) 1);
+		}
 		return vendorSimpleInfo;
 	}
 
@@ -2274,6 +2281,13 @@ public class DocumentToObjectUtils {
 		} else {
 			custmerSimpleInfo.setVendswitch((short) 1);
 		}
+		if (null != document
+				.get(ClassAndTableNameUtils.combineField(tableName, CustmerSimpleInfo.SERVICERSWITCH_FIELD))) {
+			custmerSimpleInfo.setServicerswitch(Short.valueOf(document
+					.get(ClassAndTableNameUtils.combineField(tableName, CustmerSimpleInfo.SERVICERSWITCH_FIELD))));
+		} else {
+			custmerSimpleInfo.setServicerswitch((short) 1);
+		}
 		return custmerSimpleInfo;
 	}
 

+ 10 - 0
search-console-b2b/src/main/java/com/uas/search/console/b2b/util/ObjectToDocumentUtils.java

@@ -2353,6 +2353,11 @@ public class ObjectToDocumentUtils {
 					new StringField(ClassAndTableNameUtils.combineField(tableName, VendorSimpleInfo.VENDSWITCH_FIELD),
 							JSON.toJSONString(vendorSimpleInfo.getVendswitch()), Store.YES));
 		}
+		if (null != vendorSimpleInfo.getServicerswitch()) {
+			document.add(new StringField(
+					ClassAndTableNameUtils.combineField(tableName, VendorSimpleInfo.SERVICERSWITCH_FIELD),
+					JSON.toJSONString(vendorSimpleInfo.getServicerswitch()), Store.YES));
+		}
 
 		// 排序字段
 		document.add(new NumericDocValuesField(
@@ -2408,6 +2413,11 @@ public class ObjectToDocumentUtils {
 					new StringField(ClassAndTableNameUtils.combineField(tableName, CustmerSimpleInfo.VENDSWITCH_FIELD),
 							JSON.toJSONString(custmerSimpleInfo.getVendswitch()), Store.YES));
 		}
+		if (null != custmerSimpleInfo.getServicerswitch()) {
+			document.add(new StringField(
+					ClassAndTableNameUtils.combineField(tableName, CustmerSimpleInfo.SERVICERSWITCH_FIELD),
+					JSON.toJSONString(custmerSimpleInfo.getServicerswitch()), Store.YES));
+		}
 
 		// 排序字段
 		document.add(new NumericDocValuesField(