|
@@ -1041,9 +1041,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
}
|
|
|
// 是否包含需要冷链运输商品
|
|
|
List<Integer> collect = productList.stream().map(CartItemVo::getProductId).collect(Collectors.toList());
|
|
|
- if (collect.stream().allMatch(c -> c == 7881)) {
|
|
|
+ if (collect.stream().allMatch(c -> c == 7578)) {
|
|
|
shop.setDesignatedFlag(1);
|
|
|
- } else if (!collect.contains(7881)) {
|
|
|
+ } else if (!collect.contains(7578)) {
|
|
|
shop.setDesignatedFlag(2);
|
|
|
} else {
|
|
|
shop.setDesignatedFlag(3);
|
|
@@ -1053,11 +1053,11 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
// 迭代器设置商品信息
|
|
|
for (CartItemVo cartItemVo : productList) {
|
|
|
// 设置商品运费
|
|
|
- if (7881 == cartItemVo.getProductId()) {
|
|
|
+ if (7578 == cartItemVo.getProductId()) {
|
|
|
if (cartItemVo.getNumber() >= 100) {
|
|
|
coldChain = 0d;
|
|
|
} else {
|
|
|
- coldChain = 700d;
|
|
|
+ coldChain = baseMapper.getFreightAmount(cartItemVo.getProductId());
|
|
|
shop.setPostageFlag(1);
|
|
|
}
|
|
|
}
|
|
@@ -1169,7 +1169,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
} else {
|
|
|
Double postage = (Double) postageMap.get("postage");
|
|
|
shopPostage.set(MathUtil.add(shopPostage.get(), postage).doubleValue());
|
|
|
-
|
|
|
+ log.info("shopPostage.get()======"+shopPostage.get());
|
|
|
}
|
|
|
shop.setUserBeans((Integer) postageMap.get("userBeans"));
|
|
|
}
|
|
@@ -1188,23 +1188,16 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
}
|
|
|
shop.setPostage(shopPostage.get());
|
|
|
shop.setColdChain(coldChain);
|
|
|
- if (700 == coldChain) {
|
|
|
+ if (0 != coldChain) {
|
|
|
shop.setIsColdChina(true);
|
|
|
} else {
|
|
|
shop.setIsColdChina(false);
|
|
|
}
|
|
|
- // 总费用 + 冷链费
|
|
|
- // shopPrice.set(MathUtil.add(shopPrice.get(), coldChain).doubleValue());
|
|
|
- // 只有冷链费商品 运费为0
|
|
|
- /*if (null != townId) {
|
|
|
- if (1 == shop.getDesignatedFlag()) {
|
|
|
- shop.setPostage(0d);
|
|
|
- }
|
|
|
- }*/
|
|
|
- // 总运费
|
|
|
- shop.setAllPostage(MathUtil.add(shop.getPostage(),coldChain).doubleValue());
|
|
|
+ // 运费
|
|
|
+ shop.setPostage(MathUtil.sub(shop.getPostage(), coldChain).doubleValue());
|
|
|
+ log.info("shop.getPostage()******"+shop.getPostage());
|
|
|
// 供应商总金额
|
|
|
- shopPrice.set(MathUtil.add(shopPrice.get(), shop.getAllPostage()).doubleValue());
|
|
|
+ shopPrice.set(MathUtil.add(MathUtil.add(shopPrice.get(), shop.getPostage()),coldChain).doubleValue());
|
|
|
if (shopKindCount.get() > 0) {
|
|
|
// 店铺促销
|
|
|
if (null != shopPromotion) {
|
|
@@ -1371,11 +1364,11 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
double coldChain = 0.00d;
|
|
|
if (null != totalProductList) {
|
|
|
for (CartItemVo cart :totalProductList) {
|
|
|
- if (7881 == cart.getProductId()) {
|
|
|
+ if (7578 == cart.getProductId()) {
|
|
|
if (cart.getNumber() >= 100) {
|
|
|
coldChain = 0.00d;
|
|
|
} else {
|
|
|
- coldChain = 700.00d;
|
|
|
+ coldChain = baseMapper.getFreightAmount(cart.getProductId());
|
|
|
}
|
|
|
break;
|
|
|
} else {
|
|
@@ -1519,9 +1512,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
if (null != productList && productList.size() > 0) {
|
|
|
// 是否包含需要冷链运输商品
|
|
|
List<Integer> collect = productList.stream().map(CartItemVo::getProductId).collect(Collectors.toList());
|
|
|
- if (collect.stream().allMatch(c -> c == 7881)) {
|
|
|
+ if (collect.stream().allMatch(c -> c == 7578)) {
|
|
|
shop.setDesignatedFlag(1);
|
|
|
- } else if (!collect.contains(7881)) {
|
|
|
+ } else if (!collect.contains(7578)) {
|
|
|
shop.setDesignatedFlag(2);
|
|
|
} else {
|
|
|
shop.setDesignatedFlag(3);
|
|
@@ -1539,11 +1532,11 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
for (CartItemVo cartItemVo : productList) {
|
|
|
// 设置商品运费
|
|
|
if (null != cityId) {
|
|
|
- if (7881 == cartItemVo.getProductId()) {
|
|
|
+ if (7578 == cartItemVo.getProductId()) {
|
|
|
if (cartItemVo.getNumber() >= 100) {
|
|
|
coldChain = 0d;
|
|
|
} else {
|
|
|
- coldChain = 700d;
|
|
|
+ coldChain = baseMapper.getFreightAmount(cartItemVo.getProductId());
|
|
|
shop.setPostageFlag(1);
|
|
|
}
|
|
|
}
|
|
@@ -1679,9 +1672,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
}
|
|
|
}*/
|
|
|
// 总运费
|
|
|
- shop.setAllPostage(MathUtil.add(shop.getPostage(),coldChain).doubleValue());
|
|
|
+ shop.setPostage(MathUtil.sub(shop.getPostage(),coldChain).doubleValue());
|
|
|
// 供应商总金额
|
|
|
- shopPrice.set(MathUtil.add(shopPrice.get(), shop.getAllPostage()).doubleValue());
|
|
|
+ shopPrice.set(MathUtil.add(MathUtil.add(shopPrice.get(), shop.getPostage()),coldChain).doubleValue());
|
|
|
if (shopKindCount.get() > 0) {
|
|
|
// 店铺促销
|
|
|
if (null != shopPromotion) {
|
|
@@ -2040,7 +2033,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
Double coldChain = 0d;
|
|
|
if (null != cartDto.getCityId()) {
|
|
|
// 是否包含需要冷链运输商品 1 冷链费商品 2 不含冷链费商品 3 包含冷链费商品
|
|
|
- if (cartDto.getProductId() == 7881) {
|
|
|
+ if (cartDto.getProductId() == 7578) {
|
|
|
shop.setDesignatedFlag(1);
|
|
|
} else {
|
|
|
shop.setDesignatedFlag(2);
|
|
@@ -2057,11 +2050,11 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
shop.setUserBeans((Integer) postageMap.get("userBeans"));
|
|
|
}
|
|
|
|
|
|
- if (7881 == cartItemVo.getProductId()) {
|
|
|
+ if (7578 == cartItemVo.getProductId()) {
|
|
|
if (cartItemVo.getNumber() >= 100) {
|
|
|
coldChain = 0d;
|
|
|
} else {
|
|
|
- coldChain = 700d;
|
|
|
+ coldChain = baseMapper.getFreightAmount(cartItemVo.getProductId());
|
|
|
shop.setPostageFlag(1);
|
|
|
// totalPrice.set(MathUtil.add(totalPrice.get(), coldChain).doubleValue());
|
|
|
shop.setIsColdChina(true);
|
|
@@ -2078,9 +2071,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
}
|
|
|
}*/
|
|
|
// 总运费
|
|
|
- shop.setAllPostage(MathUtil.add(shop.getPostage(),coldChain).doubleValue());
|
|
|
+ shop.setPostage(MathUtil.sub(shop.getPostage(), coldChain).doubleValue());
|
|
|
// 供应商总金额
|
|
|
- totalPrice.set(MathUtil.add(totalPrice.get(), shop.getAllPostage()).doubleValue());
|
|
|
+ totalPrice.set(MathUtil.add(MathUtil.add(totalPrice.get(), shop.getPostage()), coldChain).doubleValue());
|
|
|
// 商品总金额累加
|
|
|
originalPrice.set(MathUtil.mul(cartItemVo.getNumber(), cartItemVo.getOriginalPrice()).doubleValue());
|
|
|
totalPrice.set(MathUtil.add(totalPrice.get(), MathUtil.mul(cartItemVo.getNumber(), cartItemVo.getPrice())).doubleValue());
|
|
@@ -2252,7 +2245,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
* @param townId 地区Id
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson<Map<String, Object>> getProductsPostage(Integer userId, String skuIds, Integer townId) {
|
|
|
+ public ResponseJson<Map<String, Object>> getProductsPostage(Integer userId, String skuIds, Integer cityId) {
|
|
|
// 商品Id信息
|
|
|
List<String> skuIdList = new ArrayList<>();
|
|
|
if (skuIds.contains(",")) {
|
|
@@ -2261,7 +2254,7 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
skuIdList.add(skuIds);
|
|
|
}
|
|
|
// 计算运费
|
|
|
- Map<String, Object> resultMap = productService.computePostage(userId, townId, 0, 0d, skuIdList);
|
|
|
+ Map<String, Object> resultMap = productService.computePostage(userId, cityId, 0, 0d, skuIdList);
|
|
|
return ResponseJson.success(resultMap);
|
|
|
}
|
|
|
|