Browse Source

主动报价单和采购询价单建立索引已失效判断条件修改。

dongbw 8 years ago
parent
commit
9e9cbc4089

+ 6 - 2
search-console-b2b/src/main/java/com/uas/search/console/b2b/model/PurchaseInquiryItemSimpleInfo.java

@@ -98,7 +98,7 @@ public class PurchaseInquiryItemSimpleInfo {
 	private Short status;
 
 	/**
-	 * 是否过期(1过期,0未过期)
+	 * 是否过期(1过期,0未过期)--1为已失效,0为未失效
 	 * 
 	 * @return
 	 */
@@ -197,6 +197,10 @@ public class PurchaseInquiryItemSimpleInfo {
 
 	@SuppressWarnings("deprecation")
 	public Short getOverdue() {
+		if (this.status == 314 || this.getInvalid() == 1
+				|| (this.status == 200 && null != this.getInquiry().getCheck() && this.getInquiry().getCheck() == 1)) { // 已作废、过了报价有效期、未报价但是客户已提交的
+			return 1;
+		}
 		if (this.getInquiry().getEndDate() == null) {
 			return 0;
 		}
@@ -210,7 +214,7 @@ public class PurchaseInquiryItemSimpleInfo {
 		end.set(Calendar.YEAR, this.getInquiry().getEndDate().getYear());
 		end.set(Calendar.MONTH, this.getInquiry().getEndDate().getMonth());
 		end.set(Calendar.DAY_OF_MONTH, this.getInquiry().getEndDate().getDate());
-		if (now.compareTo(end) > 0) {
+		if (now.compareTo(end) > 0 && this.status == 200) { // 过了截止时间未报价
 			return 1;
 		} else {
 			return 0;

+ 15 - 1
search-console-b2b/src/main/java/com/uas/search/console/b2b/model/PurchaseInquirySimpleInfo.java

@@ -59,6 +59,12 @@ public class PurchaseInquirySimpleInfo {
 	@Column(name = "in_enddate")
 	private Date endDate;
 
+	/**
+	 * 客户已提交
+	 */
+	@Column(name = "in_checked")
+	private Short check;
+
 	public Long getId() {
 		return id;
 	}
@@ -107,10 +113,18 @@ public class PurchaseInquirySimpleInfo {
 		this.endDate = endDate;
 	}
 
+	public Short getCheck() {
+		return check;
+	}
+
+	public void setCheck(Short check) {
+		this.check = check;
+	}
+
 	@Override
 	public String toString() {
 		return "PurchaseInquirySimpleInfo [id=" + id + ", date=" + date + ", vend=" + vend + ", code=" + code
-				+ ", overdue=" + overdue + ", endDate=" + endDate + "]";
+				+ ", overdue=" + overdue + ", endDate=" + endDate + ", check=" + check + "]";
 	}
 
 }

+ 5 - 2
search-console-b2b/src/main/java/com/uas/search/console/b2b/model/SaleQuotationSimpleInfo.java

@@ -65,7 +65,7 @@ public class SaleQuotationSimpleInfo {
 	private String code;
 
 	/**
-	 * 处理状态(101已提交、100未提交)
+	 * 处理状态(101已提交、100未提交、314已作废
 	 */
 	@Column(name = STATUS_FIELD)
 	private Short status;
@@ -104,7 +104,7 @@ public class SaleQuotationSimpleInfo {
 	private Set<SaleQuotationItemSimpleInfo> saleQuotationItems;
 
 	/**
-	 * 是否过期(过了截止日期为1,没过为0)
+	 * 是否过期(过了截止日期为1,没过为0)-- 作为是否失效的判断条件。
 	 */
 	private Short qu_overdue;
 
@@ -174,6 +174,9 @@ public class SaleQuotationSimpleInfo {
 
 	@SuppressWarnings("deprecation")
 	public Short getOverdue() {
+		if (status == 314) { // 已作废的算作已失效。
+			return 1;
+		}
 		if (endDate == null) {
 			return 0;
 		}