Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

wangdy 8 vuotta sitten
vanhempi
commit
7e47ad7332

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java

@@ -290,7 +290,7 @@ public class ProductController {
 	 * @return
 	 */
 	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
-	public Product getProducts(@PathVariable("id") Long id) {
+	public V_ProductPrivate getProducts(@PathVariable("id") Long id) {
 		return productService.getProductById(id);
 	}
 

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

@@ -168,7 +168,7 @@ public interface ProductService {
      * @param id
      * @return
      */
-    Product getProductById(Long id);
+    V_ProductPrivate getProductById(Long id);
 
     /**
      * 通过product id获取物料交易详情

+ 6 - 4
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -194,6 +194,8 @@ public class ProductServiceImpl implements ProductService {
     @Override
     public Page<V_ProductPrivate> getAllProducts(final PageInfo page, String keyword, String type) {
         page.expression(PredicateUtils.eq("enUU", SystemSession.getUser().getEnterprise().getUu(), true));
+        page.expression(PredicateUtils.isNotNull("pcmpcode"));
+        page.expression(PredicateUtils.isNotNull("pbranden"));
         if (StringUtils.isEmpty(type)) {
             type = "nStandard";
         }
@@ -1346,11 +1348,11 @@ public class ProductServiceImpl implements ProductService {
      * @return
      */
     @Override
-    public Product getProductById(Long id) {
-        if(id == null) {
+    public V_ProductPrivate getProductById(Long id) {
+        if (id == null) {
             return null;
-        }else {
-            return productDao.findOne(id);
+        } else {
+            return v_productPrivateDao.findOne(id);
         }
     }
 

+ 13 - 12
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -810,7 +810,7 @@ define(['app/app'], function (app) {
             });
           };
           //如果之前未绑定
-          if($scope.userInfo.userEmail==null?true:false){
+          if($scope.userInfo.userEmail==null ? true:false){
             $scope.checkSuccess = true;
           }
 
@@ -825,7 +825,6 @@ define(['app/app'], function (app) {
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -833,25 +832,26 @@ define(['app/app'], function (app) {
               if (data.data == "true") {//邮箱可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//邮箱不可用
                 $scope.checkSuccess1 = false;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = false;
                 $scope.checkFailed1_1 = true;
               }
             }, function () {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
             });
           };
 
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendCheckCode = function (newUserEmail) {
+            if (!$scope.checkSuccess1 || ($scope.userInfo.userEmail==null && !$scope.checkSuccess)) {
+              return;
+						}
             $scope.sendSuccess = false;
             User.sendCheckCode({newUserEmail: newUserEmail}, function () {
               $scope.codeSuccess = true;
@@ -872,6 +872,7 @@ define(['app/app'], function (app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 
@@ -938,7 +939,6 @@ define(['app/app'], function (app) {
               $scope.validSuccess = false;
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
-              $scope.sendSuccess = false;
               window.location.href = "user#/accountManager/sec";
               window.location.reload();
               $modalInstance.close();
@@ -983,7 +983,6 @@ define(['app/app'], function (app) {
           };
 
           //新手机号是否可用
-          $scope.sendSuccess = false;
           $scope.checkFailed1 = false;
           $scope.checkFailed1_1 = false;
           $scope.checkSuccess1 = false;
@@ -991,7 +990,6 @@ define(['app/app'], function (app) {
             if (newUserTel == null || !/^[0-9]{8,11}$/.test(newUserTel)) {
               $scope.checkFailed1 = true;
               $scope.checkSuccess1 = false;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -1002,13 +1000,11 @@ define(['app/app'], function (app) {
               if (data.data == "true") {//手机可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//手机不可用
                 $scope.checkFailed1_1 = true;
                 $scope.checking1 = false;
                 $scope.checkSuccess1 = false;
-                $scope.sendSuccess = false;
               }
             }, function () {
               $scope.checkFailed1 = true;
@@ -1018,10 +1014,14 @@ define(['app/app'], function (app) {
             });
           };
 
-          //发送验证码
+          // 发送验证码
           $scope.codeSuccess = false;
-          //发送验证码
+          $scope.sendSuccess = true;
+          // 发送验证码
           $scope.sendTelCheckCode = function (newUserTel) {
+            if (!$scope.checkSuccess1) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendTelCheckCode({newUserTel: newUserTel}, function () {
               $scope.codeSuccess = true;
@@ -1042,6 +1042,7 @@ define(['app/app'], function (app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 

+ 10 - 9
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -764,7 +764,6 @@ define(['app/app'], function(app) {
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -772,25 +771,26 @@ define(['app/app'], function(app) {
               if (data.data == "true") {//邮箱可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//邮箱不可用
                 $scope.checkSuccess1 = false;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = false;
                 $scope.checkFailed1_1 = true;
               }
             }, function () {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
             });
           };
 
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendCheckCode = function (newUserEmail) {
+            if (!$scope.checkSuccess1 || ($scope.userInfo.userEmail==null && !$scope.checkSuccess)) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendCheckCode({newUserEmail: newUserEmail}, function () {
               $scope.codeSuccess = true;
@@ -811,6 +811,7 @@ define(['app/app'], function(app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 
@@ -877,7 +878,6 @@ define(['app/app'], function(app) {
               $scope.validSuccess = false;
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
-              $scope.sendSuccess = false;
               window.location.href = "vendor#/account/management/sec";
               window.location.reload();
               $modalInstance.close();
@@ -922,7 +922,6 @@ define(['app/app'], function(app) {
           };
 
           //新手机号是否可用
-          $scope.sendSuccess = false;
           $scope.checkFailed1 = false;
           $scope.checkFailed1_1 = false;
           $scope.checkSuccess1 = false;
@@ -930,7 +929,6 @@ define(['app/app'], function(app) {
             if (newUserTel == null || !/^[0-9]{8,11}$/.test(newUserTel)) {
               $scope.checkFailed1 = true;
               $scope.checkSuccess1 = false;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -941,13 +939,11 @@ define(['app/app'], function(app) {
               if (data.data == "true") {//手机可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//手机不可用
                 $scope.checkFailed1_1 = true;
                 $scope.checking1 = false;
                 $scope.checkSuccess1 = false;
-                $scope.sendSuccess = false;
               }
             }, function () {
               $scope.checkFailed1 = true;
@@ -959,8 +955,12 @@ define(['app/app'], function(app) {
 
           //发送验证码
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendTelCheckCode = function (newUserTel) {
+            if (!$scope.checkSuccess1) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendTelCheckCode({newUserTel: newUserTel}, function () {
               $scope.codeSuccess = true;
@@ -981,6 +981,7 @@ define(['app/app'], function(app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 

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

@@ -153,7 +153,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             //获取店铺的信息
             StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
                 $scope.storeInfo = data;
-				if (!$scope.storeInfo || $scope.storeInfo.status != 'OPENED' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
+				if (!$scope.storeInfo || $scope.storeInfo.status != 'OPENED' || $scope.storeInfo.storeName.indexOf('优软测试二') > -1 || $scope.storeInfo.storeName.indexOf('优软商城') > -1) {
 					$scope.$$nonProduct.canSelfSale = false;
 				} else {
 					$scope.$$nonProduct.canSelfSale = true;

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1707,7 +1707,7 @@
                                                     <div class="content margin10">
                                                         <!--<p class="title">自营 / 寄售</p>-->
                                                         <div class="input-list">
-                                                            <select ng-disabled="$$nonProduct.canSelfSale" name="selfSale" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="$$nonProduct.canSelfSale">
+                                                            <select ng-disabled="!$$nonProduct.canSelfSale" name="selfSale" class="wid56 select-adder form-control" ng-model="goods.editSelfSale">
                                                                 <option value="1">自营</option>
                                                                 <option value="2">寄售</option>
                                                             </select>
@@ -1900,7 +1900,7 @@
 													<div class="content margin10">
 														<!--<p class="title">自营 / 寄售</p>-->
 														<div class="input-list">
-															<select name="editSelfSale" ng-change="changeSaleMode(goods)" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="$$nonProduct.canSelfSale">
+															<select name="editSelfSale" ng-change="changeSaleMode(goods)" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="!$$nonProduct.canSelfSale">
 																<option value="1">自营</option>
 																<option value="2">寄售</option>
 															</select>