Browse Source

询价单增加采纳未采纳状态筛选

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8723 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
977632782e

+ 36 - 0
src/main/java/com/uas/platform/b2b/controller/PurcInquiryController.java

@@ -220,6 +220,42 @@ public class PurcInquiryController {
 		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
 	}
 
+	/**
+	 * 已采纳
+	 * 
+	 * @return
+	 */
+	@RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
+	public SPage<PurchaseInquiryItem> getAgreedInquiries(PageParams params, String keyword) {
+		logger.log("客户询价单", "查看收到的客户询价单列表(待回复)");
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("id_inid", SystemSession.getUser().getEnterprise().getUu());
+		pageParams.getFilters().put("id_agreed", Constant.YES);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
+	}
+
+	/**
+	 * 未采纳
+	 * 
+	 * @return
+	 */
+	@RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
+	public SPage<PurchaseInquiryItem> getRefusedInquiries(PageParams params, String keyword) {
+		logger.log("客户询价单", "查看收到的客户询价单列表(待回复)");
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("id_inid", SystemSession.getUser().getEnterprise().getUu());
+		pageParams.getFilters().put("id_agreed", Constant.NO);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
+	}
+
 	// /**
 	// * 未提交(主表查询,不建索引)
 	// *

+ 80 - 13
src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java

@@ -1,5 +1,23 @@
 package com.uas.platform.b2b.controller;
 
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+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.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.uas.platform.b2b.model.FileUpload;
 import com.uas.platform.b2b.model.PurchaseInquiryItem;
 import com.uas.platform.b2b.model.SearchFilter;
@@ -22,19 +40,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.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * 卖家对询价单的操作
@@ -181,6 +186,68 @@ public class SaleInquiryController {
 		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
 	}
 
+	/**
+	 * 作为卖家,收到的采购询价(已采纳)
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(params = RequestState.AGREED, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<PurchaseInquiryItem> getAgreedInquiries(PageParams params, String keyword) {
+		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
+		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("id_inid", new MultiValue(list, true));
+		}
+		pageParams.getFilters().put("id_agreed", Constant.YES);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
+	}
+
+	/**
+	 * 作为卖家,收到的采购询价(已采纳)
+	 * 
+	 * @param params
+	 * @return
+	 */
+	@RequestMapping(params = RequestState.REFUSED, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<PurchaseInquiryItem> getRefusedInquiries(PageParams params, String keyword) {
+		logger.log("客户询价单", "查看收到的客户询价单列表(已回复)");
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("id_venduu", SystemSession.getUser().getEnterprise().getUu());
+		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("id_inid", new MultiValue(list, true));
+		}
+		pageParams.getFilters().put("id_agreed", Constant.NO);
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("id_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurchaseInquiryItemIds(keyword, pageParams);
+	}
+
 	/**
 	 * 作为卖家,收到的采购询价明细
 	 * 

+ 6 - 0
src/main/webapp/resources/js/index/app.js

@@ -1925,6 +1925,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			fn = 'getWaiting';break;
 		case 'invalid':
 			fn = 'getInvalid';break;
+		// 已采纳
+		case 'agreed':
+			fn = 'getAgreed';break;
+		// 未采纳
+		case 'refused':
+			fn = 'getRefused';break;
 		}
 		return fn;
 	};

+ 20 - 0
src/main/webapp/resources/js/index/services/Purc.js

@@ -140,6 +140,16 @@ define([ 'ngResource'], function() {
                     _state: 'end'
                 }
             },
+            getAgreed: {
+            	params: {
+                    _state: 'agreed'
+                }
+            },
+            getRefused: {
+            	params: {
+                    _state: 'refused'
+                }
+            },
             reply: {
                 url: 'sale/inquiry/items/:itemId/reply',
                 method: 'POST',
@@ -856,6 +866,16 @@ define([ 'ngResource'], function() {
                 },
                 method: 'GET'
 			},
+			getAgreed: {
+            	params: {
+                    _state: 'agreed'
+                }
+            },
+            getRefused: {
+            	params: {
+                    _state: 'refused'
+                }
+            },
 			getAll: {
 				method: 'GET'
 			},

+ 8 - 0
src/main/webapp/resources/tpl/index/purc/inquiry.html

@@ -309,6 +309,14 @@ margin-left: 55px;
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已过期</button>
 					</div>
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+								ng-class="{'btn-info':active=='agreed'}" ng-click="setActive('agreed')">已采纳</button>
+					</div>
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+								ng-class="{'btn-info':active=='refused'}" ng-click="setActive('refused')">未采纳</button>
+					</div>
 				</div>
 			</div>
 			<div class="inquiry-cz col-xs-2">

+ 8 - 0
src/main/webapp/resources/tpl/index/sale/inquiry.html

@@ -151,6 +151,14 @@
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已过期</button>
 					</div>
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+								ng-class="{'btn-info':active=='agreed'}" ng-click="setActive('agreed')">已采纳</button>
+					</div>
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+								ng-class="{'btn-info':active=='refused'}" ng-click="setActive('refused')">未采纳</button>
+					</div>
 				</div>
 			</div>
 			<!--<div class="col-xs-5">