|
|
@ -113,9 +113,23 @@ public class HighThirdPartyController { |
|
|
|
List<ApiStarbucksProducts> list = apiProductService.getStarbucksProducts(map); |
|
|
|
List<ApiStarbucksProducts> list = apiProductService.getStarbucksProducts(map); |
|
|
|
for (ApiStarbucksProducts apiStarbucksProducts : list) { |
|
|
|
for (ApiStarbucksProducts apiStarbucksProducts : list) { |
|
|
|
apiStarbucksProducts.setExt1(String.valueOf(i)); |
|
|
|
apiStarbucksProducts.setExt1(String.valueOf(i)); |
|
|
|
apiStarbucksProducts.setSalesVentiPrice(apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
apiStarbucksProducts.setSalesTallPrice(apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
BigDecimal salesVentiPrice = apiStarbucksProducts.getSalesVentiPrice().add(apiStarbucksProducts.getSalesVentiPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
apiStarbucksProducts.setSalesGrandePrice(apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
BigDecimal salesTallPrice = apiStarbucksProducts.getSalesTallPrice().add(apiStarbucksProducts.getSalesTallPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
BigDecimal salesGrandePrice = apiStarbucksProducts.getSalesGrandePrice().add(apiStarbucksProducts.getSalesGrandePrice().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) { |
|
|
|
|
|
|
|
salesTallPrice = apiStarbucksProducts.getMarketTallPrice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (salesGrandePrice.compareTo(apiStarbucksProducts.getMarketGrandePrice()) > 0) { |
|
|
|
|
|
|
|
salesGrandePrice = apiStarbucksProducts.getMarketGrandePrice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
apiStarbucksProducts.setSalesVentiPrice(salesVentiPrice); |
|
|
|
|
|
|
|
apiStarbucksProducts.setSalesTallPrice(salesTallPrice); |
|
|
|
|
|
|
|
apiStarbucksProducts.setSalesGrandePrice(salesGrandePrice); |
|
|
|
starbucksProductsList.add(apiStarbucksProducts); |
|
|
|
starbucksProductsList.add(apiStarbucksProducts); |
|
|
|
} |
|
|
|
} |
|
|
|
starbucksProducts.setName(s); |
|
|
|
starbucksProducts.setName(s); |
|
|
@ -157,7 +171,8 @@ public class HighThirdPartyController { |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "查询肯德基门店") |
|
|
|
@ApiOperation(value = "查询肯德基门店") |
|
|
|
public ResponseData getKfcStoresList(@RequestParam(name = "storeName", required = false) String storeName, |
|
|
|
public ResponseData getKfcStoresList(@RequestParam(name = "storeName", required = false) String storeName, |
|
|
|
@RequestParam(name = "cityCode", required = true) String cityCode, |
|
|
|
@RequestParam(name = "cityCode", required = false) String cityCode, |
|
|
|
|
|
|
|
@RequestParam(name = "cityName", required = false) String cityName, |
|
|
|
@RequestParam(name = "lat", required = true) String lat, |
|
|
|
@RequestParam(name = "lat", required = true) String lat, |
|
|
|
@RequestParam(name = "lon", required = true) String lon) { |
|
|
|
@RequestParam(name = "lon", required = true) String lon) { |
|
|
|
try { |
|
|
|
try { |
|
|
@ -165,6 +180,7 @@ public class HighThirdPartyController { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
map.put("storeName", storeName); |
|
|
|
map.put("storeName", storeName); |
|
|
|
map.put("cityCode", cityCode); |
|
|
|
map.put("cityCode", cityCode); |
|
|
|
|
|
|
|
map.put("cityName", cityName); |
|
|
|
|
|
|
|
|
|
|
|
List<ApiKfcStores> list = apiProductService.getKfcStoresList(map); |
|
|
|
List<ApiKfcStores> list = apiProductService.getKfcStoresList(map); |
|
|
|
|
|
|
|
|
|
|
@ -202,7 +218,7 @@ public class HighThirdPartyController { |
|
|
|
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); |
|
|
|
SecRegion region = commonService.getParentByRegion(Long.valueOf(regionId)); |
|
|
|
if (region != null) { |
|
|
|
if (region != null) { |
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); |
|
|
|
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString()); |
|
|
|
productDiscount = thirdProductConfig.getProductConfigNum(1, bsCompany.getId()); |
|
|
|
productDiscount = thirdProductConfig.getProductConfigNum(2, bsCompany.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (productDiscount == null) { |
|
|
|
if (productDiscount == null) { |
|
|
@ -219,13 +235,22 @@ public class HighThirdPartyController { |
|
|
|
for (Object products : dataObject.getJSONArray("products")) { |
|
|
|
for (Object products : dataObject.getJSONArray("products")) { |
|
|
|
JSONObject productsObject = (JSONObject) products; |
|
|
|
JSONObject productsObject = (JSONObject) products; |
|
|
|
BigDecimal productsPrice = productsObject.getBigDecimal("price"); |
|
|
|
BigDecimal productsPrice = productsObject.getBigDecimal("price"); |
|
|
|
productsObject.put("salePrice", productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal salePriceF = productsPrice.add(productsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
if (salePriceF.compareTo(productsObject.getBigDecimal("originalPrice")) > 0) { |
|
|
|
|
|
|
|
salePriceF = productsObject.getBigDecimal("originalPrice"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
productsObject.put("salePrice", salePriceF); |
|
|
|
|
|
|
|
|
|
|
|
if (productsObject.getJSONArray("specGroups") != null) { |
|
|
|
if (productsObject.getJSONArray("specGroups") != null) { |
|
|
|
for (Object specGroups : productsObject.getJSONArray("specGroups")) { |
|
|
|
for (Object specGroups : productsObject.getJSONArray("specGroups")) { |
|
|
|
JSONObject specGroupsObject = (JSONObject) specGroups; |
|
|
|
JSONObject specGroupsObject = (JSONObject) specGroups; |
|
|
|
BigDecimal specGroupsPrice = specGroupsObject.getBigDecimal("price"); |
|
|
|
BigDecimal specGroupsPrice = specGroupsObject.getBigDecimal("price"); |
|
|
|
specGroupsObject.put("salePrice", specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
BigDecimal salePrice = specGroupsPrice.add(specGroupsPrice.multiply(productDiscount).divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
if (salePrice.compareTo(specGroupsObject.getBigDecimal("originalPrice")) > 0) { |
|
|
|
|
|
|
|
salePrice = specGroupsObject.getBigDecimal("originalPrice"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
specGroupsObject.put("salePrice", salePrice); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -281,6 +306,7 @@ public class HighThirdPartyController { |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("======================================================" + object); |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(object.getString("customerMobile")) || |
|
|
|
if (StringUtils.isBlank(object.getString("customerMobile")) || |
|
|
|
StringUtils.isBlank(object.getString("regionId")) || |
|
|
|
StringUtils.isBlank(object.getString("regionId")) || |
|
|
@ -465,7 +491,14 @@ public class HighThirdPartyController { |
|
|
|
List<ApiMemberProduct> list = apiMemberProductService.getListApiMemberProduct(map); |
|
|
|
List<ApiMemberProduct> list = apiMemberProductService.getListApiMemberProduct(map); |
|
|
|
|
|
|
|
|
|
|
|
for (ApiMemberProduct memberProduct : list) { |
|
|
|
for (ApiMemberProduct memberProduct : list) { |
|
|
|
memberProduct.setCostPrice(memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal costPrice = memberProduct.getCostPrice().add(memberProduct.getCostPrice().multiply(productDiscount.divide(new BigDecimal(100)))).setScale(2, RoundingMode.HALF_UP); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (costPrice.compareTo(memberProduct.getPrice()) > 0) { |
|
|
|
|
|
|
|
costPrice = memberProduct.getPrice(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memberProduct.setCostPrice(costPrice); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(list); |
|
|
|
return ResponseMsgUtil.success(list); |
|
|
|