فهرست منبع

Merge remote-tracking branch 'origin/release-201831-wangcz' into release-201831-wangcz

hejq 7 سال پیش
والد
کامیت
d136fad5f8

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

@@ -603,34 +603,39 @@ public class ProductServiceImpl implements ProductService {
                 }
                 StringUtilB2C.removeFromList(ids, productPerson.getProductId());
             }
-            //删除匹配结果信息
-            productMatchResultDao.deleteByProductids(ids);
-
-            //更新在售产品信息
-            List<Goods> goodses = goodsService.findByProductids(ids);
-            goodsService.deleteGoods(goodses);
-
-            //调整物料为禁用状态。
-            List<ProductPrivate> productPrivates = productPrivateService.findByPrIds(ids);
-            for (ProductPrivate productPrivate : productPrivates) {
-                productPrivate.setB2cEnabled(IntegerConstant.NO_SHORT);
-                StringUtilB2C.removeFromList(ids, productPrivate.getPrId());
-            }
-            ProductPrivate pPrivate = null;
-            for (Long id : ids) {
-                pPrivate = new ProductPrivate(id);
-                if (CollectionUtils.isEmpty(productPrivates)) {
-                    productPrivates = new ArrayList<>();
+            if (CollectionUtils.isNotEmpty(ids)) {
+                //删除匹配结果信息
+                productMatchResultDao.deleteByProductids(ids);
+
+                //更新在售产品信息
+                List<Goods> goodses = goodsService.findByProductids(ids);
+                goodsService.deleteGoods(goodses);
+
+                //调整物料为禁用状态。
+                List<ProductPrivate> productPrivates = productPrivateService.findByPrIds(ids);
+                for (ProductPrivate productPrivate : productPrivates) {
+                    productPrivate.setB2cEnabled(IntegerConstant.NO_SHORT);
+                    StringUtilB2C.removeFromList(ids, productPrivate.getPrId());
+                }
+                ProductPrivate pPrivate = null;
+                for (Long id : ids) {
+                    pPrivate = new ProductPrivate(id);
+                    if (CollectionUtils.isEmpty(productPrivates)) {
+                        productPrivates = new ArrayList<>();
+                    }
+                    productPrivates.add(pPrivate);
+                }
+                if (CollectionUtils.isNotEmpty(productPrivates)) {
+                    productPrivateDao.save(productPrivates);
                 }
-                productPrivates.add(pPrivate);
-            }
-            if (CollectionUtils.isNotEmpty(productPrivates)) {
-                productPrivateDao.save(productPrivates);
             }
+            int code = 1;
             if (StringUtils.isEmpty(message)) {
                 message = "删除成功";
+            } else {
+                code = CodeType.NOT_PERMIT.code();
             }
-            return ResultMap.success(message);
+            return new ResultMap(code, message);
         }
     }
 

+ 10 - 6
src/main/webapp/resources/js/vendor/controllers/forstore/single_entry.js

@@ -119,9 +119,6 @@ define(['app/app', 'jquery-uploadify'], function(app) {
       $scope.objError.kind = false
     }
 
-    $scope.RegulSpecBlur = function() {
-      $scope.objError.spec = false
-    }
     /**
      * 物料编辑品牌输入框失去焦点
      *
@@ -275,6 +272,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
       } else {
         $scope.Regul.reserve = num
       }
+      $scope.objError.reserve = false
     }
 
     $scope.setOnePrice = function(num) {
@@ -520,9 +518,15 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         $scope.objError.pcmpcode = true
         return;
       }
-      if ($scope.Regul.spec === '' || !$scope.Regul.spec) {
-        toaster.pop('warning','提示', '规格为必填项')
-        $scope.objError.spec = true
+      if ($scope.Regul.reserve === '' || !$scope.Regul.reserve) {
+        toaster.pop('warning','提示', '库存数量不能为空')
+        $scope.objError.reserve = true
+        return;
+      }
+
+      if ($scope.Regul.reserve <=0) {
+        toaster.pop('warning','提示', '库存数量必须大于等于1')
+        $scope.objError.reserve = true
         return;
       }
 

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/single_entry.html

@@ -236,7 +236,7 @@
                    placeholder="请输入规格参数"
                    ng-model="Regul.spec"
                    ng-class="objError.spec ? 'danger' : '' "
-                   ng-blur="RegulSpecBlur()"
+
                    class="form-control inputText" maxlength="50"/>
           </div>
         </div>