Forráskód Böngészése

增加询价详情页面

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8111 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 éve
szülő
commit
e56b349ee4

+ 3 - 2
src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java

@@ -20,6 +20,7 @@ import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurcInquiryService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
+import com.uas.platform.b2b.temporary.model.InquiryDetailInfo;
 import com.uas.platform.b2b.temporary.model.PurcInquiryInfo;
 import com.uas.platform.b2b.temporary.model.VendorAndContact;
 import com.uas.platform.core.logging.BufferedLoggerManager;
@@ -300,8 +301,8 @@ public class PurcInquiryController {
 	 * @return
 	 */
 	@RequestMapping(value = "/detail/{id}", method = RequestMethod.GET)
-	private PurcInquiry getDetail(@PathVariable Long id) {
-		return null;
+	private InquiryDetailInfo getDetail(@PathVariable Long id) {
+		return purcInquiryService.getInquiryDetail(id);
 	}
 
 	/**

+ 13 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryInfoDao.java

@@ -0,0 +1,13 @@
+package com.uas.platform.b2b.dao;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import com.uas.platform.b2b.model.PurchaseInquiryInfo;
+
+@Repository
+public interface PurchaseInquiryInfoDao
+		extends JpaRepository<PurchaseInquiryInfo, Long>, JpaSpecificationExecutor<PurchaseInquiryInfo> {
+
+}

+ 314 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseInquiryInfo.java

@@ -0,0 +1,314 @@
+package com.uas.platform.b2b.model;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+/**
+ * 平台里面,以供应商的角度来查看采购询价单
+ * 
+ * <pre>
+ * 数据库虚拟列里面用到的函数,是不允许操作动态数据的;原over_sysdate函数用法存在问题;
+ * 改用视图{@code v$purc$inquiry}处理
+ * </pre>
+ * 
+ * @author yingp
+ * 
+ */
+@Table(name = "purc$inquiry")
+@Entity
+public class PurchaseInquiryInfo implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$inquiry_gen")
+	@SequenceGenerator(name = "purc$inquiry_gen", sequenceName = "purc$inquiry_seq", allocationSize = 1)
+	@Column(name = "in_id")
+	private Long id;
+
+	/**
+	 * 询价单所属企业UU
+	 */
+	@Column(name = "in_enuu")
+	private Long enUU;
+
+	/**
+	 * 询价单所属用户UU
+	 */
+	@Column(name = "in_recorderuu")
+	private Long recorderUU;
+
+	/**
+	 * 询价企业
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "in_enuu", insertable = false, updatable = false)
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 流水号
+	 */
+	@Column(name = "in_code")
+	private String code;
+
+	/**
+	 * 单据归属日期
+	 */
+	@Column(name = "in_date")
+	private Date date;
+
+	/**
+	 * 录入人
+	 */
+	@Column(name = "in_recorder")
+	private String recorder;
+
+	/**
+	 * 审核人
+	 */
+	@Column(name = "in_auditor")
+	private String auditor;
+
+	/**
+	 * 报价截止日期
+	 */
+	@Column(name = "in_enddate")
+	private Date endDate;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "in_remark")
+	private String remark;
+
+	/**
+	 * 环保要求
+	 */
+	@Column(name = "in_environment")
+	private String environment;
+
+	/**
+	 * 价格类型
+	 */
+	@Column(name = "in_pricetype")
+	private String priceType;
+
+	/**
+	 * 询价明细
+	 */
+	@OneToMany(mappedBy = "inquiry", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
+			CascadeType.MERGE }, fetch = FetchType.EAGER)
+	@OrderBy("number")
+	private Set<PurchaseInquiryItemInfo> inquiryItems;
+
+	/**
+	 * 来源系统单据ID
+	 */
+	@Column(name = "in_sourceid")
+	private Long sourceId;
+
+	/**
+	 * 附件
+	 */
+	@OneToMany(fetch = FetchType.EAGER, cascade = {CascadeType.ALL})
+	@JoinTable(name = "purc$inquiryattach", joinColumns = @JoinColumn(name = "in_id", referencedColumnName = "in_id"), inverseJoinColumns = @JoinColumn(name="at_id", referencedColumnName = "at_id"))
+	private Set<Attach> attachs;
+
+	/**
+	 * 客户已提交
+	 */
+	@Column(name = "in_checked")
+	private Short check;
+
+	/**
+	 * 是否过期
+	 */
+	@Column(name = "in_overdue", insertable = false, updatable = false)
+	private Short overdue;
+
+	/**
+	 * 是否公开<br>
+	 * 1、 公共<br>
+	 * 0、 不用开
+	 */
+	@Column(name = "in_isopen")
+	private Short isOpen;
+
+	/**
+	 * 应用来源,主要是为了平台公共询价做处理
+	 */
+	@Column(name = "in_sourceapp")
+	private String sourceApp;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public String getPriceType() {
+		return priceType;
+	}
+
+	public void setPriceType(String priceType) {
+		this.priceType = priceType;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+	public String getRecorder() {
+		return recorder;
+	}
+
+	public void setRecorder(String recorder) {
+		this.recorder = recorder;
+	}
+
+	public String getAuditor() {
+		return auditor;
+	}
+
+	public void setAuditor(String auditor) {
+		this.auditor = auditor;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getEnUU() {
+		return enUU;
+	}
+
+	public void setEnUU(Long enUU) {
+		this.enUU = enUU;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public Long getRecorderUU() {
+		return recorderUU;
+	}
+
+	public void setRecorderUU(Long recorderUU) {
+		this.recorderUU = recorderUU;
+	}
+
+	public Long getSourceId() {
+		return sourceId;
+	}
+
+	public void setSourceId(Long sourceId) {
+		this.sourceId = sourceId;
+	}
+
+	public Set<PurchaseInquiryItemInfo> getInquiryItems() {
+		return inquiryItems;
+	}
+
+	public void setInquiryItems(Set<PurchaseInquiryItemInfo> inquiryItems) {
+		this.inquiryItems = inquiryItems;
+	}
+
+	public Set<Attach> getAttachs() {
+		return attachs;
+	}
+
+	public void setAttachs(Set<Attach> attachs) {
+		this.attachs = attachs;
+	}
+
+	public String getEnvironment() {
+		return environment;
+	}
+
+	public void setEnvironment(String environment) {
+		this.environment = environment;
+	}
+
+	public Short getCheck() {
+		return check;
+	}
+
+	public void setCheck(Short check) {
+		this.check = check;
+	}
+
+	public Short getOverdue() {
+		return overdue;
+	}
+
+	public void setOverdue(Short overdue) {
+		this.overdue = overdue;
+	}
+
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
+	public String getSourceApp() {
+		return sourceApp;
+	}
+
+	public void setSourceApp(String sourceApp) {
+		this.sourceApp = sourceApp;
+	}
+
+}

+ 557 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseInquiryItemInfo.java

@@ -0,0 +1,557 @@
+package com.uas.platform.b2b.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.SequenceGenerator;
+import javax.persistence.Table;
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.springframework.util.CollectionUtils;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.uas.platform.b2b.core.util.DateUtils;
+import com.uas.platform.core.model.Constant;
+import com.uas.platform.core.model.Status;
+
+/**
+ * 平台里面,以供应商的角度来查看采购询价单明细
+ * 
+ * @author yingp
+ *
+ */
+@Table(name = "purc$inquiryitems")
+@Entity
+public class PurchaseInquiryItemInfo {
+
+	@Id
+	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$inquiryitems_gen")
+	@SequenceGenerator(name = "purc$inquiryitems_gen", sequenceName = "purc$inquiryitems_seq", allocationSize = 1)
+	@Column(name = "id_id")
+	private Long id;
+
+	/**
+	 * 来源(买家ERP采购询价明细)的ID
+	 */
+	@Column(name = "id_sourceid", updatable = false)
+	private Long sourceId;
+
+	/**
+	 * 序号
+	 */
+	@Column(name = "id_number")
+	private Short number;
+
+	/**
+	 * 询价单
+	 */
+	@ManyToOne(cascade = CascadeType.ALL, optional = true)
+	@JoinColumn(name = "id_inid", nullable = false)
+	private PurchaseInquiryInfo inquiry;
+
+	/**
+	 * 买家采购员UU
+	 */
+	@Column(name = "id_useruu")
+	private Long userUU;
+
+	/**
+	 * 产品
+	 */
+	@OneToOne(cascade = { CascadeType.REFRESH })
+	@JoinColumn(name = "id_prid", insertable = false, updatable = false)
+	private Product product;
+
+	@Column(name = "id_prid")
+	private Long productId;
+
+	/**
+	 * 币种
+	 */
+	@Column(name = "id_currency")
+	private String currency;
+
+	/**
+	 * 税率
+	 */
+	@Column(name = "id_taxrate")
+	private Float taxrate;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "id_remark")
+	private String remark;
+
+	/**
+	 * 供应商UU
+	 */
+	@Column(name = "id_venduu")
+	private Long vendUU;
+
+	/**
+	 * 被询价企业
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "id_venduu", insertable = false, updatable = false)
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 供应商联系人UU
+	 */
+	@Column(name = "id_venduseruu")
+	private Long vendUserUU;
+
+	/**
+	 * (买家预先提供的)有效期始
+	 */
+	@Column(name = "id_fromdate")
+	private Date fromDate;
+
+	/**
+	 * (买家预先提供的)有效期止
+	 */
+	@Column(name = "id_todate")
+	private Date toDate;
+
+	/**
+	 * (卖家报的)有效期始
+	 */
+	@Column(name = "id_vendfromdate")
+	private Date vendFromDate;
+
+	/**
+	 * (卖家报的)有效期止
+	 */
+	@Column(name = "id_vendtodate")
+	private Date vendToDate;
+
+	/**
+	 * (卖家报的)最小订购量
+	 */
+	@Column(name = "id_minorderqty")
+	private Double minOrderQty;
+
+	/**
+	 * (卖家报的)最小包装量
+	 */
+	@Column(name = "id_minpackqty")
+	private Double minPackQty;
+
+	/**
+	 * (卖家报的)物料品牌
+	 */
+	@Column(name = "id_brand")
+	private String brand;
+
+	/**
+	 * (卖家报的)供应商物料编号
+	 */
+	@Column(name = "id_vendorprodcode")
+	private String vendorprodcode;
+
+	/**
+	 * (卖家报的)交货周期(天数)
+	 */
+	@Column(name = "id_leadtime")
+	private Long leadtime;
+
+	/**
+	 * 分段报价明细
+	 */
+	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+	@JoinColumn(name = "ir_idid")
+	@OrderBy("lapQty")
+	private Set<PurchaseInquiryReply> replies;
+
+	/**
+	 * {未回复、已回复}
+	 */
+	@Column(name = "id_status")
+	private Short status;
+
+	/**
+	 * (针对卖家的)询价传输状态{待上传、已下载}
+	 */
+	@Column(name = "id_sendstatus")
+	private Short sendStatus;
+
+	/**
+	 * (针对买家的)报价信息传输状态{待上传、已下载}
+	 */
+	@Column(name = "id_backstatus")
+	private Short backStatus;
+
+	/**
+	 * (针对卖家的)报价信息传输状态{待上传、已下载}
+	 */
+	@Column(name = "id_replysendstatus")
+	private Short replySendStatus;
+
+	/**
+	 * 是否采纳
+	 */
+	@Column(name = "id_agreed")
+	private Short agreed;
+
+	/**
+	 * (针对卖家的)是否采纳信息传输状态{待上传、已下载}
+	 */
+	@Column(name = "id_decidestatus")
+	private Short decideStatus;
+
+	/**
+	 * 是否买家已设置分段数
+	 */
+	@Column(name = "id_custlap")
+	private Short custLap;
+
+	/**
+	 * 保存erp传入数据的时间
+	 * 
+	 * @return
+	 */
+	@Column(name = "id_erpdate")
+	private Date erpDate;
+
+	/**
+	 * search项目进行是否已过期时实际根据主表中enddate与当前时间的比较获取,但是数据库无字段会报“标识符无效”的错误
+	 * 所以建立此字段,但是此字段不会赋值。
+	 * 
+	 * @return
+	 */
+	@Column(name = "id_overdue")
+	private Short overdue;
+
+	/**
+	 * 应用来源ERP、B2B
+	 */
+	@Column(name = "id_sourceapp")
+	private String sourceApp;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	@JsonIgnore
+	@JSONField(serialize = false)
+	public Long getSourceId() {
+		return sourceId;
+	}
+
+	public void setSourceId(Long sourceId) {
+		this.sourceId = sourceId;
+	}
+
+	public Short getNumber() {
+		return number;
+	}
+
+	public void setNumber(Short number) {
+		this.number = number;
+	}
+
+	@JsonIgnore
+	@JSONField(serialize = false)
+	public PurchaseInquiryInfo getInquiry() {
+		return inquiry;
+	}
+
+	public void setInquiry(PurchaseInquiryInfo inquiry) {
+		this.inquiry = inquiry;
+	}
+
+	public Product getProduct() {
+		return product;
+	}
+
+	public void setProduct(Product product) {
+		this.product = product;
+	}
+
+	public Long getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Long productId) {
+		this.productId = productId;
+	}
+
+	public String getCurrency() {
+		return currency;
+	}
+
+	public void setCurrency(String currency) {
+		this.currency = currency;
+	}
+
+	public Float getTaxrate() {
+		return taxrate;
+	}
+
+	public void setTaxrate(Float taxrate) {
+		this.taxrate = taxrate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Date getFromDate() {
+		return fromDate;
+	}
+
+	public void setFromDate(Date fromDate) {
+		this.fromDate = fromDate;
+	}
+
+	public Date getToDate() {
+		return toDate;
+	}
+
+	public void setToDate(Date toDate) {
+		this.toDate = toDate;
+	}
+
+	public Date getVendFromDate() {
+		return vendFromDate;
+	}
+
+	public void setVendFromDate(Date vendFromDate) {
+		this.vendFromDate = vendFromDate;
+	}
+
+	public Date getVendToDate() {
+		return vendToDate;
+	}
+
+	public void setVendToDate(Date vendToDate) {
+		this.vendToDate = vendToDate;
+	}
+
+	public Long getVendUU() {
+		return vendUU;
+	}
+
+	public void setVendUU(Long vendUU) {
+		this.vendUU = vendUU;
+	}
+
+	public Set<PurchaseInquiryReply> getReplies() {
+		return replies;
+	}
+
+	public void setReplies(Set<PurchaseInquiryReply> replies) {
+		this.replies = replies;
+	}
+
+	public Long getVendUserUU() {
+		return vendUserUU;
+	}
+
+	public void setVendUserUU(Long vendUserUU) {
+		this.vendUserUU = vendUserUU;
+	}
+
+	public Short getAgreed() {
+		return agreed;
+	}
+
+	public void setAgreed(Short agreed) {
+		this.agreed = agreed;
+	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
+
+	public Short getSendStatus() {
+		return sendStatus;
+	}
+
+	public void setSendStatus(Short sendStatus) {
+		this.sendStatus = sendStatus;
+	}
+
+	public Double getMinOrderQty() {
+		return minOrderQty;
+	}
+
+	public void setMinOrderQty(Double minOrderQty) {
+		this.minOrderQty = minOrderQty;
+	}
+
+	public Double getMinPackQty() {
+		return minPackQty;
+	}
+
+	public void setMinPackQty(Double minPackQty) {
+		this.minPackQty = minPackQty;
+	}
+
+	public Short getBackStatus() {
+		return backStatus;
+	}
+
+	public void setBackStatus(Short backStatus) {
+		this.backStatus = backStatus;
+	}
+
+	public Short getReplySendStatus() {
+		return replySendStatus;
+	}
+
+	public void setReplySendStatus(Short replySendStatus) {
+		this.replySendStatus = replySendStatus;
+	}
+
+	public Short getDecideStatus() {
+		return decideStatus;
+	}
+
+	public void setDecideStatus(Short decideStatus) {
+		this.decideStatus = decideStatus;
+	}
+
+	public Short getCustLap() {
+		return custLap;
+	}
+
+	public void setCustLap(Short custLap) {
+		this.custLap = custLap;
+	}
+
+	public Long getUserUU() {
+		return userUU;
+	}
+
+	public void setUserUU(Long userUU) {
+		this.userUU = userUU;
+	}
+
+	public String getBrand() {
+		return brand;
+	}
+
+	public void setBrand(String brand) {
+		this.brand = brand;
+	}
+
+	public String getVendorprodcode() {
+		return vendorprodcode;
+	}
+
+	public void setVendorprodcode(String vendorprodcode) {
+		this.vendorprodcode = vendorprodcode;
+	}
+
+	public Long getLeadtime() {
+		return leadtime;
+	}
+
+	public void setLeadtime(Long leadtime) {
+		this.leadtime = leadtime;
+	}
+
+	public Date getErpDate() {
+		return erpDate;
+	}
+
+	public void setErpDate(Date erpDate) {
+		this.erpDate = erpDate;
+	}
+
+	public String getSourceApp() {
+		return sourceApp;
+	}
+
+	public void setSourceApp(String sourceApp) {
+		this.sourceApp = sourceApp;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	/**
+	 * 回复记录的描述
+	 * 
+	 * @return
+	 */
+	public String replyDescription() {
+		if (!CollectionUtils.isEmpty(this.replies)) {
+			StringBuffer sb = new StringBuffer();
+			for (PurchaseInquiryReply reply : this.replies)
+				sb.append("分段数:").append(reply.getLapQty()).append(",").append("价格:").append(reply.getPrice())
+						.append(";");
+			return sb.toString();
+		}
+		return null;
+	}
+
+	/**
+	 * 是否可报价
+	 * <p>
+	 * 1.未报价,未截止报价
+	 * </p>
+	 * <p>
+	 * 2.已报价,未截止报价,客户未提交
+	 * </p>
+	 * 
+	 * @return
+	 */
+	public boolean isReplyable() {
+		if (this.inquiry.getEndDate() != null) {
+			return DateUtils
+					.compare(this.inquiry.getEndDate(), new Date(),
+							DateUtils.COMPARE_DAY) >= 0
+					&& (this.status == Status.NOT_REPLY.value() || (this.status == Status.REPLIED.value()
+							&& (this.inquiry.getCheck() == null || this.inquiry.getCheck() != Constant.YES)
+							&& this.agreed == null));
+		}
+		return this.status == Status.NOT_REPLY.value();
+	}
+
+    public static List<PurchaseInquiryItemInfo> distinct(List<PurchaseInquiryItemInfo> purcitems) {
+		List<PurchaseInquiryItemInfo> inquiryItems = new ArrayList<>();
+		Set<Long> keys = new HashSet<>();
+		for (PurchaseInquiryItemInfo item : purcitems) {
+			if (!keys.contains(item.getInquiry().getId())) {
+				inquiryItems.add(item);
+				keys.add(item.getInquiry().getId());
+			}
+		}
+		return inquiryItems;
+    }
+}

+ 65 - 0
src/main/java/com/uas/platform/b2b/service/impl/PurcInquiryServiceImpl.java

@@ -25,6 +25,7 @@ import com.uas.platform.b2b.dao.PurcInquiryDao;
 import com.uas.platform.b2b.dao.PurcInquiryItemDao;
 import com.uas.platform.b2b.dao.PurcInquiryItemInfoDao;
 import com.uas.platform.b2b.dao.PurchaseInquiryDao;
+import com.uas.platform.b2b.dao.PurchaseInquiryInfoDao;
 import com.uas.platform.b2b.dao.PurchaseInquiryItemDao;
 import com.uas.platform.b2b.event.PurchaseInquiryItemDecideReleaseEvent;
 import com.uas.platform.b2b.event.PurchaseInquiryItemSaveReleaseEvent;
@@ -34,10 +35,14 @@ import com.uas.platform.b2b.model.PurcInquiry;
 import com.uas.platform.b2b.model.PurcInquiryItem;
 import com.uas.platform.b2b.model.PurcInquiryItemInfo;
 import com.uas.platform.b2b.model.PurchaseInquiry;
+import com.uas.platform.b2b.model.PurchaseInquiryInfo;
 import com.uas.platform.b2b.model.PurchaseInquiryItem;
+import com.uas.platform.b2b.model.PurchaseInquiryItemInfo;
 import com.uas.platform.b2b.service.PurcInquiryService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.b2b.support.UsageBufferedLogger;
+import com.uas.platform.b2b.temporary.model.InquiryDetailInfo;
+import com.uas.platform.b2b.temporary.model.InquiryProductInfo;
 import com.uas.platform.b2b.temporary.model.PurcInquiryInfo;
 import com.uas.platform.b2b.temporary.model.VendorAndContact;
 import com.uas.platform.core.logging.BufferedLoggerManager;
@@ -74,6 +79,9 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 	@Autowired
 	private PurcInquiryItemInfoDao purcInquiryItemInfoDao;
 
+	@Autowired
+	private PurchaseInquiryInfoDao purchaseInquiryInfoDao;
+
 	@Override
 	public ModelMap save(PurcInquiryInfo inquiryInfo, List<VendorAndContact> contacts) {
 		ModelMap map = new ModelMap();
@@ -554,4 +562,61 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
 		return purcInquiryItemInfoDao.findOne(id);
 	}
 
+	@Override
+	public InquiryDetailInfo getInquiryDetail(Long id) {
+		PurchaseInquiryInfo inquiry = purchaseInquiryInfoDao.findOne(id);
+		InquiryDetailInfo inquiryInfo = new InquiryDetailInfo();
+		if (inquiry != null) {
+			inquiryInfo.setAttachs(inquiry.getAttachs());
+			inquiryInfo.setAuditor(inquiry.getAuditor());
+			inquiryInfo.setCheck(inquiry.getCheck());
+			inquiryInfo.setCode(inquiry.getCode());
+			inquiryInfo.setDate(inquiry.getDate());
+			inquiryInfo.setEndDate(inquiry.getEndDate());
+			inquiryInfo.setEnterprise(inquiry.getEnterprise());
+			inquiryInfo.setEnUU(inquiry.getEnUU());
+			inquiryInfo.setEnvironment(inquiry.getEnvironment());
+			inquiryInfo.setId(inquiry.getId());
+			inquiryInfo.setIsOpen(inquiry.getIsOpen());
+			inquiryInfo.setOverdue(inquiry.getOverdue());
+			inquiryInfo.setPriceType(inquiry.getPriceType());
+			inquiryInfo.setRecorder(inquiry.getRecorder());
+			inquiryInfo.setRecorderUU(inquiry.getRecorderUU());
+			inquiryInfo.setRemark(inquiry.getRemark());
+			inquiryInfo.setSourceApp(inquiry.getSourceApp());
+			inquiryInfo.setSourceId(inquiry.getSourceId());
+			Set<InquiryProductInfo> products = new HashSet<InquiryProductInfo>();
+			Set<Long> ids = new HashSet<Long>();
+			List<Long> idStrings = new ArrayList<>();
+			Set<PurchaseInquiryItemInfo> items = new HashSet<PurchaseInquiryItemInfo>();
+			if (!CollectionUtils.isEmpty(inquiry.getInquiryItems())) {
+				InquiryProductInfo productInfo = new InquiryProductInfo();
+				for (PurchaseInquiryItemInfo item : inquiry.getInquiryItems()) {
+					idStrings.add(item.getProductId());
+					ids.addAll(idStrings);
+				}
+				for (Long idInfo : ids) {
+					Product product = productDao.findOne(idInfo);
+					productInfo.setBrand(product.getBrand());
+					productInfo.setId(product.getId());
+					productInfo.setSpec(product.getSpec());
+					productInfo.setCode(product.getCode());
+					productInfo.setTitle(product.getTitle());
+					products.add(productInfo);
+				}
+				for (InquiryProductInfo prodInfo : products) {
+					for (PurchaseInquiryItemInfo item : inquiry.getInquiryItems()) {
+						if (item.getProductId().equals(prodInfo.getId())) {
+							items.add(item);
+						}
+					}
+				}
+				productInfo.setInquiryItems(items);
+				products.add(productInfo);
+			}
+			inquiryInfo.setProducts(products);
+		}
+		return inquiryInfo;
+	}
+
 }

+ 265 - 0
src/main/java/com/uas/platform/b2b/temporary/model/InquiryDetailInfo.java

@@ -0,0 +1,265 @@
+package com.uas.platform.b2b.temporary.model;
+
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+import com.uas.platform.b2b.model.Attach;
+import com.uas.platform.b2b.model.EnterpriseInfo;
+
+public class InquiryDetailInfo {
+
+	@Id
+	private Long id;
+
+	/**
+	 * 询价单所属企业UU
+	 */
+	private Long enUU;
+
+	/**
+	 * 询价单所属用户UU
+	 */
+	private Long recorderUU;
+
+	/**
+	 * 询价企业
+	 */
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 流水号
+	 */
+	private String code;
+
+	/**
+	 * 单据归属日期
+	 */
+	private Date date;
+
+	/**
+	 * 录入人
+	 */
+	@Column(name = "in_recorder")
+	private String recorder;
+
+	/**
+	 * 审核人
+	 */
+	@Column(name = "in_auditor")
+	private String auditor;
+
+	/**
+	 * 报价截止日期
+	 */
+	@Column(name = "in_enddate")
+	private Date endDate;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "in_remark")
+	private String remark;
+
+	/**
+	 * 环保要求
+	 */
+	private String environment;
+
+	/**
+	 * 价格类型
+	 */
+	private String priceType;
+
+	/**
+	 * 来源系统单据ID
+	 */
+	private Long sourceId;
+
+	/**
+	 * 附件
+	 */
+	private Set<Attach> attachs;
+
+	/**
+	 * 客户已提交
+	 */
+	private Short check;
+
+	/**
+	 * 是否过期
+	 */
+	private Short overdue;
+
+	/**
+	 * 是否公开<br>
+	 * 1、 公共<br>
+	 * 0、 不用开
+	 */
+	private Short isOpen;
+
+	/**
+	 * 应用来源,主要是为了平台公共询价做处理
+	 */
+	private String sourceApp;
+
+	/**
+	 * 物料,便于管理区分
+	 */
+	private Set<InquiryProductInfo> products;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnUU() {
+		return enUU;
+	}
+
+	public void setEnUU(Long enUU) {
+		this.enUU = enUU;
+	}
+
+	public Long getRecorderUU() {
+		return recorderUU;
+	}
+
+	public void setRecorderUU(Long recorderUU) {
+		this.recorderUU = recorderUU;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+	public String getRecorder() {
+		return recorder;
+	}
+
+	public void setRecorder(String recorder) {
+		this.recorder = recorder;
+	}
+
+	public String getAuditor() {
+		return auditor;
+	}
+
+	public void setAuditor(String auditor) {
+		this.auditor = auditor;
+	}
+
+	public Date getEndDate() {
+		return endDate;
+	}
+
+	public void setEndDate(Date endDate) {
+		this.endDate = endDate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getEnvironment() {
+		return environment;
+	}
+
+	public void setEnvironment(String environment) {
+		this.environment = environment;
+	}
+
+	public String getPriceType() {
+		return priceType;
+	}
+
+	public void setPriceType(String priceType) {
+		this.priceType = priceType;
+	}
+
+	public Long getSourceId() {
+		return sourceId;
+	}
+
+	public void setSourceId(Long sourceId) {
+		this.sourceId = sourceId;
+	}
+
+	public Set<Attach> getAttachs() {
+		return attachs;
+	}
+
+	public void setAttachs(Set<Attach> attachs) {
+		this.attachs = attachs;
+	}
+
+	public Short getCheck() {
+		return check;
+	}
+
+	public void setCheck(Short check) {
+		this.check = check;
+	}
+
+	public Short getOverdue() {
+		return overdue;
+	}
+
+	public void setOverdue(Short overdue) {
+		this.overdue = overdue;
+	}
+
+	public Short getIsOpen() {
+		return isOpen;
+	}
+
+	public void setIsOpen(Short isOpen) {
+		this.isOpen = isOpen;
+	}
+
+	public String getSourceApp() {
+		return sourceApp;
+	}
+
+	public void setSourceApp(String sourceApp) {
+		this.sourceApp = sourceApp;
+	}
+
+	public Set<InquiryProductInfo> getProducts() {
+		return products;
+	}
+
+	public void setProducts(Set<InquiryProductInfo> products) {
+		this.products = products;
+	}
+
+}

+ 411 - 0
src/main/java/com/uas/platform/b2b/temporary/model/InquiryItemDetailInfo.java

@@ -0,0 +1,411 @@
+package com.uas.platform.b2b.temporary.model;
+
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+import com.uas.platform.b2b.model.EnterpriseInfo;
+import com.uas.platform.b2b.model.PurchaseInquiryReply;
+
+public class InquiryItemDetailInfo {
+
+	@Id
+	private Long id;
+
+	/**
+	 * 来源(买家ERP采购询价明细)的ID
+	 */
+	private Long sourceId;
+
+	/**
+	 * 序号
+	 */
+	private Short number;
+
+	/**
+	 * 买家采购员UU
+	 */
+	private Long userUU;
+
+	/**
+	 * 币种
+	 */
+	private String currency;
+
+	/**
+	 * 税率
+	 */
+	private Float taxrate;
+
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+	/**
+	 * 供应商UU
+	 */
+	private Long vendUU;
+
+	/**
+	 * 被询价企业
+	 */
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 供应商联系人UU
+	 */
+	private Long vendUserUU;
+
+	/**
+	 * (买家预先提供的)有效期始
+	 */
+	private Date fromDate;
+
+	/**
+	 * (买家预先提供的)有效期止
+	 */
+	private Date toDate;
+
+	/**
+	 * (卖家报的)有效期始
+	 */
+	@Column(name = "id_vendfromdate")
+	private Date vendFromDate;
+
+	/**
+	 * (卖家报的)有效期止
+	 */
+	@Column(name = "id_vendtodate")
+	private Date vendToDate;
+
+	/**
+	 * (卖家报的)最小订购量
+	 */
+	@Column(name = "id_minorderqty")
+	private Double minOrderQty;
+
+	/**
+	 * (卖家报的)最小包装量
+	 */
+	@Column(name = "id_minpackqty")
+	private Double minPackQty;
+
+	/**
+	 * (卖家报的)物料品牌
+	 */
+	private String brand;
+
+	/**
+	 * (卖家报的)供应商物料编号
+	 */
+	private String vendorprodcode;
+
+	/**
+	 * (卖家报的)交货周期(天数)
+	 */
+	private Long leadtime;
+
+	/**
+	 * 分段报价明细
+	 */
+	private Set<PurchaseInquiryReply> replies;
+
+	/**
+	 * {未回复、已回复}
+	 */
+	private Short status;
+
+	/**
+	 * (针对卖家的)询价传输状态{待上传、已下载}
+	 */
+	private Short sendStatus;
+
+	/**
+	 * (针对买家的)报价信息传输状态{待上传、已下载}
+	 */
+	private Short backStatus;
+
+	/**
+	 * (针对卖家的)报价信息传输状态{待上传、已下载}
+	 */
+	private Short replySendStatus;
+
+	/**
+	 * 是否采纳
+	 */
+	private Short agreed;
+
+	/**
+	 * (针对卖家的)是否采纳信息传输状态{待上传、已下载}
+	 */
+	private Short decideStatus;
+
+	/**
+	 * 是否买家已设置分段数
+	 */
+	private Short custLap;
+
+	/**
+	 * 保存erp传入数据的时间
+	 * 
+	 * @return
+	 */
+	private Date erpDate;
+
+	/**
+	 * search项目进行是否已过期时实际根据主表中enddate与当前时间的比较获取,但是数据库无字段会报“标识符无效”的错误
+	 * 所以建立此字段,但是此字段不会赋值。
+	 * 
+	 * @return
+	 */
+	private Short overdue;
+
+	/**
+	 * 应用来源ERP、B2B
+	 */
+	private String sourceApp;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getSourceId() {
+		return sourceId;
+	}
+
+	public void setSourceId(Long sourceId) {
+		this.sourceId = sourceId;
+	}
+
+	public Short getNumber() {
+		return number;
+	}
+
+	public void setNumber(Short number) {
+		this.number = number;
+	}
+
+	public Long getUserUU() {
+		return userUU;
+	}
+
+	public void setUserUU(Long userUU) {
+		this.userUU = userUU;
+	}
+
+	public String getCurrency() {
+		return currency;
+	}
+
+	public void setCurrency(String currency) {
+		this.currency = currency;
+	}
+
+	public Float getTaxrate() {
+		return taxrate;
+	}
+
+	public void setTaxrate(Float taxrate) {
+		this.taxrate = taxrate;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getVendUU() {
+		return vendUU;
+	}
+
+	public void setVendUU(Long vendUU) {
+		this.vendUU = vendUU;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public Long getVendUserUU() {
+		return vendUserUU;
+	}
+
+	public void setVendUserUU(Long vendUserUU) {
+		this.vendUserUU = vendUserUU;
+	}
+
+	public Date getFromDate() {
+		return fromDate;
+	}
+
+	public void setFromDate(Date fromDate) {
+		this.fromDate = fromDate;
+	}
+
+	public Date getToDate() {
+		return toDate;
+	}
+
+	public void setToDate(Date toDate) {
+		this.toDate = toDate;
+	}
+
+	public Date getVendFromDate() {
+		return vendFromDate;
+	}
+
+	public void setVendFromDate(Date vendFromDate) {
+		this.vendFromDate = vendFromDate;
+	}
+
+	public Date getVendToDate() {
+		return vendToDate;
+	}
+
+	public void setVendToDate(Date vendToDate) {
+		this.vendToDate = vendToDate;
+	}
+
+	public Double getMinOrderQty() {
+		return minOrderQty;
+	}
+
+	public void setMinOrderQty(Double minOrderQty) {
+		this.minOrderQty = minOrderQty;
+	}
+
+	public Double getMinPackQty() {
+		return minPackQty;
+	}
+
+	public void setMinPackQty(Double minPackQty) {
+		this.minPackQty = minPackQty;
+	}
+
+	public String getBrand() {
+		return brand;
+	}
+
+	public void setBrand(String brand) {
+		this.brand = brand;
+	}
+
+	public String getVendorprodcode() {
+		return vendorprodcode;
+	}
+
+	public void setVendorprodcode(String vendorprodcode) {
+		this.vendorprodcode = vendorprodcode;
+	}
+
+	public Long getLeadtime() {
+		return leadtime;
+	}
+
+	public void setLeadtime(Long leadtime) {
+		this.leadtime = leadtime;
+	}
+
+	public Set<PurchaseInquiryReply> getReplies() {
+		return replies;
+	}
+
+	public void setReplies(Set<PurchaseInquiryReply> replies) {
+		this.replies = replies;
+	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
+
+	public Short getSendStatus() {
+		return sendStatus;
+	}
+
+	public void setSendStatus(Short sendStatus) {
+		this.sendStatus = sendStatus;
+	}
+
+	public Short getBackStatus() {
+		return backStatus;
+	}
+
+	public void setBackStatus(Short backStatus) {
+		this.backStatus = backStatus;
+	}
+
+	public Short getReplySendStatus() {
+		return replySendStatus;
+	}
+
+	public void setReplySendStatus(Short replySendStatus) {
+		this.replySendStatus = replySendStatus;
+	}
+
+	public Short getAgreed() {
+		return agreed;
+	}
+
+	public void setAgreed(Short agreed) {
+		this.agreed = agreed;
+	}
+
+	public Short getDecideStatus() {
+		return decideStatus;
+	}
+
+	public void setDecideStatus(Short decideStatus) {
+		this.decideStatus = decideStatus;
+	}
+
+	public Short getCustLap() {
+		return custLap;
+	}
+
+	public void setCustLap(Short custLap) {
+		this.custLap = custLap;
+	}
+
+	public Date getErpDate() {
+		return erpDate;
+	}
+
+	public void setErpDate(Date erpDate) {
+		this.erpDate = erpDate;
+	}
+
+	public Short getOverdue() {
+		return overdue;
+	}
+
+	public void setOverdue(Short overdue) {
+		this.overdue = overdue;
+	}
+
+	public String getSourceApp() {
+		return sourceApp;
+	}
+
+	public void setSourceApp(String sourceApp) {
+		this.sourceApp = sourceApp;
+	}
+
+}

+ 87 - 0
src/main/java/com/uas/platform/b2b/temporary/model/InquiryProductInfo.java

@@ -0,0 +1,87 @@
+package com.uas.platform.b2b.temporary.model;
+
+import java.util.Set;
+
+import com.uas.platform.b2b.model.PurchaseInquiryItemInfo;
+
+public class InquiryProductInfo {
+
+	/**
+	 * id
+	 */
+	private Long id;
+
+	/**
+	 * 商品信息标题
+	 */
+	private String title;
+
+	/**
+	 * 产品编号
+	 */
+	private String code;
+
+	/**
+	 * 产品规格
+	 */
+	private String spec;
+
+	/**
+	 * 品牌
+	 */
+	private String brand;
+
+	/**
+	 * 询价详情
+	 */
+	private Set<PurchaseInquiryItemInfo> inquiryItems;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getSpec() {
+		return spec;
+	}
+
+	public void setSpec(String spec) {
+		this.spec = spec;
+	}
+
+	public String getBrand() {
+		return brand;
+	}
+
+	public void setBrand(String brand) {
+		this.brand = brand;
+	}
+
+	public Set<PurchaseInquiryItemInfo> getInquiryItems() {
+		return inquiryItems;
+	}
+
+	public void setInquiryItems(Set<PurchaseInquiryItemInfo> inquiryItems) {
+		this.inquiryItems = inquiryItems;
+	}
+
+}