Browse Source

上架的逻辑的第一个分段的数量设置为最小起订量。

yujia 8 years ago
parent
commit
085e114e6b

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

@@ -296,13 +296,15 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 							// 输入负数
 							releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getMinPackage());
 						}else {
-							Double rel_reserve = releaseProductByBatch.getReserve() == null ? 0 : releaseProductByBatch.getReserve();
-							int relVal = minBuy.compareTo(rel_reserve);
-							if(relVal > 0) {
-								releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getReserve());
-							}else {
-								releaseProductByBatch.setMinBuyQty(minBuy);
-							}
+                            //临时隐藏,因为上架的文件的修改,导致这个逻辑暂时不用 2017-12-12
+//							Double rel_reserve = releaseProductByBatch.getReserve() == null ? 0 : releaseProductByBatch.getReserve();
+//							int relVal = minBuy.compareTo(rel_reserve);
+//							if(relVal > 0) {
+//								releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getReserve());
+//							}else {
+//								releaseProductByBatch.setMinBuyQty(minBuy);
+//							}
+                            releaseProductByBatch.setMinBuyQty(minBuy);
 							if((releaseProductByBatch.getBreakUp() != null) && !releaseProductByBatch.getBreakUp()) {
 								double v = releaseProductByBatch.getMinBuyQty() % releaseProductByBatch.getMinPackage();
 								if(NumberUtil.compare(v, 0.0) != 0) {
@@ -474,7 +476,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			}else if(j < prices.size() - 1) {
 				GoodsQtyPrice qtyPrice = prices.get(j + 1);
 				if(NumberUtil.compare(qtyPrice.getStart(), price.getStart()) > 0) {
-					price.setStart(NumberUtil.sub(qtyPrice.getStart(), 1.0d));
+					price.setEnd(NumberUtil.sub(qtyPrice.getStart(), 1.0d));
 					prices2.add(price);
 				}else {
 					productByBatch.addErrmsg("8-12:后一个分段数量的起始值必须大于前一个分段的起始值");

BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls


+ 19 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js

@@ -444,8 +444,9 @@ define([ 'app/app' ], function(app) {
             });
             commodity.editPrices[commodity.editPrices.length - 1].end = $scope.maxReserve;
             commodity.editPrices[commodity.editPrices.length - 1].endPre = $scope.maxReserve;
-            commodity.editPrices[0].start = $scope.minReserve;
-            commodity.editPrices[0].startPre = $scope.minReserve;
+            // commodity.editPrices[0].start = $scope.minReserve;
+            // commodity.editPrices[0].startPre = $scope.minReserve;
+            commodity.editPrices[0].startPre = commodity.editPrices[0].start;
 
             commodity.editReserve = commodity.reserve;
             commodity.editReservePre = commodity.reserve;
@@ -711,8 +712,18 @@ define([ 'app/app' ], function(app) {
          */
         $scope.changeMinBuyQty = function (commodity) {
             commodity.editMinBuyQtyInValid = true;
+            if(typeof commodity.editMinBuyQty == 'undefined') {
+                return ;
+            }
             if(!commodity.editMinBuyQty) {
                 commodity.editMinBuyQtyInValid = false;
+                toaster.pop('warning', '提示', '起拍量必须是正整数');
+                return false;
+            }
+            //加入临时逻辑,起拍量必须增加
+            if(parseInt(commodity.editMinBuyQty) < parseInt(commodity.minBuyQty)) {
+                commodity.editMinBuyQtyInValid = false;
+                toaster.pop('warning', '提示', '起拍量只能增加');
                 return false;
             }
             if(!$scope.isInt.test(commodity.editMinBuyQty)) {
@@ -954,7 +965,12 @@ define([ 'app/app' ], function(app) {
             }
             if(!$scope.isInt.test(commodity.editMinBuyQty)) {
                 commodity.editMinBuyQtyInValid  = true;
-                toaster.pop('warning', '提示', '最小起拍量必须是正整数');
+                toaster.pop('warning', '提示', '起拍量必须是正整数');
+                return result;
+            }
+            if(parseInt(commodity.editMinBuyQty) < parseInt(commodity.minBuyQty)) {
+                commodity.editMinBuyQtyInValid  = true;
+                toaster.pop('warning', '提示', '起拍量只能增加');
                 return result;
             }
             if(commodity.editReserve < commodity.editMinBuyQty) {