|
|
@@ -12,6 +12,7 @@ import com.uas.ps.inquiry.entity.InquiryDetail;
|
|
|
import com.uas.ps.inquiry.entity.InquiryMessage;
|
|
|
import com.uas.ps.inquiry.entity.InquirySource;
|
|
|
import com.uas.ps.inquiry.entity.OrderStatus;
|
|
|
+import com.uas.ps.inquiry.model.Attach;
|
|
|
import com.uas.ps.inquiry.model.PublicInquiryItemInfo;
|
|
|
import com.uas.ps.inquiry.model.PurcInquiry;
|
|
|
import com.uas.ps.inquiry.model.PurcInquiryItemInfo;
|
|
|
@@ -21,20 +22,23 @@ 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 java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
-import java.rmi.AccessException;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
import javassist.NotFoundException;
|
|
|
+import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+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;
|
|
|
+
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.rmi.AccessException;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -57,6 +61,8 @@ public class PublicInquiryController {
|
|
|
|
|
|
private final static InquiryBufferedLogger logger = BufferedLoggerManager.getLogger(InquiryBufferedLogger.class);
|
|
|
|
|
|
+ private final static Logger log = Logger.getLogger(Logger.class);
|
|
|
+
|
|
|
/**
|
|
|
* 将买家ERP的公共询价写到公共询价服务中心
|
|
|
*
|
|
|
@@ -69,7 +75,9 @@ public class PublicInquiryController {
|
|
|
@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());
|
|
|
}
|
|
|
|
|
|
@@ -83,7 +91,9 @@ public class PublicInquiryController {
|
|
|
@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());
|
|
|
}
|
|
|
|
|
|
@@ -97,7 +107,9 @@ public class PublicInquiryController {
|
|
|
@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;
|
|
|
}
|
|
|
@@ -112,9 +124,11 @@ public class PublicInquiryController {
|
|
|
@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));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -126,8 +140,10 @@ public class PublicInquiryController {
|
|
|
@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));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -139,8 +155,10 @@ public class PublicInquiryController {
|
|
|
@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));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -153,8 +171,10 @@ public class PublicInquiryController {
|
|
|
@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));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -170,7 +190,10 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/turntoInquiry", method = RequestMethod.POST)
|
|
|
private ModelMap transtoInquiry(Long id, Long enuu, Long useruu) {
|
|
|
- return publicInquiryService.transtoInquiry(id, enuu, useruu);
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ ModelMap map = publicInquiryService.transtoInquiry(id, enuu, useruu);
|
|
|
+ log.info("/inquiry/public/turntoInquiry post 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -185,12 +208,15 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
public IPage<PurcInquiryItemInfo> getInquiry(PageInfo pageInfo, SearchFilter searchFilter, String distributes) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
if (!StringUtils.isEmpty(distributes)) {
|
|
|
List<Long> distribute = JSONObject.parseArray(distributes, Long.class);
|
|
|
searchFilter.setDistribute(distribute);
|
|
|
}
|
|
|
+ IPage<PurcInquiryItemInfo> page = publicInquiryService.findTodoByPageInfo(pageInfo, searchFilter);
|
|
|
logger.log("公共询价", "查询公共询价信息", null, searchFilter.getUserUU(), searchFilter.getEnUU(), InquirySource.PLAIN.name());
|
|
|
- return publicInquiryService.findTodoByPageInfo(pageInfo, searchFilter);
|
|
|
+ log.info("/inquiry/public 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return page;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -203,14 +229,17 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/inquiryList", method = RequestMethod.GET)
|
|
|
public IPage<PurcInquiryItemInfo> getInquiryList(PageInfo pageInfo, SearchFilter searchFilter) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
if (null != searchFilter.getUserUU()) {
|
|
|
pageInfo.filter("userUU", searchFilter.getUserUU());
|
|
|
}
|
|
|
if (null != searchFilter.getEnUU()) {
|
|
|
pageInfo.filter("inquiry.enUU", searchFilter.getEnUU());
|
|
|
}
|
|
|
+ IPage<PurcInquiryItemInfo> infoIPage = publicInquiryService.findTodoByPageInfo(pageInfo, searchFilter);
|
|
|
logger.log("公共询价", "查询已发布公共询价信息", null, searchFilter.getUserUU(), searchFilter.getEnUU(), InquirySource.MALL.name());
|
|
|
- return publicInquiryService.findTodoByPageInfo(pageInfo, searchFilter);
|
|
|
+ log.info("/inquiry/public/inquiryList 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return infoIPage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -230,6 +259,7 @@ public class PublicInquiryController {
|
|
|
@RequestMapping(value = "/mobile", method = RequestMethod.GET)
|
|
|
public ModelMap publincInquiry(Integer page, Integer size, Long en_uu, String _state,
|
|
|
String keyword, String user_tel, Long fromDate, Long endDate) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
ModelMap map = new ModelMap();
|
|
|
PageInfo pageInfo = setPageInfo(page, size);
|
|
|
SearchFilter filter = new SearchFilter();
|
|
|
@@ -260,6 +290,7 @@ public class PublicInquiryController {
|
|
|
map.put("content", publicInquiryService.findTodoByPageInfo(pageInfo, filter).getContent());
|
|
|
return map;
|
|
|
}
|
|
|
+ log.info("/inquiry/mobile 耗时:" + (System.currentTimeMillis() - start));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -304,6 +335,7 @@ public class PublicInquiryController {
|
|
|
@RequestMapping(value = "/mobile/v2", method = RequestMethod.GET)
|
|
|
public ModelMap publicInquiry(Integer page, Integer size, Long en_uu, String _state,
|
|
|
String keyword, String user_tel, Long fromDate, Long endDate) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
ModelMap map = new ModelMap();
|
|
|
PageInfo pageInfo = setPageInfo(page, size);
|
|
|
SearchFilter filter = new SearchFilter();
|
|
|
@@ -334,6 +366,7 @@ public class PublicInquiryController {
|
|
|
map.put("content", publicInquiryService.covertRemindToInquiry(saleService.findRemindByPageInfo(pageInfo, filter).getContent()));
|
|
|
return map;
|
|
|
}
|
|
|
+ log.info("/inquiry/public/mobile/v2 耗时:" + (System.currentTimeMillis() - start));
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -349,6 +382,7 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/quotation/list", method = RequestMethod.GET)
|
|
|
public IPage<PublicInquiryItemInfo> getQuotation(PageInfo pageInfo, String filter, String _state, Short overdue) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
SearchFilter searchFilter = JSONObject.parseObject(filter, SearchFilter.class);
|
|
|
if (null != searchFilter.getVendUU()) {
|
|
|
pageInfo.filter("vendUU", searchFilter.getVendUU());
|
|
|
@@ -361,7 +395,9 @@ public class PublicInquiryController {
|
|
|
pageInfo = publicInquiryService.covert(pageInfo, _state, overdue);
|
|
|
}
|
|
|
logger.log("公共询价", "查询已转报价询价列表信息", "状态: " + _state == null ? "all" : _state, searchFilter.getUserUU(), searchFilter.getEnUU(), InquirySource.PLAIN.name());
|
|
|
- return publicInquiryService.findByPageInfo(pageInfo, searchFilter);
|
|
|
+ IPage<PublicInquiryItemInfo> inquiryItemInfoIPage = publicInquiryService.findByPageInfo(pageInfo, searchFilter);
|
|
|
+ log.info("/inquiry/public/quotation/list 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return inquiryItemInfoIPage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -373,10 +409,13 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/quotation/one", method = RequestMethod.GET)
|
|
|
public PublicInquiryItemInfo getQuotationById(Long id, Long enuu, Long useruu) throws AccessException {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
if (StringUtils.isEmpty(enuu) || StringUtils.isEmpty(useruu)) {
|
|
|
throw new IllegalAccessError("暂无访问权限");
|
|
|
}
|
|
|
- return publicInquiryService.findOneInfo(id, enuu, useruu);
|
|
|
+ PublicInquiryItemInfo info = publicInquiryService.findOneInfo(id, enuu, useruu);
|
|
|
+ log.info("/inquiry/public/quotation/one 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return info;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -390,11 +429,14 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/quotationList", method = RequestMethod.GET)
|
|
|
public Page<PublicInquiryItemInfo> getQuotationList(PageInfo pageInfo, String filter, String _state, Short overdue) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
SearchFilter searchFilter = JSONObject.parseObject(filter, SearchFilter.class);
|
|
|
if (null != _state) {
|
|
|
pageInfo = publicInquiryService.covert(pageInfo, _state, overdue);
|
|
|
}
|
|
|
- return publicInquiryService.findListByPageInfo(pageInfo, searchFilter);
|
|
|
+ Page<PublicInquiryItemInfo> itemInfoPage = publicInquiryService.findListByPageInfo(pageInfo, searchFilter);
|
|
|
+ log.info("/inquiry/public/quotationList 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return itemInfoPage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -407,8 +449,11 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/messageList", method = RequestMethod.GET)
|
|
|
public List<InquiryMessage> getList(Long enuu, Integer size) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
logger.log("公共询价", "获取最新的公共询价", "大小: " + size, Constant.UU, enuu, InquirySource.PLAIN.name());
|
|
|
- return publicInquiryService.getMessageList(enuu, size);
|
|
|
+ List<InquiryMessage> messages = publicInquiryService.getMessageList(enuu, size);
|
|
|
+ log.info("/inquiry/public/messageList 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return messages;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -420,7 +465,10 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/attachUrl", method = RequestMethod.GET)
|
|
|
public com.uas.ps.inquiry.model.Attach getAttach(Long id) {
|
|
|
- return attachService.findById(id);
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ Attach attach = attachService.findById(id);
|
|
|
+ log.info("/inquiry/public/atatchUrl 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return attach;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -432,8 +480,11 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/findInquiryById", method = RequestMethod.GET)
|
|
|
public PurcInquiry findById(Long id, Long enuu) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
logger.log("公共询价", "获取询价信息", "id: " + id, Constant.UU, enuu, InquirySource.PLAIN.name());
|
|
|
- return publicInquiryService.findInquiryById(id);
|
|
|
+ PurcInquiry inquiry = publicInquiryService.findInquiryById(id);
|
|
|
+ log.info("/inquiry/public/findInquiryById 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return inquiry;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -444,7 +495,10 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/findCodeRankingList", method = RequestMethod.GET)
|
|
|
public List<Map<String, Object>> findCodeRankingList() {
|
|
|
- return publicInquiryService.findCodeRankingList();
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ List<Map<String, Object>> list = publicInquiryService.findCodeRankingList();
|
|
|
+ log.info("/inquiry/public/findCodeRankingList 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -457,8 +511,11 @@ public class PublicInquiryController {
|
|
|
@HttpLog
|
|
|
@RequestMapping(value = "/findItemByItemId", method = RequestMethod.GET)
|
|
|
public PurcInquiryItemInfo findItemByItemId(Long itemId, Long enuu) {
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ PurcInquiryItemInfo itemInfo = publicInquiryService.findItemByItemId(itemId, enuu);
|
|
|
logger.log("公共询价", "获取询价信息", "id: " + itemId, Constant.UU, enuu, InquirySource.B2B.name());
|
|
|
- return publicInquiryService.findItemByItemId(itemId, enuu);
|
|
|
+ log.info("/inquiry/public/findItemByItemId 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return itemInfo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -468,7 +525,10 @@ public class PublicInquiryController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/getPurcInquiryItemCount", method = RequestMethod.GET)
|
|
|
public ModelMap getPurcInquiryItemCount() {
|
|
|
- return publicInquiryService.getPurcInquiryItemCount();
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ ModelMap map = publicInquiryService.getPurcInquiryItemCount();
|
|
|
+ log.info("/inquiry/public/getPurcInquiryItemCount 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -479,6 +539,9 @@ public class PublicInquiryController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/getPurcInquiryItemCountByMonth", method = RequestMethod.GET)
|
|
|
public ModelMap getPurcInquiryItemCountByMonth(Integer year, Integer month) {
|
|
|
- return publicInquiryService.countByMonth(year, month);
|
|
|
+ long start = System.currentTimeMillis();
|
|
|
+ ModelMap map = publicInquiryService.countByMonth(year, month);
|
|
|
+ log.info("/inquiry/public/getPurcInquiryItemCountByMonth 耗时:" + (System.currentTimeMillis() - start));
|
|
|
+ return map;
|
|
|
}
|
|
|
}
|