|
|
@@ -2,16 +2,17 @@ package com.uas.ps.inquiry.controller;
|
|
|
|
|
|
import com.uas.ps.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.ps.httplog.annotation.HttpLog;
|
|
|
-import com.uas.ps.inquiry.entity.Constant;
|
|
|
-import com.uas.ps.inquiry.entity.InquirySource;
|
|
|
+import com.uas.ps.inquiry.entity.*;
|
|
|
import com.uas.ps.inquiry.model.PublicInquiryItem;
|
|
|
import com.uas.ps.inquiry.service.AttachService;
|
|
|
import com.uas.ps.inquiry.service.InquiryForSaleService;
|
|
|
import com.uas.ps.inquiry.service.PublicInquiryService;
|
|
|
import com.uas.ps.inquiry.support.InquiryBufferedLogger;
|
|
|
+import javassist.NotFoundException;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -46,6 +47,120 @@ public class ErpDownloadController {
|
|
|
|
|
|
private final static Logger log = Logger.getLogger(Logger.class);
|
|
|
|
|
|
+ /**
|
|
|
+ * 将买家ERP的公共询价写到公共询价服务中心
|
|
|
+ *
|
|
|
+ * @param inquiries 公共询价信息
|
|
|
+ * @param enuu 询价企业UU
|
|
|
+ * @param address 询价企业地址信息
|
|
|
+ * @return
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(method = RequestMethod.POST)
|
|
|
+ public void saveInquiries(@RequestBody List<BatchInquiry> inquiries, Long enuu, String address) throws NotFoundException, UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ publicInquiryService.save(inquiries, enuu, URLDecoder.decode(address, "UTF-8"));
|
|
|
+ log.info("/inquiry/public post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ logger.log("公共询价", "ERP上传公共询价", "size: " + inquiries.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * erp的公共询价单提交待审核时,更新公共询价服务中心的单据设置为不能报价
|
|
|
+ *
|
|
|
+ * @param inquiries 封装的数据信息
|
|
|
+ * @param enuu 询价企业UU
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/check", method = RequestMethod.POST)
|
|
|
+ public void updateInquiryStatus(@RequestBody List<BatchInquiry> inquiries, Long enuu) throws UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ publicInquiryService.updateStatus(inquiries, enuu);
|
|
|
+ log.info("/inquiry/public/check post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ logger.log("公共询价", "ERP设置公共询价不能报价", "size: " + inquiries.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * (针对客户)获取公共询价服务中心供应商的报价信息
|
|
|
+ *
|
|
|
+ * @param enuu 询价企业UU
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-01-14 15:20
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/quotation", method = RequestMethod.GET)
|
|
|
+ public List<InquiryDetail> getReply(Long enuu) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ List<InquiryDetail> details = publicInquiryService.findNotUploadReply(enuu);
|
|
|
+ log.info("/inquiry/public/quotation 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ logger.log("公共询价", "ERP获取供应商报价信息", "size: " + details.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ return details;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公共询价服务中心的报价信息传到买家ERP之后,修改公共询价服务中心里面的询价单明细的上传状态
|
|
|
+ *
|
|
|
+ * @param data 传回的id串
|
|
|
+ * @return
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/reply/back", method = RequestMethod.POST)
|
|
|
+ public void onReplySuccess(@RequestBody String data, Long enuu) throws UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ String[] idArray = URLDecoder.decode(data, "UTF-8").split(",");
|
|
|
+ logger.log("公共询价", "ERP获取报价信息返回id", "id: " + idArray, Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ publicInquiryService.onReplyUploadSuccess(idArray);
|
|
|
+ log.info("/inquiry/public/reply/back post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 买家在收到报价信息后,点击提交按钮后,状态传至公共询价服务中心,至此公共询价服务中心的供应商不能再对这张询价单进行报价
|
|
|
+ *
|
|
|
+ * @param details 封装的data信息
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/checking", method = RequestMethod.POST)
|
|
|
+ public void checkInquiry(@RequestBody List<InquiryDetail> details , Long enuu) throws UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ logger.log("公共询价", "ERP提交报价信息应用禁止报价", "size: " + details.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ publicInquiryService.updateInquiryStatus(details, enuu);
|
|
|
+ log.info("/inquiry/public/checking post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 买家ERP(不)采纳了价格之后,修改公共询价服务中心里面的报价信息的状态
|
|
|
+ *
|
|
|
+ * @return 封装的data信息
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/reply/decide", method = RequestMethod.POST)
|
|
|
+ public void onReplyDecide(@RequestBody List<InquiryDecide> decides, Long enuu) throws UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ logger.log("公共询价", "ERP针对供应报价信息进行(不)采纳操作", "size: " + decides.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ publicInquiryService.onReplyDecide(decides, enuu);
|
|
|
+ log.info("/inquiry/public/reply/decide post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 买家ERP作废询价单后,修改公共询价服务中心里面的状态
|
|
|
+ *
|
|
|
+ * @param inquiries 封装的询价信息
|
|
|
+ * @return
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @HttpLog
|
|
|
+ @RequestMapping(value = "/invalid", method = RequestMethod.POST)
|
|
|
+ public void onReplyInvalid(@RequestBody List<Inquiry> inquiries, Long enuu) throws UnsupportedEncodingException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ logger.log("公共询价", "ERP作废公共询价单返回数据到公共服务", "size: " + inquiries.size(), Constant.UU, enuu, InquirySource.ERP.name());
|
|
|
+ publicInquiryService.onReplyInvalid(inquiries, enuu);
|
|
|
+ log.info("/inquiry/public/invalid post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 买家采纳或拒绝之后,上传到报价方UAS
|
|
|
*
|
|
|
@@ -95,7 +210,7 @@ public class ErpDownloadController {
|
|
|
*/
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/down/reply", method = RequestMethod.GET)
|
|
|
- public List<PublicInquiryItem> getReply(Long enUU) {
|
|
|
+ public List<PublicInquiryItem> downReply(Long enUU) {
|
|
|
long start = System.currentTimeMillis();
|
|
|
List<PublicInquiryItem> details = publicInquiryService.findNotUploadToUas(enUU);
|
|
|
log.info("/inquiry/public/quotation 耗时:" + (System.currentTimeMillis() - start));
|
|
|
@@ -113,7 +228,7 @@ public class ErpDownloadController {
|
|
|
*/
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/down/reply/back", method = RequestMethod.POST)
|
|
|
- public void onReplySuccess(String ids, Long enUU) throws UnsupportedEncodingException {
|
|
|
+ public void onReplyDownSuccess(String ids, Long enUU) throws UnsupportedEncodingException {
|
|
|
long start = System.currentTimeMillis();
|
|
|
String[] idArray = URLDecoder.decode(ids, "UTF-8").split(",");
|
|
|
logger.log("公共询价", "将报价方在商城报价的单据同步到报价方UAS 之后 回调 修改状态", "id: " + idArray, Constant.UU, enUU, InquirySource.ERP.name());
|