Files
service/erp/shipment/modify.go
kanade f546c3f22a feat(erp): 添加销售价格字段和收汇客户信息字段
- 在销售审核模块中为产品项目添加销售单价字段
- 在销售变更模块中为产品添加变更前后销售价格字段
- 在发货单相关结构体中添加收汇客户ID、名称和地址字段
- 在应收账款模块中添加收汇客户相关信息字段
- 统一在发货单主结构体和详情结构体中添加收汇客户字段
- 引入decimal库支持精确的价格计算和存储
2026-09-08 15:04:20 +08:00

281 lines
13 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package shipment
import (
"context"
"time"
"git.kumo.work/shama/service/client"
bean2 "git.kumo.work/shama/service/erp/bean"
modify2 "git.kumo.work/shama/service/erp/shipment/modify"
"git.kumo.work/shama/service/lib/bean"
"github.com/shopspring/decimal"
)
type modify struct {
Modify modify2.Modify
}
type ArgsShipmentList struct {
Page bean.Page
Search ShipmentSearch
}
type ShipmentSearch struct {
InvoiceSerial string // 出运发票号
CustomIds []int64 // 客户筛选
StaffIds []int64 // 业务员筛选
CreatedStaffIds []int64 // 业务员筛选
WorkflowStatus []int64 // 审核状态
IsAudit int64 // 审核状态 是否审核 1=是 2=否
ShipmentIds []int64 // 出舱id
ModifyIds []int64 // 订舱修改单id
InvoiceDateStart *time.Time // 发票日期
InvoiceDateEnd *time.Time // 发票日期
ContractDateStart *time.Time // 合同日期
ContractDateEnd *time.Time // 合同日期
BanFlag int64 // 是否有效
ShipmentId int64 // 出运id
}
type ReplyShipmentList struct {
List []ShipmentItem `json:"list"`
Total int64 `json:"total"`
}
type ShipmentItem struct {
Id int64 `json:"id"`
ShipmentId int64 `json:"shipmentId"`
PiSerials string `json:"piSerials"`
InvoiceSerial string `json:"invoiceSerial"`
ContractDate *time.Time `json:"contractDate"`
InvoiceDate *time.Time `json:"invoiceDate"`
CustomName string `json:"customName"`
CustomShortName string `json:"customShortName"`
RecCustomId int64 `json:"recCustomId"`
RecCustomName string `json:"recCustomName"`
RecCustomAddress string `json:"recCustomAddress"`
EstSailingDate *time.Time `json:"estSailingDate"`
ShipPort string `json:"shipPort"`
DischargePort string `json:"dischargePort"`
DischargePortEng string `json:"dischargePortEng"`
WorkflowStatus int64 `json:"workflowStatus"`
CreatedStaffId int64 `json:"createdStaffId"`
CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"`
}
// List @TITLE 列表
func (m *modify) List(ctx context.Context, args ArgsShipmentList) (reply ReplyShipmentList, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(ctx, "List", args, &reply)
return
}
type ArgsShipmentAdd struct {
ShipmentId int64 // 订舱id
}
// Add @TITLE 添加
func (m *modify) Add(ctx context.Context, args ArgsShipmentAdd) (modifyId int64, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(ctx, "Add", args, &modifyId)
return
}
type ReplyModifyInfo struct {
Id int64 `json:"id"`
ShipmentId int64 `json:"shipmentId"`
VouchingClerkId int64 `json:"vouchingClerkId"`
CustomId int64 `json:"customId"`
CustomName string `json:"customName"`
CustomShortName string `json:"customShortName"`
EstSailingDate *time.Time `json:"estSailingDate"`
InvoiceSerial string `json:"invoiceSerial"`
InvoiceDate *time.Time `json:"invoiceDate"`
ContractDate *time.Time `json:"contractDate"`
TradeType string `json:"tradeType"`
OurCompany string `json:"ourCompany"`
PaymentType string `json:"paymentType"`
PaymentDepositRate *decimal.Decimal `json:"paymentDepositRate"`
PaymentDepositAmount *decimal.Decimal `json:"paymentDepositAmount"`
PaymentCycle *int64 `json:"paymentCycle"`
PaymentTerms string `json:"paymentTerms"`
CommissionRate *decimal.Decimal `json:"commissionRate"`
TradeCountry string `json:"tradeCountry"`
RecBank string `json:"recBank"`
RecBankEng string `json:"recBankEng"`
RecBankName string `json:"recBankName"`
RecBankNameEng string `json:"recBankNameEng"`
RecBankCardNo string `json:"recBankCardNo"`
RecBankCardName string `json:"recBankCardName"`
RecBankAddress string `json:"recBankAddress"`
RecCustomId int64 `json:"recCustomId"`
RecCustomName string `json:"recCustomName"`
RecCustomAddress string `json:"recCustomAddress"`
RecCompanyName string `json:"recCompanyName"`
Shipper string `json:"shipper"`
Consignee string `json:"consignee"`
Notifier string `json:"notifier"`
DueRecDate *time.Time `json:"dueRecDate"`
ShipMode string `json:"shipMode"`
ContainerType string `json:"containerType"`
ReadyDate *time.Time `json:"readyDate"`
ShipPort string `json:"shipPort"`
DischargePort string `json:"dischargePort"`
DischargePortEng string `json:"dischargePortEng"`
DeliveryCountry string `json:"deliveryCountry"`
DeliveryCountryEng string `json:"deliveryCountryEng"`
Destination string `json:"destination"`
FactoryHaulAdress string `json:"factoryHaulAdress"`
LogisticsCompanyId int64 `json:"logisticsCompanyId"`
LogisticsCompany string `json:"logisticsCompany"`
LogisticsCompanyContactName string `json:"logisticsCompanyContactName"`
LogisticsCompanyContactPhone string `json:"logisticsCompanyContactPhone"`
LogisticsCompanyContactTel string `json:"logisticsCompanyContactTel"`
LogisticsCompanyContactEmail string `json:"logisticsCompanyContactEmail"`
SeparableFlag int64 `json:"separableFlag"`
CopyCount *int64 `json:"copyCount"`
InsuranceRatio *int64 `json:"insuranceRatio"`
CreditSerial string `json:"creditSerial"`
CreditDate *time.Time `json:"creditDate"`
InlandShipWay string `json:"inlandShipWay"`
PackagingType string `json:"packagingType"`
ShipmentNo string `json:"shipmentNo"`
CnoSno string `json:"cnoSno"`
Declare1 string `json:"declare1"`
Declare2 string `json:"declare2"`
Info string `json:"info"`
RegulatoryMethods string `json:"regulatoryMethods"`
TaxExemptionNature string `json:"taxExemptionNature"`
MarkText string `json:"markText"`
MarkImg string `json:"markImg"`
DomesticShippingCost decimal.Decimal `json:"domesticShippingCost"`
ForeignShippingCost decimal.Decimal `json:"foreignShippingCost"`
ForeignCommission decimal.Decimal `json:"foreignCommission"`
WorkflowId int64 `json:"workflowId"`
WorkflowStatus int64 `json:"workflowStatus"`
WorkflowReason string `json:"workflowReason"`
CreatedStaffId int64 `json:"createdStaffId"`
CreatedAt *time.Time `json:"createdAt"`
SaleCurrency string `json:"saleCurrency"`
SaleCurrencyName string `json:"saleCurrencyName"`
SaleCurrencySymbol string `json:"saleCurrencySymbol"`
SaleCurrencyRate decimal.Decimal `json:"saleCurrencyRate"`
BanFlag int64 `json:"banFlag"`
}
// Info @TITLE 详情
func (m *modify) Info(ctx context.Context, modifyId int64) (reply ReplyModifyInfo, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(ctx, "Info", modifyId, &reply)
return
}
type ArgsShipmentEdit struct {
ModifyId int64 // 订舱修改单ID
ArgsShipmentData
}
type ArgsShipmentData struct {
EstSailingDate *time.Time // 预计发运日期
InvoiceSerial string // 发票编号
InvoiceDate *time.Time // 发票日期
ContractDate *time.Time // 合同日期
TradeType string // 贸易类型
OurCompany string // 我方公司
RecBank string // 收款银行
RecBankEng string // 收款银行英文
RecBankName string // 收款银行名称
RecBankNameEng string // 收款银行名称英文
RecBankCardNo string // 收款银行卡号
RecBankCardName string // 收款银行卡名
RecBankAddress string // 收汇银行地址
RecCustomId int64 // 收汇客户
RecCustomName string // 收汇客户名称
RecCustomAddress string // 收汇客户地址
RecCompanyName string // 收汇公司名称
PaymentTerms string // 付款条件
TradeCountry string // 贸易国
PaymentType string // 付款方式
PaymentDepositRate decimal.Decimal // 定金比例
PaymentCycle int64 // 付款周期
CommissionRate decimal.Decimal // 佣金比例
DueRecDate *time.Time // 预计收汇日期日期
Shipper string // 发货方
Consignee string // 收货方
Notifier string // 通知方
ShipMode string // 运输方式
ContainerType string // 柜型
ReadyDate *time.Time // 预计发运日期
ShipPort string // 港口
DischargePort string // 卸货港口
DischargePortEng string // 卸货港口英文
DeliveryCountry string // 运抵国
DeliveryCountryEng string // 运抵国英文
Destination string // 目的地
FactoryHaulAdress string // 工厂拖柜地址
SeparableFlag int64 // 可分批标记1=可分 2=不可分)
LogisticsCompanyId int64 // 物流公司id
LogisticsCompany string // 物流公司
LogisticsCompanyContactName string // 物流公司联系人
LogisticsCompanyContactPhone string // 物流公司联系人电话
LogisticsCompanyContactTel string // 物流公司联系人固定电话
LogisticsCompanyContactEmail string // 物流公司联系人邮箱
CopyCount int64 // 提单份数
InsuranceRatio int64 // 保险比率
CreditSerial string // 信用证号
CreditDate *time.Time // 开证日期
InlandShipWay string // 内陆运输
PackagingType string // 包装种类
ShipmentNo string // shipmentNO
CnoSno string // CONTAINER NO./SEAL NO.
Declare1 string // 声明1
Declare2 string // 声明2
Info string // 备注
RegulatoryMethods string // 监管方式
TaxExemptionNature string // 征免性质
MarkText string // 唛头文字
MarkImg string // 唛头图片
VouchingClerkId int64 // 单证id
DomesticShippingCost decimal.Decimal // 国内运费
ForeignShippingCost decimal.Decimal // 海外运费
ForeignCommission decimal.Decimal // 海外佣金
}
// Edit @TITLE 编辑
func (m *modify) Edit(ctx context.Context, args ArgsShipmentEdit) (err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Edit", args, &reply)
return
}
// Customs @TITLE 报关信息
func (m *modify) Customs(ctx context.Context, modifyId int64) (reply bean2.ReplyCustoms, err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
err = xClient.Call(ctx, "Customs", modifyId, &reply)
return
}
// Cancel @TITLE 作废
func (m *modify) Cancel(ctx context.Context, modifyId int64) (err error) {
xClient, err := client.GetClient(m)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Cancel", modifyId, &reply)
return
}