1.通知中心相关接口
2.代客下单
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_shop_msg_state")
|
||||
public class TbShopMsgState {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "type")
|
||||
private Integer type;
|
||||
|
||||
@Column(name = "state")
|
||||
private Integer state;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Instant updateTime;
|
||||
|
||||
}
|
||||
@@ -1,59 +1,51 @@
|
||||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 商家openid信息表
|
||||
* @TableName tb_shop_open_id
|
||||
*/
|
||||
@Table(name="tb_shop_open_id")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class TbShopOpenId implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_shop_open_id")
|
||||
public class TbShopOpenId {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 已经订阅消息的商家微信号
|
||||
*/
|
||||
@Size(max = 5000)
|
||||
@Column(name = "open_id", length = 5000)
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
@Column(name = "update_time")
|
||||
private Instant updateTime;
|
||||
|
||||
/**
|
||||
* 类型 -1 任意消息 0库存预警
|
||||
*/
|
||||
@Column(name = "type")
|
||||
private Integer type;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Size(max = 255)
|
||||
@Column(name = "nickname")
|
||||
private String nickname;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "avatar")
|
||||
private String avatar;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "note")
|
||||
private String note;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.Activate;
|
||||
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface TbCashierCartMapper extends BaseMapper<TbCashierCart> {
|
||||
|
||||
|
||||
}
|
||||
@@ -2,10 +2,14 @@ package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.pojo.product.TbProductSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {
|
||||
|
||||
|
||||
@@ -14,4 +18,5 @@ public interface TbProducSkutMapper extends BaseMapper<TbProductSku> {
|
||||
|
||||
@Update("update tb_product_sku set stock_number=#{stocktakinNum} where id=#{id} and stock_number=#{stockNumber}")
|
||||
Integer updateStock(@Param("id") Integer id,@Param("stockNumber") Double stockNumber,@Param("stocktakinNum") Integer stocktakinNum);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import cn.ysk.cashier.pojo.product.TbProductSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
public interface TbProductMapper extends BaseMapper<TbProduct> {
|
||||
|
||||
@Select("select * from tb_product_sku as sku where sku.is_del=0 and sku.is_grounding=1 and sku.is_pause_sale=0 and sku.shop_id=#{shopId} and sku.id=#{skuId}")
|
||||
TbProductSku selectSkuByIdAndShopId(@Param("shopId") Integer shopId, @Param("skuId") Integer skuId);
|
||||
|
||||
}
|
||||
@Select("select * from tb_product product where product.id=#{id} and product.shop_id=#{shopId} and product.is_del=0")
|
||||
TbProduct selectByIdAndShopId(@Param("shopId") Integer shopId, @Param("id") Integer id);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopMsgState;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_msg_state】的数据库操作Mapper
|
||||
* @createDate 2024-08-12 13:39:46
|
||||
* @Entity cn.ysk.cashier.mybatis.pojo.TbShopMsgStatetb
|
||||
*/
|
||||
public interface TbShopMsgStateMapper extends BaseMapper<TbShopMsgState> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,48 @@
|
||||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
|
||||
import cn.ysk.cashier.pojo.shop.TbFullShopId;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Mapper
|
||||
* @createDate 2024-08-02 10:00:27
|
||||
* @createDate 2024-08-08 11:14:32
|
||||
* @Entity cn.ysk.cashier.mybatis.entity.TbShopOpenId
|
||||
*/
|
||||
public interface TbShopOpenIdMapper extends BaseMapper<TbShopOpenId> {
|
||||
|
||||
@Update("update tb_shop_open_id set status=#{state} where shop_id=#{shopId} and status != #{state}")
|
||||
int updateShopState(@Param("shopId") Integer shopId, @Param("state") Integer state);
|
||||
|
||||
@Update("update tb_shop_open_id set status=#{state} and shop_id=#{shopId} and id=#{id}")
|
||||
int updateStateById(@Param("state") Integer state, @Param("shopId") Integer shopId, @Param("id") Integer id);
|
||||
|
||||
@Update("update tb_shop_open_id set type")
|
||||
int updateTypeByShopId(@Param("shopId") Integer shopId, @Param("type") Integer type);
|
||||
|
||||
@Select("<script>" +
|
||||
" select *,\n" +
|
||||
" SUM(IF(type = 0, `status`, 0)) AS proState,\n" +
|
||||
" SUM(IF(type = 1, `status`, 0)) AS conState,\n" +
|
||||
" SUM(IF(type = 2, `status`, 0)) AS opeState,\n" +
|
||||
" SUM(IF(type = -1, `status`, 0)) AS allState\n" +
|
||||
" from tb_shop_open_id where shop_id=#{shopId}\n" +
|
||||
" <if test=\"nickName !=null and nickName != ''\">\n" +
|
||||
" and nickname like concat('%', #{nickName} '%')\n" +
|
||||
" </if>\n" +
|
||||
" <if test=\"openId !=null and openId != ''\">\n" +
|
||||
" and open_id like concat('%', #{openId} '%')\n" +
|
||||
" </if>\n" +
|
||||
" group by shop_id, open_id" +
|
||||
"</script>")
|
||||
Page<TbFullShopId> selectAll(@Param("shopId") Integer shopId, @Param("nickName") String nickName, @Param("openId") String openId, Page<TbFullShopId> page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopMsgState;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_msg_state】的数据库操作Service
|
||||
* @createDate 2024-08-12 13:39:46
|
||||
*/
|
||||
public interface TbShopMsgStateService extends IService<TbShopMsgState> {
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Service
|
||||
* @createDate 2024-08-02 10:00:27
|
||||
* @createDate 2024-08-08 11:14:32
|
||||
*/
|
||||
public interface TbShopOpenIdService extends IService<TbShopOpenId> {
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopMsgState;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopMsgStateService;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbShopMsgStateMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_msg_state】的数据库操作Service实现
|
||||
* @createDate 2024-08-12 13:39:46
|
||||
*/
|
||||
@Service
|
||||
public class TbShopMsgStateServiceImpl extends ServiceImpl<TbShopMsgStateMapper, TbShopMsgState>
|
||||
implements TbShopMsgStateService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* @author Administrator
|
||||
* @description 针对表【tb_shop_open_id(商家openid信息表)】的数据库操作Service实现
|
||||
* @createDate 2024-08-02 10:00:27
|
||||
* @createDate 2024-08-08 11:14:32
|
||||
*/
|
||||
@Service
|
||||
public class TbShopOpenIdServiceImpl extends ServiceImpl<TbShopOpenIdMapper, TbShopOpenId>
|
||||
|
||||
Reference in New Issue
Block a user