|
@@ -5,6 +5,9 @@ import java.util.List;
|
|
|
|
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
import com.pj.api.client.admin.AdminInterface;
|
|
import com.pj.api.dto.AppUserDto;
|
|
import com.pj.api.dto.AppUserDto;
|
|
|
|
+import com.pj.common.core.exception.ServiceException;
|
|
|
|
+import com.pj.current.dto.APPLoginUserInfo;
|
|
|
|
+import com.pj.current.satoken.StpAPPUserUtil;
|
|
import com.pj.current.satoken.StpUserUtil;
|
|
import com.pj.current.satoken.StpUserUtil;
|
|
import com.pj.enummj.DeleteStatus;
|
|
import com.pj.enummj.DeleteStatus;
|
|
import com.pj.tb_goods_cart.dto.GoodsCartInfoDto;
|
|
import com.pj.tb_goods_cart.dto.GoodsCartInfoDto;
|
|
@@ -87,7 +90,7 @@ public class TbGoodsCartService extends ServiceImpl<TbGoodsCartMapper, TbGoodsCa
|
|
//当前商品的单位
|
|
//当前商品的单位
|
|
tbGoodsCart.setGoodsUnit(tbGoodsTransit.getGoodsUnits());
|
|
tbGoodsCart.setGoodsUnit(tbGoodsTransit.getGoodsUnits());
|
|
//商品价格
|
|
//商品价格
|
|
- tbGoodsCart.setTotalPrice((goodsCartInfoDto.getBuyWeight() == null? 0 : goodsCartInfoDto.getBuyWeight())
|
|
|
|
|
|
+ tbGoodsCart.setTotalPrice((goodsCartInfoDto.getBuyWeight() == null? tbGoodsCart.getBuyWeight() : goodsCartInfoDto.getBuyWeight())
|
|
*
|
|
*
|
|
(tbGoodsTransit.getPrice() == null? 0 : tbGoodsTransit.getPrice()));
|
|
(tbGoodsTransit.getPrice() == null? 0 : tbGoodsTransit.getPrice()));
|
|
//设置基本属性
|
|
//设置基本属性
|
|
@@ -102,6 +105,19 @@ public class TbGoodsCartService extends ServiceImpl<TbGoodsCartMapper, TbGoodsCa
|
|
return AjaxJson.getSuccess("添加购物车成功!");
|
|
return AjaxJson.getSuccess("添加购物车成功!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 删除购物车,可批量 */
|
|
|
|
+ public int cleanCart(List<Long> ids){
|
|
|
|
+ if(ids.size() == 0)return 0;
|
|
|
|
+ //检查登录
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
|
+ throw new ServiceException("当前登录账号信息已失效!");
|
|
|
|
+ //清理购物车
|
|
|
|
+ int batchIds = tbGoodsCartMapper.deleteBatchIds(ids);
|
|
|
|
+ System.out.println("已清空 " + batchIds + " 个商品!");
|
|
|
|
+ return batchIds;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* todo:采购支付,暂时预留
|
|
* todo:采购支付,暂时预留
|
|
*/
|
|
*/
|