Browse Source

更新财务对账功能:1、默认不显示数据,所有单据都由用户筛选得出;2、用户名称提示时去掉重复

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

+ 36 - 3
src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java

@@ -3,7 +3,9 @@ package com.uas.platform.b2b.controller;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
@@ -121,6 +123,37 @@ public class SaleApCheckController {
 		return erpProdIODetailService.findAllApChecks(distributes);
 	}
 
+	/**
+	 * 得到所有的供应商信息便于筛选
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/getAllCustomers", method = RequestMethod.GET)
+	@ResponseBody
+	public Set<Object> getAllApChecksCustomers() {
+		List<Long> distributes = null;
+		// 判断当前用户是否被客户分配
+		if (!SystemSession.getUser().isSys()) {
+			List<Vendor> vendors = userService.findChooseVendor(SystemSession.getUser().getUserUU());
+			distributes = new ArrayList<Long>();
+			if (!CollectionUtils.isEmpty(vendors)) {
+				for (Vendor v : vendors) {
+					distributes.add(v.getMyEnUU());
+				}
+			} else {
+				return null;
+			}
+		}
+		List<ErpProdIODetail> erpProdIODetails = erpProdIODetailService.findAllApChecks(distributes);
+		Set<Object> set = new HashSet<>();
+		if (!CollectionUtils.isEmpty(erpProdIODetails)) {
+			for (ErpProdIODetail erpProdIODetail : erpProdIODetails) {
+				set.add(erpProdIODetail.getCustName());
+			}
+		}
+		return set;
+	}
+
 	/**
 	 * 通过日期筛选,筛选出超出默认日期的单据
 	 * 
@@ -128,9 +161,9 @@ public class SaleApCheckController {
 	 * @param endDate
 	 * @return
 	 */
-	@RequestMapping(value = "/getAllByDate", method = RequestMethod.GET)
+	@RequestMapping(value = "/getAllByKeywords", method = RequestMethod.GET)
 	@ResponseBody
-	public List<ErpProdIODetail> getAllApchecksByDate(Long fromDate, Long endDate) {
+	public List<ErpProdIODetail> getAllApchecksByDate(Long fromDate, Long endDate, String keyword) {
 		List<Long> distributes = null;
 		// 判断当前用户是否被客户分配
 		if (!SystemSession.getUser().isSys()) {
@@ -144,7 +177,7 @@ public class SaleApCheckController {
 				return null;
 			}
 		}
-		return erpProdIODetailService.findXlsApChecks(distributes, null, fromDate, endDate);
+		return erpProdIODetailService.findXlsApChecks(distributes, keyword, fromDate, endDate);
 	}
 	/**
 	 * 保存生成的应收对账单主记录

+ 43 - 39
src/main/webapp/resources/js/index/app.js

@@ -4691,22 +4691,22 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	app.controller('PurchaseApCheckListCtrl',['$scope', 'FaApCheck', 'toaster', '$state','$filter', '$modal', function($scope, FaApCheck, toaster, $state, $filter, $modal){
 		$scope.data = {};// 列表数据
 		$scope.loading = true;
-		$scope.getData = function(){
-		    FaApCheck.getAll(function(data){
-				$scope.data = data;
-				angular.forEach($scope.data, function(item) {
-						item:{
-							$selected:true;
-						}
-					});
-				$scope.loading = false;
-			});
-
-		}
+//		$scope.getData = function(){
+//		    FaApCheck.getAll(function(data){
+//				$scope.data = data;
+//				angular.forEach($scope.data, function(item) {
+//						item:{
+//							$selected:true;
+//						}
+//					});
+//				$scope.loading = false;
+//			});
+//
+//		}
 		
 		document.getElementById('suuorname').focus();//光标默认在客户
 		
-		$scope.getData();
+//		$scope.getData();
 		
 		$scope.condition = {
 			$fromOpened:false
@@ -4774,31 +4774,35 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 				$scope.condition.dateTo = ($scope.sdateTo || 0);
 			}
 			$scope.condition.venduuorname = $scope.vuuorname;
-			//物料名称和物料规格存在特殊符号,用|作分割符
-			$scope.keywordXls = angular.copy(($scope.condition.uuorname == null ? "" : $scope.condition.uuorname)
-							+ "|"+ ($scope.condition.venduuorname == null ? "" : $scope.condition.venduuorname)
-							+ "|"+ ($scope.condition.factory == null ? "" : $scope.condition.factory)
-							+ "|"+ ($scope.condition.prodTitle == null ? "" : $scope.condition.prodTitle)
-							+ "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
-			$scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
-			$scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
-			if($scope.keywordXls.length == 4){
-				if($scope.condition.dateFrom != null || $scope.condition.dateTo != null) {
-					$scope.fromDate =$scope.condition.dateFrom ?  $scope.condition.dateFrom.getTime() : null;
-					$scope.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
-					FaApCheck.getAllByDate({fromDate: $scope.fromDate, endDate: $scope.endDate}, function(data) {
-						$scope.data = data;
-						angular.forEach($scope.data, function(item) {
-								item:{
-									$selected:true;
-								}
-							});
-						$scope.loading = false;
-					}, function(response) {
-						toaster.pop('error', '提示', response.data);
-					});
-				}
+//			//物料名称和物料规格存在特殊符号,用|作分割符
+//			$scope.keywordXls = angular.copy(($scope.condition.uuorname == null ? "" : $scope.condition.uuorname)
+//							+ "|"+ ($scope.condition.venduuorname == null ? "" : $scope.condition.venduuorname)
+//							+ "|"+ ($scope.condition.factory == null ? "" : $scope.condition.factory)
+//							+ "|"+ ($scope.condition.prodTitle == null ? "" : $scope.condition.prodTitle)
+//							+ "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
+//			$scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
+//			$scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
+			if($scope.condition.dateFrom != null || $scope.condition.dateTo != null || $scope.keywordXls != null) {
+				$scope.fromDate =$scope.condition.dateFrom ?  $scope.condition.dateFrom.getTime() : null;
+				$scope.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
+				$scope.keywordXls = angular.copy(($scope.condition.uuorname == null ? "" : $scope.condition.uuorname)
+						+ "|"+ ($scope.condition.venduuorname == null ? "" : $scope.condition.venduuorname)
+						+ "|"+ ($scope.condition.factory == null ? "" : $scope.condition.factory)
+						+ "|"+ ($scope.condition.prodTitle == null ? "" : $scope.condition.prodTitle)
+						+ "|"+ ($scope.condition.prodSpec == null ? "" : $scope.condition.prodSpec));//保存当前取值的关键词
+				FaApCheck.getAllByKeywords({fromDate: $scope.fromDate, endDate: $scope.endDate, keyword:$scope.keywordXls}, function(data) {
+					$scope.data = data;
+					angular.forEach($scope.data, function(item) {
+							item:{
+								$selected:true;
+							}
+						});
+					$scope.loading = false;
+				}, function(response) {
+					toaster.pop('error', '提示', response.data);
+				});
 			}
+			
 		}
 		
 		/**
@@ -7843,11 +7847,11 @@ app.controller('SaleSendCtrl', ['$scope', '$filter', 'SaleSend', 'ngTableParams'
 	 */
 	app.controller('SearchCustInfoCtrl', ['$scope', '$modalInstance', 'suuorname', 'FaApCheck', function($scope, $modalInstance, suuorname, FaApCheck) {
 		$scope.getData = function(){
-		    FaApCheck.getAll(function(data){
+		    FaApCheck.getAllCustomers(function(data) {
 				$scope.custs= data;
 				angular.forEach($scope.data, function(item) {
 						item:{
-							$selected:true;
+							$selected: true;
 						}
 					});
 				$scope.loading = false;

+ 7 - 2
src/main/webapp/resources/js/index/services/Fa.js

@@ -43,8 +43,13 @@ define([ 'ngResource'], function() {
 				method: 'GET',
 				isArray: true
 			},
-			getAllByDate: {
-				url: 'sale/apCheck/getAllByDate',
+			getAllCustomers: {
+				url: 'sale/apCheck/getAllCustomers',
+				method: 'GET',
+				isArray: true
+			},
+			getAllByKeywords: {
+				url: 'sale/apCheck/getAllByKeywords',
 				method: 'GET',
 				isArray: true
 			},

+ 8 - 3
src/main/webapp/resources/tpl/index/fa/apCheckList.html

@@ -51,16 +51,22 @@
 	.info {
 		overflow:scroll;
 	}
+	
+	#tip {
+		margin: 10px;
+	}
 </style>
 
 <div style="margin-right:20px;">
 <div width="100%">
 	<div class="block searchcolor">
 	
- 		<div class="loading in" ng-class="{'in': loading}">
+ 	<!-- 	<div class="loading in" ng-class="{'in': loading}">
 			<i></i>
-		</div>
+		</div> -->
+		<div class="row" id="tip">(<a class="text-inverse">*提示</a>:为了提高反应速率,现在所有单据都由用户手动筛选得出)</div>
   		<div class="row">
+  			
   			<div class="col-xs-1">
 				<label>&nbsp;&nbsp;客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户:</label>
 			</div>
@@ -155,7 +161,6 @@
 							</button>
 						</span>
 					</div>
-					<div>(<span class="text-inverse">*注: </span>列表默认显示的时间为近六个月的数据,超出的可以通过日期筛选得出)</div>
 					</div>
 					</div>
 					<div class="col-xs-2 col-xs-offset-1" style="margin-top:4px">

+ 1 - 1
src/main/webapp/resources/tpl/index/fa/custInfo.html

@@ -12,7 +12,7 @@
 		<tbody>
 				<div style="overflow-y:scroll; width:100%;max-height:500px">			
 					<tr ng-repeat="cust in custs">
-						<td width="80px;"><a ng-bind="cust.custName" ng-click="CustName(cust.custName)"></a></td>
+						<td width="80px;"><a ng-bind="cust" ng-click="CustName(cust)"></a></td>
 					</tr>
 				</div>
 		<tbody>