Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jiujian
/
client-customer-order-service
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhuyifan
2025-02-28 14:28:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
877407e8dd0f08aa1862d695c3d59ac0c5474204
877407e8
1 parent
0e685719
feat(ClientCustomerOrderService): 添加 SKU 菜品库存相关 RPC接口
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
221 additions
and
0 deletions
src/main/java/com/tianting/infoloop/mapper/SkuSellQuantityMapper.java
src/main/java/com/tianting/infoloop/model/db/SkuSellQuantity.java
src/main/java/com/tianting/infoloop/service/SkuSellQuantityService.java
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
src/main/java/com/tianting/infoloop/service/impl/SkuSellQuantityServiceImpl.java
src/main/proto/ClientCustomerOrderService.proto
src/main/resources/mapper/SkuSellQuantityMapper.xml
src/main/java/com/tianting/infoloop/mapper/SkuSellQuantityMapper.java
0 → 100644
View file @
877407e
package
com
.
tianting
.
infoloop
.
mapper
;
import
com.tianting.infoloop.inject.MyBaseMapper
;
import
com.tianting.infoloop.model.db.SkuSellQuantity
;
/**
* @author zhuyf
* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Mapper
* @createDate 2025-02-28 14:03:59
* @Entity com.tianting.infoloop.model.db.SkuSellQuantity
*/
public
interface
SkuSellQuantityMapper
extends
MyBaseMapper
<
SkuSellQuantity
>
{
}
src/main/java/com/tianting/infoloop/model/db/SkuSellQuantity.java
0 → 100644
View file @
877407e
package
com
.
tianting
.
infoloop
.
model
.
db
;
import
com.baomidou.mybatisplus.annotation.FieldFill
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* sku售卖量
* @TableName sku_sell_quantities
*/
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"sku_sell_quantities"
)
public
class
SkuSellQuantity
extends
Model
<
OrderDetailDb
>
implements
Serializable
{
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
*
*/
private
Integer
enterpriseId
;
/**
*
*/
private
Integer
stallId
;
/**
* 商品ID
*/
private
Integer
skuId
;
/**
* 最大可售量
*/
private
Integer
maxSellQuantity
;
/**
* 今日已售量
*/
private
Integer
todaySellQuantity
;
/**
*
*/
private
Integer
createdBy
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createdAt
;
/**
*
*/
private
Integer
creationSource
;
/**
*
*/
private
Integer
updatedBy
;
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updatedAt
;
/**
*
*/
private
Integer
updateSource
;
@TableLogic
private
Integer
isDeleted
;
}
\ No newline at end of file
src/main/java/com/tianting/infoloop/service/SkuSellQuantityService.java
0 → 100644
View file @
877407e
package
com
.
tianting
.
infoloop
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.tianting.infoloop.model.db.SkuSellQuantity
;
/**
* @author zhuyf
* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Service
* @createDate 2025-02-28 14:03:59
*/
public
interface
SkuSellQuantityService
extends
IService
<
SkuSellQuantity
>
{
}
src/main/java/com/tianting/infoloop/service/grpc/OrderGrpcService.java
View file @
877407e
This diff is collapsed. Click to expand it.
src/main/java/com/tianting/infoloop/service/impl/SkuSellQuantityServiceImpl.java
0 → 100644
View file @
877407e
package
com
.
tianting
.
infoloop
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.tianting.infoloop.mapper.SkuSellQuantityMapper
;
import
com.tianting.infoloop.model.db.SkuSellQuantity
;
import
com.tianting.infoloop.service.SkuSellQuantityService
;
import
org.springframework.stereotype.Service
;
/**
* @author zhuyf
* @description 针对表【sku_sell_quantities(sku售卖量)】的数据库操作Service实现
* @createDate 2025-02-28 14:03:59
*/
@Service
public
class
SkuSellQuantityServiceImpl
extends
ServiceImpl
<
SkuSellQuantityMapper
,
SkuSellQuantity
>
implements
SkuSellQuantityService
{
}
src/main/proto/ClientCustomerOrderService.proto
View file @
877407e
...
...
@@ -33,6 +33,13 @@ service ClientCustomerOrderServiceRpc {
// 操作记录
rpc
GetOrderOperationRecordsByOrderId
(
GetOrderOperationRecordsByOrderIdRequest
)
returns
(
GetOrderOperationRecordsByOrderIdResponse
)
{}
rpc
BatchCreateOrderOperationRecords
(
BatchCreateOrderOperationRecordsRequest
)
returns
(
BatchCreateOrderOperationRecordsResponse
)
{}
// sku菜品库存
rpc
QuerySkuSellQuantitiesByStall
(
QuerySkuSellQuantitiesByStallRpcRequest
)
returns
(
QuerySkuSellQuantitiesByStallRpcResponse
)
{}
rpc
QuerySkuSellQuantitiesByStallAndSkuIds
(
QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest
)
returns
(
QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse
)
{}
rpc
BatchSaveSkuSellQuantities
(
BatchSaveSkuSellQuantitiesRpcRequest
)
returns
(
BatchSaveSkuSellQuantitiesRpcResponse
)
{}
}
enum
OrderStatusEnum
{
...
...
@@ -608,3 +615,56 @@ message BatchCreateOrderOperationRecordsResponse {
bool
isCreated
=
1
;
repeated
int32
ids
=
2
;
}
message
SingleSkuSellQuantityRpcResponse
{
int32
id
=
1
;
int32
enterpriseId
=
2
;
int32
stallId
=
3
;
int32
skuId
=
4
;
int32
maxSellQuantity
=
5
;
int32
todaySellQuantity
=
6
;
int32
createdBy
=
7
;
int64
createdAt
=
8
;
int32
creationSource
=
9
;
int32
updatedBy
=
10
;
int64
updatedAt
=
11
;
int32
updateSource
=
12
;
bool
isDeleted
=
13
;
}
message
QuerySkuSellQuantitiesByStallRpcRequest
{
int32
enterpriseId
=
1
;
int32
stallId
=
2
;
}
message
QuerySkuSellQuantitiesByStallRpcResponse
{
repeated
SingleSkuSellQuantityRpcResponse
responses
=
1
;
}
message
QuerySkuSellQuantitiesByStallAndSkuIdsRpcRequest
{
int32
enterpriseId
=
1
;
int32
stallId
=
2
;
repeated
int32
skuIds
=
3
;
}
message
QuerySkuSellQuantitiesByStallAndSkuIdsRpcResponse
{
repeated
SingleSkuSellQuantityRpcResponse
responses
=
1
;
}
message
BatchSaveSkuSellQuantitiesRpcRequest
{
repeated
SkuSellQuantityModification
skuSellQuantityModifications
=
1
;
int32
enterpriseId
=
2
;
int32
updatedBy
=
3
;
int32
updateSource
=
4
;
}
message
SkuSellQuantityModification
{
int32
id
=
1
;
int32
stallId
=
2
;
int32
skuId
=
3
;
int32
maxSellQuantity
=
4
;
}
message
BatchSaveSkuSellQuantitiesRpcResponse
{
bool
isSaved
=
1
;
}
...
...
src/main/resources/mapper/SkuSellQuantityMapper.xml
0 → 100644
View file @
877407e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.tianting.infoloop.mapper.SkuSellQuantityMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.tianting.infoloop.model.db.SkuSellQuantity"
>
<id
property=
"id"
column=
"id"
jdbcType=
"INTEGER"
/>
<result
property=
"enterpriseId"
column=
"enterpriseId"
jdbcType=
"INTEGER"
/>
<result
property=
"stallId"
column=
"stallId"
jdbcType=
"INTEGER"
/>
<result
property=
"skuId"
column=
"skuId"
jdbcType=
"INTEGER"
/>
<result
property=
"maxSellQuantity"
column=
"maxSellQuantity"
jdbcType=
"INTEGER"
/>
<result
property=
"todaySellQuantity"
column=
"todaySellQuantity"
jdbcType=
"INTEGER"
/>
<result
property=
"createdBy"
column=
"createdBy"
jdbcType=
"INTEGER"
/>
<result
property=
"createdAt"
column=
"createdAt"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"creationSource"
column=
"creationSource"
jdbcType=
"INTEGER"
/>
<result
property=
"updatedBy"
column=
"updatedBy"
jdbcType=
"INTEGER"
/>
<result
property=
"updatedAt"
column=
"updatedAt"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateSource"
column=
"updateSource"
jdbcType=
"INTEGER"
/>
<result
property=
"isDeleted"
column=
"isDeleted"
jdbcType=
"TINYINT"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,enterpriseId,stallId,
skuId,maxSellQuantity,todaySellQuantity,
createdBy,createdAt,creationSource,
updatedBy,updatedAt,updateSource,
isDeleted
</sql>
</mapper>
Please
register
or
login
to post a comment