|
|
@@ -1,28 +1,10 @@
|
|
|
package com.uas.platform.b2b.erp.controller;
|
|
|
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.URLDecoder;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.ui.ModelMap;
|
|
|
-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.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.uas.account.support.Page;
|
|
|
import com.uas.platform.b2b.dao.VendorDao;
|
|
|
-import com.uas.platform.b2b.erp.model.B2BCustomer;
|
|
|
-import com.uas.platform.b2b.erp.model.B2BVendor;
|
|
|
-import com.uas.platform.b2b.erp.model.PageInfo;
|
|
|
-import com.uas.platform.b2b.erp.model.VendorInfo;
|
|
|
-import com.uas.platform.b2b.erp.model.VendorRate;
|
|
|
+import com.uas.platform.b2b.erp.model.*;
|
|
|
import com.uas.platform.b2b.erp.support.ErpBufferedLogger;
|
|
|
import com.uas.platform.b2b.model.InvitationRecord;
|
|
|
import com.uas.platform.b2b.model.SearchFilter;
|
|
|
@@ -35,13 +17,25 @@ import com.uas.platform.b2b.service.UserService;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.temporary.model.BasePartnersInfo;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
-import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.util.serializer.FlexJsonUtils;
|
|
|
import com.uas.search.b2b.model.MultiValue;
|
|
|
import com.uas.search.b2b.model.PageParams;
|
|
|
import com.uas.search.b2b.model.Sort;
|
|
|
import com.uas.search.b2b.util.SearchConstants;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
+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 java.io.UnsupportedEncodingException;
|
|
|
+import java.net.URLDecoder;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
@Controller
|
|
|
@@ -73,16 +67,20 @@ public class VendorRateController {
|
|
|
*/
|
|
|
@RequestMapping(method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<B2BVendor> getVendors(@RequestParam("pageInfo") String pageInfo) throws UnsupportedEncodingException {
|
|
|
+ public Page<B2BVendor> getVendors(@RequestParam("pageInfo") String pageInfo, @RequestParam("vendUUs") String vendor) throws UnsupportedEncodingException {
|
|
|
String jsonStr = URLDecoder.decode(pageInfo, "UTF-8");
|
|
|
PageInfo info = JSON.parseObject(jsonStr, PageInfo.class);
|
|
|
+ vendor = URLDecoder.decode(vendor, "UTF-8");
|
|
|
+ List<Object> vendUUs = JSON.parseArray(vendor, Object.class);
|
|
|
String keyword = info.getKeyword();
|
|
|
PageParams pageParams = new PageParams();
|
|
|
pageParams.setSize(info.getPageSize());
|
|
|
pageParams.setPage(info.getPageNumber());
|
|
|
ModelMap map = new ModelMap();
|
|
|
map.put("ve_myenuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- map.put("ve_vendswitch", Constant.YES);
|
|
|
+ ModelMap notMap = new ModelMap();
|
|
|
+ notMap.put("ve_vendenuu", new MultiValue(vendUUs, true));
|
|
|
+ pageParams.setNotEqualFilters(notMap);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("ve_id", false, Sort.Type.LONG, new Long(1)));
|
|
|
map.put(SearchConstants.SORT_KEY, sortList);
|
|
|
@@ -96,27 +94,30 @@ public class VendorRateController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/customer", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<B2BCustomer> getCustomers(@RequestParam("pageInfo") String pageInfo) throws UnsupportedEncodingException {
|
|
|
+ public Page<B2BCustomer> getCustomers(@RequestParam("pageInfo") String pageInfo, @RequestParam("custUUs") String customer) throws UnsupportedEncodingException {
|
|
|
String jsonStr = URLDecoder.decode(pageInfo, "UTF-8");
|
|
|
PageInfo info = JSON.parseObject(jsonStr, PageInfo.class);
|
|
|
+ customer = URLDecoder.decode(customer, "UTF-8");
|
|
|
+ List<Object> custUUs = JSON.parseArray(customer, Object.class);
|
|
|
String keyword = info.getKeyword();
|
|
|
com.uas.search.b2b.model.PageParams pageParams = new com.uas.search.b2b.model.PageParams();
|
|
|
pageParams.setSize(info.getPageSize());
|
|
|
pageParams.setPage(info.getPageNumber());
|
|
|
ModelMap map = new ModelMap();
|
|
|
map.put("ve_vendenuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
- map.put("ve_custswitch", Constant.YES);
|
|
|
-
|
|
|
+ ModelMap notMap = new ModelMap();
|
|
|
+ notMap.put("ve_myenuu", new MultiValue(custUUs, true));
|
|
|
+ pageParams.setNotEqualFilters(notMap);
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
SearchFilter filter = userService.distribute();
|
|
|
- if (filter != null && filter.getDistribute() == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- if (filter != null && !org.springframework.util.CollectionUtils.isEmpty(filter.getDistribute())) {
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
- list.addAll(filter.getDistribute());
|
|
|
- map.put("ve_myenuu", new MultiValue(list, true));
|
|
|
- }
|
|
|
+// if (filter != null && filter.getDistribute() == null) {
|
|
|
+// return null;
|
|
|
+// }
|
|
|
+// if (filter != null && !org.springframework.util.CollectionUtils.isEmpty(filter.getDistribute())) {
|
|
|
+// List<Object> list = new ArrayList<>();
|
|
|
+// list.addAll(filter.getDistribute());
|
|
|
+// map.put("ve_myenuu", new MultiValue(list, true));
|
|
|
+// }
|
|
|
sortList.add(new Sort("ve_id", false, Sort.Type.LONG, new Long(1)));
|
|
|
map.put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.setFilters(map);
|
|
|
@@ -126,22 +127,26 @@ public class VendorRateController {
|
|
|
/**
|
|
|
* UAS新的合作伙伴<br>
|
|
|
* 请求者的名义查看个人的发出的请求<br>
|
|
|
- * 已通过
|
|
|
+ * 已通过(全部合作伙伴)
|
|
|
*
|
|
|
* @param data
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/request", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Page<BasePartnersInfo> getDoneRequest(@RequestParam("data") String data) throws Exception {
|
|
|
+ public Page<BasePartnersInfo> getDoneRequest(@RequestParam("data") String data, @RequestParam("vendUUs") String vendor, @RequestParam("custUUs") String customer) throws Exception {
|
|
|
String jsonStr = URLDecoder.decode(data, "UTF-8");
|
|
|
PageInfo info = JSON.parseObject(jsonStr, PageInfo.class);
|
|
|
+ vendor = URLDecoder.decode(vendor, "UTF-8");
|
|
|
+ List<Long> vendUUs = JSON.parseArray(vendor, Long.class);
|
|
|
+ customer = URLDecoder.decode(customer, "UTF-8");
|
|
|
+ List<Long> custUUs = JSON.parseArray(customer, Long.class);
|
|
|
String keyword = info.getKeyword();
|
|
|
PageParams pageParams = new PageParams();
|
|
|
pageParams.setSize(info.getPageSize());
|
|
|
pageParams.setPage(info.getPageNumber());
|
|
|
return addPartnerService.findByBusCodeAndKeyWordForERP(keyword, Status.ENABLED.value(), pageParams.getSize(),
|
|
|
- pageParams.getPage());
|
|
|
+ pageParams.getPage(), vendUUs, custUUs);
|
|
|
}
|
|
|
|
|
|
|