购物车只查询当天购物车,规格增加销量
This commit is contained in:
@@ -30,7 +30,7 @@ public interface TbCashierCartMapper {
|
|||||||
TbCashierCart selectByDetail(@Param("masterId") String masterId, @Param("productId") String productId,
|
TbCashierCart selectByDetail(@Param("masterId") String masterId, @Param("productId") String productId,
|
||||||
@Param("shopId") String shopId, @Param("skuId") String skuId, @Param("day") String day,@Param("uuid") String uuid);
|
@Param("shopId") String shopId, @Param("skuId") String skuId, @Param("day") String day,@Param("uuid") String uuid);
|
||||||
|
|
||||||
List<TbCashierCart> selectByMaskerId(@Param("masterId")String masterId, @Param("shopId")Integer shopId,@Param("status") String status);
|
List<TbCashierCart> selectByMaskerId(@Param("masterId")String masterId, @Param("shopId")Integer shopId,@Param("status") String status,@Param("day") String day);
|
||||||
|
|
||||||
void deleteByCartId(@Param("masterId") String masterId, @Param("cartId")Integer cartId);
|
void deleteByCartId(@Param("masterId") String masterId, @Param("cartId")Integer cartId);
|
||||||
|
|
||||||
|
|||||||
@@ -27,4 +27,6 @@ public interface TbProductSkuMapper {
|
|||||||
TbProductSkuWithBLOBs selectByShopIdAndProductIdAndSpec(@Param("shopId") String shopId, @Param("productId") String productId, @Param("spec") String spec);
|
TbProductSkuWithBLOBs selectByShopIdAndProductIdAndSpec(@Param("shopId") String shopId, @Param("productId") String productId, @Param("spec") String spec);
|
||||||
|
|
||||||
TbProductSkuWithBLOBs selectByProduct(@Param("productId") Integer productId);
|
TbProductSkuWithBLOBs selectByProduct(@Param("productId") Integer productId);
|
||||||
|
|
||||||
|
void updateByskuId(@Param("productSkuId") Integer productSkuId,@Param("num") Integer num);
|
||||||
}
|
}
|
||||||
@@ -40,6 +40,8 @@ public class DutyService {
|
|||||||
private TbShopInfoMapper shopInfoMapper;
|
private TbShopInfoMapper shopInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopUserDutyPayMapper shopUserDutyPayMapper;
|
private ShopUserDutyPayMapper shopUserDutyPayMapper;
|
||||||
|
@Autowired
|
||||||
|
private TbProductSkuMapper productSkuMapper;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void exect(String message) {
|
public void exect(String message) {
|
||||||
try {
|
try {
|
||||||
@@ -88,6 +90,7 @@ public class DutyService {
|
|||||||
shopUserDutyDetail.setProductId(orderDetail.getProductId());
|
shopUserDutyDetail.setProductId(orderDetail.getProductId());
|
||||||
shopUserDutyDetail.setProductName(orderDetail.getProductName());
|
shopUserDutyDetail.setProductName(orderDetail.getProductName());
|
||||||
detaiList.add(shopUserDutyDetail);
|
detaiList.add(shopUserDutyDetail);
|
||||||
|
productSkuMapper.updateByskuId(orderDetail.getProductSkuId(),orderDetail.getNum());
|
||||||
}
|
}
|
||||||
if (detaiList.size() > 0) {
|
if (detaiList.size() > 0) {
|
||||||
shopUserDutyDetailMapper.batchInsert(detaiList);
|
shopUserDutyDetailMapper.batchInsert(detaiList);
|
||||||
@@ -127,6 +130,7 @@ public class DutyService {
|
|||||||
detaiList.add(shopUserDutyDetail);
|
detaiList.add(shopUserDutyDetail);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
productSkuMapper.updateByskuId(orderDetail.getProductSkuId(),orderDetail.getNum());
|
||||||
}
|
}
|
||||||
if (detaiList.size() > 0) {
|
if (detaiList.size() > 0) {
|
||||||
shopUserDutyDetailMapper.batchInsert(detaiList);
|
shopUserDutyDetailMapper.batchInsert(detaiList);
|
||||||
@@ -195,6 +199,7 @@ public class DutyService {
|
|||||||
shopUserDutyDetail.setProductId(orderDetail.getProductId());
|
shopUserDutyDetail.setProductId(orderDetail.getProductId());
|
||||||
shopUserDutyDetail.setProductName(orderDetail.getProductName());
|
shopUserDutyDetail.setProductName(orderDetail.getProductName());
|
||||||
detaiList.add(shopUserDutyDetail);
|
detaiList.add(shopUserDutyDetail);
|
||||||
|
productSkuMapper.updateByskuId(orderDetail.getProductSkuId(),orderDetail.getNum());
|
||||||
}
|
}
|
||||||
if (detaiList.size() > 0) {
|
if (detaiList.size() > 0) {
|
||||||
shopUserDutyDetailMapper.batchInsert(detaiList);
|
shopUserDutyDetailMapper.batchInsert(detaiList);
|
||||||
@@ -234,6 +239,7 @@ public class DutyService {
|
|||||||
detaiList.add(shopUserDutyDetail);
|
detaiList.add(shopUserDutyDetail);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
productSkuMapper.updateByskuId(orderDetail.getProductSkuId(),orderDetail.getNum());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detaiList.size() > 0) {
|
if (detaiList.size() > 0) {
|
||||||
|
|||||||
@@ -185,9 +185,9 @@ public class OrderService {
|
|||||||
return Result.fail(CodeEnum.SHOPINFONOEXIST);
|
return Result.fail(CodeEnum.SHOPINFONOEXIST);
|
||||||
}
|
}
|
||||||
String day = DateUtils.getDay();
|
String day = DateUtils.getDay();
|
||||||
List<TbCashierCart> list = cashierCartMapper.selectByMaskerId(masterId, Integer.valueOf(shopId),"create");
|
List<TbCashierCart> list = cashierCartMapper.selectByMaskerId(masterId, Integer.valueOf(shopId),"create",day);
|
||||||
if (list.size() < 1){
|
if (list.size() < 1){
|
||||||
list = cashierCartMapper.selectByMaskerId(masterId, Integer.valueOf(shopId), "refund");
|
list = cashierCartMapper.selectByMaskerId(masterId, Integer.valueOf(shopId), "refund",day);
|
||||||
if (list.size() > 0){
|
if (list.size() > 0){
|
||||||
if (list.size() < 1) {
|
if (list.size() < 1) {
|
||||||
return Result.fail(CodeEnum.CARTJH);
|
return Result.fail(CodeEnum.CARTJH);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectByMaskerId" resultType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
|
<select id="selectByMaskerId" resultType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
|
||||||
select *
|
select *
|
||||||
from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} order by id desc
|
from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} and trade_day = #{day} order by id desc
|
||||||
</select>
|
</select>
|
||||||
<select id="selectCartList" resultType="com.chaozhanggui.system.cashierservice.entity.po.CartPo">
|
<select id="selectCartList" resultType="com.chaozhanggui.system.cashierservice.entity.po.CartPo">
|
||||||
select shop_Id as shopId,master_id as masterId,uuid,
|
select shop_Id as shopId,master_id as masterId,uuid,
|
||||||
|
|||||||
@@ -333,8 +333,11 @@
|
|||||||
updated_at = #{updatedAt,jdbcType=BIGINT}
|
updated_at = #{updatedAt,jdbcType=BIGINT}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateByskuId">
|
||||||
|
update tb_product_sku set real_sales_number = real_sales_number + #{num} where id = #{productSkuId}
|
||||||
|
</update>
|
||||||
|
|
||||||
<select id="selectByShopIdAndProductIdAndSpec" resultMap="ResultMapWithBLOBs">
|
<select id="selectByShopIdAndProductIdAndSpec" resultMap="ResultMapWithBLOBs">
|
||||||
select * from tb_product_sku where shop_id=#{shopId} and product_id=#{productId}
|
select * from tb_product_sku where shop_id=#{shopId} and product_id=#{productId}
|
||||||
|
|
||||||
<if test="spec != null and spec !=''">
|
<if test="spec != null and spec !=''">
|
||||||
|
|||||||
Reference in New Issue
Block a user