From eeefb47f82f7c0afb0f523af30b62d67aec951b0 Mon Sep 17 00:00:00 2001 From: kanade Date: Mon, 22 Dec 2025 11:47:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(erp):=20=E4=BC=98=E5=8C=96=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=95=86=E5=93=81=E7=BB=93=E6=9E=84=E4=BD=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 PurchaseProduct 结构体定义 - 调整 SaleProductAdd 和 SaleProductEdit 字段布局 - 统一结构体字段的换行与缩进格式 - 删除重复的类型声明和注释 - 保持代码风格一致性 --- erp/shipment/modify/saleProduct.go | 210 ++++++++++++++-------------- erp/shipment/saleProduct.go | 212 ++++++++++++++--------------- 2 files changed, 205 insertions(+), 217 deletions(-) diff --git a/erp/shipment/modify/saleProduct.go b/erp/shipment/modify/saleProduct.go index eb9f597..6b3a254 100644 --- a/erp/shipment/modify/saleProduct.go +++ b/erp/shipment/modify/saleProduct.go @@ -119,59 +119,54 @@ type ArgsSaleProductAdd struct { Products []SaleProductAdd // 产品信息 } type SaleProductAdd struct { - SaleProductId int64 // 销售商品id - CustomSerial string // 客户货号 - PackageDescription 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 // 出运数量 - ShipmentCountUnit string // 数量单位 - Length *decimal.Decimal // 长 - Width *decimal.Decimal // 宽 - Height *decimal.Decimal // 高 - NetWeight *decimal.Decimal // 净重 - GrossWeight *decimal.Decimal // 毛重 - NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 - CustomsVolume decimal.Decimal // 报关体积 - TotalCustomsVolume decimal.Decimal // 报关总体积 - CustomsNetWeight decimal.Decimal // 报关净重 - TotalCustomsNetWeight decimal.Decimal // 报关总净重 - CustomsGrossWeight decimal.Decimal // 报关毛重 - TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 - CustomsBrand string // 品牌 - DomesticSupply string // 货源地 - FactoryName string // 工厂名称 - HsSerial int64 // 是否商检 1=商检 2=未商检 - Texture string // 材质 - EngTexture string // 英文材质 - EpmNo string // EPM NO - TaxExemption string // 免征税 - ItemNumber string // 项号 - Remark1 string // 备注1 - Remark2 string // 备注2 - Remark3 string // 备注3 - Remark4 string // 备注4 - Remark5 string // 备注5 - Remark6 string // 备注6 - RemarkImg string // 图片备注 - ContainerNumber string // 箱号 - SealNumber string // 封号 - PurchaseProducts []PurchaseProduct // 采购商品 - Children []SaleProductAdd // 子产品 -} -type PurchaseProduct struct { - PurchaseProductId int64 // 采购商品id - ShipmentCount int64 // 出运数量 + SaleProductId int64 // 销售商品id + CustomSerial string // 客户货号 + PackageDescription 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 // 出运数量 + ShipmentCountUnit string // 数量单位 + Length *decimal.Decimal // 长 + Width *decimal.Decimal // 宽 + Height *decimal.Decimal // 高 + NetWeight *decimal.Decimal // 净重 + GrossWeight *decimal.Decimal // 毛重 + NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 + CustomsVolume decimal.Decimal // 报关体积 + TotalCustomsVolume decimal.Decimal // 报关总体积 + CustomsNetWeight decimal.Decimal // 报关净重 + TotalCustomsNetWeight decimal.Decimal // 报关总净重 + CustomsGrossWeight decimal.Decimal // 报关毛重 + TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 + CustomsBrand string // 品牌 + DomesticSupply string // 货源地 + FactoryName string // 工厂名称 + HsSerial int64 // 是否商检 1=商检 2=未商检 + Texture string // 材质 + EngTexture string // 英文材质 + EpmNo string // EPM NO + TaxExemption string // 免征税 + ItemNumber string // 项号 + Remark1 string // 备注1 + Remark2 string // 备注2 + Remark3 string // 备注3 + Remark4 string // 备注4 + Remark5 string // 备注5 + Remark6 string // 备注6 + RemarkImg string // 图片备注 + ContainerNumber string // 箱号 + SealNumber string // 封号 + Children []SaleProductAdd // 子产品 } // Add @TITLE 添加 @@ -189,61 +184,60 @@ type ArgsSaleProductEdit struct { Products []SaleProductEdit } type SaleProductEdit struct { - ShipmentSaleProductId int64 // 出舱单商品id - Sort int64 // 排序 - Po string // Po - CustomSerial string // 客户货号 - PackageDescription string // 包装 - PackageEngDescription string // 包装英文描述 - PackageWeight decimal.Decimal // 包装重量 - Name string // 中文品名 - EngName string // 英文品名 - CustomsSerial string // 海关编码 - CustomsName string // 中文报关名称 - CustomsMeasureUnit string // 报关单位 - CustomsInvoiceUnit string // 开票单位 - CustomsDetail string // 申报要素 - BlEngName string // 提单英文名 - InnerNum *int64 // 内盒入数 - BoxNumUnit string // 箱数单位 - OuterNum *int64 // 装箱单数 - ShipmentCount int64 // 出运数量 - ShipmentCountUnit string // 数量单位 - Length *decimal.Decimal // 长 - Width *decimal.Decimal // 宽 - Height *decimal.Decimal // 高 - NetWeight *decimal.Decimal // 净重 - GrossWeight *decimal.Decimal // 毛重 - NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 - CustomsVolume decimal.Decimal // 报关体积 - TotalCustomsVolume decimal.Decimal // 报关总体积 - CustomsNetWeight decimal.Decimal // 报关净重 - TotalCustomsNetWeight decimal.Decimal // 报关总净重 - CustomsGrossWeight decimal.Decimal // 报关毛重 - TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 - SalePrice decimal.Decimal // 销售单价 - CustomsPrice decimal.Decimal // 报关单价 - CustomsAmount decimal.Decimal // 报关总价 - CustomsBrand string // 品牌 - DomesticSupply string // 货源地 - FactoryName string // 工厂名称 - HsSerial int64 // 是否商检 1=商检 2=未商检 - Texture string // 材质 - EngTexture string // 英文材质 - EpmNo string // EPM NO - TaxExemption string // 免征税 - ItemNumber string // 项号 - Remark1 string // 备注1 - Remark2 string // 备注2 - Remark3 string // 备注3 - Remark4 string // 备注4 - Remark5 string // 备注5 - Remark6 string // 备注6 - ExchangeSettlementRemark string // 结汇备注 - RemarkImg string // 图片备注 - ContainerNumber string // 箱号 - SealNumber string // 封号 - PurchaseProducts []PurchaseProduct // 采购商品 + ShipmentSaleProductId int64 // 出舱单商品id + Sort int64 // 排序 + Po string // Po + CustomSerial string // 客户货号 + PackageDescription string // 包装 + PackageEngDescription string // 包装英文描述 + PackageWeight decimal.Decimal // 包装重量 + Name string // 中文品名 + EngName string // 英文品名 + CustomsSerial string // 海关编码 + CustomsName string // 中文报关名称 + CustomsMeasureUnit string // 报关单位 + CustomsInvoiceUnit string // 开票单位 + CustomsDetail string // 申报要素 + BlEngName string // 提单英文名 + InnerNum *int64 // 内盒入数 + BoxNumUnit string // 箱数单位 + OuterNum *int64 // 装箱单数 + ShipmentCount int64 // 出运数量 + ShipmentCountUnit string // 数量单位 + Length *decimal.Decimal // 长 + Width *decimal.Decimal // 宽 + Height *decimal.Decimal // 高 + NetWeight *decimal.Decimal // 净重 + GrossWeight *decimal.Decimal // 毛重 + NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 + CustomsVolume decimal.Decimal // 报关体积 + TotalCustomsVolume decimal.Decimal // 报关总体积 + CustomsNetWeight decimal.Decimal // 报关净重 + TotalCustomsNetWeight decimal.Decimal // 报关总净重 + CustomsGrossWeight decimal.Decimal // 报关毛重 + TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 + SalePrice decimal.Decimal // 销售单价 + CustomsPrice decimal.Decimal // 报关单价 + CustomsAmount decimal.Decimal // 报关总价 + CustomsBrand string // 品牌 + DomesticSupply string // 货源地 + FactoryName string // 工厂名称 + HsSerial int64 // 是否商检 1=商检 2=未商检 + Texture string // 材质 + EngTexture string // 英文材质 + EpmNo string // EPM NO + TaxExemption string // 免征税 + ItemNumber string // 项号 + Remark1 string // 备注1 + Remark2 string // 备注2 + Remark3 string // 备注3 + Remark4 string // 备注4 + Remark5 string // 备注5 + Remark6 string // 备注6 + ExchangeSettlementRemark string // 结汇备注 + RemarkImg string // 图片备注 + ContainerNumber string // 箱号 + SealNumber string // 封号 } // Edit @TITLE 编辑 diff --git a/erp/shipment/saleProduct.go b/erp/shipment/saleProduct.go index ffaac58..14bd9dd 100644 --- a/erp/shipment/saleProduct.go +++ b/erp/shipment/saleProduct.go @@ -121,60 +121,55 @@ type ArgsSaleProductAdd struct { Products []SaleProductAdd // 产品信息 } type SaleProductAdd struct { - SaleProductId int64 // 销售商品id - CustomSerial string // 客户货号 - Po string // po - PackageDescription 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 // 出运数量 - ShipmentCountUnit string // 数量单位 - Length *decimal.Decimal // 长 - Width *decimal.Decimal // 宽 - Height *decimal.Decimal // 高 - NetWeight *decimal.Decimal // 净重 - GrossWeight *decimal.Decimal // 毛重 - NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 - CustomsVolume decimal.Decimal // 报关体积 - TotalCustomsVolume decimal.Decimal // 报关总体积 - CustomsNetWeight decimal.Decimal // 报关净重 - TotalCustomsNetWeight decimal.Decimal // 报关总净重 - CustomsGrossWeight decimal.Decimal // 报关毛重 - TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 - CustomsBrand string // 品牌 - DomesticSupply string // 货源地 - FactoryName string // 工厂名称 - HsSerial int64 // 是否商检 1=商检 2=未商检 - Texture string // 材质 - EngTexture string // 英文材质 - EpmNo string // EPM NO - TaxExemption string // 免征税 - ItemNumber string // 项号 - Remark1 string // 备注1 - Remark2 string // 备注2 - Remark3 string // 备注3 - Remark4 string // 备注4 - Remark5 string // 备注5 - Remark6 string // 备注6 - RemarkImg string // 图片备注 - ContainerNumber string // 箱号 - SealNumber string // 封号 - PurchaseProducts []PurchaseProduct // 采购商品 - Children []SaleProductAdd // 子产品 -} -type PurchaseProduct struct { - PurchaseProductId int64 // 采购商品id - ShipmentCount int64 // 出运数量 + SaleProductId int64 // 销售商品id + CustomSerial string // 客户货号 + Po string // po + PackageDescription 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 // 出运数量 + ShipmentCountUnit string // 数量单位 + Length *decimal.Decimal // 长 + Width *decimal.Decimal // 宽 + Height *decimal.Decimal // 高 + NetWeight *decimal.Decimal // 净重 + GrossWeight *decimal.Decimal // 毛重 + NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 + CustomsVolume decimal.Decimal // 报关体积 + TotalCustomsVolume decimal.Decimal // 报关总体积 + CustomsNetWeight decimal.Decimal // 报关净重 + TotalCustomsNetWeight decimal.Decimal // 报关总净重 + CustomsGrossWeight decimal.Decimal // 报关毛重 + TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 + CustomsBrand string // 品牌 + DomesticSupply string // 货源地 + FactoryName string // 工厂名称 + HsSerial int64 // 是否商检 1=商检 2=未商检 + Texture string // 材质 + EngTexture string // 英文材质 + EpmNo string // EPM NO + TaxExemption string // 免征税 + ItemNumber string // 项号 + Remark1 string // 备注1 + Remark2 string // 备注2 + Remark3 string // 备注3 + Remark4 string // 备注4 + Remark5 string // 备注5 + Remark6 string // 备注6 + RemarkImg string // 图片备注 + ContainerNumber string // 箱号 + SealNumber string // 封号 + Children []SaleProductAdd // 子产品 } // Add @TITLE 添加 @@ -192,61 +187,60 @@ type ArgsSaleProductEdit struct { Products []SaleProductEdit } type SaleProductEdit struct { - ShipmentSaleProductId int64 // 出舱单商品id - Sort int64 // 排序 - Po string // Po - CustomSerial string // 客户货号 - PackageDescription string // 包装 - PackageEngDescription string // 包装英文描述 - PackageWeight decimal.Decimal // 包装重量 - Name string // 中文品名 - EngName string // 英文品名 - CustomsSerial string // 海关编码 - CustomsName string // 中文报关名称 - CustomsMeasureUnit string // 报关单位 - CustomsInvoiceUnit string // 开票单位 - CustomsDetail string // 申报要素 - BlEngName string // 提单英文名 - InnerNum *int64 // 内盒入数 - BoxNumUnit string // 箱数单位 - OuterNum *int64 // 装箱单数 - ShipmentCount int64 // 出运数量 - ShipmentCountUnit string // 数量单位 - Length *decimal.Decimal // 长 - Width *decimal.Decimal // 宽 - Height *decimal.Decimal // 高 - NetWeight *decimal.Decimal // 净重 - GrossWeight *decimal.Decimal // 毛重 - NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 - CustomsVolume decimal.Decimal // 报关体积 - TotalCustomsVolume decimal.Decimal // 报关总体积 - CustomsNetWeight decimal.Decimal // 报关净重 - TotalCustomsNetWeight decimal.Decimal // 报关总净重 - CustomsGrossWeight decimal.Decimal // 报关毛重 - TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 - SalePrice decimal.Decimal // 销售单价 - CustomsBrand string // 品牌 - CustomsPrice decimal.Decimal // 报关价格 - CustomsAmount decimal.Decimal // 报关总价 - DomesticSupply string // 货源地 - FactoryName string // 工厂名称 - HsSerial int64 // 是否商检 1=商检 2=未商检 - Texture string // 材质 - EngTexture string // 英文材质 - EpmNo string // EPM NO - TaxExemption string // 免征税 - ItemNumber string // 项号 - Remark1 string // 备注1 - Remark2 string // 备注2 - Remark3 string // 备注3 - Remark4 string // 备注4 - Remark5 string // 备注5 - Remark6 string // 备注6 - ExchangeSettlementRemark string // 结汇备注 - RemarkImg string // 图片备注 - ContainerNumber string // 箱号 - SealNumber string // 封号 - PurchaseProducts []PurchaseProduct // 采购商品 + ShipmentSaleProductId int64 // 出舱单商品id + Sort int64 // 排序 + Po string // Po + CustomSerial string // 客户货号 + PackageDescription string // 包装 + PackageEngDescription string // 包装英文描述 + PackageWeight decimal.Decimal // 包装重量 + Name string // 中文品名 + EngName string // 英文品名 + CustomsSerial string // 海关编码 + CustomsName string // 中文报关名称 + CustomsMeasureUnit string // 报关单位 + CustomsInvoiceUnit string // 开票单位 + CustomsDetail string // 申报要素 + BlEngName string // 提单英文名 + InnerNum *int64 // 内盒入数 + BoxNumUnit string // 箱数单位 + OuterNum *int64 // 装箱单数 + ShipmentCount int64 // 出运数量 + ShipmentCountUnit string // 数量单位 + Length *decimal.Decimal // 长 + Width *decimal.Decimal // 宽 + Height *decimal.Decimal // 高 + NetWeight *decimal.Decimal // 净重 + GrossWeight *decimal.Decimal // 毛重 + NetGrossVolume int64 // 净毛体计算类型 1=内盒 2=外箱 + CustomsVolume decimal.Decimal // 报关体积 + TotalCustomsVolume decimal.Decimal // 报关总体积 + CustomsNetWeight decimal.Decimal // 报关净重 + TotalCustomsNetWeight decimal.Decimal // 报关总净重 + CustomsGrossWeight decimal.Decimal // 报关毛重 + TotalCustomsGrossWeight decimal.Decimal // 报关总毛重 + SalePrice decimal.Decimal // 销售单价 + CustomsBrand string // 品牌 + CustomsPrice decimal.Decimal // 报关价格 + CustomsAmount decimal.Decimal // 报关总价 + DomesticSupply string // 货源地 + FactoryName string // 工厂名称 + HsSerial int64 // 是否商检 1=商检 2=未商检 + Texture string // 材质 + EngTexture string // 英文材质 + EpmNo string // EPM NO + TaxExemption string // 免征税 + ItemNumber string // 项号 + Remark1 string // 备注1 + Remark2 string // 备注2 + Remark3 string // 备注3 + Remark4 string // 备注4 + Remark5 string // 备注5 + Remark6 string // 备注6 + ExchangeSettlementRemark string // 结汇备注 + RemarkImg string // 图片备注 + ContainerNumber string // 箱号 + SealNumber string // 封号 } // Edit @TITLE 编辑