|
@@ -1,29 +1,6 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-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.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.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.model.*;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.AttachService;
|
|
import com.uas.platform.b2b.service.AttachService;
|
|
|
import com.uas.platform.b2b.service.PurchaseProofingService;
|
|
import com.uas.platform.b2b.service.PurchaseProofingService;
|
|
@@ -42,6 +19,23 @@ import com.uas.search.b2b.model.SPage;
|
|
|
import com.uas.search.b2b.model.Sort;
|
|
import com.uas.search.b2b.model.Sort;
|
|
|
import com.uas.search.b2b.model.Sort.Type;
|
|
import com.uas.search.b2b.model.Sort.Type;
|
|
|
import com.uas.search.b2b.util.SearchConstants;
|
|
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.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.ArrayList;
|
|
|
|
|
+import java.util.HashSet;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 卖家获取对应的客户打样申请单
|
|
* 卖家获取对应的客户打样申请单
|
|
@@ -219,7 +213,7 @@ public class SaleSampleController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 作为卖家,分页获取客户的打样认定单
|
|
|
|
|
|
|
+ * 作为卖家,分页获取客户的打样认定单(全部)
|
|
|
*
|
|
*
|
|
|
* @param json
|
|
* @param json
|
|
|
* @return
|
|
* @return
|
|
@@ -256,6 +250,84 @@ public class SaleSampleController {
|
|
|
return searchService.searchPurchaseProofingApprovalIds(keyword, pageParams);
|
|
return searchService.searchPurchaseProofingApprovalIds(keyword, pageParams);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,分页获取客户的打样认定单(合格)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param json
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/approval", params = RequestState.AGREED, method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<PurchaseProofingApproval> getQualifiedProofingApprovals(PageParams params, String keyword, Long fromDate,
|
|
|
|
|
+ Long endDate) {
|
|
|
|
|
+ logger.log("客户认定单", "查看所有客户认定单");
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
|
|
+ pageParams.getFilters().put("psa_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ pageParams.getFilters().put("psa_finalresult", "合格");
|
|
|
|
|
+ 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("psa_enuu", new MultiValue(list, true));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fromDate != null) {
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.FROM_DATE_KEY, fromDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (endDate != null) {
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.END_DATE_KEY, endDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
|
+ sortList.add(new Sort("psa_indate", false, Type.LONG, new Long(946659661)));
|
|
|
|
|
+ sortList.add(new Sort("psa_id", false, Type.LONG, new Long(1)));
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
|
|
+ return searchService.searchPurchaseProofingApprovalIds(keyword, pageParams);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,分页获取客户的打样认定单(不合格)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param json
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/approval", params = RequestState.REFUSED, method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<PurchaseProofingApproval> getUnqualifiedProofingApprovals(PageParams params, String keyword, Long fromDate,
|
|
|
|
|
+ Long endDate) {
|
|
|
|
|
+ logger.log("客户认定单", "查看所有客户认定单");
|
|
|
|
|
+ // 判断当前用户是否被客户分配
|
|
|
|
|
+ com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
|
|
|
|
|
+ pageParams.getFilters().put("psa_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ pageParams.getFilters().put("psa_finalresult", "不合格");
|
|
|
|
|
+ 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("psa_enuu", new MultiValue(list, true));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (fromDate != null) {
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.FROM_DATE_KEY, fromDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (endDate != null) {
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.END_DATE_KEY, endDate);
|
|
|
|
|
+ }
|
|
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
|
|
+ sortList.add(new Sort("psa_indate", false, Type.LONG, new Long(946659661)));
|
|
|
|
|
+ sortList.add(new Sort("psa_id", false, Type.LONG, new Long(1)));
|
|
|
|
|
+ pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
|
|
+ return searchService.searchPurchaseProofingApprovalIds(keyword, pageParams);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 作为卖家,根据ID获取客户的打样认定单详细界面
|
|
* 作为卖家,根据ID获取客户的打样认定单详细界面
|
|
|
*
|
|
*
|