|
|
@@ -1,5 +1,23 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+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.ResponseBody;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
+
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.model.FileUpload;
|
|
|
@@ -14,6 +32,7 @@ import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
import com.uas.platform.b2b.temporary.model.InquiryMessage;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
+import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
@@ -23,19 +42,6 @@ import com.uas.search.b2b.model.SPage;
|
|
|
import com.uas.search.b2b.model.Sort;
|
|
|
import com.uas.search.b2b.model.Sort.Type;
|
|
|
import com.uas.search.b2b.util.SearchConstants;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
-
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 卖家对询价单的操作
|
|
|
@@ -195,34 +201,6 @@ public class SaleInquiryController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
|
|
|
}
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 作为卖家,收到的采购询价(已作废)
|
|
|
-// *
|
|
|
-// * @param params
|
|
|
-// */
|
|
|
-// @RequestMapping(params = RequestState.INVALID, method = RequestMethod.GET)
|
|
|
-// @ResponseBody
|
|
|
-// public SPage<PurchaseInquiryItem> getInvalidInquiries(PageParams params, String keyword) {
|
|
|
-// logger.log("客户询价单", "查看收到的客户询价单列表(已作废)");
|
|
|
-// com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
-// // 当前登录企业作为供应商
|
|
|
-// pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
-// SearchFilter filter = userService.distribute();
|
|
|
-// if (filter != null && filter.getDistribute() == null) {
|
|
|
-// return null;
|
|
|
-// }
|
|
|
-// if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
|
|
|
-// List<Object> list = new ArrayList<>();
|
|
|
-// list.addAll(filter.getDistribute());
|
|
|
-// pageParams.getFilters().put("id_inid", new MultiValue(list, true));
|
|
|
-// }
|
|
|
-// pageParams.getFilters().put("id_status", Status.DISABLED.value());
|
|
|
-// List<Sort> sortList = new ArrayList<>();
|
|
|
-// sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
|
|
|
-// pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
-// return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
|
|
|
-// }
|
|
|
|
|
|
/**
|
|
|
* 作为卖家,收到的采购询价(已失效)
|
|
|
@@ -325,6 +303,196 @@ public class SaleInquiryController {
|
|
|
return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(全部)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiries(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(全部)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(待报价)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesTodo(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(待报价)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("status", Status.NOT_REPLY.value());
|
|
|
+ pageInfo.filter("overdue", Constant.NO);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已过期)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.END, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesEnd(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("overdue", Constant.YES);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已回复)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesDone(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("overdue", Constant.NO);
|
|
|
+ pageInfo.filter("status", Status.REPLIED.value());
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已过期)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.INVALID, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesInvalid(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("overdue", Constant.YES);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已过期)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.REFUSED, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesRefused(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("overdue", Constant.YES);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已过期)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.AGREED, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getPurchaseInquiriesAgreed(PageParams params, String searchFilter) {
|
|
|
+ logger.log("客户询价单", "查看收到的客户询价单列表(已过期)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("overdue", Constant.YES);
|
|
|
+ SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
+ SearchFilter filters = userService.distribute();
|
|
|
+ if (filters != null && filters.getDistribute() == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
+ List<Object> list = new ArrayList<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 作为卖家,收到的采购询价明细
|
|
|
*
|