feat(erp): 添加采购商品关联信息- 在产品详情中增加采购商品列表字段

- 扩展出舱单产品与采购商品的关联结构
- 新增采购商品详情信息结构体定义
- 支持在出运产品中关联多个采购商品- 完善产品添加和编辑时的采购商品数据处理
This commit is contained in:
2025-09-28 15:40:39 +08:00
parent 9aba2baa8c
commit 0593a556e4
3 changed files with 435 additions and 356 deletions

View File

@@ -2,12 +2,13 @@ package sale
import (
"context"
"time"
"git.kumo.work/shama/service/client"
bean2 "git.kumo.work/shama/service/erp/bean"
product2 "git.kumo.work/shama/service/erp/product"
"git.kumo.work/shama/service/lib/bean"
"github.com/shopspring/decimal"
"time"
)
type product struct {
@@ -281,6 +282,7 @@ type ReplyProductInfo struct {
Quote ProductQuoteInfo `json:"quote"`
Children []ReplyProductInfo `json:"children"`
CreatedStaffId int64 `json:"createdStaffId"`
PurchaseProducts []PurchaseProduct `json:"purchaseProducts"`
}
type ProductPackageInfo struct {
@@ -311,6 +313,23 @@ type ProductQuoteInfo struct {
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
type PurchaseProduct struct {
Id int64 `json:"id"`
PurchaseId int64 `json:"purchaseId"`
PiSerial string `json:"piSerial"`
PoSerial string `json:"poSerial"`
BatchNo int64 `json:"batchNo"`
FactoryId int64 `json:"factoryId"`
FactoryName string `json:"factoryName"`
DeliveryDate *time.Time `json:"deliveryDate"`
DeliveryDateEnd *time.Time `json:"deliveryDateEnd"`
PurchaseCount int64 `json:"purchaseCount"`
PurchasePrice decimal.Decimal `json:"purchasePrice"`
ShipmentCount int64 `json:"shipmentCount"`
ShippedCount int64 `json:"shippedCount"`
AccountingCount int64 `json:"accountingCount"`
AccountedCount int64 `json:"accountedCount"`
}
// Info @TITLE 产品详情
func (p *product) Info(ctx context.Context, saleProductId int64) (reply ReplyProductInfo, err error) {