Forráskód Böngészése

主动报价获取数据方式进行更新

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9765 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 éve
szülő
commit
9a7b601c91

+ 125 - 15
src/main/java/com/uas/platform/b2b/controller/SaleQuotationController.java

@@ -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);
+	}
+
 	/**
 	/**
 	 * 作为卖家,主动报价
 	 * 作为卖家,主动报价
 	 * 
 	 * 

+ 9 - 2
src/main/webapp/resources/js/index/app.js

@@ -4875,7 +4875,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	
 	
 	
 	
 	// 主动报价 - 列表
 	// 主动报价 - 列表
-	app.controller('SaleQuotationListCtrl', ['$scope', '$filter', 'Quotation', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', '$rootScope', function($scope, $filter, Quotation, PurcInquiry, ngTableParams, toaster, BaseService, $rootScope){
+	app.controller('SaleQuotationListCtrl', ['$scope', '$filter', 'Quotation', 'PurcInquiry', 'ngTableParams', 'toaster', 'BaseService', '$rootScope', 'QuotationInfo', function($scope, $filter, Quotation, PurcInquiry, ngTableParams, toaster, BaseService, $rootScope, QuotationInfo){
 		BaseService.scrollBackToTop();
 		BaseService.scrollBackToTop();
 		$rootScope.enteryStatus = false;
 		$rootScope.enteryStatus = false;
 		$scope.active = 'todo';
 		$scope.active = 'todo';
@@ -4909,8 +4909,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					$scope.tableParams.page(1);
 					$scope.tableParams.page(1);
 			}
 			}
 		};
 		};
+		
+		$scope.searchMethod = false;
 		var getService = function() {
 		var getService = function() {
-			return Quotation;
+			if($scope.searchMethod) {
+				return Quotation;
+			} else {
+				return QuotationInfo;
+			}
 		};
 		};
 		$scope.tableParams = new ngTableParams({
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
 			page : 1, 
@@ -4978,6 +4984,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		
 		
 		// 搜索框回车
 		// 搜索框回车
 		$scope.onSearch = function() {
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 			$scope.tableParams.reload();
 		};
 		};

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

@@ -812,6 +812,24 @@ define([ 'ngResource'], function() {
 				method: 'DELETE'
 				method: 'DELETE'
 			}
 			}
 		});
 		});
+	}]).factory('QuotationInfo', ['$resource', function($resource){
+		return $resource('sale/quotation/info', {}, {
+			getTodo: {
+				params: {
+					_state: 'todo'
+				}
+			},
+			getDone: {
+				params: {
+					_state: 'done'
+				}
+			},
+            getInvalid: {
+                params: {
+                    _state: 'invalid'
+                }
+            }
+		});
 	}]).factory('PurcOrderSave', ['$resource', function($resource){
 	}]).factory('PurcOrderSave', ['$resource', function($resource){
 		return $resource('sale/newOrder', {}, {
 		return $resource('sale/newOrder', {}, {
 			save: {
 			save: {