|
|
@@ -320,29 +320,50 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
|
|
|
qtyPrice.setStart(DoubleConstant.minReserve);
|
|
|
if(Currency.USD.equals(releaseProductByBatch.getCurrency())) {
|
|
|
Double usdMinPackPrice = releaseProductByBatch.getUsdMinPackPrice();
|
|
|
- qtyPrice.setUSDPrice(usdMinPackPrice);
|
|
|
- qtyPrice.setUSDNTPrice(usdMinPackPrice);
|
|
|
- priceMaxMinPrice[0] = usdMinPackPrice;
|
|
|
- priceMaxMinPrice[1] = usdMinPackPrice;
|
|
|
+ if(usdMinPackPrice != null) {
|
|
|
+ qtyPrice.setUSDPrice(usdMinPackPrice);
|
|
|
+ qtyPrice.setUSDNTPrice(usdMinPackPrice);
|
|
|
+ priceMaxMinPrice[0] = usdMinPackPrice;
|
|
|
+ priceMaxMinPrice[1] = usdMinPackPrice;
|
|
|
+ }
|
|
|
+
|
|
|
}else {
|
|
|
Double rmbMinPackPrice = releaseProductByBatch.getRmbMinPackPrice();
|
|
|
- qtyPrice.setRMBPrice(rmbMinPackPrice);
|
|
|
- BigDecimal priceNum = new BigDecimal(rmbMinPackPrice);
|
|
|
- BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
|
|
|
- qtyPrice.setRMBNTPrice(priceNum.divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- priceMaxMinPrice[0] = rmbMinPackPrice;
|
|
|
- priceMaxMinPrice[1] = rmbMinPackPrice;
|
|
|
+ if(rmbMinPackPrice != null) {
|
|
|
+ qtyPrice.setRMBPrice(rmbMinPackPrice);
|
|
|
+ BigDecimal priceNum = new BigDecimal(rmbMinPackPrice);
|
|
|
+ BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
|
|
|
+ qtyPrice.setRMBNTPrice(priceNum.divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
+ priceMaxMinPrice[0] = rmbMinPackPrice;
|
|
|
+ priceMaxMinPrice[1] = rmbMinPackPrice;
|
|
|
+ }
|
|
|
}
|
|
|
qtyPrice.setEnd(DoubleConstant.maxReserve);
|
|
|
prices.add(qtyPrice);
|
|
|
}
|
|
|
releaseProductByBatch.setPrices(prices);
|
|
|
if(Currency.USD.equals(releaseProductByBatch.getCurrency())) {
|
|
|
- releaseProductByBatch.setMinPriceUSD(priceMaxMinPrice[0]);
|
|
|
- releaseProductByBatch.setMaxPriceUSD(priceMaxMinPrice[1]);
|
|
|
+ if(NumberUtil.compare(priceMaxMinPrice[0], Double.MAX_VALUE) == 0) {
|
|
|
+ releaseProductByBatch.setMinPriceUSD(null);
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.setMinPriceUSD(priceMaxMinPrice[0]);
|
|
|
+ }
|
|
|
+ if(NumberUtil.compare(priceMaxMinPrice[1], Double.MIN_VALUE) == 0) {
|
|
|
+ releaseProductByBatch.setMaxPriceUSD(null);
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.setMaxPriceUSD(priceMaxMinPrice[1]);
|
|
|
+ }
|
|
|
}else {
|
|
|
- releaseProductByBatch.setMinPriceRMB(priceMaxMinPrice[0]);
|
|
|
- releaseProductByBatch.setMaxPriceRMB(priceMaxMinPrice[1]);
|
|
|
+ if(NumberUtil.compare(priceMaxMinPrice[0], Double.MAX_VALUE) == 0) {
|
|
|
+ releaseProductByBatch.setMinPriceRMB(null);
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.setMinPriceRMB(priceMaxMinPrice[0]);
|
|
|
+ }
|
|
|
+ if(NumberUtil.compare(priceMaxMinPrice[1], Double.MIN_VALUE) == 0) {
|
|
|
+ releaseProductByBatch.setMaxPriceRMB(null);
|
|
|
+ }else {
|
|
|
+ releaseProductByBatch.setMaxPriceRMB(priceMaxMinPrice[1]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|