This commit is contained in:
守护自己的云 2024-09-20 14:51:43 +08:00
parent aafd4150c3
commit 57d59b3fbe
9 changed files with 274 additions and 34 deletions

View File

@ -4,11 +4,13 @@ type BusinessType = string // 业务类型
const ( const (
BusinessTypeSaleAudit BusinessType = "saleAudit" // 销售合同审核 BusinessTypeSaleAudit BusinessType = "saleAudit" // 销售合同审核
BusinessTypePurchaseAudit BusinessType = "purchaseAudit" // 销售合同审核 BusinessTypePurchaseAudit BusinessType = "purchaseAudit" // 销售合同审核
BusinessTypeShipmentAudit BusinessType = "shipmentAudit" // 销售合同审核
) )
var BusinessTypeName = map[BusinessType]string{ var BusinessTypeName = map[BusinessType]string{
BusinessTypeSaleAudit: "销售合同审核", BusinessTypeSaleAudit: "销售合同审核",
BusinessTypePurchaseAudit: "采购合同审核", BusinessTypePurchaseAudit: "采购合同审核",
BusinessTypeShipmentAudit: "订舱单审核",
} }
type AuditStatus = int64 // 审核状态 type AuditStatus = int64 // 审核状态
@ -31,4 +33,5 @@ type ExportType = string // 导出类型
const ( const (
ExportTypeSalePi = "salePi" // 销售pi导出 ExportTypeSalePi = "salePi" // 销售pi导出
ExportTypeSaleBenefit = "saleBenefit" // 效益测算导出 ExportTypeSaleBenefit = "saleBenefit" // 效益测算导出
ExportTypePurchase = "purchase" // 采购导出
) )

View File

@ -11,6 +11,7 @@ type annotations struct {
type AnnotationsItem struct { type AnnotationsItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
PurchaseId int64 `json:"purchaseId"`
Sort int64 `json:"sort"` Sort int64 `json:"sort"`
Value string `json:"value"` Value string `json:"value"`
CreatedAt *time.Time `json:"createdAt"` CreatedAt *time.Time `json:"createdAt"`
@ -18,12 +19,12 @@ type AnnotationsItem struct {
} }
// All @TITLE 获取附注 // All @TITLE 获取附注
func (a *annotations) All(ctx context.Context, purchaseId int64) (reply []AnnotationsItem, err error) { func (a *annotations) All(ctx context.Context, purchaseIds []int64) (reply []AnnotationsItem, err error) {
xClient, err := client.GetClient(a) xClient, err := client.GetClient(a)
if err != nil { if err != nil {
return return
} }
err = xClient.Call(ctx, "All", purchaseId, &reply) err = xClient.Call(ctx, "All", purchaseIds, &reply)
return return
} }

View File

@ -11,6 +11,7 @@ type clause struct {
type ClauseItem struct { type ClauseItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
PurchaseId int64 `json:"purchaseId"`
Sort int64 `json:"sort"` Sort int64 `json:"sort"`
Key string `json:"key"` Key string `json:"key"`
Value string `json:"value"` Value string `json:"value"`
@ -19,12 +20,12 @@ type ClauseItem struct {
} }
// All @TITLE 获取条款 // All @TITLE 获取条款
func (c *clause) All(ctx context.Context, purchaseId int64) (reply []ClauseItem, err error) { func (c *clause) All(ctx context.Context, purchaseIds []int64) (reply []ClauseItem, err error) {
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
return return
} }
err = xClient.Call(ctx, "All", purchaseId, &reply) err = xClient.Call(ctx, "All", purchaseIds, &reply)
return return
} }

View File

@ -83,6 +83,7 @@ type SaleItem struct {
HasPurchase int64 `json:"hasPurchase"` HasPurchase int64 `json:"hasPurchase"`
PurchaseStatus int64 `json:"purchaseStatus"` PurchaseStatus int64 `json:"purchaseStatus"`
ShipmentStatus int64 `json:"shipmentStatus"` ShipmentStatus int64 `json:"shipmentStatus"`
TotalSaleAmount decimal.Decimal `json:"totalSaleAmount"`
CreatedStaffId int64 `json:"createdStaffId"` CreatedStaffId int64 `json:"createdStaffId"`
CreatedAt *time.Time `json:"createdAt"` CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"` UpdatedAt *time.Time `json:"updatedAt"`

25
erp/shipment/audit.go Normal file
View File

@ -0,0 +1,25 @@
package shipment
import (
"context"
"git.kumo.work/shama/service/client"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
ShipmentId int64 // 订舱单id
AuditStaffIds []int64 // 审核人
}
// Submit @TITLE 提交审核
func (a *audit) Submit(ctx context.Context, args ArgsAuditSubmit) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Submit", args, &reply)
return
}

View File

@ -0,0 +1,76 @@
package shipment
import (
"context"
"git.kumo.work/shama/service/client"
"github.com/shopspring/decimal"
"time"
)
type customsCost struct {
}
type CustomsCostItem struct {
Id int64 `json:"id"`
Name string `json:"name"`
Amount decimal.Decimal `json:"amount"`
Remarks string `json:"remarks"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// All @TITLE 获取费用
func (c *customsCost) All(ctx context.Context, purchaseId int64) (reply []CustomsCostItem, err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
err = xClient.Call(ctx, "All", purchaseId, &reply)
return
}
type ArgsCustomsCostAdd struct {
ShipmentId int64 // 订舱单ID
CustomsCostAdd
}
type CustomsCostAdd struct {
Name string // 费用名
Amount decimal.Decimal // 金额
Remarks string // 备注信息
}
// Add @TITLE 添加费用
func (c *customsCost) Add(ctx context.Context, args ArgsCustomsCostAdd) (err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Add", args, &reply)
}
type ArgsCustomsCostEdit struct {
CustomsCostId int64 // 费用ID
CustomsCostAdd
}
// Edit @TITLE 编辑费用
func (c *customsCost) Edit(ctx context.Context, args ArgsCustomsCostEdit) (err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Delete @TITLE 删除费用
func (c *customsCost) Delete(ctx context.Context, customsCostIds []int64) (err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Delete", customsCostIds, &reply)
}

103
erp/shipment/gift.go Normal file
View File

@ -0,0 +1,103 @@
package shipment
import (
"context"
"git.kumo.work/shama/service/client"
"github.com/shopspring/decimal"
"time"
)
type gift struct {
}
type GiftItem struct {
Id int64 `json:"id"`
Name string `json:"name"`
EngName string `json:"engName"`
CustomsName string `json:"customsName"`
CustomsSerial string `json:"customsSerial"`
CustomsMeasureUnit string `json:"customsMeasureUnit"`
CustomsInvoiceUnit string `json:"customsInvoiceUnit"`
CustomsDetail string `json:"customsDetail"`
ShipmentCount int64 `json:"shipmentCount"`
OuterBoxCount int64 `json:"outerBoxCount"`
TotalVolume decimal.Decimal `json:"totalVolume"`
TotalGrossWeight decimal.Decimal `json:"totalGrossWeight"`
TotalNetWeight decimal.Decimal `json:"totalNetWeight"`
CustomsPrice decimal.Decimal `json:"customsPrice"`
CustomsAmount decimal.Decimal `json:"customsAmount"`
DomesticSupply string `json:"domesticSupply"`
Remark string `json:"remark"`
Sort int64 `json:"sort"`
CreatedAt *time.Time `json:"createdAt"`
}
// All @TITLE 全部赠品
func (g *gift) All(ctx context.Context, shipmentId int64) (reply []GiftItem, err error) {
xClient, err := client.GetClient(g)
if err != nil {
return
}
err = xClient.Call(ctx, "All", shipmentId, &reply)
return
}
type ArgsGiftAdd struct {
ShipmentId int64 // 订舱单ID
GiftAdd
}
type GiftAdd struct {
Name string // 中文品名
EngName string // 英文品名
CustomsName string // 中文报关名称
CustomsSerial string // 海关编码
CustomsMeasureUnit string // 报关单位
CustomsInvoiceUnit string // 开票单位
CustomsDetail string // 申报要素
ShipmentCount int64 // 出运数量
OuterBoxCount int64 // 箱数
TotalVolume decimal.Decimal // 总体积
TotalGrossWeight decimal.Decimal // 总毛重
TotalNetWeight decimal.Decimal // 总净重
CustomsPrice decimal.Decimal // 报关单价
CustomsAmount decimal.Decimal // 报关总价
DomesticSupply string // 境内货源地
Remark string // 备注
Sort int64 // 排序
}
// Add @TITLE 添加赠品
func (g *gift) Add(ctx context.Context, args ArgsGiftAdd) (err error) {
xClient, err := client.GetClient(g)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Add", args, &reply)
}
type GiftEdit struct {
GiftId int64 // 费用ID
GiftAdd
}
// Edit @TITLE 编辑赠品
func (g *gift) Edit(ctx context.Context, args []GiftEdit) (err error) {
xClient, err := client.GetClient(g)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Delete @TITLE 删除赠品
func (g *gift) Delete(ctx context.Context, giftIds []int64) (err error) {
xClient, err := client.GetClient(g)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Delete", giftIds, &reply)
}

View File

@ -16,6 +16,7 @@ type SaleProductItem struct {
Sort int64 `json:"sort"` Sort int64 `json:"sort"`
Po string `json:"po"` Po string `json:"po"`
Serial string `json:"serial"` Serial string `json:"serial"`
ImgFilePaths []string `json:"imgFilePaths"`
CustomSerial string `json:"customSerial"` CustomSerial string `json:"customSerial"`
PackageDescription string `json:"packageDescription"` PackageDescription string `json:"packageDescription"`
PackageEngDescription string `json:"packageEngDescription"` PackageEngDescription string `json:"packageEngDescription"`
@ -86,7 +87,6 @@ type ArgsSaleProductAdd struct {
} }
type SaleProductAdd struct { type SaleProductAdd struct {
SaleProductId int64 // 销售商品id SaleProductId int64 // 销售商品id
Sort int64 // 排序
CustomSerial string // 客户货号 CustomSerial string // 客户货号
PackageEngDescription string // 包装英文描述 PackageEngDescription string // 包装英文描述
Name string // 中文品名 Name string // 中文品名
@ -109,6 +109,10 @@ type SaleProductAdd struct {
GrossWeight *decimal.Decimal // 毛重 GrossWeight *decimal.Decimal // 毛重
NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱
CustomsBrand string // 品牌 CustomsBrand string // 品牌
DomesticSupply string // 货源地
FactoryName string // 工厂名称
HsSerial int64 // 是否商检 1=商检 2=未商检
Texture string // 材质
EpmNo string // EPM NO EpmNo string // EPM NO
TaxExemption string // 免征税 TaxExemption string // 免征税
ItemNumber string // 项号 ItemNumber string // 项号
@ -133,13 +137,38 @@ func (s *saleProduct) Add(ctx context.Context, args ArgsSaleProductAdd) (err err
} }
type ArgsSaleProductEdit struct { type ArgsSaleProductEdit struct {
ShipmentSaleProductId int64 ShipmentId int64 // 订舱单id
Product SaleProductEdit Products []SaleProductEdit
} }
type SaleProductEdit struct { type SaleProductEdit struct {
SaleProductId int64 // 销售商品id ShipmentSaleProductId int64 // 出舱单商品id
Sort int64 // 排序
CustomSerial string // 客户货号
PackageEngDescription string // 包装英文描述
Name string // 中文品名
EngName string // 英文品名
CustomsSerial string // 海关编码
CustomsName string // 中文报关名称
CustomsMeasureUnit string // 报关单位
CustomsInvoiceUnit string // 开票单位
CustomsDetail string // 申报要素
BlEngName string // 提单英文名
InnerNum *int64 // 内盒入数
BoxNumUnit string // 箱数单位
OuterNum *int64 // 装箱单数
ShipmentCount int64 // 出运数量 ShipmentCount int64 // 出运数量
ShipmentCountUnit string // 数量单位
Length *decimal.Decimal // 长
Width *decimal.Decimal // 宽
Height *decimal.Decimal // 高
NetWeight *decimal.Decimal // 净重
GrossWeight *decimal.Decimal // 毛重
NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱
CustomsBrand string // 品牌
DomesticSupply string // 货源地
FactoryName string // 工厂名称
HsSerial int64 // 是否商检 1=商检 2=未商检
Texture string // 材质
EpmNo string // EPM NO EpmNo string // EPM NO
TaxExemption string // 免征税 TaxExemption string // 免征税
ItemNumber string // 项号 ItemNumber string // 项号
@ -151,8 +180,6 @@ type SaleProductEdit struct {
Remark6 string // 备注6 Remark6 string // 备注6
ContainerNumber string // 箱号 ContainerNumber string // 箱号
SealNumber string // 封号 SealNumber string // 封号
Sort int64 // 排序
BlEngName string // 提单英文名
} }
// Edit @TITLE 编辑 // Edit @TITLE 编辑

View File

@ -4,4 +4,7 @@ type Shipment struct {
Sale sale Sale sale
Cost cost Cost cost
SaleProduct saleProduct SaleProduct saleProduct
Audit audit
CustomsCost customsCost
Gift gift
} }