|
|
@@ -1,8 +1,33 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+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.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.*;
|
|
|
+import com.uas.platform.b2b.model.Attach;
|
|
|
+import com.uas.platform.b2b.model.FileUpload;
|
|
|
+import com.uas.platform.b2b.model.PurchaseProofingApproval;
|
|
|
+import com.uas.platform.b2b.model.PurchaseProofingItem;
|
|
|
+import com.uas.platform.b2b.model.PurchaseProofingSend;
|
|
|
+import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.AttachService;
|
|
|
import com.uas.platform.b2b.service.PurchaseProofingService;
|
|
|
@@ -21,21 +46,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.PathVariable;
|
|
|
-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 java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 卖家获取对应的客户打样申请单
|
|
|
@@ -161,6 +171,7 @@ public class SaleSampleController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
return searchService.searchPurchaseProofingItemIds(keyword, pageParams);
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 作为卖家,分页获取客户的打样申请单(已作废)
|
|
|
*
|
|
|
@@ -195,6 +206,116 @@ public class SaleSampleController {
|
|
|
return searchService.searchPurchaseProofingItemIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 作为卖家,分页获取客户的打样申请单
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseProofingItem> getAllProofingItems(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 : filters.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseProofingService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,分页获取客户的打样申请单(待处理)
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.TODO)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseProofingItem> getTodoItems(PageParams params, String searchFilter) {
|
|
|
+ // 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
+ logger.log("客户打样申请", "查看客户打样申请(待处理)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("status", Status.UNSEND.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 : filters.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseProofingService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,分页获取客户的打样申请单(已处理)
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.DONE)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseProofingItem> getDoneItems(PageParams params, String searchFilter) {
|
|
|
+ // 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
+ logger.log("客户打样申请", "查看客户打样申请(已处理)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("status", Status.SEND.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 : filters.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseProofingService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作为卖家,分页获取客户的打样申请单(已作废)
|
|
|
+ *
|
|
|
+ * @param json
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET, params = RequestState.INVALID)
|
|
|
+ @ResponseBody
|
|
|
+ public SPage<PurchaseProofingItem> getInvalidItems(PageParams params, String searchFilter) {
|
|
|
+ // 我作为卖家,把我的企业ID作为供应商ID传入
|
|
|
+ logger.log("客户打样申请", "查看客户打样申请(已作废)");
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
+ pageInfo.filter("status", Status.CANCELLED.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 : filters.getDistribute()) {
|
|
|
+ list.add(object);
|
|
|
+ }
|
|
|
+ filter.setDistribute(list);
|
|
|
+ }
|
|
|
+ return purchaseProofingService.findByPageInfo(pageInfo, null, filter);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 作为卖家,根据打样申请明细ID查找客户客户打样申请明细
|
|
|
*
|