Просмотр исходного кода

Merge remote-tracking branch 'origin/feature-commodity-0901-v1' into release-20170915

suntg 8 лет назад
Родитель
Сommit
c8e463eb36

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -1378,8 +1378,8 @@ public class GoodsServiceImpl implements GoodsService {
 				if (CollectionUtils.isEmpty(delayTime1)) {
 				if (CollectionUtils.isEmpty(delayTime1)) {
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国外发往国外没设置。");
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国外发往国外没设置。");
 				}
 				}
-				goods.setB2cDeliveryHKMaxTime((short) (delayTime1.get(0).getMaxTime() + goods.getSelfDeliveryHKMaxTime()));
-				goods.setB2cDeliveryHKMinTime((short) (delayTime1.get(0).getMinTime() + goods.getSelfDeliveryHKMinTime()));
+				goods.setB2cDeliveryHKMaxTime((short) (delayTime1.get(0).getMaxTime() + Short.valueOf(goods.getSelfDeliveryHKMaxTime() == null ? 0 : goods.getSelfDeliveryHKMaxTime())));
+				goods.setB2cDeliveryHKMinTime((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getSelfDeliveryHKMinTime() == null  ? 0 : goods.getSelfDeliveryHKMinTime())));
 				goods.setB2cMaxDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMaxDelivery() == null ? 0 : goods.getMaxDelivery())));
 				goods.setB2cMaxDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMaxDelivery() == null ? 0 : goods.getMaxDelivery())));
 				goods.setB2cMinDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMinDelivery() == null ? 0 : goods.getMinDelivery())));
 				goods.setB2cMinDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMinDelivery() == null ? 0 : goods.getMinDelivery())));
 			}
 			}

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

@@ -173,7 +173,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 						reserve = Double.valueOf(reserveCellValue.toString());
 						reserve = Double.valueOf(reserveCellValue.toString());
 						int compareTo = reserve.compareTo(DoubleConstant.maxReserve);
 						int compareTo = reserve.compareTo(DoubleConstant.maxReserve);
 						if(compareTo > 0) {
 						if(compareTo > 0) {
-							releaseProductByBatch.addErrmsg("6:发布数量大于了我们设置的最大值99999999");
+							releaseProductByBatch.addErrmsg("6:发布数量大于了我们设置的最大值" + DoubleConstant.maxReserve);
 						}else if(NumberUtil.compare(reserve, DoubleConstant.zero) < 1) {
 						}else if(NumberUtil.compare(reserve, DoubleConstant.zero) < 1) {
 							releaseProductByBatch.addErrmsg("6:发布数量必须大于0");
 							releaseProductByBatch.addErrmsg("6:发布数量必须大于0");
 						}
 						}
@@ -282,7 +282,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					// 最小包单价
 					// 最小包单价
 					Object priceMinPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_STRING, r, 9);
 					Object priceMinPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_STRING, r, 9);
 					releaseProductByBatch.setMinPackPriceStr(String.valueOf(priceMinPackQtyCellValue));
 					releaseProductByBatch.setMinPackPriceStr(String.valueOf(priceMinPackQtyCellValue));
-					if ((priceMinPackQtyCellValue != null)&&(isNumber(priceMinPackQtyCellValue.toString()))) {
+					if ((priceMinPackQtyCellValue != null)&&(isNumber(priceMinPackQtyCellValue.toString())) && (NumberUtil.compare(Double.valueOf(priceMinPackQtyCellValue.toString()), 0.0d) > 0)) {
 						Double price = Double.valueOf(priceMinPackQtyCellValue.toString());
 						Double price = Double.valueOf(priceMinPackQtyCellValue.toString());
 						price = fractionNumCeil(price, 6);
 						price = fractionNumCeil(price, 6);
 						if(Currency.USD.equals(currency)) {
 						if(Currency.USD.equals(currency)) {
@@ -291,7 +291,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 							releaseProductByBatch.setRmbMinPackPrice(price);
 							releaseProductByBatch.setRmbMinPackPrice(price);
 						}
 						}
 					}else {
 					}else {
-						releaseProductByBatch.addErrmsg("10:最小包单价信息为空");
+						releaseProductByBatch.addErrmsg("10:最小包单价信息必须是大于0的数字");
 					}
 					}
 
 
 					Object deliveryMinCellValue = readWorkBookCell(row.getCell(10), Cell.CELL_TYPE_STRING, r, 10);
 					Object deliveryMinCellValue = readWorkBookCell(row.getCell(10), Cell.CELL_TYPE_STRING, r, 10);
@@ -493,7 +493,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		if((min != null) || (max != null)) {
 		if((min != null) || (max != null)) {
 			min  = min == null ? max : min;
 			min  = min == null ? max : min;
 			max  = max == null ? min : max;
 			max  = max == null ? min : max;
-			if(min.shortValue() > ShortConstant.maxDelivery || min.shortValue() < 0 || max.shortValue() > Short.MAX_VALUE || max.shortValue() < 0){
+			if(min.shortValue() > ShortConstant.maxDelivery.shortValue() || min.shortValue() < 0 || max.shortValue() > ShortConstant.maxDelivery.shortValue() || max.shortValue() < 0){
 				releaseProductByBatch.addErrmsg("11-12:交期的信息必须为正整数并且小于" + ShortConstant.maxDelivery);
 				releaseProductByBatch.addErrmsg("11-12:交期的信息必须为正整数并且小于" + ShortConstant.maxDelivery);
 			}else {
 			}else {
 				if(min.shortValue() > max.shortValue()) {
 				if(min.shortValue() > max.shortValue()) {
@@ -640,7 +640,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 
 		Object priceCellValue = readWorkBookCell(cellPrice, Cell.CELL_TYPE_STRING, r, num + 1);
 		Object priceCellValue = readWorkBookCell(cellPrice, Cell.CELL_TYPE_STRING, r, num + 1);
 		releaseProductByBatch.setFragmentPrice(String.valueOf(priceCellValue), i);
 		releaseProductByBatch.setFragmentPrice(String.valueOf(priceCellValue), i);
-		if ((endQtyCellValue != null)&&(isNumber(endQtyCellValue.toString()))) {
+		if ((endQtyCellValue != null)&&(isNumber(endQtyCellValue.toString())) && (NumberUtil.compare(Double.valueOf(endQtyCellValue.toString()), 0.0d) > 0)) {
 			Double end = Double.valueOf(endQtyCellValue.toString());
 			Double end = Double.valueOf(endQtyCellValue.toString());
 			GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
 			GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
 			// 分段结束值 与最小库存比较
 			// 分段结束值 与最小库存比较

+ 4 - 1
src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java

@@ -861,7 +861,10 @@ public class OrderDetail extends Document implements Serializable{
 			if(NumberUtil.compare(remind, 0.0) != 0) {
 			if(NumberUtil.compare(remind, 0.0) != 0) {
 				this.number = goods.getMinBuyQty();
 				this.number = goods.getMinBuyQty();
 			}
 			}
-//			double times = NumberUtil.div(this.number, this.minPackQty)
+			if(NumberUtil.compare(this.number, goods.getMinBuyQty()) < 0) {
+				this.number = goods.getMinBuyQty();
+//			double times = NumberUtil.div(this.number, this.minPackQty
+			}
 //			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
 //			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
 //			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
 //			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
 //				this.number = goods.getMinBuyQty();
 //				this.number = goods.getMinBuyQty();

+ 3 - 0
src/main/java/com/uas/platform/b2c/trade/presale/model/Cart.java

@@ -315,6 +315,9 @@ public class Cart {
 			if(NumberUtil.compare(remaind, 0.0) != 0) {
 			if(NumberUtil.compare(remaind, 0.0) != 0) {
 				this.number = goods.getMinBuyQty();
 				this.number = goods.getMinBuyQty();
 			}
 			}
+			if(NumberUtil.compare(this.number, goods.getMinBuyQty()) < 0) {
+				this.number = goods.getMinBuyQty();
+			}
 //			double times = NumberUtil.div(this.number, this.minPackQty);
 //			double times = NumberUtil.div(this.number, this.minPackQty);
 //			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
 //			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
 //			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
 //			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {

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

@@ -172,7 +172,7 @@ define([ 'app/app' ], function(app) {
 				url: 'release/product/release/excel',
 				url: 'release/product/release/excel',
 				file: file,
 				file: file,
 				method: 'POST',
 				method: 'POST',
-				params : {selfSale : $scope.batch.sellType == 'self' ? true : false}
+				params : {selfSale : $scope.batch.sellType == 'self' ? true : false, currency : $scope.batch.currency}
 			}).success(function(data) {
 			}).success(function(data) {
 				$scope.selectFile(' ');
 				$scope.selectFile(' ');
 				$scope.batch.myFiles = [];
 				$scope.batch.myFiles = [];

+ 9 - 11
src/main/webapp/resources/view/vendor/modal/releaseProductByBatchTip.html

@@ -17,19 +17,17 @@
 	<div class="modal-header"><h4>批量发布库存说明</h4></div>
 	<div class="modal-header"><h4>批量发布库存说明</h4></div>
 	<div class="modal-body col-xs-12">
 	<div class="modal-body col-xs-12">
 		<p class="col-xs-12">
 		<p class="col-xs-12">
-			<div class="col-xs-12">1:红色必选项</div>
-			<div class="col-xs-12">品牌英文名、产品型号、库存类型、库存数量、产品生产日期</div>
+			<div class="col-xs-12">1.标题红色为必填项,黑色为选填项</div>
+			<div class="col-xs-12">2.最小包装数量不填时默认为1</div>
+			<div class="col-xs-12">3.最小起订量不填时默认等于最小包装数量</div>
+			<div class="col-xs-12">4.不可拆卖时,最小起订量应为最小保障数量的倍数</div>
+			<div class="col-xs-12">5.价格分段不填写时默认存在一个分段,分段数量为1-999999999,价格为单价</div>
 		</p>
 		</p>
 		<p class="col-xs-12">
 		<p class="col-xs-12">
-			<div class="col-xs-12">2:二选一必填项</div>
-			<div class="col-xs-12">a.RMB和USD最小包单价可以选填一种:</div>
-			<div class="col-xs-12">b.大陆交期和香港交期可以选填一种:</div>
-			<div class="col-xs-12">c.根据自身实际情况,可同时选择两种币别销售</div>
-		</p>
-		<p class="col-xs-12">
-			<div class="col-xs-12">3:日期格式</div>
-			<div class="col-xs-12">a.以准确数字做交期天数,如直接填写"5"</div>
-			<div class="col-xs-12">b.以"~"做连接符写出区间段,如"3~5"</div>
+			<div class="col-xs-12">6.日期:</div>
+			<div class="col-xs-12" style="margin-left: 20px;">a.以准确的数字做交期</div>
+			<div class="col-xs-12" style="margin-left: 20px;">b.最小和最大交期一样时默认为准确交期</div>
+			<div class="col-xs-12" style="margin-left: 20px;">c.仅填写最小或最大交期时默认为准确交期</div>
 		</p>
 		</p>
 	</div>
 	</div>
 	<div class="modal-footer col-xs-12">
 	<div class="modal-footer col-xs-12">