- 添加费用(cost)相关结构体与方法定义 - 添加产品(product)相关结构体与方法定义 - 添加备注(remark)相关结构体与方法定义 - 添加做账主服务(old)及列表、详情等核心接口 - 定义做账单据相关的数据模型和查询参数结构 - 实现通过RPC客户端调用后端服务的通用逻辑 - 添加开票产品资料和做账工厂相关接口定义
58 lines
2.6 KiB
Go
58 lines
2.6 KiB
Go
package old
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type product struct {
|
|
}
|
|
|
|
type ProductItem struct {
|
|
Id int64 `json:"id"`
|
|
PurchaseProductId int64 `json:"purchaseProductId"`
|
|
SaleProductId int64 `json:"saleProductId"`
|
|
Sort int64 `json:"sort"`
|
|
Serial string `json:"serial"`
|
|
PiSerial string `json:"piSerial"`
|
|
CustomSerial string `json:"customSerial"`
|
|
Name string `json:"name"`
|
|
CustomsSerial string `json:"customsSerial"`
|
|
CustomsName string `json:"customsName"`
|
|
CustomsInvoiceUnit string `json:"customsInvoiceUnit"`
|
|
CustomsUnit string `json:"customsUnit"`
|
|
RealCustomsInvoiceUnit string `json:"realCustomsInvoiceUnit"`
|
|
InvoiceType int64 `json:"invoiceType"`
|
|
InvoiceCount decimal.Decimal `json:"invoiceCount"`
|
|
AccountingCount int64 `json:"accountingCount"`
|
|
OuterNum *int64 `json:"outerNum"`
|
|
BoxCount int64 `json:"boxCount"`
|
|
PurchasePrice decimal.Decimal `json:"purchasePrice"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
Volume *decimal.Decimal `json:"volume"`
|
|
TotalVolume decimal.Decimal `json:"totalVolume"`
|
|
GrossWeight *decimal.Decimal `json:"grossWeight"`
|
|
TotalGrossWeight decimal.Decimal `json:"totalGrossWeight"`
|
|
NetWeight *decimal.Decimal `json:"netWeight"`
|
|
TotalNetWeight decimal.Decimal `json:"totalNetWeight"`
|
|
PackageDescription string `json:"packageDescription"`
|
|
FactoryId int64 `json:"factoryId"`
|
|
FactoryName string `json:"factoryName"`
|
|
SaleProductAccountingCount int64 `json:"saleProductAccountingCount"`
|
|
SaleProductPurchasedCount int64 `json:"saleProductPurchasedCount"`
|
|
ContainerNumber string `json:"containerNumber"`
|
|
ContainerNumberBoxCount int64 `json:"containerNumberBoxCount"`
|
|
}
|
|
|
|
// All @TITLE 获取产品
|
|
func (p *product) All(ctx context.Context, accountingId int64) (reply []ProductItem, err error) {
|
|
xClient, err := client.GetClient(p)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "All", accountingId, &reply)
|
|
return
|
|
}
|