1.代客下单 同步查询小程序购物车商品
This commit is contained in:
@@ -2,8 +2,6 @@ package cn.ysk.cashier.mybatis.entity;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import javax.persistence.Column;
|
|
||||||
import javax.persistence.GeneratedValue;
|
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -14,7 +12,7 @@ import lombok.Data;
|
|||||||
*/
|
*/
|
||||||
@Table(name="tb_shop_user")
|
@Table(name="tb_shop_user")
|
||||||
@Data
|
@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 name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private String head_img;
|
private String head_img;
|
||||||
|
|
||||||
@@ -142,12 +140,12 @@ public class TbMShopUser implements Serializable {
|
|||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Long created_at;
|
private Long created_at;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Long updated_at;
|
private Long updated_at;
|
||||||
|
|
||||||
@@ -174,7 +172,7 @@ public class TbMShopUser implements Serializable {
|
|||||||
if (getClass() != that.getClass()) {
|
if (getClass() != that.getClass()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
TbMShopUser other = (TbMShopUser) that;
|
TbShopUser other = (TbShopUser) that;
|
||||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||||
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
|
&& (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()))
|
&& (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("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package cn.ysk.cashier.mybatis.mapper;
|
package cn.ysk.cashier.mybatis.mapper;
|
||||||
|
|
||||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
import cn.ysk.cashier.mybatis.entity.TbShopUser;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
@@ -16,7 +15,7 @@ import java.util.Map;
|
|||||||
* @createDate 2024-07-06 11:46:46
|
* @createDate 2024-07-06 11:46:46
|
||||||
* @Entity cn.ysk.cashier.mybatis.entity.TbMShopUser
|
* @Entity cn.ysk.cashier.mybatis.entity.TbMShopUser
|
||||||
*/
|
*/
|
||||||
public interface TbMShopUserMapper extends BaseMapper<TbMShopUser> {
|
public interface TbMShopUserMapper extends BaseMapper<TbShopUser> {
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
"SELECT \n" +
|
"SELECT \n" +
|
||||||
" COUNT(DISTINCT a.id) AS userTotal, \n" +
|
" COUNT(DISTINCT a.id) AS userTotal, \n" +
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package cn.ysk.cashier.mybatis.mapper;
|
package cn.ysk.cashier.mybatis.mapper;
|
||||||
|
|
||||||
import cn.ysk.cashier.mybatis.entity.TbMShopUser;
|
|
||||||
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
||||||
import cn.ysk.cashier.vo.TbOrderSaleVO;
|
import cn.ysk.cashier.vo.TbOrderSaleVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
@@ -8,7 +7,6 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
|
public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cn.ysk.cashier.mybatis.service;
|
package cn.ysk.cashier.mybatis.service;
|
||||||
|
|
||||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
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;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
* @description 针对表【tb_shop_user(商户储值会员)】的数据库操作Service
|
* @description 针对表【tb_shop_user(商户储值会员)】的数据库操作Service
|
||||||
* @createDate 2024-07-06 11:46:46
|
* @createDate 2024-07-06 11:46:46
|
||||||
*/
|
*/
|
||||||
public interface TbMShopUserService extends IService<TbMShopUser> {
|
public interface TbMShopUserService extends IService<TbShopUser> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员概述信息
|
* 查询会员概述信息
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package cn.ysk.cashier.mybatis.service.impl;
|
|||||||
|
|
||||||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.service.TbMShopUserService;
|
||||||
import cn.ysk.cashier.mybatis.mapper.TbMShopUserMapper;
|
import cn.ysk.cashier.mybatis.mapper.TbMShopUserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
|
|||||||
* @createDate 2024-07-06 11:46:46
|
* @createDate 2024-07-06 11:46:46
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class TbMShopUserServiceImpl extends ServiceImpl<TbMShopUserMapper, TbMShopUser>
|
public class TbMShopUserServiceImpl extends ServiceImpl<TbMShopUserMapper, TbShopUser>
|
||||||
implements TbMShopUserService{
|
implements TbMShopUserService{
|
||||||
|
|
||||||
private final TbMShopUserMapper shopUserMapper;
|
private final TbMShopUserMapper shopUserMapper;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.ysk.cashier.dto.ScanPayDTO;
|
import cn.ysk.cashier.dto.ScanPayDTO;
|
||||||
import cn.ysk.cashier.exception.BadRequestException;
|
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.TbOrderPayment;
|
||||||
import cn.ysk.cashier.mybatis.entity.TbShopUserFlow;
|
import cn.ysk.cashier.mybatis.entity.TbShopUserFlow;
|
||||||
import cn.ysk.cashier.mybatis.mapper.*;
|
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.TbOrderDetail;
|
||||||
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
import cn.ysk.cashier.pojo.order.TbOrderInfo;
|
||||||
import cn.ysk.cashier.pojo.shop.TbMerchantThirdApply;
|
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.repository.shop.TbMerchantThirdApplyRepository;
|
||||||
import cn.ysk.cashier.service.TbPayService;
|
import cn.ysk.cashier.service.TbPayService;
|
||||||
import cn.ysk.cashier.utils.RabbitMsgUtils;
|
import cn.ysk.cashier.utils.RabbitMsgUtils;
|
||||||
@@ -306,9 +305,9 @@ public class TbPayServiceImpl implements TbPayService {
|
|||||||
|
|
||||||
|
|
||||||
// 扣减会员余额
|
// 扣减会员余额
|
||||||
TbMShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbMShopUser>()
|
TbShopUser shopUser = shopUserMapper.selectOne(new LambdaUpdateWrapper<TbShopUser>()
|
||||||
.eq(TbMShopUser::getStatus, 1)
|
.eq(TbShopUser::getStatus, 1)
|
||||||
.eq(TbMShopUser::getId, orderInfo.getUserId()));
|
.eq(TbShopUser::getId, orderInfo.getUserId()));
|
||||||
|
|
||||||
if (shopUser == null) {
|
if (shopUser == null) {
|
||||||
throw new BadRequestException("用户不存在或已被禁用");
|
throw new BadRequestException("用户不存在或已被禁用");
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="cn.ysk.cashier.mybatis.mapper.TbMShopUserMapper">
|
<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"/>
|
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||||
<result property="amount" column="amount" jdbcType="DECIMAL"/>
|
<result property="amount" column="amount" jdbcType="DECIMAL"/>
|
||||||
<result property="credit_amount" column="credit_amount" jdbcType="DECIMAL"/>
|
<result property="credit_amount" column="credit_amount" jdbcType="DECIMAL"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user