|
|
@@ -1,5 +1,23 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
+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.uas.platform.b2b.model.FileUpload;
|
|
|
import com.uas.platform.b2b.model.PurchaseInquiryItem;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
@@ -22,19 +40,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.data.domain.Sort.Direction;
|
|
|
-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.List;
|
|
|
|
|
|
/**
|
|
|
* 卖家对询价单的操作
|
|
|
@@ -181,6 +186,68 @@ public class SaleInquiryController {
|
|
|
return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已采纳)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getAgreedInquiries(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<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("id_inid", new MultiValue(list, true));
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("id_agreed", Constant.YES);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,收到的采购询价(已采纳)
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseInquiryItem> getRefusedInquiries(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<>();
|
|
|
+ for (Object object : filter.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("id_inid", new MultiValue(list, true));
|
|
|
+ }
|
|
|
+ pageParams.getFilters().put("id_agreed", Constant.NO);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 作为卖家,收到的采购询价明细
|
|
|
*
|