Переглянути джерело

修改送货提醒时的备注语句

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@1378 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 роки тому
батько
коміт
7bf4c25a58

+ 30 - 20
src/main/java/com/uas/platform/b2b/erp/service/impl/PurchaseNotifyServiceImpl.java

@@ -59,32 +59,42 @@ public class PurchaseNotifyServiceImpl implements PurchaseNotifyService {
 			} else {// 对现有的单据,
 				PurchaseNotice existNotice = existNotices.get(0);
 				SimpleDateFormat dateFormat = new SimpleDateFormat("MM月dd日");
+				String dateString = dateFormat.format(new Date());
+				String remark = "";
+				if(StringUtils.hasText(existNotice.getRemark())) {
+					remark = existNotice.getRemark() + ";";
+				}
 				existNotice.setSendStatus((short) Status.NOT_UPLOAD.value());//对卖家传输状态 待上传
-				if(existNotice.getEndQty() > notice.getQty()) {
-					// 已发货数大于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
-					if(StringUtils.hasText(existNotice.getRemark())) {
-						existNotice.setRemark(existNotice.getRemark() + ";" + 
-								dateFormat.format(new Date()) + "修改需求数量" + 
+				if(existNotice.getQty() != notice.getQty()) {
+					if(existNotice.getEndQty() > notice.getQty()) {
+						// 已发货数大于新的需求数,修改平台上的需求数为已发货数,将已发货数量传回买家ERP修改发货提醒的数量
+						existNotice.setRemark(remark + dateString + "修改需求数量," + 
 								existNotice.getQty() + "变为" + existNotice.getEndQty());
+						existNotice.setQty(existNotice.getEndQty());//需求数量
+						existNotice.setStatus((short) Status.REPLIED.value());//状态 已回复
+						oppNotices.add(existNotice);
+						notices.add(existNotice);
 					} else {
-						existNotice.setRemark(dateFormat.format(new Date()) + "修改需求数量" + 
-								existNotice.getQty() + "变为" + existNotice.getEndQty());
+						// 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
+						existNotice.setRemark(remark + dateString + "修改需求数量," + 
+								existNotice.getQty() + "变为" + notice.getQty());
+						existNotice.setQty(notice.getQty());// 需求数量
+						existNotice.setDelivery(notice.getDelivery());// 交期
+						notices.add(existNotice);
 					}
-					existNotice.setQty(existNotice.getEndQty());//需求数量
-					existNotice.setStatus((short) Status.REPLIED.value());//状态 已回复
-					oppNotices.add(existNotice);
-					notices.add(existNotice);
 				} else {
-					// 已发货数小于或等于新的需求数,修改平台上的需求数为新的需求数
-					if(StringUtils.hasText(existNotice.getRemark())) {
-						existNotice.setRemark(existNotice.getRemark() + ";" + 
-								dateFormat.format(new Date()) + "修改需求数量" + 
-								existNotice.getQty() + "变为" + notice.getQty());
-					} else {
-						existNotice.setRemark(dateFormat.format(new Date()) + "修改需求数量" + 
-								existNotice.getQty() + "变为" + notice.getQty());
+					String existDeliveryStr = "空";
+					String deliveryStr = "空";
+					if(existNotice.getDelivery() != null) {
+						existDeliveryStr = dateFormat.format(existNotice.getDelivery());
+					}
+					if(notice.getDelivery() != null) {
+						deliveryStr = dateFormat.format(notice.getDelivery());
+					}
+					if( ! existDeliveryStr.equals(deliveryStr)) {
+						existNotice.setRemark(remark + dateString + "修改交期," + 
+								existDeliveryStr + "变为" + deliveryStr);
 					}
-					existNotice.setQty(notice.getQty());// 需求数量
 					existNotice.setDelivery(notice.getDelivery());// 交期
 					notices.add(existNotice);
 				}