From d8231f77a509b2a81ff1fb2102cd518c2c219230 Mon Sep 17 00:00:00 2001 From: chenlin Date: Thu, 15 May 2025 14:24:18 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E"=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E5=8D=A1=E5=B8=A6=E5=BA=93=E5=AD=98=E8=B0=83=E6=8B=A8=E6=98=8E?= =?UTF-8?q?=E7=BB=86"=E6=8E=A5=E5=8F=A3=EF=BC=9B=202=E3=80=81CannibalizeSt?= =?UTF-8?q?ockTask=E8=A1=A8=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=9Ama?= =?UTF-8?q?ker=5Fid=E3=80=81maker=5Fname=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/stockmanage/stock.go | 46 +++- app/admin/models/game_card.go | 340 +++++++++++++++++++++++++++- app/admin/router/stockmanage.go | 21 +- docs/docs.go | 205 ++++++++++++++++- docs/swagger.json | 205 ++++++++++++++++- docs/swagger.yaml | 147 +++++++++++- 6 files changed, 939 insertions(+), 25 deletions(-) diff --git a/app/admin/apis/stockmanage/stock.go b/app/admin/apis/stockmanage/stock.go index d63ab19..12e7fd0 100644 --- a/app/admin/apis/stockmanage/stock.go +++ b/app/admin/apis/stockmanage/stock.go @@ -7,6 +7,7 @@ import ( "go-admin/app/admin/models" orm "go-admin/common/global" "go-admin/logger" + "go-admin/tools" "go-admin/tools/app" "net/http" "time" @@ -182,14 +183,32 @@ func CannibalizeTaskCreate(c *gin.Context) { return } + sysUser, err := models.GetSysUserByCtx(c) + if err != nil { + logger.Error("sys user err:", logger.Field("err", err)) + app.Error(c, http.StatusInternalServerError, err, "操作失败") + return + } + + // 校验入参门店是否包含在用户所有门店中,是否过期 + if !(tools.GetRoleName(c) == "admin" || tools.GetRoleName(c) == "系统管理员") { + if !models.CheckUserStore(req.FromStoreId, sysUser) { + app.Error(c, http.StatusInternalServerError, errors.New("操作失败:您没有该门店权限"), + "操作失败:您没有该门店权限") + return + } + } + task := &models.CannibalizeStockTask{ FromStoreId: req.FromStoreId, ToStoreId: req.ToStoreId, TaskId: uint32(time.Now().Unix()), Count: 0, Status: models.CannibalizeTaskStatusNotImportGoods, + MakerId: uint32(sysUser.UserId), + MakerName: sysUser.NickName, } - err := orm.Eloquent.Create(task).Error + err = orm.Eloquent.Create(task).Error if err != nil { logger.Error("err:", logger.Field("err", err)) app.Error(c, http.StatusInternalServerError, err, "创建调拨任务错误") @@ -286,6 +305,31 @@ func CannibalizeTaskList(c *gin.Context) { app.OK(c, resp, "") } +// CannibalizeTaskDetail 查询游戏卡库存调拨明细 +// @Summary 查询游戏卡库存调拨明细 +// @Tags 租卡系统-库存管理 +// @Produce json +// @Accept json +// @Param request body models.CannibalizeTaskDetailReq true "查询游戏卡库存调拨明细" +// @Success 200 {object} models.CannibalizeTaskDetailResp +// @Router /api/v1/stock/cannibalize_task/detail [post] +func CannibalizeTaskDetail(c *gin.Context) { + req := models.CannibalizeTaskDetailReq{} + if c.ShouldBindJSON(&req) != nil { + logger.Errorf("para err") + app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误") + return + } + resp, err := req.GetCannibalizeTaskDetail(c) + if err != nil { + logger.Error("err:", logger.Field("err", err)) + app.Error(c, http.StatusInternalServerError, err, "查询游戏卡库存调拨明细错误") + return + } + + app.OK(c, resp, "") +} + // 6.调拨任务卡列表 func CannibalizeTaskGameCardGoodsList(c *gin.Context) { req := models.CannibalizeTaskGameCardGoodsListReq{} diff --git a/app/admin/models/game_card.go b/app/admin/models/game_card.go index d870a3b..aab07b4 100644 --- a/app/admin/models/game_card.go +++ b/app/admin/models/game_card.go @@ -2532,18 +2532,19 @@ const ( type CannibalizeStockTask struct { Model - FromStoreId uint32 `json:"from_store_id"` - ToStoreId uint32 `json:"to_store_id"` - TaskId uint32 `json:"task_id"` // 时间戳 + FromStoreId uint32 `json:"from_store_id"` // + ToStoreId uint32 `json:"to_store_id"` // + TaskId uint32 `json:"task_id"` // 时间戳 + Count uint32 `json:"count"` // 总数量 + Status uint8 `json:"status"` // 1-待填调拨卡 2-待发货 3-已发货 4-已入库 + DeliveryTime time.Time `json:"delivery_time"` // + InStorageTime time.Time `json:"in_storage_time"` // + MakerId uint32 `json:"maker_id" gorm:"index"` // 制单人id + MakerName string `json:"maker_name"` // 制单人名称 + FromStoreName string `json:"from_store_name" gorm:"-"` // + ToStoreName string `json:"to_store_name" gorm:"-"` // + //GameCardId uint32 `json:"game_card_id"` // 游戏卡id - Count uint32 `json:"count"` // 总数量 - Status uint8 `json:"status"` // 1-待填调拨卡 2-待发货 3-已发货 4-已入库 - DeliveryTime time.Time `json:"delivery_time"` - InStorageTime time.Time `json:"in_storage_time"` - - FromStoreName string `json:"from_store_name" gorm:"-"` - ToStoreName string `json:"to_store_name" gorm:"-"` - //CannibalizeStockTask int `json:"cannibalize_stock_task" gorm:"-"` } @@ -2634,6 +2635,323 @@ func (m *CannibalizeTaskListReq) GetCannibalizeTaskList(c *gin.Context) (*Cannib return resp, nil } +type CannibalizeTaskDetailReq struct { + TaskId uint32 `json:"task_id"` // 任务ID + DeliverStoreId []uint32 `json:"deliver_store_id"` // 调出门店id + ReceiveStoreId []uint32 `json:"receive_store_id"` // 调入门店id + GameCardId []uint32 `json:"game_card_id"` // 游戏卡id + SerialNumber string `json:"serial_number"` // 游戏卡串码 + State uint32 `json:"state"` // 调拨状态:1-调拨中 2-已完成 + SendTimeStart string `json:"send_time_start"` // 调出开始时间 + SendTimeEnd string `json:"send_time_end"` // 调出结束时间 + ReceiveTimeStart string `json:"receive_time_start"` // 调入开始时间 + ReceiveTimeEnd string `json:"receive_time_end"` // 调入结束时间 + IsExport uint32 `json:"is_export"` // 1-导出 + PageIndex int `json:"pageIndex"` // 页码 + PageSize int `json:"pageSize"` // 页面条数 +} + +type CannibalizeTaskDetailResp struct { + Total int64 `json:"total"` // 总条数/记录数 + PageIndex int `json:"pageIndex"` // 页码 + PageSize int `json:"pageSize"` // 页面条数 + ExportUrl string `json:"export_url"` // 导出excel路径 + List []GameCardAllotDetailData `json:"list"` // +} + +// GameCardAllotDetailData 租赁卡带库存调拨明细数据 +type GameCardAllotDetailData struct { + TaskId uint32 `json:"task_id"` // 任务ID + DeliverStoreId uint32 `json:"deliver_store_id"` // 调出门店id + DeliverStoreName string `json:"deliver_store_name"` // 调出门店名称 + ReceiveStoreId uint32 `json:"receive_store_id"` // 调入门店id + ReceiveStoreName string `json:"receive_store_name"` // 调入门店名称 + MakerId uint32 `json:"maker_id"` // 制单人id + MakerName string `json:"maker_name"` // 制单人名称 + MakerTime *time.Time `json:"maker_time"` // 制单时间/发起时间 + SendTime *time.Time `json:"send_time"` // 发货时间/调出时间 + ReceiveTime *time.Time `json:"receive_time"` // 收货时间/调入时间 + State uint32 `json:"state"` // 调拨状态:1-调拨中 2-已完成 + GameCardId uint32 `json:"game_card_id"` // 游戏卡id + SerialNumber string `json:"serial_number"` // 游戏卡串码 + GameCardName string `json:"game_card_name"` // 游戏卡名称 +} + +func (m *CannibalizeTaskDetailReq) GetCannibalizeTaskDetail(c *gin.Context) (*CannibalizeTaskDetailResp, error) { + // 用户权限校验:非管理员仅能查看自己门店的数据 + if !(tools.GetRoleName(c) == "admin" || tools.GetRoleName(c) == "系统管理员") { + sysUser, err := GetSysUserByCtx(c) + if err != nil { + return nil, errors.New("操作失败: " + err.Error()) + } + + // 获取用户绑定门店 + storeList := GetValidStoreIDs(sysUser.StoreData) + if len(storeList) > 0 { + m.DeliverStoreId = CompareLists(storeList, m.DeliverStoreId) + m.ReceiveStoreId = CompareLists(storeList, m.ReceiveStoreId) + if len(m.DeliverStoreId) == 0 && len(m.ReceiveStoreId) == 0 { + return &CannibalizeTaskDetailResp{}, nil + } + } else { + return nil, errors.New("用户未绑定门店") + } + } + + resp := &CannibalizeTaskDetailResp{ + PageIndex: m.PageIndex, + PageSize: m.PageSize, + } + page := m.PageIndex - 1 + if page < 0 { + page = 0 + } + if m.PageSize == 0 { + m.PageSize = 10 + } + + // 构建查询 CannibalizeStockTask 与 CannibalizeGameCardGoods 的 JOIN 语句 + qs := orm.Eloquent.Debug().Table("cannibalize_stock_task"). + Select("cannibalize_stock_task.id as task_id, "+ + "cannibalize_stock_task.from_store_id as deliver_store_id, "+ + "cannibalize_stock_task.to_store_id as receive_store_id, "+ + "cannibalize_stock_task.maker_id, "+ + "cannibalize_stock_task.maker_name, "+ + "cannibalize_stock_task.created_at as maker_time, "+ + "cannibalize_stock_task.delivery_time as send_time, "+ + "cannibalize_stock_task.in_storage_time as receive_time, "+ + "CASE "+ + "WHEN cannibalize_stock_task.status IN (2, 3) THEN 1 "+ + "WHEN cannibalize_stock_task.status = 4 THEN 2 "+ + "ELSE cannibalize_stock_task.status "+ + "END AS state, "+ + "cannibalize_game_card_goods.game_card_id, "+ + "cannibalize_game_card_goods.serial_number"). + Joins("JOIN cannibalize_game_card_goods ON cannibalize_game_card_goods.cannibalize_stock_task_id "+ + "= cannibalize_stock_task.id"). + Where("cannibalize_stock_task.status <> ?", 1) // 1 表示未审核/无效任务等 + + // Count 查询 + countQuery := orm.Eloquent.Table("cannibalize_stock_task"). + Joins("JOIN cannibalize_game_card_goods ON cannibalize_game_card_goods.cannibalize_stock_task_id "+ + "= cannibalize_stock_task.id"). + Where("cannibalize_stock_task.status <> ?", 1) + + if m.TaskId != 0 { + qs = qs.Where("cannibalize_stock_task.id = ?", m.TaskId) + countQuery = countQuery.Where("cannibalize_stock_task.id = ?", m.TaskId) + } + + if len(m.DeliverStoreId) > 0 { + qs = qs.Where("cannibalize_stock_task.from_store_id IN ?", m.DeliverStoreId) + countQuery = countQuery.Where("cannibalize_stock_task.from_store_id IN ?", m.DeliverStoreId) + } + + if len(m.ReceiveStoreId) > 0 { + qs = qs.Where("cannibalize_stock_task.to_store_id IN ?", m.ReceiveStoreId) + countQuery = countQuery.Where("cannibalize_stock_task.to_store_id IN ?", m.ReceiveStoreId) + } + + if len(m.GameCardId) != 0 { + qs = qs.Where("cannibalize_game_card_goods.game_card_id IN ?", m.GameCardId) + countQuery = countQuery.Where("cannibalize_game_card_goods.game_card_id IN ?", m.GameCardId) + } + + if m.SerialNumber != "" { + qs = qs.Where("cannibalize_game_card_goods.serial_number = ?", m.SerialNumber) + countQuery = countQuery.Where("cannibalize_game_card_goods.serial_number = ?", m.SerialNumber) + } + + if m.State != 0 { + switch m.State { + case 1: // 调拨中 + qs = qs.Where("cannibalize_stock_task.status IN (?)", + []uint32{ErpInventoryAllotOrderWaitSend, ErpInventoryAllotOrderWaitReceive}) + countQuery = countQuery.Where("cannibalize_stock_task.status IN (?)", + []uint32{ErpInventoryAllotOrderWaitSend, ErpInventoryAllotOrderWaitReceive}) + case 2: // 已完成 + qs = qs.Where("cannibalize_stock_task.status = ?", ErpInventoryAllotOrderFinished) + countQuery = countQuery.Where("cannibalize_stock_task.status = ?", ErpInventoryAllotOrderFinished) + } + } + + if m.SendTimeStart != "" { + startTime, err := time.Parse(QueryTimeFormat, m.SendTimeStart) + if err != nil { + return nil, err + } + qs = qs.Where("cannibalize_stock_task.delivery_time >= ?", startTime) + countQuery = countQuery.Where("cannibalize_stock_task.delivery_time >= ?", startTime) + } + if m.SendTimeEnd != "" { + endTime, err := time.Parse(QueryTimeFormat, m.SendTimeEnd) + if err != nil { + return nil, err + } + qs = qs.Where("cannibalize_stock_task.delivery_time <= ?", endTime) + countQuery = countQuery.Where("cannibalize_stock_task.delivery_time <= ?", endTime) + } + if m.ReceiveTimeStart != "" { + startTime, err := time.Parse(QueryTimeFormat, m.ReceiveTimeStart) + if err != nil { + return nil, err + } + qs = qs.Where("cannibalize_stock_task.in_storage_time >= ?", startTime) + countQuery = countQuery.Where("cannibalize_stock_task.in_storage_time >= ?", startTime) + } + if m.ReceiveTimeEnd != "" { + endTime, err := time.Parse(QueryTimeFormat, m.ReceiveTimeEnd) + if err != nil { + return nil, err + } + qs = qs.Where("cannibalize_stock_task.in_storage_time <= ?", endTime) + countQuery = countQuery.Where("cannibalize_stock_task.in_storage_time <= ?", endTime) + } + + var count int64 + err := countQuery.Count(&count).Error + if err != nil { + return nil, err + } + resp.Total = count + + var list []GameCardAllotDetailData + if m.IsExport == 1 { + err = qs.Order("cannibalize_stock_task.created_at DESC").Find(&list).Error + } else { + err = qs.Order("cannibalize_stock_task.created_at DESC"). + Offset(page * m.PageSize).Limit(m.PageSize).Find(&list).Error + } + if err != nil { + return nil, err + } + + storeMap, err := GetAllStoreData() + if err != nil { + return nil, err + } + + // 1. 将 list 转换为 CannibalizeGameCardGoods 切片 + goodsList := make([]CannibalizeGameCardGoods, len(list)) + for i, item := range list { + list[i].DeliverStoreName = storeMap[item.DeliverStoreId].Name + list[i].ReceiveStoreName = storeMap[item.ReceiveStoreId].Name + + goodsList[i].GameCardId = list[i].GameCardId + } + + // 2. 调用补全游戏名称的方法 + goodsList = CannibalizeGameCardGoodsSetInfo(goodsList) + + // 3. 把补全的 GameCardName 写回 list + for i := range list { + list[i].GameCardName = goodsList[i].GameCardName + } + + resp.List = list + + if m.IsExport == 1 { + resp.ExportUrl, err = exportCannibalizeTaskDetail(resp.List) + if err != nil { + return nil, err + } + resp.List = []GameCardAllotDetailData{} + } + + return resp, nil +} + +// exportCannibalizeTaskDetail 游戏卡带库存调拨明细导出 +func exportCannibalizeTaskDetail(dataList []GameCardAllotDetailData) (string, error) { + file := excelize.NewFile() + sheet := "Sheet1" + fileName := time.Now().Format("2006-01-02_15-04-05") + "_卡带调拨明细.xlsx" + savePath := config.ExportConfig.Path + fileName + url := config.ExportConfig.Url + fileName + + // 标题栏 + headers := []string{ + "任务ID", "调出门店", "调入门店", "制单人", "制单时间", "调出时间", "调入时间", + "调拨状态", "卡带ID", "卡带名称", "串码", + } + + // 设置标题栏 + for i, header := range headers { + cell, _ := excelize.CoordinatesToCellName(i+1, 1) + _ = file.SetCellValue(sheet, cell, header) + } + + // 填充数据 + for rowIndex, item := range dataList { + row := rowIndex + 2 // 从第二行开始填充数据 + + var makerTime, sendTime, receiveTime string + if item.MakerTime != nil { + makerTime = item.MakerTime.Format("2006-01-02 15:04:05") + } + if item.SendTime != nil { + sendTime = item.SendTime.Format("2006-01-02 15:04:05") + } + if item.ReceiveTime != nil { + receiveTime = item.ReceiveTime.Format("2006-01-02 15:04:05") + } + + var stateStr string + switch item.State { + case 1: + stateStr = "调拨中" + case 2: + stateStr = "已完成" + default: + stateStr = "未知" + } + + values := []interface{}{ + item.TaskId, + item.DeliverStoreName, + item.ReceiveStoreName, + item.MakerName, + makerTime, + sendTime, + receiveTime, + stateStr, + item.GameCardId, + item.GameCardName, + item.SerialNumber, + } + + for colIndex, val := range values { + cell, _ := excelize.CoordinatesToCellName(colIndex+1, row) + _ = file.SetCellValue(sheet, cell, val) + } + } + + // 设置样式 + style, _ := file.NewStyle(`{ + "alignment":{"horizontal":"center","vertical":"center"}, + "border":[ + {"type":"left","color":"000000","style":1}, + {"type":"top","color":"000000","style":1}, + {"type":"right","color":"000000","style":1}, + {"type":"bottom","color":"000000","style":1} + ] + }`) + + lastRow := len(dataList) + 1 + endCell := fmt.Sprintf("K%d", lastRow) + _ = file.SetCellStyle(sheet, "A1", endCell, style) + _ = file.SetRowHeight(sheet, 1, 20) + _ = file.SetColWidth(sheet, "A", "K", 20) + + // 保存文件 + if err := file.SaveAs(savePath); err != nil { + logger.Error("保存Excel文件失败", logger.Field("err", err)) + return "", err + } + + return url, nil +} + type CooperativeCannibalizeTaskReq struct { CooperativeBusinessId uint32 `json:"cooperative_business_id"` StoreId uint64 `json:"store_id" ` // 门店id diff --git a/app/admin/router/stockmanage.go b/app/admin/router/stockmanage.go index ac44f38..c536b16 100644 --- a/app/admin/router/stockmanage.go +++ b/app/admin/router/stockmanage.go @@ -11,8 +11,9 @@ import ( func registerStockManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { order := v1.Group("/stock").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { - order.POST("/list", stockmanage.GameCardGoodsStockInfoList) // 库存列表 - order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList) // 库存调拨列表 + order.POST("/list", stockmanage.GameCardGoodsStockInfoList) // 库存列表 + order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList) // 库存调拨列表 + order.POST("/cannibalize_task/detail", stockmanage.CannibalizeTaskDetail) // 库存调拨明细 order.POST("/card/dels", stockmanage.GameCardGoodsStockDels) // 游戏卡减库存/出库 order.POST("/out_list", stockmanage.GameCardGoodsStockOutInfoList) // 出库明细 @@ -24,19 +25,19 @@ func registerStockManageUnAuthRouter(v1 *gin.RouterGroup) { order := v1.Group("/stock") { //order.POST("/list", stockmanage.GameCardGoodsStockInfoList) // 库存列表 - order.POST("/card/list", stockmanage.GameCardGoodsStockCardList) // 游戏卡列表 - order.POST("/card/adds", stockmanage.GameCardGoodsStockAdds) // 游戏卡入库 //order.POST("/card/dels", stockmanage.GameCardGoodsStockDels) // 游戏卡减库存/出库 + order.POST("/card/list", stockmanage.GameCardGoodsStockCardList) // 游戏卡列表 + order.POST("/card/adds", stockmanage.GameCardGoodsStockAdds) // 游戏卡入库 order.POST("/card/stock_derive", stockmanage.ExportDataGameCardGoodsStock) // order.POST("/cannibalize_task/create", stockmanage.CannibalizeTaskCreate) // 创建调拨 - order.POST("/cannibalize_task/import_goods", stockmanage.CannibalizeTaskImportGameCardGoods) // - order.POST("/cannibalize_task/deliver_goods", stockmanage.CannibalizeTaskDeliverGoods) // - order.POST("/cannibalize_task/put_in_storage", stockmanage.CannibalizeTaskPutInStorage) // - //order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList) // 库存调拨列表 - order.POST("/cannibalize_task/goods_list", stockmanage.CannibalizeTaskGameCardGoodsList) // - order.POST("/cannibalize_task/del", stockmanage.CannibalizeTaskDel) // + order.POST("/cannibalize_task/import_goods", stockmanage.CannibalizeTaskImportGameCardGoods) // 导入调拨卡带信息 + order.POST("/cannibalize_task/deliver_goods", stockmanage.CannibalizeTaskDeliverGoods) // 调拨发货 + order.POST("/cannibalize_task/put_in_storage", stockmanage.CannibalizeTaskPutInStorage) // 调拨收货 + order.POST("/cannibalize_task/goods_list", stockmanage.CannibalizeTaskGameCardGoodsList) // 调拨游戏卡列表 + order.POST("/cannibalize_task/del", stockmanage.CannibalizeTaskDel) // 删除调拨任务 //order.POST("/type", goodsmanage.GameCardTypes) // 获取游戏类型 + //order.POST("/cannibalize_task/list", stockmanage.CannibalizeTaskList) // 库存调拨列表 } } diff --git a/docs/docs.go b/docs/docs.go index 971da57..dcd4beb 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -6184,6 +6184,39 @@ const docTemplate = `{ } } }, + "/api/v1/stock/cannibalize_task/detail": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "租卡系统-库存管理" + ], + "summary": "查询游戏卡库存调拨明细", + "parameters": [ + { + "description": "查询游戏卡库存调拨明细", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.CannibalizeTaskDetailReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CannibalizeTaskDetailResp" + } + } + } + } + }, "/api/v1/stock/cannibalize_task/list": { "post": { "consumes": [ @@ -7858,7 +7891,7 @@ const docTemplate = `{ "type": "object", "properties": { "count": { - "description": "GameCardId uint32 ` + "`" + `json:\"game_card_id\"` + "`" + ` // 游戏卡id", + "description": "总数量", "type": "integer" }, "createdAt": { @@ -7881,6 +7914,14 @@ const docTemplate = `{ "in_storage_time": { "type": "string" }, + "maker_id": { + "description": "制单人id", + "type": "integer" + }, + "maker_name": { + "description": "制单人名称", + "type": "string" + }, "status": { "description": "1-待填调拨卡 2-待发货 3-已发货 4-已入库", "type": "integer" @@ -7901,6 +7942,99 @@ const docTemplate = `{ } } }, + "models.CannibalizeTaskDetailReq": { + "type": "object", + "properties": { + "deliver_store_id": { + "description": "调出门店id", + "type": "array", + "items": { + "type": "integer" + } + }, + "game_card_id": { + "description": "游戏卡id", + "type": "array", + "items": { + "type": "integer" + } + }, + "is_export": { + "description": "1-导出", + "type": "integer" + }, + "pageIndex": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "页面条数", + "type": "integer" + }, + "receive_store_id": { + "description": "调入门店id", + "type": "array", + "items": { + "type": "integer" + } + }, + "receive_time_end": { + "description": "调入结束时间", + "type": "string" + }, + "receive_time_start": { + "description": "调入开始时间", + "type": "string" + }, + "send_time_end": { + "description": "调出结束时间", + "type": "string" + }, + "send_time_start": { + "description": "调出开始时间", + "type": "string" + }, + "serial_number": { + "description": "游戏卡串码", + "type": "string" + }, + "state": { + "description": "调拨状态:1-调拨中 2-已完成", + "type": "integer" + }, + "task_id": { + "description": "任务ID", + "type": "integer" + } + } + }, + "models.CannibalizeTaskDetailResp": { + "type": "object", + "properties": { + "export_url": { + "description": "导出excel路径", + "type": "string" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.GameCardAllotDetailData" + } + }, + "pageIndex": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "页面条数", + "type": "integer" + }, + "total": { + "description": "总条数/记录数", + "type": "integer" + } + } + }, "models.CannibalizeTaskListReq": { "type": "object", "properties": { @@ -13012,6 +13146,14 @@ const docTemplate = `{ "description": "经手人id", "type": "integer" }, + "make_time_end": { + "description": "制单结束时间", + "type": "string" + }, + "make_time_start": { + "description": "制单开始时间", + "type": "string" + }, "pageIndex": { "description": "页码", "type": "integer" @@ -14287,6 +14429,67 @@ const docTemplate = `{ } } }, + "models.GameCardAllotDetailData": { + "type": "object", + "properties": { + "deliver_store_id": { + "description": "调出门店id", + "type": "integer" + }, + "deliver_store_name": { + "description": "调出门店名称", + "type": "string" + }, + "game_card_id": { + "description": "游戏卡id", + "type": "integer" + }, + "game_card_name": { + "description": "游戏卡名称", + "type": "string" + }, + "maker_id": { + "description": "制单人id", + "type": "integer" + }, + "maker_name": { + "description": "制单人名称", + "type": "string" + }, + "maker_time": { + "description": "制单时间/发起时间", + "type": "string" + }, + "receive_store_id": { + "description": "调入门店id", + "type": "integer" + }, + "receive_store_name": { + "description": "调入门店名称", + "type": "string" + }, + "receive_time": { + "description": "收货时间/调入时间", + "type": "string" + }, + "send_time": { + "description": "发货时间/调出时间", + "type": "string" + }, + "serial_number": { + "description": "游戏卡串码", + "type": "string" + }, + "state": { + "description": "调拨状态:1-调拨中 2-已完成", + "type": "integer" + }, + "task_id": { + "description": "任务ID", + "type": "integer" + } + } + }, "models.GameCardGoods": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 1fd05eb..e2aa468 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -6173,6 +6173,39 @@ } } }, + "/api/v1/stock/cannibalize_task/detail": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "租卡系统-库存管理" + ], + "summary": "查询游戏卡库存调拨明细", + "parameters": [ + { + "description": "查询游戏卡库存调拨明细", + "name": "request", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/models.CannibalizeTaskDetailReq" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.CannibalizeTaskDetailResp" + } + } + } + } + }, "/api/v1/stock/cannibalize_task/list": { "post": { "consumes": [ @@ -7847,7 +7880,7 @@ "type": "object", "properties": { "count": { - "description": "GameCardId uint32 `json:\"game_card_id\"` // 游戏卡id", + "description": "总数量", "type": "integer" }, "createdAt": { @@ -7870,6 +7903,14 @@ "in_storage_time": { "type": "string" }, + "maker_id": { + "description": "制单人id", + "type": "integer" + }, + "maker_name": { + "description": "制单人名称", + "type": "string" + }, "status": { "description": "1-待填调拨卡 2-待发货 3-已发货 4-已入库", "type": "integer" @@ -7890,6 +7931,99 @@ } } }, + "models.CannibalizeTaskDetailReq": { + "type": "object", + "properties": { + "deliver_store_id": { + "description": "调出门店id", + "type": "array", + "items": { + "type": "integer" + } + }, + "game_card_id": { + "description": "游戏卡id", + "type": "array", + "items": { + "type": "integer" + } + }, + "is_export": { + "description": "1-导出", + "type": "integer" + }, + "pageIndex": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "页面条数", + "type": "integer" + }, + "receive_store_id": { + "description": "调入门店id", + "type": "array", + "items": { + "type": "integer" + } + }, + "receive_time_end": { + "description": "调入结束时间", + "type": "string" + }, + "receive_time_start": { + "description": "调入开始时间", + "type": "string" + }, + "send_time_end": { + "description": "调出结束时间", + "type": "string" + }, + "send_time_start": { + "description": "调出开始时间", + "type": "string" + }, + "serial_number": { + "description": "游戏卡串码", + "type": "string" + }, + "state": { + "description": "调拨状态:1-调拨中 2-已完成", + "type": "integer" + }, + "task_id": { + "description": "任务ID", + "type": "integer" + } + } + }, + "models.CannibalizeTaskDetailResp": { + "type": "object", + "properties": { + "export_url": { + "description": "导出excel路径", + "type": "string" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/models.GameCardAllotDetailData" + } + }, + "pageIndex": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "页面条数", + "type": "integer" + }, + "total": { + "description": "总条数/记录数", + "type": "integer" + } + } + }, "models.CannibalizeTaskListReq": { "type": "object", "properties": { @@ -13001,6 +13135,14 @@ "description": "经手人id", "type": "integer" }, + "make_time_end": { + "description": "制单结束时间", + "type": "string" + }, + "make_time_start": { + "description": "制单开始时间", + "type": "string" + }, "pageIndex": { "description": "页码", "type": "integer" @@ -14276,6 +14418,67 @@ } } }, + "models.GameCardAllotDetailData": { + "type": "object", + "properties": { + "deliver_store_id": { + "description": "调出门店id", + "type": "integer" + }, + "deliver_store_name": { + "description": "调出门店名称", + "type": "string" + }, + "game_card_id": { + "description": "游戏卡id", + "type": "integer" + }, + "game_card_name": { + "description": "游戏卡名称", + "type": "string" + }, + "maker_id": { + "description": "制单人id", + "type": "integer" + }, + "maker_name": { + "description": "制单人名称", + "type": "string" + }, + "maker_time": { + "description": "制单时间/发起时间", + "type": "string" + }, + "receive_store_id": { + "description": "调入门店id", + "type": "integer" + }, + "receive_store_name": { + "description": "调入门店名称", + "type": "string" + }, + "receive_time": { + "description": "收货时间/调入时间", + "type": "string" + }, + "send_time": { + "description": "发货时间/调出时间", + "type": "string" + }, + "serial_number": { + "description": "游戏卡串码", + "type": "string" + }, + "state": { + "description": "调拨状态:1-调拨中 2-已完成", + "type": "integer" + }, + "task_id": { + "description": "任务ID", + "type": "integer" + } + } + }, "models.GameCardGoods": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 144053b..007202c 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -378,7 +378,7 @@ definitions: models.CannibalizeStockTask: properties: count: - description: GameCardId uint32 `json:"game_card_id"` // 游戏卡id + description: 总数量 type: integer createdAt: description: 创建时间 @@ -394,6 +394,12 @@ definitions: type: integer in_storage_time: type: string + maker_id: + description: 制单人id + type: integer + maker_name: + description: 制单人名称 + type: string status: description: 1-待填调拨卡 2-待发货 3-已发货 4-已入库 type: integer @@ -408,6 +414,73 @@ definitions: description: 更新时间 type: string type: object + models.CannibalizeTaskDetailReq: + properties: + deliver_store_id: + description: 调出门店id + items: + type: integer + type: array + game_card_id: + description: 游戏卡id + items: + type: integer + type: array + is_export: + description: 1-导出 + type: integer + pageIndex: + description: 页码 + type: integer + pageSize: + description: 页面条数 + type: integer + receive_store_id: + description: 调入门店id + items: + type: integer + type: array + receive_time_end: + description: 调入结束时间 + type: string + receive_time_start: + description: 调入开始时间 + type: string + send_time_end: + description: 调出结束时间 + type: string + send_time_start: + description: 调出开始时间 + type: string + serial_number: + description: 游戏卡串码 + type: string + state: + description: 调拨状态:1-调拨中 2-已完成 + type: integer + task_id: + description: 任务ID + type: integer + type: object + models.CannibalizeTaskDetailResp: + properties: + export_url: + description: 导出excel路径 + type: string + list: + items: + $ref: '#/definitions/models.GameCardAllotDetailData' + type: array + pageIndex: + description: 页码 + type: integer + pageSize: + description: 页面条数 + type: integer + total: + description: 总条数/记录数 + type: integer + type: object models.CannibalizeTaskListReq: properties: pageIndex: @@ -4137,6 +4210,12 @@ definitions: handler_id: description: 经手人id type: integer + make_time_end: + description: 制单结束时间 + type: string + make_time_start: + description: 制单开始时间 + type: string pageIndex: description: 页码 type: integer @@ -5063,6 +5142,51 @@ definitions: description: 查看人数 type: integer type: object + models.GameCardAllotDetailData: + properties: + deliver_store_id: + description: 调出门店id + type: integer + deliver_store_name: + description: 调出门店名称 + type: string + game_card_id: + description: 游戏卡id + type: integer + game_card_name: + description: 游戏卡名称 + type: string + maker_id: + description: 制单人id + type: integer + maker_name: + description: 制单人名称 + type: string + maker_time: + description: 制单时间/发起时间 + type: string + receive_store_id: + description: 调入门店id + type: integer + receive_store_name: + description: 调入门店名称 + type: string + receive_time: + description: 收货时间/调入时间 + type: string + send_time: + description: 发货时间/调出时间 + type: string + serial_number: + description: 游戏卡串码 + type: string + state: + description: 调拨状态:1-调拨中 2-已完成 + type: integer + task_id: + description: 任务ID + type: integer + type: object models.GameCardGoods: properties: card_type: @@ -13928,6 +14052,27 @@ paths: summary: 系统信息 tags: - system/系统信息 + /api/v1/stock/cannibalize_task/detail: + post: + consumes: + - application/json + parameters: + - description: 查询游戏卡库存调拨明细 + in: body + name: request + required: true + schema: + $ref: '#/definitions/models.CannibalizeTaskDetailReq' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.CannibalizeTaskDetailResp' + summary: 查询游戏卡库存调拨明细 + tags: + - 租卡系统-库存管理 /api/v1/stock/cannibalize_task/list: post: consumes: