Browse Source

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

administrator 11 years ago
parent
commit
191ed2b746

+ 15 - 0
src/main/java/com/uas/platform/b2b/erp/controller/InquiryDownController.java

@@ -1,11 +1,14 @@
 package com.uas.platform.b2b.erp.controller;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import com.uas.platform.b2b.erp.model.Inquiry;
@@ -40,4 +43,16 @@ public class InquiryDownController {
 		return inquiryService.convertSaleQuotation(saleQuotationService.findNotUploadQuotation());
 	}
 
+	/**
+	 * 平台的主动报价传到买家ERP之后,修改平台里面的主动报价的上传状态
+	 * 
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	@RequestMapping(value = "/back", method = RequestMethod.POST)
+	@ResponseBody
+	public void onReplySuccess(@RequestParam("data") String data) throws UnsupportedEncodingException {
+		saleQuotationService.onQuotationUploadSuccess(URLDecoder.decode(data, "UTF-8").split(","));
+	}
+
 }

+ 7 - 0
src/main/java/com/uas/platform/b2b/service/SaleQuotationService.java

@@ -23,4 +23,11 @@ public interface SaleQuotationService {
 	 */
 	public List<SaleQuotation> findNotUploadQuotation();
 
+	/**
+	 * 主动报价成功传到买家之后
+	 * 
+	 * @param idArray
+	 */
+	public void onQuotationUploadSuccess(String[] idArray);
+
 }

+ 11 - 0
src/main/java/com/uas/platform/b2b/service/impl/SaleQuotationServiceImpl.java

@@ -33,4 +33,15 @@ public class SaleQuotationServiceImpl implements SaleQuotationService {
 				(short) Status.NOT_UPLOAD.value());
 	}
 
+	@Override
+	public void onQuotationUploadSuccess(String[] idArray) {
+		for (String id : idArray) {
+			SaleQuotation quotation = saleQuotationDao.findOne(Long.parseLong(id));
+			if (quotation != null) {
+				quotation.setSendStatus((short) Status.DOWNLOADED.value());
+				saleQuotationDao.save(quotation);
+			}
+		}
+	}
+
 }