Browse Source

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@357 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 years ago
parent
commit
4970385e48

+ 1 - 1
src/main/java/com/uas/platform/b2b/erp/controller/InquiryController.java

@@ -42,7 +42,7 @@ public class InquiryController {
 	 */
 	@RequestMapping(method = RequestMethod.POST)
 	@ResponseBody
-	public void savePurchases(@RequestParam("data") String data) throws UnsupportedEncodingException {
+	public void saveInquiries(@RequestParam("data") String data) throws UnsupportedEncodingException {
 		String jsonStr = URLDecoder.decode(data, "UTF-8");
 		List<Inquiry> inquiries = FlexJsonUtils.fromJsonArray(jsonStr, Inquiry.class);
 		purchaseInquiryService.save(inquiryService.convertInquiry(inquiries));

+ 144 - 0
src/main/java/com/uas/platform/b2b/mobile/model/Purchase.java

@@ -0,0 +1,144 @@
+package com.uas.platform.b2b.mobile.model;
+
+import java.util.Date;
+
+import com.uas.platform.b2b.model.PurchaseOrder;
+
+/**
+ * 数据传送到移动端的轻量级实体类 <br>
+ * 收到的客户采购订单
+ * 
+ * @author yingp
+ *
+ */
+public class Purchase {
+
+	/**
+	 * ID
+	 */
+	private long pu_id;
+	/**
+	 * 订单号
+	 */
+	private String pu_code;
+	/**
+	 * 日期
+	 */
+	private Date pu_date;
+	/**
+	 * 备注
+	 */
+	private String pu_remark;
+	/**
+	 * 币种
+	 */
+	private String pu_currency;
+	/**
+	 * 汇率
+	 */
+	private Float pu_rate;
+	/**
+	 * 付款方式
+	 */
+	private String pu_payments;
+	/**
+	 * 交货地址
+	 */
+	private String pu_address;
+	/**
+	 * 采购方企业
+	 */
+	private String en_name;
+
+	public long getPu_id() {
+		return pu_id;
+	}
+
+	public void setPu_id(long pu_id) {
+		this.pu_id = pu_id;
+	}
+
+	public String getPu_code() {
+		return pu_code;
+	}
+
+	public void setPu_code(String pu_code) {
+		this.pu_code = pu_code;
+	}
+
+	public Date getPu_date() {
+		return pu_date;
+	}
+
+	public void setPu_date(Date pu_date) {
+		this.pu_date = pu_date;
+	}
+
+	public String getPu_remark() {
+		return pu_remark;
+	}
+
+	public void setPu_remark(String pu_remark) {
+		this.pu_remark = pu_remark;
+	}
+
+	public String getPu_currency() {
+		return pu_currency;
+	}
+
+	public void setPu_currency(String pu_currency) {
+		this.pu_currency = pu_currency;
+	}
+
+	public Float getPu_rate() {
+		return pu_rate;
+	}
+
+	public void setPu_rate(Float pu_rate) {
+		this.pu_rate = pu_rate;
+	}
+
+	public String getPu_payments() {
+		return pu_payments;
+	}
+
+	public void setPu_payments(String pu_payments) {
+		this.pu_payments = pu_payments;
+	}
+
+	public String getPu_address() {
+		return pu_address;
+	}
+
+	public void setPu_address(String pu_address) {
+		this.pu_address = pu_address;
+	}
+
+	public String getEn_name() {
+		return en_name;
+	}
+
+	public void setEn_name(String en_name) {
+		this.en_name = en_name;
+	}
+
+	public Purchase() {
+	}
+
+	/**
+	 * 转为移动端客户采购单
+	 * 
+	 * @param order
+	 */
+	public Purchase(PurchaseOrder order) {
+		this.pu_address = order.getShipAddress();
+		this.pu_code = order.getCode();
+		this.pu_currency = order.getCurrency();
+		this.pu_rate = order.getRate();
+		this.pu_payments = order.getPayments();
+		this.pu_remark = order.getRemark();
+		this.en_name = order.getEnterprise().getEnName();
+		this.pu_id = order.getId();
+		this.pu_date = order.getDate();
+	}
+}

+ 174 - 0
src/main/java/com/uas/platform/b2b/mobile/model/PurchaseChange.java

@@ -0,0 +1,174 @@
+package com.uas.platform.b2b.mobile.model;
+
+import java.util.Date;
+
+import com.uas.platform.b2b.model.PurchaseOrderChange;
+import com.uas.platform.core.model.Constant;
+import com.uas.platform.core.model.Status;
+
+/**
+ * 数据传送到移动端的轻量级实体类 <br>
+ * 收到的客户采购变更单
+ * 
+ * @author yingp
+ *
+ */
+public class PurchaseChange {
+
+	/**
+	 * 流水号
+	 */
+	private String pc_code;
+	/**
+	 * 订单号
+	 */
+	private String pc_purccode;
+	/**
+	 * 日期
+	 */
+	private Date pc_date;
+	/**
+	 * 原付款方式
+	 */
+	private String pc_payments;
+	/**
+	 * 新付款方式
+	 */
+	private String pc_newpayments;
+	/**
+	 * 原币种
+	 */
+	private String pc_currency;
+	/**
+	 * 新币种
+	 */
+	private String pc_newcurrency;
+	/**
+	 * 原汇率
+	 */
+	private Float pc_rate;
+	/**
+	 * 新汇率
+	 */
+	private Float pc_newrate;
+	/**
+	 * 备注
+	 */
+	private String pc_remark;
+	/**
+	 * 是否已同意
+	 */
+	private String pc_agreed;
+
+	public String getPc_code() {
+		return pc_code;
+	}
+
+	public void setPc_code(String pc_code) {
+		this.pc_code = pc_code;
+	}
+
+	public String getPc_purccode() {
+		return pc_purccode;
+	}
+
+	public void setPc_purccode(String pc_purccode) {
+		this.pc_purccode = pc_purccode;
+	}
+
+	public Date getPc_date() {
+		return pc_date;
+	}
+
+	public void setPc_date(Date pc_date) {
+		this.pc_date = pc_date;
+	}
+
+	public String getPc_payments() {
+		return pc_payments;
+	}
+
+	public void setPc_payments(String pc_payments) {
+		this.pc_payments = pc_payments;
+	}
+
+	public String getPc_newpayments() {
+		return pc_newpayments;
+	}
+
+	public void setPc_newpayments(String pc_newpayments) {
+		this.pc_newpayments = pc_newpayments;
+	}
+
+	public String getPc_currency() {
+		return pc_currency;
+	}
+
+	public void setPc_currency(String pc_currency) {
+		this.pc_currency = pc_currency;
+	}
+
+	public String getPc_newcurrency() {
+		return pc_newcurrency;
+	}
+
+	public void setPc_newcurrency(String pc_newcurrency) {
+		this.pc_newcurrency = pc_newcurrency;
+	}
+
+	public Float getPc_rate() {
+		return pc_rate;
+	}
+
+	public void setPc_rate(Float pc_rate) {
+		this.pc_rate = pc_rate;
+	}
+
+	public Float getPc_newrate() {
+		return pc_newrate;
+	}
+
+	public void setPc_newrate(Float pc_newrate) {
+		this.pc_newrate = pc_newrate;
+	}
+
+	public String getPc_remark() {
+		return pc_remark;
+	}
+
+	public void setPc_remark(String pc_remark) {
+		this.pc_remark = pc_remark;
+	}
+
+	public String getPc_agreed() {
+		return pc_agreed;
+	}
+
+	public void setPc_agreed(String pc_agreed) {
+		this.pc_agreed = pc_agreed;
+	}
+
+	public PurchaseChange() {
+	}
+
+	/**
+	 * 转为移动端的变更单
+	 * 
+	 * @param orderChange
+	 */
+	public PurchaseChange(PurchaseOrderChange orderChange) {
+		if (orderChange.getAgreed() != null && orderChange.getAgreed() == Constant.YES)
+			this.pc_agreed = Status.AGREED.getPhrase();
+		this.pc_code = orderChange.getCode();
+		this.pc_currency = orderChange.getOrder().getCurrency();
+		this.pc_date = orderChange.getDate();
+		this.pc_newcurrency = orderChange.getNewCurrency();
+		this.pc_newpayments = orderChange.getNewPayments();
+		this.pc_newrate = orderChange.getNewRate();
+		this.pc_payments = orderChange.getOrder().getPayments();
+		this.pc_purccode = orderChange.getOrder().getCode();
+		this.pc_rate = orderChange.getOrder().getRate();
+		this.pc_remark = orderChange.getRemark();
+	}
+
+}