|
@@ -1,7 +1,24 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
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.JSON;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.model.SaleQuotationAll;
|
|
import com.uas.platform.b2b.model.SaleQuotationAll;
|
|
|
import com.uas.platform.b2b.model.SaleQuotationItem;
|
|
import com.uas.platform.b2b.model.SaleQuotationItem;
|
|
@@ -24,20 +41,6 @@ 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.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;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 卖家主动报价
|
|
* 卖家主动报价
|
|
@@ -194,6 +197,113 @@ public class SaleQuotationController {
|
|
|
return searchService.searchSaleQuotationIds(keyword, pageParams);
|
|
return searchService.searchSaleQuotationIds(keyword, pageParams);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,查看自己的主动报价单(待提交)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<SaleQuotationAll> getSalQuotationInfoTodo(PageParams params, String searchFilter) {
|
|
|
|
|
+ logger.log("主动报价单", "查看主动报价单-未提交");
|
|
|
|
|
+ // 当前登录企业作为供应商
|
|
|
|
|
+ SearchFilter filter = new SearchFilter();
|
|
|
|
|
+ SearchFilter filters = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
|
|
+ filter.setEndDate(filters.getEndDate());
|
|
|
|
|
+ filter.setFromDate(filters.getFromDate());
|
|
|
|
|
+ SearchFilter disfilter = userService.distribute();
|
|
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filter.setDistribute(disfilter.getDistribute());
|
|
|
|
|
+ }
|
|
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
|
|
+ pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ pageInfo.filter("status", Status.INPUTTING.value());
|
|
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(pageInfo, null, filters);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,查看自己的主动报价单(已提交)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<SaleQuotationAll> getSalQuotationInfoDone(PageParams params, String searchFilter) {
|
|
|
|
|
+ logger.log("主动报价单", "查看主动报价单-已提交");
|
|
|
|
|
+ // 当前登录企业作为供应商
|
|
|
|
|
+ SearchFilter filter = new SearchFilter();
|
|
|
|
|
+ SearchFilter filters = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
|
|
+ filter.setEndDate(filters.getEndDate());
|
|
|
|
|
+ filter.setFromDate(filters.getFromDate());
|
|
|
|
|
+ SearchFilter disfilter = userService.distribute();
|
|
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filter.setDistribute(disfilter.getDistribute());
|
|
|
|
|
+ }
|
|
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
|
|
+ pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ pageInfo.filter("status", Status.SUBMITTED.value());
|
|
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(pageInfo, null, filter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,查看自己的主动报价单(已失效)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/info", params = RequestState.INVALID, method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<SaleQuotationAll> getSalQuotationInfoInvalid(PageParams params, String searchFilter) {
|
|
|
|
|
+ logger.log("主动报价单", "查看主动报价单-已失效");
|
|
|
|
|
+ // 当前登录企业作为供应商
|
|
|
|
|
+ SearchFilter filter = new SearchFilter();
|
|
|
|
|
+ SearchFilter filters = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
|
|
+ filter.setEndDate(filters.getEndDate());
|
|
|
|
|
+ filter.setFromDate(filters.getFromDate());
|
|
|
|
|
+ SearchFilter disfilter = userService.distribute();
|
|
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filter.setDistribute(disfilter.getDistribute());
|
|
|
|
|
+ }
|
|
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
|
|
+ pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ pageInfo.filter("overdue", Constant.YES);
|
|
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(pageInfo, null, filter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 作为卖家,查看自己的主动报价单(全部)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param params
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.GET)
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public SPage<SaleQuotationAll> getSalQuotationInfo(PageParams params, String searchFilter) {
|
|
|
|
|
+ logger.log("主动报价单", "查看主动报价单-全部");
|
|
|
|
|
+ // 当前登录企业作为供应商
|
|
|
|
|
+ SearchFilter filter = new SearchFilter();
|
|
|
|
|
+ SearchFilter filters = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
|
|
+ filter.setEndDate(filters.getEndDate());
|
|
|
|
|
+ filter.setFromDate(filters.getFromDate());
|
|
|
|
|
+ SearchFilter disfilter = userService.distribute();
|
|
|
|
|
+ if (filter != null && filter.getDistribute() == null) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filter.setDistribute(disfilter.getDistribute());
|
|
|
|
|
+ }
|
|
|
|
|
+ PageInfo pageInfo = new PageInfo(params);
|
|
|
|
|
+ pageInfo.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
|
|
+ return saleQuotationService.findAllDetailByPageInfo(pageInfo, null, filter);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 作为卖家,主动报价
|
|
* 作为卖家,主动报价
|
|
|
*
|
|
*
|