Преглед на файлове

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

administrator преди 11 години
родител
ревизия
628e6c8f6e

+ 2 - 2
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -12,11 +12,11 @@ import com.uas.platform.b2b.model.PurchaseNotice;
 public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNotice>, JpaRepository<PurchaseNotice, Long> {
 
 	/**
-	 * 按买家企业ID和编号查找送货提醒单
+	 * 按买家企业ID和送货提醒来源ID查找送货提醒单
 	 * 
 	 * @return
 	 */
-	List<PurchaseNotice> findByEnUUAndCode(long enUU, String code);
+	List<PurchaseNotice> findByEnUUAndSourceId(long enUU, long sourceId);
 
 	/**
 	 * 按供应商企业ID和传输状态查找送货提醒单

+ 6 - 6
src/main/java/com/uas/platform/b2b/erp/model/AcceptNotifyDetail.java

@@ -16,7 +16,7 @@ public class AcceptNotifyDetail {
 
 	private String and_ordercode;
 	private Short and_orderdetno;
-	private String pn_code;
+	private Long pn_id;
 	private Double and_inqty;
 	private Double and_price;
 	private String and_remark;
@@ -70,12 +70,12 @@ public class AcceptNotifyDetail {
 		this.and_price = and_price;
 	}
 
-	public String getPn_code() {
-		return pn_code;
+	public Long getPn_id() {
+		return pn_id;
 	}
 
-	public void setPn_code(String pn_code) {
-		this.pn_code = pn_code;
+	public void setPn_id(Long pn_id) {
+		this.pn_id = pn_id;
 	}
 
 	public AcceptNotifyDetail() {
@@ -111,7 +111,7 @@ public class AcceptNotifyDetail {
 		orderItem.setOrder(order);
 		PurchaseNotice notice = new PurchaseNotice();
 		notice.setOrderItem(orderItem);
-		notice.setCode(this.pn_code);
+		notice.setSourceId(this.pn_id);
 		notice.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 		item.setNotice(notice);
 		return item;

+ 16 - 6
src/main/java/com/uas/platform/b2b/erp/model/PurchaseNotify.java

@@ -16,7 +16,8 @@ import com.uas.platform.core.model.Status;
  */
 public class PurchaseNotify {
 
-	private String pn_code;
+	private long pn_id;
+	private long ve_uu;
 	private Date pn_indate;
 	private Double pn_qty;
 	private Date pn_delivery;
@@ -25,12 +26,12 @@ public class PurchaseNotify {
 	private String pn_remark;
 	private Double pn_endqty;
 
-	public String getPn_code() {
-		return pn_code;
+	public long getPn_id() {
+		return pn_id;
 	}
 
-	public void setPn_code(String pn_code) {
-		this.pn_code = pn_code;
+	public void setPn_id(long pn_id) {
+		this.pn_id = pn_id;
 	}
 
 	public Date getPn_indate() {
@@ -89,6 +90,14 @@ public class PurchaseNotify {
 		this.pn_endqty = pn_endqty;
 	}
 
+	public long getVe_uu() {
+		return ve_uu;
+	}
+
+	public void setVe_uu(long ve_uu) {
+		this.ve_uu = ve_uu;
+	}
+
 	/**
 	 * 转为平台的客户送货提醒
 	 * 
@@ -96,13 +105,14 @@ public class PurchaseNotify {
 	 */
 	public PurchaseNotice convert() {
 		PurchaseNotice notice = new PurchaseNotice();
-		notice.setCode(pn_code);
+		notice.setSourceId(pn_id);
 		notice.setDate(pn_indate);
 		notice.setDelivery(pn_delivery);
 		notice.setEndQty(pn_endqty);
 		notice.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 		notice.setQty(pn_qty);
 		notice.setRemark(pn_remark);
+		notice.setVendUU(ve_uu);
 		PurchaseOrder order = new PurchaseOrder();
 		order.setCode(pn_ordercode);
 		PurchaseOrderItem orderItem = new PurchaseOrderItem();

+ 3 - 1
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java

@@ -35,6 +35,7 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 					.getOrderItem().getOrder().getCode(), notice.getOrderItem().getNumber());
 			if (!CollectionUtils.isEmpty(orderItems)) {
 				notice.setOrderItem(orderItems.get(0));
+				notice.setOrderItemId(notice.getOrderItem().getId());
 				notices.add(notice);
 			}
 		}
@@ -58,9 +59,10 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 			if (!CollectionUtils.isEmpty(items)) {
 				for (SaleSendItem item : items) {
 					PurchaseNotice notice = item.getNotice();
-					List<PurchaseNotice> notices = purchaseNoticeDao.findByEnUUAndCode(notice.getEnUU(), notice.getCode());
+					List<PurchaseNotice> notices = purchaseNoticeDao.findByEnUUAndSourceId(notice.getEnUU(), notice.getSourceId());
 					if (!CollectionUtils.isEmpty(notices)) {
 						item.setNotice(notices.get(0));
+						item.setNoticeId(item.getNotice().getId());
 					}
 				}
 			}

+ 18 - 7
src/main/java/com/uas/platform/b2b/model/PurchaseNotice.java

@@ -35,10 +35,10 @@ public class PurchaseNotice implements Serializable {
 	private Long id;
 
 	/**
-	 * 送货提醒单号
+	 * 来源系统的送货提醒ID
 	 */
-	@Column(name = "pn_code")
-	private String code;
+	@Column(name = "pn_sourceid")
+	private long sourceId;
 
 	/**
 	 * 送货提醒单所属企业UU
@@ -89,6 +89,9 @@ public class PurchaseNotice implements Serializable {
 	@JoinColumn(name = "pn_pdid", insertable = false, updatable = false, nullable = false)
 	private PurchaseOrderItem orderItem;
 
+	@Column(name = "pn_pdid")
+	private Long orderItemId;
+
 	/**
 	 * (对卖家)传输状态
 	 */
@@ -115,12 +118,12 @@ public class PurchaseNotice implements Serializable {
 		this.id = id;
 	}
 
-	public String getCode() {
-		return code;
+	public long getSourceId() {
+		return sourceId;
 	}
 
-	public void setCode(String code) {
-		this.code = code;
+	public void setSourceId(long sourceId) {
+		this.sourceId = sourceId;
 	}
 
 	public Long getEnUU() {
@@ -211,4 +214,12 @@ public class PurchaseNotice implements Serializable {
 		this.endStatus = endStatus;
 	}
 
+	public Long getOrderItemId() {
+		return orderItemId;
+	}
+
+	public void setOrderItemId(Long orderItemId) {
+		this.orderItemId = orderItemId;
+	}
+
 }

+ 11 - 0
src/main/java/com/uas/platform/b2b/model/SaleSendItem.java

@@ -41,6 +41,9 @@ public class SaleSendItem {
 	@JoinColumn(name = "si_noticeid", insertable = false, updatable = false, nullable = false)
 	private PurchaseNotice notice;
 
+	@Column(name = "si_noticeid")
+	private Long noticeId;
+
 	/**
 	 * 数量
 	 */
@@ -122,4 +125,12 @@ public class SaleSendItem {
 		this.remark = remark;
 	}
 
+	public Long getNoticeId() {
+		return noticeId;
+	}
+
+	public void setNoticeId(Long noticeId) {
+		this.noticeId = noticeId;
+	}
+
 }

+ 3 - 3
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -48,10 +48,10 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 			PurchaseOrder order = notice.getOrderItem().getOrder();
 			if (order.getVendUserUU() != null) {
 				// Android
-				XingePusher.pushSingleAccountAndroid(order.getVendUserUU().toString(), "新增一个送货提醒-", "单号:" + notice.getCode() + ",客户:"
+				XingePusher.pushSingleAccountAndroid(order.getVendUserUU().toString(), "新增一个送货提醒-", "客户采购单号:" + order.getCode() + ",客户:"
 						+ order.getEnterprise().getEnName(), "com.sas.mobile.activity.PurchaseChangeActivity");
 				// IOS
-				XingePusher.pushSingleAccountIOS(order.getVendUserUU().toString(), "新增一个送货提醒-" + "单号:" + notice.getCode() + ",客户:"
+				XingePusher.pushSingleAccountIOS(order.getVendUserUU().toString(), "新增一个送货提醒-" + "客户采购单号:" + order.getCode() + ",客户:"
 						+ order.getEnterprise().getEnName());
 			}
 		}
@@ -141,7 +141,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 	public void end(List<PurchaseNotify> notifies) {
 		long enUU = SystemSession.getUser().getEnterprise().getUu();
 		for (PurchaseNotify notify : notifies) {
-			List<PurchaseNotice> notices = purchaseNoticeDao.findByEnUUAndCode(enUU, notify.getPn_code());
+			List<PurchaseNotice> notices = purchaseNoticeDao.findByEnUUAndSourceId(enUU, notify.getPn_id());
 			if (!CollectionUtils.isEmpty(notices)) {
 				PurchaseNotice notice = notices.get(0);
 				notice.setEnd(Constant.YES);