1.代客下单 同步查询小程序购物车商品

This commit is contained in:
2024-08-23 10:28:49 +08:00
parent 532dec69e3
commit 614ffc9abf
7 changed files with 17 additions and 23 deletions

View File

@@ -2,8 +2,6 @@ package cn.ysk.cashier.mybatis.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@@ -14,7 +12,7 @@ import lombok.Data;
*/
@Table(name="tb_shop_user")
@Data
public class TbMShopUser implements Serializable {
public class TbShopUser implements Serializable {
/**
* (随机)
*/
@@ -82,7 +80,7 @@ public class TbMShopUser implements Serializable {
private String name;
/**
*
*
*/
private String head_img;
@@ -142,12 +140,12 @@ public class TbMShopUser implements Serializable {
private Integer sort;
/**
*
*
*/
private Long created_at;
/**
*
*
*/
private Long updated_at;
@@ -174,7 +172,7 @@ public class TbMShopUser implements Serializable {
if (getClass() != that.getClass()) {
return false;
}
TbMShopUser other = (TbMShopUser) that;
TbShopUser other = (TbShopUser) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getCredit_amount() == null ? other.getCredit_amount() == null : this.getCredit_amount().equals(other.getCredit_amount()))
@@ -281,4 +279,4 @@ public class TbMShopUser implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

View File

@@ -1,7 +1,6 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import cn.ysk.cashier.mybatis.entity.TbShopUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -16,7 +15,7 @@ import java.util.Map;
* @createDate 2024-07-06 11:46:46
* @Entity cn.ysk.cashier.mybatis.entity.TbMShopUser
*/
public interface TbMShopUserMapper extends BaseMapper<TbMShopUser> {
public interface TbMShopUserMapper extends BaseMapper<TbShopUser> {
@Select("<script>" +
"SELECT \n" +
" COUNT(DISTINCT a.id) AS userTotal, \n" +

View File

@@ -1,6 +1,5 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import cn.ysk.cashier.pojo.order.TbOrderInfo;
import cn.ysk.cashier.vo.TbOrderSaleVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -8,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {

View File

@@ -1,7 +1,7 @@
package cn.ysk.cashier.mybatis.service;
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import cn.ysk.cashier.mybatis.entity.TbShopUser;
import com.baomidou.mybatisplus.extension.service.IService;
/**
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @description 针对表【tb_shop_user(商户储值会员)】的数据库操作Service
* @createDate 2024-07-06 11:46:46
*/
public interface TbMShopUserService extends IService<TbMShopUser> {
public interface TbMShopUserService extends IService<TbShopUser> {
/**
* 查询会员概述信息

View File

@@ -2,7 +2,7 @@ package cn.ysk.cashier.mybatis.service.impl;
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import cn.ysk.cashier.mybatis.entity.TbShopUser;
import cn.ysk.cashier.mybatis.service.TbMShopUserService;
import cn.ysk.cashier.mybatis.mapper.TbMShopUserMapper;
import org.springframework.stereotype.Service;
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
* @createDate 2024-07-06 11:46:46
*/
@Service
public class TbMShopUserServiceImpl extends ServiceImpl<TbMShopUserMapper, TbMShopUser>
public class TbMShopUserServiceImpl extends ServiceImpl<TbMShopUserMapper, TbShopUser>
implements TbMShopUserService{
private final TbMShopUserMapper shopUserMapper;

View File

@@ -4,7 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.ysk.cashier.dto.ScanPayDTO;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
import cn.ysk.cashier.mybatis.entity.TbShopUser;
import cn.ysk.cashier.mybatis.entity.TbOrderPayment;
import cn.ysk.cashier.mybatis.entity.TbShopUserFlow;
import cn.ysk.cashier.mybatis.mapper.*;
@@ -14,7 +14,6 @@ import cn.ysk.cashier.pojo.order.TbCashierCart;
import cn.ysk.cashier.pojo.order.TbOrderDetail;
import cn.ysk.cashier.pojo.order.TbOrderInfo;
import cn.ysk.cashier.pojo.shop.TbMerchantThirdApply;
import cn.ysk.cashier.pojo.shop.TbShopUser;
import cn.ysk.cashier.repository.shop.TbMerchantThirdApplyRepository;
import cn.ysk.cashier.service.TbPayService;
import cn.ysk.cashier.utils.RabbitMsgUtils;
@@ -306,9 +305,9 @@ public class TbPayServiceImpl implements TbPayService {
// 扣减会员余额
TbMShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbMShopUser>()
.eq(TbMShopUser::getStatus, 1)
.eq(TbMShopUser::getId, orderInfo.getUserId()));
TbShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbShopUser>()
.eq(TbShopUser::getStatus, 1)
.eq(TbShopUser::getId, orderInfo.getUserId()));
if (shopUser == null) {
throw new BadRequestException("用户不存在或已被禁用");

View File

@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.ysk.cashier.mybatis.mapper.TbMShopUserMapper">
<resultMap id="BaseResultMap" type="cn.ysk.cashier.mybatis.entity.TbMShopUser">
<resultMap id="BaseResultMap" type="cn.ysk.cashier.mybatis.entity.TbShopUser">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="amount" column="amount" jdbcType="DECIMAL"/>
<result property="credit_amount" column="credit_amount" jdbcType="DECIMAL"/>