Showing
7 changed files
with
221 additions
and
0 deletions
| 1 | +package com.tianting.infoloop.mapper; | ||
| 2 | + | ||
| 3 | +import com.tianting.infoloop.inject.MyBaseMapper; | ||
| 4 | +import com.tianting.infoloop.model.db.SkuSellQuantity; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | +* @author zhuyf | ||
| 8 | +* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Mapper | ||
| 9 | +* @createDate 2025-02-28 14:03:59 | ||
| 10 | +* @Entity com.tianting.infoloop.model.db.SkuSellQuantity | ||
| 11 | +*/ | ||
| 12 | +public interface SkuSellQuantityMapper extends MyBaseMapper<SkuSellQuantity> { | ||
| 13 | + | ||
| 14 | + | ||
| 15 | +} |
| 1 | +package com.tianting.infoloop.model.db; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.TableLogic; | ||
| 8 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 9 | +import com.baomidou.mybatisplus.extension.activerecord.Model; | ||
| 10 | +import lombok.Data; | ||
| 11 | +import lombok.EqualsAndHashCode; | ||
| 12 | +import lombok.experimental.Accessors; | ||
| 13 | + | ||
| 14 | +import java.io.Serializable; | ||
| 15 | +import java.time.LocalDateTime; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * sku售卖量 | ||
| 19 | + * @TableName sku_sell_quantities | ||
| 20 | + */ | ||
| 21 | +@EqualsAndHashCode(callSuper = true) | ||
| 22 | +@Data | ||
| 23 | +@Accessors(chain = true) | ||
| 24 | +@TableName(value ="sku_sell_quantities") | ||
| 25 | +public class SkuSellQuantity extends Model<OrderDetailDb> implements Serializable { | ||
| 26 | + | ||
| 27 | + @TableId(type = IdType.AUTO) | ||
| 28 | + private Integer id; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * | ||
| 32 | + */ | ||
| 33 | + private Integer enterpriseId; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * | ||
| 37 | + */ | ||
| 38 | + private Integer stallId; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 商品ID | ||
| 42 | + */ | ||
| 43 | + private Integer skuId; | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 最大可售量 | ||
| 47 | + */ | ||
| 48 | + private Integer maxSellQuantity; | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 今日已售量 | ||
| 52 | + */ | ||
| 53 | + private Integer todaySellQuantity; | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * | ||
| 57 | + */ | ||
| 58 | + private Integer createdBy; | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + @TableField(fill = FieldFill.INSERT) | ||
| 62 | + private LocalDateTime createdAt; | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * | ||
| 66 | + */ | ||
| 67 | + private Integer creationSource; | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * | ||
| 71 | + */ | ||
| 72 | + private Integer updatedBy; | ||
| 73 | + | ||
| 74 | + | ||
| 75 | + @TableField(fill = FieldFill.INSERT_UPDATE) | ||
| 76 | + private LocalDateTime updatedAt; | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * | ||
| 80 | + */ | ||
| 81 | + private Integer updateSource; | ||
| 82 | + | ||
| 83 | + @TableLogic | ||
| 84 | + private Integer isDeleted; | ||
| 85 | + | ||
| 86 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | +package com.tianting.infoloop.service; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
| 4 | +import com.tianting.infoloop.model.db.SkuSellQuantity; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | +* @author zhuyf | ||
| 8 | +* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Service | ||
| 9 | +* @createDate 2025-02-28 14:03:59 | ||
| 10 | +*/ | ||
| 11 | +public interface SkuSellQuantityService extends IService<SkuSellQuantity> { | ||
| 12 | + | ||
| 13 | +} |
This diff is collapsed. Click to expand it.
| 1 | +package com.tianting.infoloop.service.impl; | ||
| 2 | + | ||
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
| 4 | +import com.tianting.infoloop.mapper.SkuSellQuantityMapper; | ||
| 5 | +import com.tianting.infoloop.model.db.SkuSellQuantity; | ||
| 6 | +import com.tianting.infoloop.service.SkuSellQuantityService; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | +* @author zhuyf | ||
| 11 | +* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Service实现 | ||
| 12 | +* @createDate 2025-02-28 14:03:59 | ||
| 13 | +*/ | ||
| 14 | +@Service | ||
| 15 | +public class SkuSellQuantityServiceImpl extends ServiceImpl<SkuSellQuantityMapper, SkuSellQuantity> implements SkuSellQuantityService { | ||
| 16 | + | ||
| 17 | +} |
| ... | @@ -33,6 +33,13 @@ service ClientCustomerOrderServiceRpc { | ... | @@ -33,6 +33,13 @@ service ClientCustomerOrderServiceRpc { |
| 33 | // 操作记录 | 33 | // 操作记录 |
| 34 | rpc GetOrderOperationRecordsByOrderId (GetOrderOperationRecordsByOrderIdRequest) returns (GetOrderOperationRecordsByOrderIdResponse) {} | 34 | rpc GetOrderOperationRecordsByOrderId (GetOrderOperationRecordsByOrderIdRequest) returns (GetOrderOperationRecordsByOrderIdResponse) {} |
| 35 | rpc BatchCreateOrderOperationRecords (BatchCreateOrderOperationRecordsRequest) returns (BatchCreateOrderOperationRecordsResponse) {} | 35 | rpc BatchCreateOrderOperationRecords (BatchCreateOrderOperationRecordsRequest) returns (BatchCreateOrderOperationRecordsResponse) {} |
| 36 | + | ||
| 37 | + | ||
| 38 | + // sku菜品库存 | ||
| 39 | + rpc QuerySkuSellQuantitiesByStall(QuerySkuSellQuantitiesByStallRpcRequest) returns (QuerySkuSellQuantitiesByStallRpcResponse) {} | ||
| 40 | + rpc QuerySkuSellQuantitiesByStallAndSkuIds(QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest) returns (QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse) {} | ||
| 41 | + rpc BatchSaveSkuSellQuantities(BatchSaveSkuSellQuantitiesRpcRequest) returns (BatchSaveSkuSellQuantitiesRpcResponse) {} | ||
| 42 | + | ||
| 36 | } | 43 | } |
| 37 | 44 | ||
| 38 | enum OrderStatusEnum { | 45 | enum OrderStatusEnum { |
| ... | @@ -608,3 +615,56 @@ message BatchCreateOrderOperationRecordsResponse { | ... | @@ -608,3 +615,56 @@ message BatchCreateOrderOperationRecordsResponse { |
| 608 | bool isCreated = 1; | 615 | bool isCreated = 1; |
| 609 | repeated int32 ids = 2; | 616 | repeated int32 ids = 2; |
| 610 | } | 617 | } |
| 618 | + | ||
| 619 | +message SingleSkuSellQuantityRpcResponse { | ||
| 620 | + int32 id = 1; | ||
| 621 | + int32 enterpriseId = 2; | ||
| 622 | + int32 stallId = 3; | ||
| 623 | + int32 skuId = 4; | ||
| 624 | + int32 maxSellQuantity = 5; | ||
| 625 | + int32 todaySellQuantity = 6; | ||
| 626 | + int32 createdBy = 7; | ||
| 627 | + int64 createdAt = 8; | ||
| 628 | + int32 creationSource = 9; | ||
| 629 | + int32 updatedBy = 10; | ||
| 630 | + int64 updatedAt = 11; | ||
| 631 | + int32 updateSource = 12; | ||
| 632 | + bool isDeleted = 13; | ||
| 633 | +} | ||
| 634 | + | ||
| 635 | +message QuerySkuSellQuantitiesByStallRpcRequest { | ||
| 636 | + int32 enterpriseId = 1; | ||
| 637 | + int32 stallId = 2; | ||
| 638 | +} | ||
| 639 | + | ||
| 640 | +message QuerySkuSellQuantitiesByStallRpcResponse { | ||
| 641 | + repeated SingleSkuSellQuantityRpcResponse responses = 1; | ||
| 642 | +} | ||
| 643 | + | ||
| 644 | +message QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest { | ||
| 645 | + int32 enterpriseId = 1; | ||
| 646 | + int32 stallId = 2; | ||
| 647 | + repeated int32 skuIds = 3; | ||
| 648 | +} | ||
| 649 | + | ||
| 650 | +message QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse { | ||
| 651 | + repeated SingleSkuSellQuantityRpcResponse responses = 1; | ||
| 652 | +} | ||
| 653 | + | ||
| 654 | +message BatchSaveSkuSellQuantitiesRpcRequest { | ||
| 655 | + repeated SkuSellQuantityModification skuSellQuantityModifications = 1; | ||
| 656 | + int32 enterpriseId = 2; | ||
| 657 | + int32 updatedBy = 3; | ||
| 658 | + int32 updateSource = 4; | ||
| 659 | +} | ||
| 660 | + | ||
| 661 | +message SkuSellQuantityModification { | ||
| 662 | + int32 id = 1; | ||
| 663 | + int32 stallId = 2; | ||
| 664 | + int32 skuId = 3; | ||
| 665 | + int32 maxSellQuantity = 4; | ||
| 666 | +} | ||
| 667 | + | ||
| 668 | +message BatchSaveSkuSellQuantitiesRpcResponse { | ||
| 669 | + bool isSaved = 1; | ||
| 670 | +} | ... | ... |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<!DOCTYPE mapper | ||
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | +<mapper namespace="com.tianting.infoloop.mapper.SkuSellQuantityMapper"> | ||
| 6 | + | ||
| 7 | + <resultMap id="BaseResultMap" type="com.tianting.infoloop.model.db.SkuSellQuantity"> | ||
| 8 | + <id property="id" column="id" jdbcType="INTEGER"/> | ||
| 9 | + <result property="enterpriseId" column="enterpriseId" jdbcType="INTEGER"/> | ||
| 10 | + <result property="stallId" column="stallId" jdbcType="INTEGER"/> | ||
| 11 | + <result property="skuId" column="skuId" jdbcType="INTEGER"/> | ||
| 12 | + <result property="maxSellQuantity" column="maxSellQuantity" jdbcType="INTEGER"/> | ||
| 13 | + <result property="todaySellQuantity" column="todaySellQuantity" jdbcType="INTEGER"/> | ||
| 14 | + <result property="createdBy" column="createdBy" jdbcType="INTEGER"/> | ||
| 15 | + <result property="createdAt" column="createdAt" jdbcType="TIMESTAMP"/> | ||
| 16 | + <result property="creationSource" column="creationSource" jdbcType="INTEGER"/> | ||
| 17 | + <result property="updatedBy" column="updatedBy" jdbcType="INTEGER"/> | ||
| 18 | + <result property="updatedAt" column="updatedAt" jdbcType="TIMESTAMP"/> | ||
| 19 | + <result property="updateSource" column="updateSource" jdbcType="INTEGER"/> | ||
| 20 | + <result property="isDeleted" column="isDeleted" jdbcType="TINYINT"/> | ||
| 21 | + </resultMap> | ||
| 22 | + | ||
| 23 | + <sql id="Base_Column_List"> | ||
| 24 | + id,enterpriseId,stallId, | ||
| 25 | + skuId,maxSellQuantity,todaySellQuantity, | ||
| 26 | + createdBy,createdAt,creationSource, | ||
| 27 | + updatedBy,updatedAt,updateSource, | ||
| 28 | + isDeleted | ||
| 29 | + </sql> | ||
| 30 | +</mapper> |
-
Please register or login to post a comment