|
|
@@ -41,8 +41,12 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
|
|
|
public static final String STATUS_FIELD = "id_status";
|
|
|
|
|
|
+ public static final String VENDTODATE_FIELD = "id_vendtodate";
|
|
|
+
|
|
|
public static final String OVERDUE_FIELD = "id_overdue";
|
|
|
|
|
|
+ public static final String INVALID_FIELD = "id_invalid";
|
|
|
+
|
|
|
public static final String SOURCEAPP_FIELD = "id_sourceapp";
|
|
|
|
|
|
public static final String AGREED_FIELD = "id_agreed";
|
|
|
@@ -72,6 +76,12 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
@Column(name = SENDSTATUS_FIELD)
|
|
|
private Short sendStatus;
|
|
|
|
|
|
+ /**
|
|
|
+ * 报价有效期截止
|
|
|
+ */
|
|
|
+ @Column(name = VENDTODATE_FIELD)
|
|
|
+ private Date vendToDate;
|
|
|
+
|
|
|
/**
|
|
|
* 询价单
|
|
|
*/
|
|
|
@@ -88,12 +98,19 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
private Short status;
|
|
|
|
|
|
/**
|
|
|
- * 是否过期
|
|
|
+ * 是否过期(1过期,0未过期)
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
private Short id_overdue;
|
|
|
|
|
|
+ /**
|
|
|
+ * 报价是否过期 (1为报价失效,0为为未效)
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Short id_invalid;
|
|
|
+
|
|
|
/**
|
|
|
* 应用来源
|
|
|
*/
|
|
|
@@ -170,6 +187,14 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
this.agreed = agreed;
|
|
|
}
|
|
|
|
|
|
+ public Date getVendToDate() {
|
|
|
+ return vendToDate;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setVendToDate(Date vendToDate) {
|
|
|
+ this.vendToDate = vendToDate;
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressWarnings("deprecation")
|
|
|
public Short getOverdue() {
|
|
|
if (this.getInquiry().getEndDate() == null) {
|
|
|
@@ -196,6 +221,32 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
this.id_overdue = overdue;
|
|
|
}
|
|
|
|
|
|
+ @SuppressWarnings("deprecation")
|
|
|
+ public Short getInvalid() {
|
|
|
+ if (this.vendToDate == null) {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ Date before = new Date();
|
|
|
+ Date date = new Date(before.getTime() - 24 * 60 * 60 * 1000);
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.YEAR, date.getYear());
|
|
|
+ now.set(Calendar.MONTH, date.getMonth());
|
|
|
+ now.set(Calendar.DAY_OF_MONTH, date.getDate());
|
|
|
+ Calendar end = Calendar.getInstance();
|
|
|
+ end.set(Calendar.YEAR, this.vendToDate.getYear());
|
|
|
+ end.set(Calendar.MONTH, this.vendToDate.getMonth());
|
|
|
+ end.set(Calendar.DAY_OF_MONTH, this.vendToDate.getDate());
|
|
|
+ if (now.compareTo(end) > 0) {
|
|
|
+ return 1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setInvalid(Short invalid) {
|
|
|
+ this.id_invalid = invalid;
|
|
|
+ }
|
|
|
+
|
|
|
public static List<String> getKeywordFields() {
|
|
|
List<String> fields = new ArrayList<>();
|
|
|
fields.add(PRODUCT_FIELD);
|
|
|
@@ -209,8 +260,9 @@ public class PurchaseInquiryItemSimpleInfo {
|
|
|
@Override
|
|
|
public String toString() {
|
|
|
return "PurchaseInquiryItemSimpleInfo [id=" + id + ", enterprise=" + enterprise + ", product=" + product
|
|
|
- + ", sendStatus=" + sendStatus + ", inquiry=" + inquiry + ", status=" + status + ", id_overdue="
|
|
|
- + id_overdue + ", sourceapp=" + sourceapp + "]";
|
|
|
+ + ", sendStatus=" + sendStatus + ", vendToDate=" + vendToDate + ", inquiry=" + inquiry + ", status="
|
|
|
+ + status + ", id_overdue=" + id_overdue + ", id_invalid=" + id_invalid + ", sourceapp=" + sourceapp
|
|
|
+ + ", agreed=" + agreed + "]";
|
|
|
}
|
|
|
|
|
|
|