Browse Source

pcb产品导入

yangc 7 years ago
parent
commit
5a41470f65

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -190,7 +190,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			if (colNum != UploadConstant.TOTAL_COLUMN_PERSON && colNum != UploadConstant.MAX_TOTAL_COLUMN_PERSON) {
 				throw new IllegalOperatorException("表格模板不正确!请重新下载最新模板");
 			}
-		} else if ((isPcb && colNum != UploadConstant.TOTAL_COLUMN_PCB && colNum != UploadConstant.MAX_TOTAL_COLUMN_PCB) || (colNum != UploadConstant.TOTAL_COLUMN && colNum != UploadConstant.MAX_TOTAL_COLUMN)) {
+		} else if ((isPcb && colNum != UploadConstant.TOTAL_COLUMN_PCB && colNum != UploadConstant.MAX_TOTAL_COLUMN_PCB) || (!isPcb && colNum != UploadConstant.TOTAL_COLUMN && colNum != UploadConstant.MAX_TOTAL_COLUMN)) {
 				throw new IllegalOperatorException("表格模板不正确!请重新下载最新模板");
 			}
 		int rowNum = SheetUtil.getSheetLastNum(sheet, isPcb ? UploadConstant.MAX_TOTAL_COLUMN_PCB : UploadConstant.MAX_TOTAL_COLUMN);

+ 4 - 3
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -1846,9 +1846,10 @@ define([ 'app/app' ], function(app) {
 				$scope.openHomeCenterModel();
 			}*/
 		// };
-		$q.all[$rootScope.pcbPromise].then(function (res) {
-			$rootScope.isPcbStore = res == 1;
-		})
+		// $q.all[$rootScope.pcbPromise].then(function (res) {
+		// 	$rootScope.isPcbStore = res == 1;
+		// })
+        // console.log($scope.pcbPromise);
 	}]);
 
     function checkNullStr (str) {

+ 6 - 11
src/main/webapp/resources/js/vendor/app.js

@@ -677,14 +677,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		});
 		var applyPromise = deferred1.promise;
 
-		// 是否pcb
-		var deferred2 = $q.defer();
-		StoreInfo.isPcb({enuu: $rootScope.userInfo.enterprise.uu}, function (result) {
-			deferred1.resolve(result);
-		}, function (error) {
-			deferred1.reject(error);
-		});
-		$rootScope.pcbPromise = deferred2.promise;
+        // console.log($rootScope.userInfo);
 
 		// 合并多个Promise对象
 		$q.all([storePromise, applyPromise]).then(function (result) {
@@ -710,9 +703,11 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 						$state.go('vendor_store_maintain');
 					}
 				}
-				$q.all[$rootScope.pcbPromise].then(function (res) {
-					$rootScope.isPcbStore = res == 1;
-				})
+                // 是否pcb
+                StoreInfo.isPcb({enuu: $rootScope.userInfo.enterprise.uu}, function (res) {
+                    $rootScope.isPcbStore = res.data == 1;
+                }, function (error) {
+                });
 			}).error(function (error) {
 				toaster.pop('error', '获取登录信息失败');
 			})

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -247,7 +247,7 @@ define([ 'app/app' ], function(app) {
 			} else {
                 var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, repeatImport : $scope.repeatImport};
 			}
-			var uploadUrl = $rootScope.isPcbStore ? '/release/product/batchRelease/pcb' : 'release/product/release/excel';
+			var uploadUrl = $rootScope.isPcbStore ? '/release/product/release/excel/pcb' : 'release/product/release/excel';
 			$upload.upload({
 				url: uploadUrl,
 				file: file,