Browse Source

报价单信息实体增加拒绝理由字段。

dongbw 7 years ago
parent
commit
ff720493e7

+ 25 - 0
src/main/java/com/uas/ps/inquiry/model/PublicInquiryItemInfo.java

@@ -427,6 +427,12 @@ public class PublicInquiryItemInfo implements Serializable {
 	@Column(name = "id_cust_currency")
 	private String custCurrency;
 
+	/**
+	 * 拒绝采纳理由
+	 */
+	@Column(name = "id_refusereason")
+	private String refusereason;
+
 	public User getUser() {
 		return user;
 	}
@@ -923,6 +929,18 @@ public class PublicInquiryItemInfo implements Serializable {
 		this.custCurrency = custCurrency;
 	}
 
+	public void setRemainingTime(Long remainingTime) {
+		this.remainingTime = remainingTime;
+	}
+
+	public String getRefusereason() {
+		return refusereason;
+	}
+
+	public void setRefusereason(String refusereason) {
+		this.refusereason = refusereason;
+	}
+
 	@Override
 	public String toString() {
 		return "PublicInquiryItemInfo{" +
@@ -982,6 +1000,13 @@ public class PublicInquiryItemInfo implements Serializable {
 				", unit='" + unit + '\'' +
 				", cmpCode='" + cmpCode + '\'' +
 				", inbrand='" + inbrand + '\'' +
+				", remainingTime=" + remainingTime +
+				", checked=" + checked +
+				", attachUrl='" + attachUrl + '\'' +
+				", attachName='" + attachName + '\'' +
+				", user=" + user +
+				", custCurrency='" + custCurrency + '\'' +
+				", refusereason='" + refusereason + '\'' +
 				'}';
 	}
 }

+ 21 - 3
src/main/java/com/uas/ps/inquiry/service/impl/InquiryServiceImpl.java

@@ -496,7 +496,13 @@ public class InquiryServiceImpl implements InquiryService {
     public void decideQuote(Long id, Short status) {
         PublicInquiryItem item = itemDao.findOne(id);
         // 验证是否重复操作
-        validateInquiry(item);
+        if (null != item.getAgreed()) {
+            if (item.getAgreed().equals(Constant.YES)) {
+                throw new IllegalOperatorException("该报价已被采纳,请勿重复处理");
+            } else if (item.getAgreed().equals(Constant.NO)) {
+                throw new IllegalOperatorException("该报价已被拒绝,请勿重复处理");
+            }
+        }
         item.setAgreed(status);
         itemDao.save(item);
         // 更新询价推荐表相关信息
@@ -524,7 +530,13 @@ public class InquiryServiceImpl implements InquiryService {
     public void adpotQuote(Long id, Short status) {
         PublicInquiryItem item = itemDao.findOne(id);
         // 验证是否重复操作
-        validateInquiry(item);
+        if (null != item.getAgreed()) {
+            if (item.getAgreed().equals(Constant.YES)) {
+                throw new IllegalOperatorException("该报价已被采纳,请勿重复处理");
+            } else if (item.getAgreed().equals(Constant.NO)) {
+                throw new IllegalOperatorException("该报价已被拒绝,请勿重复处理");
+            }
+        }
         item.setAgreed(status);
         itemDao.save(item);
         // 更新询价推荐表相关信息
@@ -565,7 +577,13 @@ public class InquiryServiceImpl implements InquiryService {
     public void refuseQuote(Long id, Short status,String refusereason) {
         PublicInquiryItem item = itemDao.findOne(id);
         // 验证是否重复操作
-        validateInquiry(item);
+        if (null != item.getAgreed()) {
+            if (item.getAgreed().equals(Constant.YES)) {
+                throw new IllegalOperatorException("该报价已被采纳,请勿重复处理");
+            } else if (item.getAgreed().equals(Constant.NO)) {
+                throw new IllegalOperatorException("该报价已被拒绝,请勿重复处理");
+            }
+        }
         item.setAgreed(status);
         item.setRefusereason(refusereason);
         itemDao.save(item);