|
|
@ -35,6 +35,7 @@ import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.math.RoundingMode; |
|
|
|
|
|
|
|
import java.sql.Array; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
@ -118,20 +119,44 @@ public class HighThirdPartyController { |
|
|
|
BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getMarketTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getMarketTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getMarketGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getMarketGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
|
|
|
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) { |
|
|
|
|
|
|
|
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice(); |
|
|
|
|
|
|
|
} |
|
|
|
// 判断当前价格是否大雨原价 如果大于显示原价
|
|
|
|
if (salesTallPrice.compareTo(apiStarbucksProducts.getMarketTallPrice()) > 0) { |
|
|
|
if (salesTallPrice.compareTo(apiStarbucksProducts.getMarketTallPrice()) > 0) { |
|
|
|
salesTallPrice = apiStarbucksProducts.getMarketTallPrice(); |
|
|
|
salesTallPrice = apiStarbucksProducts.getMarketTallPrice(); |
|
|
|
} |
|
|
|
} |
|
|
|
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) { |
|
|
|
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) { |
|
|
|
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice(); |
|
|
|
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (salesVentiPrice.compareTo(apiStarbucksProducts.getMarketVentiPrice()) > 0) { |
|
|
|
|
|
|
|
salesVentiPrice = apiStarbucksProducts.getMarketVentiPrice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] strings = apiStarbucksProducts.getCupSize().split(","); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (String string : strings) { |
|
|
|
|
|
|
|
if ("中杯".equals(string)) { |
|
|
|
|
|
|
|
apiStarbucksProducts.setShowPrice(salesTallPrice); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("大杯".equals(string)) { |
|
|
|
|
|
|
|
apiStarbucksProducts.setShowPrice(salesGrandePrice); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("超大杯".equals(string)) { |
|
|
|
|
|
|
|
apiStarbucksProducts.setShowPrice(salesVentiPrice); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice); |
|
|
|
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice); |
|
|
|
apiStarbucksProducts.setSalesTallPrice(salesTallPrice); |
|
|
|
apiStarbucksProducts.setSalesTallPrice(salesTallPrice); |
|
|
|
apiStarbucksProducts.setCount(0); |
|
|
|
apiStarbucksProducts.setCount(0); |
|
|
|
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice); |
|
|
|
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice); |
|
|
|
starbucksProductsList.add(apiStarbucksProducts); |
|
|
|
if (apiStarbucksProducts.getShowPrice() != null) { |
|
|
|
|
|
|
|
starbucksProductsList.add(apiStarbucksProducts); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
starbucksProducts.setName(s); |
|
|
|
starbucksProducts.setName(s); |
|
|
|
starbucksProducts.setExt2(SysConst.getSysConfig().getImgUrl() + ProductImgEnum.getNameByImgUrl(s)); |
|
|
|
starbucksProducts.setExt2(SysConst.getSysConfig().getImgUrl() + ProductImgEnum.getNameByImgUrl(s)); |
|
|
|