Browse Source

fix:商机增加已报价、未报价过滤查询

dongbw 7 years ago
parent
commit
5b7c3a3096

+ 26 - 12
src/main/java/com/uas/ps/inquiry/page/SearchFilter.java

@@ -84,6 +84,11 @@ public class SearchFilter {
 	 */
 	private Integer valid;
 
+	/**
+	 * 是否已报价 1为是,0为否
+	 */
+	private Integer quoted;
+
 	public Integer getEnableOffer() {
 		return enableOffer;
 	}
@@ -174,6 +179,22 @@ public class SearchFilter {
 		this.distribute = distribute;
 	}
 
+	public Short getIsLogin() {
+		return isLogin;
+	}
+
+	public void setIsLogin(Short isLogin) {
+		this.isLogin = isLogin;
+	}
+
+	public Integer getValid() {
+		return valid;
+	}
+
+	public void setValid(Integer valid) {
+		this.valid = valid;
+	}
+
 	@Override
 	public String toString() {
 		return "SearchFilter{" +
@@ -192,22 +213,15 @@ public class SearchFilter {
 				", isAll=" + isAll +
 				", enableOffer=" + enableOffer +
 				", valid=" + valid +
+				", quoted=" + quoted +
 				'}';
 	}
 
-	public Short getIsLogin() {
-		return isLogin;
+	public Integer getQuoted() {
+		return quoted;
 	}
 
-	public void setIsLogin(Short isLogin) {
-		this.isLogin = isLogin;
-	}
-
-	public Integer getValid() {
-		return valid;
-	}
-
-	public void setValid(Integer valid) {
-		this.valid = valid;
+	public void setQuoted(Integer quoted) {
+		this.quoted = quoted;
 	}
 }

+ 17 - 0
src/main/java/com/uas/ps/inquiry/service/impl/InquiryForSaleServiceImpl.java

@@ -576,6 +576,14 @@ public class InquiryForSaleServiceImpl implements InquiryForSaleService {
             if (filter.getEnableOffer() != null && filter.getEnableOffer() == 1) {
                 pageInfo.expression(PredicateUtils.gt("endDate", new Date(), false));
             }
+            // 过滤是否已报价
+            if (filter.getQuoted() != null) {
+                if (filter.getQuoted() == 1) {
+                    pageInfo.expression(PredicateUtils.isNotNull("newId"));
+                } else if (filter.getQuoted() == 0) {
+                    pageInfo.expression(PredicateUtils.isNull("newId"));
+                }
+            }
         }
         Page reminds = remindDao.findAll(new Specification<InquiryRemind>() {
             @Override
@@ -661,6 +669,14 @@ public class InquiryForSaleServiceImpl implements InquiryForSaleService {
             if (filter.getEnableOffer() != null && filter.getEnableOffer() == 1) {
                 pageInfo.expression(PredicateUtils.gt("endDate", new Date(), false));
             }
+            // 过滤是否已报价
+            if (filter.getQuoted() != null) {
+                if (filter.getQuoted() == 1) {
+                    pageInfo.expression(PredicateUtils.isNotNull("newId"));
+                } else if (filter.getQuoted() == 0) {
+                    pageInfo.expression(PredicateUtils.isNull("newId"));
+                }
+            }
         }
         Page reminds = inquiryEnRemindDao.findAll(new Specification<InquiryEnRemind>() {
             @Override
@@ -741,6 +757,7 @@ public class InquiryForSaleServiceImpl implements InquiryForSaleService {
         if (validatePublicItem(publicInquiryItem, result)) {
             return result;
         }
+        // 可能由于直接使用询价明细实体转换报价,而未清除id,所以这里参数中的id可能是询价明细id
         Long itemId = null != publicInquiryItem.getId() ? publicInquiryItem.getId() : publicInquiryItem.getSourceId();
         if (null == itemId) {
             result.put("message", "未传入有效的询价明细id");