1.商品列表增加"厂家编码"查询;

This commit is contained in:
chenlin 2024-12-25 10:33:46 +08:00
parent c5958b0cb7
commit 8a0c190cf7
4 changed files with 419 additions and 0 deletions

View File

@ -306,6 +306,7 @@ func (c *ErpCommodity) SetErpCategory() error {
type ErpCommodityListReq struct {
SerialNumber string `json:"serial_number"` // 商品编号
ManufacturerCode string `json:"manufacturer_code"` // 厂家编码
ErpCommodityName string `json:"erp_commodity_name"` // 商品名称
ErpCategoryId uint32 `json:"erp_category_id"` // 商品分类id
IMEI string `json:"imei"` // 串码
@ -436,6 +437,9 @@ func (m *ErpCommodityListReq) List() (*ErpCommodityListResp, error) {
if m.SerialNumber != "" {
qs = qs.Where("serial_number = ?", m.SerialNumber)
}
if m.ManufacturerCode != "" {
qs = qs.Where("manufacturer_code = ?", m.ManufacturerCode)
}
if m.ErpCommodityName != "" {
qs = qs.Where("name LIKE ?", "%"+m.ErpCommodityName+"%")
}
@ -526,6 +530,10 @@ func (m *ErpCommodityListReq) List() (*ErpCommodityListResp, error) {
startIndex = 0
page = 0
}
if startIndex > len(commodities) {
startIndex = 0
page = 0
}
endIndex := (page + 1) * m.PageSize
if endIndex > len(commodities) {
endIndex = len(commodities)

View File

@ -1175,6 +1175,39 @@ const docTemplate = `{
}
}
},
"/api/v1/decision/store_sales_report": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"决策中心V1.4.0"
],
"summary": "门店销售对比",
"parameters": [
{
"description": "门店销售对比数据模型",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ErpStoreSalesDataReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ErpStoreSalesDataResp"
}
}
}
}
},
"/api/v1/dept": {
"put": {
"security": [
@ -8913,6 +8946,10 @@ const docTemplate = `{
"description": "1-导出",
"type": "integer"
},
"manufacturer_code": {
"description": "厂家编码",
"type": "string"
},
"pageIndex": {
"description": "页码",
"type": "integer"
@ -12725,6 +12762,88 @@ const docTemplate = `{
}
}
},
"models.ErpStoreSalesDataReq": {
"type": "object",
"properties": {
"end_time": {
"description": "结束时间",
"type": "string"
},
"is_export": {
"description": "1-导出",
"type": "integer"
},
"pageIndex": {
"description": "页码",
"type": "integer"
},
"pageSize": {
"description": "页面条数",
"type": "integer"
},
"sort_type": {
"description": "排序类型desc 降序、asc 升序",
"type": "string"
},
"start_time": {
"description": "开始时间",
"type": "string"
},
"store_id": {
"description": "门店ID",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"models.ErpStoreSalesDataResp": {
"type": "object",
"properties": {
"export_url": {
"type": "string"
},
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/models.StoreSalesData"
}
},
"pageIndex": {
"description": "页码",
"type": "integer"
},
"pageSize": {
"description": "每页展示条数",
"type": "integer"
},
"total": {
"description": "总条数",
"type": "integer"
},
"total_count": {
"description": "总销售数量",
"type": "integer"
},
"total_promotion_fee": {
"description": "总推广费",
"type": "number"
},
"total_sales_amount": {
"description": "总销售额",
"type": "number"
},
"total_sales_profit": {
"description": "总销售毛利",
"type": "number"
},
"total_staff_profit": {
"description": "总员工毛利",
"type": "number"
}
}
},
"models.ExecuteData": {
"type": "object",
"properties": {
@ -17290,6 +17409,39 @@ const docTemplate = `{
}
}
},
"models.StoreSalesData": {
"type": "object",
"properties": {
"count": {
"description": "销售数量",
"type": "integer"
},
"promotion_fee": {
"description": "推广费",
"type": "number"
},
"sales_profit": {
"description": "销售毛利",
"type": "number"
},
"staff_profit": {
"description": "员工毛利",
"type": "number"
},
"store_id": {
"description": "门店id",
"type": "integer"
},
"store_name": {
"description": "门店名称",
"type": "string"
},
"total_sales_amount": {
"description": "销售额",
"type": "number"
}
}
},
"models.Supplier": {
"type": "object",
"properties": {

View File

@ -1164,6 +1164,39 @@
}
}
},
"/api/v1/decision/store_sales_report": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"决策中心V1.4.0"
],
"summary": "门店销售对比",
"parameters": [
{
"description": "门店销售对比数据模型",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ErpStoreSalesDataReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.ErpStoreSalesDataResp"
}
}
}
}
},
"/api/v1/dept": {
"put": {
"security": [
@ -8902,6 +8935,10 @@
"description": "1-导出",
"type": "integer"
},
"manufacturer_code": {
"description": "厂家编码",
"type": "string"
},
"pageIndex": {
"description": "页码",
"type": "integer"
@ -12714,6 +12751,88 @@
}
}
},
"models.ErpStoreSalesDataReq": {
"type": "object",
"properties": {
"end_time": {
"description": "结束时间",
"type": "string"
},
"is_export": {
"description": "1-导出",
"type": "integer"
},
"pageIndex": {
"description": "页码",
"type": "integer"
},
"pageSize": {
"description": "页面条数",
"type": "integer"
},
"sort_type": {
"description": "排序类型desc 降序、asc 升序",
"type": "string"
},
"start_time": {
"description": "开始时间",
"type": "string"
},
"store_id": {
"description": "门店ID",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"models.ErpStoreSalesDataResp": {
"type": "object",
"properties": {
"export_url": {
"type": "string"
},
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/models.StoreSalesData"
}
},
"pageIndex": {
"description": "页码",
"type": "integer"
},
"pageSize": {
"description": "每页展示条数",
"type": "integer"
},
"total": {
"description": "总条数",
"type": "integer"
},
"total_count": {
"description": "总销售数量",
"type": "integer"
},
"total_promotion_fee": {
"description": "总推广费",
"type": "number"
},
"total_sales_amount": {
"description": "总销售额",
"type": "number"
},
"total_sales_profit": {
"description": "总销售毛利",
"type": "number"
},
"total_staff_profit": {
"description": "总员工毛利",
"type": "number"
}
}
},
"models.ExecuteData": {
"type": "object",
"properties": {
@ -17279,6 +17398,39 @@
}
}
},
"models.StoreSalesData": {
"type": "object",
"properties": {
"count": {
"description": "销售数量",
"type": "integer"
},
"promotion_fee": {
"description": "推广费",
"type": "number"
},
"sales_profit": {
"description": "销售毛利",
"type": "number"
},
"staff_profit": {
"description": "员工毛利",
"type": "number"
},
"store_id": {
"description": "门店id",
"type": "integer"
},
"store_name": {
"description": "门店名称",
"type": "string"
},
"total_sales_amount": {
"description": "销售额",
"type": "number"
}
}
},
"models.Supplier": {
"type": "object",
"properties": {

View File

@ -1629,6 +1629,9 @@ definitions:
is_export:
description: 1-导出
type: integer
manufacturer_code:
description: 厂家编码
type: string
pageIndex:
description: 页码
type: integer
@ -4413,6 +4416,65 @@ definitions:
description: 数据总条数
type: integer
type: object
models.ErpStoreSalesDataReq:
properties:
end_time:
description: 结束时间
type: string
is_export:
description: 1-导出
type: integer
pageIndex:
description: 页码
type: integer
pageSize:
description: 页面条数
type: integer
sort_type:
description: 排序类型desc 降序、asc 升序
type: string
start_time:
description: 开始时间
type: string
store_id:
description: 门店ID
items:
type: integer
type: array
type: object
models.ErpStoreSalesDataResp:
properties:
export_url:
type: string
list:
items:
$ref: '#/definitions/models.StoreSalesData'
type: array
pageIndex:
description: 页码
type: integer
pageSize:
description: 每页展示条数
type: integer
total:
description: 总条数
type: integer
total_count:
description: 总销售数量
type: integer
total_promotion_fee:
description: 总推广费
type: number
total_sales_amount:
description: 总销售额
type: number
total_sales_profit:
description: 总销售毛利
type: number
total_staff_profit:
description: 总员工毛利
type: number
type: object
models.ExecuteData:
properties:
commodity_serial_number:
@ -7693,6 +7755,30 @@ definitions:
description: 销售额
type: number
type: object
models.StoreSalesData:
properties:
count:
description: 销售数量
type: integer
promotion_fee:
description: 推广费
type: number
sales_profit:
description: 销售毛利
type: number
staff_profit:
description: 员工毛利
type: number
store_id:
description: 门店id
type: integer
store_name:
description: 门店名称
type: string
total_sales_amount:
description: 销售额
type: number
type: object
models.Supplier:
properties:
account_holder:
@ -9702,6 +9788,27 @@ paths:
summary: 进销存报表
tags:
- 决策中心V1.4.0
/api/v1/decision/store_sales_report:
post:
consumes:
- application/json
parameters:
- description: 门店销售对比数据模型
in: body
name: request
required: true
schema:
$ref: '#/definitions/models.ErpStoreSalesDataReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.ErpStoreSalesDataResp'
summary: 门店销售对比
tags:
- 决策中心V1.4.0
/api/v1/dept:
post:
consumes: