|
@@ -203,6 +203,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
* 设置商品促销优惠
|
|
|
*/
|
|
|
if (null != promotions) {
|
|
|
+ if (1 == promotions.getMode()) {
|
|
|
+ promotions.setTouchPrice(baseMapper.getTouchPriceBySku(cartItemVo.getSkuId(), promotions.getId()));
|
|
|
+ }
|
|
|
// 当前促销活动的价格计算列表
|
|
|
List<PromotionPriceVo> promotionPriceList = productService.getPromotionProducts(promotions, cartItemVo, taxFlag);
|
|
|
BigDecimal totalAmount = MathUtil.mul(cartItemVo.getNumber(), cartItemVo.getPrice());
|
|
@@ -592,6 +595,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
* 设置商品促销优惠
|
|
|
*/
|
|
|
if (null != promotions) {
|
|
|
+ if (1 == promotions.getMode()) {
|
|
|
+ promotions.setTouchPrice(baseMapper.getTouchPriceBySku(cartItemVo.getSkuId(), promotions.getId()));
|
|
|
+ }
|
|
|
BigDecimal totalAmount = MathUtil.mul(cartItemVo.getNumber(), cartItemVo.getPrice());
|
|
|
Double floor = Math.floor(MathUtil.div(totalAmount, promotions.getTouchPrice()).doubleValue());
|
|
|
// 关闭阶梯价格,活动优先
|
|
@@ -910,18 +916,18 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
if (firstSize != shopList.size()) {
|
|
|
shopList = cartClubMapper.getCartShopsByProductIds(userId, skuIdList, 2);
|
|
|
}
|
|
|
- String helpContent=null;
|
|
|
- boolean flag=false;
|
|
|
+ String helpContent = null;
|
|
|
+ boolean flag = false;
|
|
|
if (null != shopList && shopList.size() > 0) {
|
|
|
// 遍历供应商列表
|
|
|
List<String> finalIdList = skuIdList;//购物车商品skuId列表
|
|
|
Integer finalUserIdentity = userIdentity;
|
|
|
Integer finalUserClubType = userClubType;
|
|
|
Integer finalUserIdentity1 = userIdentity;
|
|
|
- for (int i=0;i<shopList.size();i++) {
|
|
|
+ for (int i = 0; i < shopList.size(); i++) {
|
|
|
//订单中存在不能退货的商品则给出不能退货提示
|
|
|
- if(null!=shopList.get(i).getReturnGoodsStutas()&&shopList.get(i).getReturnGoodsStutas()==2){
|
|
|
- flag=true;
|
|
|
+ if (null != shopList.get(i).getReturnGoodsStutas() && shopList.get(i).getReturnGoodsStutas() == 2) {
|
|
|
+ flag = true;
|
|
|
helpContent = cartClubMapper.getHelpContent(1040);
|
|
|
break;
|
|
|
}
|
|
@@ -1210,10 +1216,10 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
resultData.put("userBeans", userBeans);
|
|
|
resultData.put("includeRecharge", includeRecharge);
|
|
|
resultData.put("couponList", couponList);
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
resultData.put("returnGoodsStutas", 2);
|
|
|
resultData.put("helpContent", helpContent);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultData.put("returnGoodsStutas", 1);
|
|
|
resultData.put("helpContent", null);
|
|
|
}
|
|
@@ -1295,20 +1301,20 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
// 商品的供应商列表
|
|
|
List<CartShopVo> shopList = cartClubMapper.getShopsByProductIds(productIdList);
|
|
|
//按供应商分类统计商品
|
|
|
- String helpContent=null;
|
|
|
- boolean flag=false;
|
|
|
+ String helpContent = null;
|
|
|
+ boolean flag = false;
|
|
|
if (null != shopList && shopList.size() > 0) {
|
|
|
// 遍历供应商列表
|
|
|
List<Integer> finalIdList = skuIdList;//商品id列表
|
|
|
Integer finalUserIdentity = userIdentity;
|
|
|
Integer finalUserClubType = userClubType;
|
|
|
Integer finalUserIdentity1 = userIdentity;
|
|
|
- for (int i=0;i<shopList.size();i++) {
|
|
|
+ for (int i = 0; i < shopList.size(); i++) {
|
|
|
//订单中存在不能退货的商品则给出不能退货提示
|
|
|
- if(null!=shopList.get(i).getReturnGoodsStutas()&&shopList.get(i).getReturnGoodsStutas()==2){
|
|
|
- flag=true;
|
|
|
- helpContent = cartClubMapper.getHelpContent(1040);
|
|
|
- break;
|
|
|
+ if (null != shopList.get(i).getReturnGoodsStutas() && shopList.get(i).getReturnGoodsStutas() == 2) {
|
|
|
+ flag = true;
|
|
|
+ helpContent = cartClubMapper.getHelpContent(1040);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
shopList.forEach(shop -> {
|
|
@@ -1595,10 +1601,10 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
resultData.put("userBeans", userBeans);
|
|
|
resultData.put("includeRecharge", includeRecharge);
|
|
|
resultData.put("couponList", couponList);
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
resultData.put("returnGoodsStutas", 2);
|
|
|
resultData.put("helpContent", helpContent);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultData.put("returnGoodsStutas", 1);
|
|
|
resultData.put("helpContent", null);
|
|
|
}
|
|
@@ -1637,9 +1643,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
CartItemVo cartItemVo = cartClubMapper.getCartItemByProductId(cartDto.getSkuId());
|
|
|
if (null == cartItemVo) {
|
|
|
return ResponseJson.error("商品数据异常!", null);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//是否能退货
|
|
|
- if(null!=cartItemVo.getReturnGoodsStutas()&&2==cartItemVo.getReturnGoodsStutas()){
|
|
|
+ if (null != cartItemVo.getReturnGoodsStutas() && 2 == cartItemVo.getReturnGoodsStutas()) {
|
|
|
String helpContent = orderCommonMapper.getHelpContent(1040);
|
|
|
cartItemVo.setHelpContent(helpContent);
|
|
|
}
|
|
@@ -1839,21 +1845,21 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
// 获取用户可用优惠券
|
|
|
List<CouponVo> couponList = getUserCartCoupons(cartList, cartDto.getSource(), cartDto.getUserId());
|
|
|
//订单中存在不能退货的商品则给出不能退货提示
|
|
|
- boolean flag=false;
|
|
|
- String helpContent=null;
|
|
|
- if(null!=shopList&&shopList.size()>0){
|
|
|
- for (CartShopVo so:shopList) {
|
|
|
- List<CartItemVo> carList = so.getCartList();
|
|
|
- if(null!=carList&&carList.size()>0){
|
|
|
- for (CartItemVo op:carList) {
|
|
|
- if(null!=op.getReturnGoodsStutas()&&op.getReturnGoodsStutas()==2){
|
|
|
- flag=true;
|
|
|
- helpContent=op.getHelpContent();
|
|
|
- }
|
|
|
- }
|
|
|
+ boolean flag = false;
|
|
|
+ String helpContent = null;
|
|
|
+ if (null != shopList && shopList.size() > 0) {
|
|
|
+ for (CartShopVo so : shopList) {
|
|
|
+ List<CartItemVo> carList = so.getCartList();
|
|
|
+ if (null != carList && carList.size() > 0) {
|
|
|
+ for (CartItemVo op : carList) {
|
|
|
+ if (null != op.getReturnGoodsStutas() && op.getReturnGoodsStutas() == 2) {
|
|
|
+ flag = true;
|
|
|
+ helpContent = op.getHelpContent();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
// 包装返回数据
|
|
|
Map<String, Object> resultData = new HashMap<>();
|
|
|
resultData.put("list", shopList);
|
|
@@ -1869,10 +1875,10 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
resultData.put("includeRecharge", includeRecharge);
|
|
|
resultData.put("promotions", totalPromotions);
|
|
|
resultData.put("couponList", couponList);
|
|
|
- if(flag){
|
|
|
+ if (flag) {
|
|
|
resultData.put("returnGoodsStutas", 2);
|
|
|
resultData.put("helpContent", helpContent);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultData.put("returnGoodsStutas", 1);
|
|
|
resultData.put("helpContent", null);
|
|
|
}
|
|
@@ -1937,9 +1943,9 @@ public class CartClubServiceImpl implements CartClubService {
|
|
|
/**
|
|
|
* 获取结算商品运费
|
|
|
*
|
|
|
- * @param userId 用户ID
|
|
|
- * @param skuIds skuIds,逗号隔开
|
|
|
- * @param townId 地区Id
|
|
|
+ * @param userId 用户ID
|
|
|
+ * @param skuIds skuIds,逗号隔开
|
|
|
+ * @param townId 地区Id
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<Map<String, Object>> getProductsPostage(Integer userId, String skuIds, Integer townId) {
|