Browse Source

物料、产品加载数据方法更新,一键匹配更新数据方法更新

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9490 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 8 years ago
parent
commit
108bb6469a

+ 38 - 0
src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java

@@ -145,6 +145,44 @@ public class BaseInfoController {
 		return searchService.searchProductsCheckIds(keyword, pageParams);
 	}
 
+	/**
+	 * 查看自己的物料资料--不查询(全部)
+	 */
+	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProduct(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(全部)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isSale", Constant.YES);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(标准)
+	 */
+	@RequestMapping(value = "/info", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isSale", Constant.YES);
+		pageInfo.filter("standard", Constant.YES);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(非标准)
+	 */
+	@RequestMapping(value = "/info", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductNonStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了产品信息(非标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isSale", Constant.YES);
+		pageInfo.filter("standard", Constant.NO);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
 	/**
 	 * 通过id查看详情
 	 */

+ 70 - 2
src/main/java/com/uas/platform/b2b/controller/ProductController.java

@@ -157,6 +157,36 @@ public class ProductController {
 		return productService.findProductInfoByPageInfo(pageInfo, keyword);
 	}
 
+	/**
+	 * 所有的物料信息(不做查询)
+	 * 
+	 * @param params
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/info/newest", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getProductInfoStandard(PageParams params, String keyword) {
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("standard", Constant.YES);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 所有的物料信息(不做查询)
+	 * 
+	 * @param params
+	 * @param keyword
+	 * @return
+	 */
+	@RequestMapping(value = "/info/newest", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getProductInfoNonStandard(PageParams params, String keyword) {
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("standard", Constant.NO);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
 	/**
 	 * 开启物料销售
 	 * 
@@ -357,6 +387,44 @@ public class ProductController {
 		return searchService.searchProductsCheckIds(keyword, pageParams);
 	}
 
+	/**
+	 * 查看自己的物料资料--不查询(全部)
+	 */
+	@RequestMapping(value = "/matchResult/info", method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProduct(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("matchstatus", Status.SUBMITTED.value());
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(销售)
+	 */
+	@RequestMapping(value = "/matchResult/info", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isSale", Constant.YES);
+		pageInfo.filter("matchstatus", Status.SUBMITTED.value());
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(采购)
+	 */
+	@RequestMapping(value = "/matchResult/info", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductNonStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(非标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isPurchase", Constant.YES);
+		pageInfo.filter("matchstatus", Status.SUBMITTED.value());
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
 	/**
 	 * 更新物料
 	 * 
@@ -377,9 +445,9 @@ public class ProductController {
 	 */
 	@RequestMapping(value = "/updateall", method = RequestMethod.POST)
 	@ResponseBody
-	public ModelMap updateall(@RequestBody String ids) {
+	public ModelMap updateall(boolean status, @RequestBody String ids) {
 		List<Long> idStrings = JSONObject.parseArray(ids, Long.class);
-		return productService.updateall(idStrings);
+		return productService.updateall(status, idStrings);
 	}
 
 	/**

+ 38 - 0
src/main/java/com/uas/platform/b2b/controller/PurcProductController.java

@@ -192,6 +192,44 @@ public class PurcProductController {
 		return searchService.searchProductsCheckIds(keyword, pageParams);
 	}
 
+	/**
+	 * 查看自己的物料资料--不查询(全部)
+	 */
+	@RequestMapping(value = "/info", method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProduct(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(全部)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isPurchase", Constant.YES);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(标准)
+	 */
+	@RequestMapping(value = "/info", params = RequestState.STANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isPurchase", Constant.YES);
+		pageInfo.filter("standard", Constant.YES);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
+	/**
+	 * 查看自己的物料资料--不查询(非标准)
+	 */
+	@RequestMapping(value = "/info", params = RequestState.NONSTANDARD, method = RequestMethod.GET)
+	@ResponseBody
+	public SPage<Product> getAllProductNonStandard(PageParams params, String keyword) {
+		logger.log("查看产品", SystemSession.getUser().getUserName() + "查看了物料信息(非标准)");
+		PageInfo pageInfo = new PageInfo(params);
+		pageInfo.filter("isPurchase", Constant.YES);
+		pageInfo.filter("standard", Constant.NO);
+		return productService.findProductInfoByPageInfo(pageInfo, keyword);
+	}
+
 	/**
 	 * 开启关闭销售
 	 * 

+ 11 - 9
src/main/java/com/uas/platform/b2b/service/impl/ProductServiceImpl.java

@@ -335,21 +335,23 @@ public class ProductServiceImpl implements ProductService {
 	}
 
 	@Override
-	public ModelMap updateall(List<Long> idStrings) {
+	public ModelMap updateall(boolean status, List<Long> idStrings) {
 		ModelMap map = new ModelMap();
 		for (Long id : idStrings) {
 			refreshproduct(id);
 		}
 		int size1 = idStrings.size();
-		List<Product> products = productDao.findByEnUUAndMatchstatus(SystemSession.getUser().getEnterprise().getUu(),
-				Status.SUBMITTED.value());
 		int size2 = 0;
-		if (!CollectionUtils.isEmpty(products)) {
-			for (Product porduct : products) {
-				if (porduct.getMatchresults().size() == 1) {
-					for (ProductMatchResult result : porduct.getMatchresults()) {
-						refreshproduct(result.getId());
-						size2 = size2 + 1;
+		if (status) {
+			List<Product> products = productDao.findByEnUUAndMatchstatus(
+					SystemSession.getUser().getEnterprise().getUu(), Status.SUBMITTED.value());
+			if (!CollectionUtils.isEmpty(products)) {
+				for (Product porduct : products) {
+					if (porduct.getMatchresults().size() == 1) {
+						for (ProductMatchResult result : porduct.getMatchresults()) {
+							refreshproduct(result.getId());
+							size2 = size2 + 1;
+						}
 					}
 				}
 			}

+ 92 - 42
src/main/webapp/resources/js/index/app.js

@@ -533,10 +533,6 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url : '/invitation',
             templateUrl : "static/tpl/index/baseInfo/invitation.html",
             controller : 'InvitationCtrl'
-        // }).state('baseInfo.invitationforEn', {
-        //     url : '/invitationforEn',
-        //     templateUrl : "static/tpl/index/baseInfo/invitation.html",
-        //     controller : 'InvitationByEnCtrl'
         }).state('qc', {
             url : "/qc",
             views : {
@@ -10485,7 +10481,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 物料资料
 	 */
-	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', '$rootScope', '$modal', 'Products', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout, $rootScope, $modal, Products) {
+	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', '$rootScope', '$modal', 'Products', 'GetProductInfoNewest', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout, $rootScope, $modal, Products, GetProductInfoNewest) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
@@ -10513,8 +10509,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					$scope.tableParams.page(1);
 			}
 		};
+		
+		$scope.searchMethod = false;
 		var getService = function() {
-			return GetProductInfo;
+			if($scope.searchMethod) {
+				return GetProductInfo;
+			} else {
+				return GetProductInfoNewest;
+			}
 		};
 		
 		$scope.tableParams = new ngTableParams({
@@ -10547,6 +10549,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -16674,7 +16677,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	}]);
 	
 	// 当前企业所有的物料信息
-	app.controller('ProductAllCtrl', ['$scope', 'ProductAll', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', 'Products', function($scope, ProductAll, ngTableParams, $filter, BaseService, toaster, $timeout, Products) {
+	app.controller('ProductAllCtrl', ['$scope', 'ProductAll', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', 'Products', 'ProductAllNewest', function($scope, ProductAll, ngTableParams, $filter, BaseService, toaster, $timeout, Products, ProductAllNewest) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
@@ -16702,9 +16705,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					$scope.tableParams.page(1);
 			}
 		};
+		
+		$scope.searchMethod = false;
 		var getService = function() {
-			return ProductAll;
-//			return Products.getAllNewest;
+			if($scope.searchMethod) {
+				return ProductAll;
+			} else {
+				return ProductAllNewest;
+			}
+				
 		};
 		
 		$scope.tableParams = new ngTableParams({
@@ -16739,6 +16748,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -16826,13 +16836,26 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}
 		};
 		
+		$scope.searchMethod = false;
 		var getService = function() {
 			if($rootScope.productMatchStatus === 'sale') {
-				return Products.matchResultforSale;
+				if($scope.searchMethod) {
+					return Products.matchResultforSale;
+				} else {
+					return Products.newestMatchResultforSale;
+				}
 			} else if($rootScope.productMatchStatus === 'purc') {
-				return Products.matchResultforPurc;
+				if($scope.searchMethod) {
+					return Products.matchResultforPurc;
+				} else {
+					return Products.newestMatchResultforPurc;
+				}
 			} else {
-				return Products.matchResult;
+				if($scope.searchMethod) {
+					return Products.matchResult;
+				} else {
+					return Products.newestMatchResult;
+				}
 			}
 		};
 		
@@ -16840,6 +16863,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			page : 1, 
 			count : 20,
 			sorting: {
+				matchsize: 'asc',
+				id: 'desc'
             }
 		}, {
 			total : 0, 
@@ -16884,6 +16909,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -16914,14 +16940,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     				return;
     			}
     		});
-//    		$scope.checks.checked = result;
-//    		 var checked = true;
-//             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
-//                 if (!message.checked) {
-//                     checked = false;
-//                 }
-//             });
-//             $scope.checks.checked = checked;
+    		$scope.checks.checked = result;
+    		 var checked = true;
+             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
+                 if (!message.checked) {
+                     checked = false;
+                 }
+             });
+             $scope.checks.checked = checked;
         };
         
         $scope.product = {
@@ -16981,7 +17007,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					}
 				} 
 			});
-			Products.updateall( {}, ids, function(data) {
+
+			Products.updateall( {status: $scope.checks.checked}, ids, function(data) {
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 					$timeout(function() {
@@ -17028,14 +17055,21 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}
 		};
 		
+		$scope.searchMethod = false;
 		var getService = function() {
-			return Products.matchResultforSale;
+			if($scope.searchMethod) {
+				return Products.matchResultforSale;
+			} else {
+				return Products.newestMatchResultforSale;
+			}
 		};
 		
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
 			count : 20,
 			sorting: {
+				matchsize: 'asc',
+				id: 'desc'
             }
 		}, {
 			total : 0, 
@@ -17080,6 +17114,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -17110,14 +17145,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     				return;
     			}
     		});
-//    		$scope.checks.checked = result;
-//    		 var checked = true;
-//             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
-//                 if (!message.checked) {
-//                     checked = false;
-//                 }
-//             });
-//             $scope.checks.checked = checked;
+    		$scope.checks.checked = result;
+    		 var checked = true;
+             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
+                 if (!message.checked) {
+                     checked = false;
+                 }
+             });
+             $scope.checks.checked = checked;
         };
         
         $scope.product = {
@@ -17177,7 +17212,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					}
 				} 
 			});
-			Products.updateall( {}, ids, function(data) {
+			Products.updateall( {status: $scope.checks.checked}, ids, function(data) {
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 					$timeout(function() {
@@ -17224,14 +17259,21 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}
 		};
 		
+		$scope.searchMethod = false;
 		var getService = function() {
-			return Products.matchResultforPurc;
+			if($scope.searchMethod) {
+				return Products.matchResultforPurc;
+			} else {
+				return Products.newestMatchResultforPurc;
+			}
 		};
 		
 		$scope.tableParams = new ngTableParams({
 			page : 1, 
 			count : 20,
 			sorting: {
+				matchsize: 'asc',
+				id: 'desc'
             }
 		}, {
 			total : 0, 
@@ -17276,6 +17318,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
 		// 搜索框回车
 		$scope.onSearch = function() {
+			$scope.searchMethod = true;
 			$scope.tableParams.page(1);
 			$scope.tableParams.reload();
 		};
@@ -17307,13 +17350,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
     			}
     		});
     		$scope.checks.checked = result;
-//    		 var checked = true;
-//             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
-//                 if (!message.checked) {
-//                     checked = false;
-//                 }
-//             });
-//             $scope.checks.checked = checked;
+    		 var checked = true;
+             angular.forEach($scope.tableParams.data, function(message) { // 单选全部时,全选选中
+                 if (!message.checked) {
+                     checked = false;
+                 }
+             });
+             $scope.checks.checked = checked;
         };
         
         $scope.product = {
@@ -17373,7 +17416,8 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					}
 				} 
 			});
-			Products.updateall( {}, ids, function(data) {
+			
+			Products.updateall( {status: $scope.checks.checked}, ids, function(data) {
 				if(data.success) {
 					toaster.pop('success', '提示', data.success);
 					$timeout(function() {
@@ -17393,7 +17437,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 采购物料资料
 	 */
-	app.controller('PurcProductCtrl', ['$scope', 'PurcProduct', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', 'Products', '$modal', 'GetProductInfo', '$rootScope', function($scope, PurcProduct, ngTableParams, $filter, BaseService, toaster, $timeout, Products, $modal, GetProductInfo, $rootScope) {
+	app.controller('PurcProductCtrl', ['$scope', 'PurcProduct', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', 'Products', '$modal', 'GetProductInfo', '$rootScope', 'PurcProductNewest', function($scope, PurcProduct, ngTableParams, $filter, BaseService, toaster, $timeout, Products, $modal, GetProductInfo, $rootScope, PurcProductNewest) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
@@ -17421,8 +17465,14 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					$scope.tableParams.page(1);
 			}
 		};
+		
+		$scope.searchMethod = false;
 		var getService = function() {
-			return PurcProduct;
+			if($scope.searchMethod) {
+				return PurcProduct;
+			} else {
+				return PurcProductNewest;
+			}
 		};
 		
 		$scope.tableParams = new ngTableParams({

+ 16 - 0
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -71,6 +71,22 @@ define(['ngResource'], function() {
 				method: 'POST'
 			}
 		})
+	}]).factory('GetProductInfoNewest', ['$resource', function($resource) {
+		return $resource('product/baseInfo/info', {}, {
+			getAll : {
+				isArray : false
+			},
+			getStandard: {
+				params: {
+					_state: 'standard'
+				}
+			},
+			getNonstandard: {
+				params: {
+					_state: 'nonstandard'
+				}
+			}
+		})
 	}]).factory('ComponentActive', ['$resource', function($resource) {
 		//获取ComponentActive的分页数据
 		return $resource('api/product/component/:uuid', {}, {

+ 53 - 4
src/main/webapp/resources/js/index/services/Product.js

@@ -68,6 +68,13 @@ define([ 'ngResource'], function() {
 					_state: 'all'
 				}
 			},
+			newestMatchResult: {
+				url: 'product/matchResult/info',
+				method: 'GET',
+				params: {
+					_state: 'all'
+				}
+			},
 			matchResultforSale: {
 				url: 'product/matchResult',
 				method: 'GET',
@@ -75,6 +82,13 @@ define([ 'ngResource'], function() {
 					_state: 'standard'
 				}
 			},
+			newestMatchResultforSale: {
+				url: 'product/matchResult/info',
+				method: 'GET',
+				params: {
+					_state: 'standard'
+				}
+			},
 			matchResultforPurc: {
 				url: 'product/matchResult',
 				method: 'GET',
@@ -82,6 +96,13 @@ define([ 'ngResource'], function() {
 					_state: 'nonstandard'
 				}
 			},
+			newestMatchResultforPurc: {
+				url: 'product/matchResult/info',
+				method: 'GET',
+				params: {
+					_state: 'nonstandard'
+				}
+			},
 			updateByEn: {
 				url: 'product/updateByEn',
 				method: 'POST'
@@ -89,10 +110,6 @@ define([ 'ngResource'], function() {
 			matchsize: {
 				url: 'product/matchsize/:type',
 				method: 'GET'
-			},
-			getAllNewest: {
-				url: 'product/info/newest',
-				method: 'GET',
 			}
 		});
 	}]).factory('PurcProduct', ['$resource', function($resource) {
@@ -111,6 +128,22 @@ define([ 'ngResource'], function() {
 				}
 			}
 		})
+	}]).factory('PurcProductNewest', ['$resource', function($resource) {
+		return $resource('purcProduct/info', {}, {
+			getAll : {
+				isArray : false
+			},
+			getStandard: {
+				params: {
+					_state: 'standard'
+				}
+			},
+			getNonstandard: {
+				params: {
+					_state: 'nonstandard'
+				}
+			}
+		})
 	}]).factory('ProductAll', ['$resource', function($resource) {
 		return $resource('product/info', {}, {
 			getAll: {
@@ -127,5 +160,21 @@ define([ 'ngResource'], function() {
 				}
 			}
 		})
+	}]).factory('ProductAllNewest', ['$resource', function($resource) {
+		return $resource('product/info/newest', {}, {
+			getAll: {
+				isArray : false
+			},
+			getStandard: {
+				params: {
+					_state: 'standard'
+				}
+			},
+			getNonstandard: {
+				params: {
+					_state: 'nonstandard'
+				}
+			}
+		})
 	}]);
 });