1、获取零售订单小票数据,增加字段IsShowImei和IMEI;
This commit is contained in:
parent
cdd28ce1b7
commit
47adb34c2c
|
@ -426,13 +426,15 @@ type ErpOrderReceiptDataResp struct {
|
|||
StoreTel string `json:"storeTel"` // 卖家电话
|
||||
StoreAddress string `json:"storeAddress"` // 店铺地址
|
||||
Uid int `json:"uid"` // 用户id
|
||||
IsShowImei int `json:"is_show_imei"` // 是否打印商品串码,1-打印串码,0-不打印
|
||||
}
|
||||
|
||||
type TableData struct {
|
||||
Name string `json:"name"`
|
||||
SL uint32 `json:"SL"` // 销售数量
|
||||
DJ float64 `json:"DJ"` // 商品指导零售价
|
||||
JE float64 `json:"JE"` // 商品指导零售价乘以销售数量
|
||||
SL uint32 `json:"SL"` // 销售数量
|
||||
DJ float64 `json:"DJ"` // 商品指导零售价
|
||||
JE float64 `json:"JE"` // 商品指导零售价乘以销售数量
|
||||
IMEI string `json:"imei"` // 串码
|
||||
}
|
||||
|
||||
// Contains 判断id是否在list中
|
||||
|
@ -5169,16 +5171,10 @@ func QueryReceiptData(req *ErpOrderDeleteReq, c *gin.Context) (*ErpOrderReceiptD
|
|||
|
||||
order := orders[0]
|
||||
var salesName string
|
||||
if order.SalesmanList != "" {
|
||||
var salesmanInfo []ErpOrderSales
|
||||
err = json.Unmarshal([]byte(order.SalesmanList), &salesmanInfo)
|
||||
if err != nil {
|
||||
logger.Error("unmarshal err:", logger.Field("err", err))
|
||||
}
|
||||
|
||||
if len(order.Salesman) != 0 {
|
||||
// 遍历销售员信息,拼接名称
|
||||
var names []string
|
||||
for _, item := range salesmanInfo {
|
||||
for _, item := range order.Salesman {
|
||||
names = append(names, item.Name)
|
||||
}
|
||||
salesName = strings.Join(names, ",") // 使用中文逗号拼接
|
||||
|
@ -5191,6 +5187,10 @@ func QueryReceiptData(req *ErpOrderDeleteReq, c *gin.Context) (*ErpOrderReceiptD
|
|||
resp.Time = orders[0].UpdatedAt
|
||||
resp.CollectS = salesName
|
||||
|
||||
if order.StoreId == 29 { // 大运哈曼店才打印商品串码
|
||||
resp.IsShowImei = 1
|
||||
}
|
||||
|
||||
var totalCouponAmount float64
|
||||
commodityMap := make(map[string]TableData, 0)
|
||||
for i, item := range order.Commodities {
|
||||
|
@ -5199,6 +5199,7 @@ func QueryReceiptData(req *ErpOrderDeleteReq, c *gin.Context) (*ErpOrderReceiptD
|
|||
tableData.SL = uint32(item.Count)
|
||||
tableData.DJ = item.RetailPrice
|
||||
tableData.JE = float64(item.Count) * item.RetailPrice
|
||||
tableData.IMEI = item.IMEI
|
||||
|
||||
key := fmt.Sprintf("commodity_%d", i)
|
||||
commodityMap[key] = tableData
|
||||
|
|
|
@ -9383,7 +9383,6 @@ const docTemplate = `{
|
|||
"required": [
|
||||
"cashiers",
|
||||
"erp_order_commodities",
|
||||
"member_type",
|
||||
"retail_type",
|
||||
"salesman",
|
||||
"store_id",
|
||||
|
@ -9624,6 +9623,10 @@ const docTemplate = `{
|
|||
"description": "积分抵扣总金额",
|
||||
"type": "number"
|
||||
},
|
||||
"is_show_imei": {
|
||||
"description": "是否打印商品串码,1-打印串码,0-不打印",
|
||||
"type": "integer"
|
||||
},
|
||||
"membersAmount": {
|
||||
"description": "会员优惠总金额",
|
||||
"type": "number"
|
||||
|
@ -16896,6 +16899,10 @@ const docTemplate = `{
|
|||
"description": "销售数量",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
"description": "串码",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
@ -9372,7 +9372,6 @@
|
|||
"required": [
|
||||
"cashiers",
|
||||
"erp_order_commodities",
|
||||
"member_type",
|
||||
"retail_type",
|
||||
"salesman",
|
||||
"store_id",
|
||||
|
@ -9613,6 +9612,10 @@
|
|||
"description": "积分抵扣总金额",
|
||||
"type": "number"
|
||||
},
|
||||
"is_show_imei": {
|
||||
"description": "是否打印商品串码,1-打印串码,0-不打印",
|
||||
"type": "integer"
|
||||
},
|
||||
"membersAmount": {
|
||||
"description": "会员优惠总金额",
|
||||
"type": "number"
|
||||
|
@ -16885,6 +16888,10 @@
|
|||
"description": "销售数量",
|
||||
"type": "integer"
|
||||
},
|
||||
"imei": {
|
||||
"description": "串码",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
@ -2310,7 +2310,6 @@ definitions:
|
|||
required:
|
||||
- cashiers
|
||||
- erp_order_commodities
|
||||
- member_type
|
||||
- retail_type
|
||||
- salesman
|
||||
- store_id
|
||||
|
@ -2439,6 +2438,9 @@ definitions:
|
|||
integrationAmount:
|
||||
description: 积分抵扣总金额
|
||||
type: number
|
||||
is_show_imei:
|
||||
description: 是否打印商品串码,1-打印串码,0-不打印
|
||||
type: integer
|
||||
membersAmount:
|
||||
description: 会员优惠总金额
|
||||
type: number
|
||||
|
@ -7691,6 +7693,9 @@ definitions:
|
|||
SL:
|
||||
description: 销售数量
|
||||
type: integer
|
||||
imei:
|
||||
description: 串码
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
type: object
|
||||
|
|
Loading…
Reference in New Issue
Block a user