Merge remote-tracking branch 'origin/zs' into test

This commit is contained in:
2024-08-12 15:33:21 +08:00
48 changed files with 1472 additions and 118 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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> {
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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> {
}

View File

@@ -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);
}

View File

@@ -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> {
}

View File

@@ -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> {

View File

@@ -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{
}

View File

@@ -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>