|
|
@@ -1,8 +1,31 @@
|
|
|
package com.uas.platform.b2b.controller;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+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.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.dubbo.common.utils.CollectionUtils;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.uas.platform.b2b.model.*;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrder;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderAll;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderItem;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderReply;
|
|
|
+import com.uas.platform.b2b.model.SearchFilter;
|
|
|
import com.uas.platform.b2b.search.SearchService;
|
|
|
import com.uas.platform.b2b.service.PurchaseOrderService;
|
|
|
import com.uas.platform.b2b.service.UserService;
|
|
|
@@ -21,20 +44,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.Page;
|
|
|
-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.web.bind.annotation.*;
|
|
|
-import org.springframework.web.servlet.ModelAndView;
|
|
|
-
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 卖家对订单的操作
|
|
|
@@ -161,7 +170,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items", params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderTodo> getTodoPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getTodoPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待回复)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -183,7 +192,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_status", Status.NOT_REPLY.value());
|
|
|
- return searchService.searchPurchaseTodoOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -194,7 +203,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items", params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderDone> getDonePurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getDonePurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已回复)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -219,7 +228,7 @@ public class SaleOrderController {
|
|
|
ModelMap map = new ModelMap();
|
|
|
map.put("pu_end", Constant.YES); // 过滤掉已结案状态的
|
|
|
pageParams.setNotEqualFilters(map);
|
|
|
- return searchService.searchPurchaseDoneOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -230,7 +239,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items", params = RequestState.END, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderEnd> getEndPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getEndPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已结案)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -252,7 +261,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_end", Constant.YES);
|
|
|
- return searchService.searchaPurchaseEndOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -262,7 +271,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items", params = RequestState.RECEIVED, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderReceived> getReceivedPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getReceivedPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(已收货)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -284,7 +293,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_venduu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_end", Constant.YES);
|
|
|
- return searchService.searchPurchaseReceivedOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -294,7 +303,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items", params = RequestState.WAITING, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderWaiting> getWaitingPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getWaitingPurchaseOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("客户采购单", "查看收到的客户采购订单列表(包括采购明细)(待交货)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -319,7 +328,7 @@ public class SaleOrderController {
|
|
|
map.put("pu_end", Constant.YES);
|
|
|
map.put("pu_end", 2); // 建索引时,将不处于已结案状态,但是货物全部交接完毕的单,end值设为了2
|
|
|
pageParams.setNotEqualFilters(map);
|
|
|
- return searchService.searchPurchaseWaitingOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -588,7 +597,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/purc", params = RequestState.TODO, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderTodo> getTodoPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getTodoPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("平台采购单", "查看发出的采购订单列表(包括采购明细)(待回复)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -610,7 +619,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_status", Status.NOT_REPLY);
|
|
|
- return searchService.searchPurchaseTodoOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -621,7 +630,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/purc", params = RequestState.DONE, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderDone> getDonePurcOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getDonePurcOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("平台采购单", "查看收到的采购订单列表(包括采购明细)(已回复)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -643,7 +652,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_reply", Constant.YES);
|
|
|
- return searchService.searchPurchaseDoneOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -654,7 +663,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/purc", params = RequestState.END, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderEnd> getEndPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getEndPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("平台采购单", "查看收到的采购订单列表(包括采购明细)(已结案)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -676,7 +685,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
|
|
|
pageParams.getFilters().put("pu_enuu", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageParams.getFilters().put("pu_end", Constant.YES);
|
|
|
- return searchService.searchaPurchaseEndOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -686,7 +695,7 @@ public class SaleOrderController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/items/purc", params = RequestState.WAITING, method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public SPage<PurchaseOrderWaiting> getWaitingPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
+ public SPage<PurchaseOrderAll> getWaitingPurcOrderItems(PageParams params, String searchFilter) {
|
|
|
logger.log("平台采购单", "查看收到的采购订单列表(包括采购明细)(待交货)");
|
|
|
JSONObject jsonObject = JSONObject.parseObject(searchFilter);
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
@@ -709,7 +718,7 @@ public class SaleOrderController {
|
|
|
pageParams.getFilters().put("pu_venduu", new MultiValue(list, true));
|
|
|
}
|
|
|
pageParams.getFilters().put("pu_end", Constant.NO);
|
|
|
- return searchService.searchPurchaseWaitingOrderIds(keyword, pageParams);
|
|
|
+ return searchService.searchPurchaseOrderIds(keyword, pageParams);
|
|
|
}
|
|
|
|
|
|
/**
|