- 在报关单搜索条件中添加预计船期起止时间字段- 在结汇单搜索条件中添加预计船期起止时间字段- 在商检单搜索条件中添加预计船期起止时间字段- 调整时间包导入位置以符合代码规范
		
			
				
	
	
		
			205 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			205 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package shipment
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"time"
 | |
| 
 | |
| 	"git.kumo.work/shama/service/client"
 | |
| 	bean2 "git.kumo.work/shama/service/erp/bean"
 | |
| 	"git.kumo.work/shama/service/lib/bean"
 | |
| )
 | |
| 
 | |
| type exchangeSettlement struct {
 | |
| }
 | |
| 
 | |
| type ArgsExchangeSettlementList struct {
 | |
| 	Page   bean.Page
 | |
| 	Search ExchangeSettlementSearch
 | |
| }
 | |
| type ExchangeSettlementSearch struct {
 | |
| 	ExchangeSettlementNo  string     // 结汇单号
 | |
| 	InvoiceSerial         string     // 出运发票号
 | |
| 	CustomIds             []int64    // 客户筛选
 | |
| 	StaffIds              []int64    // 业务员筛选
 | |
| 	BanFlag               int64      // 是否有效
 | |
| 	ExchangeSettlementIds []int64    // 结汇id
 | |
| 	EstSailingDateStart   *time.Time // 预计船期
 | |
| 	EstSailingDateEnd     *time.Time // 预计船期
 | |
| }
 | |
| type ReplyExchangeSettlementList struct {
 | |
| 	List  []ExchangeSettlementItem `json:"list"`
 | |
| 	Total int64                    `json:"total"`
 | |
| }
 | |
| 
 | |
| type ExchangeSettlementItem struct {
 | |
| 	Id                   int64      `json:"id"`
 | |
| 	ShipmentId           int64      `json:"shipmentId"`
 | |
| 	Type                 int64      `json:"type"`
 | |
| 	InvoiceSerial        string     `json:"invoiceSerial"`
 | |
| 	ExchangeSettlementNo string     `json:"exchangeSettlementNo"`
 | |
| 	ContractDate         *time.Time `json:"contractDate"`
 | |
| 	InvoiceDate          *time.Time `json:"invoiceDate"`
 | |
| 	CustomName           string     `json:"customName"`
 | |
| 	CustomShortName      string     `json:"customShortName"`
 | |
| 	EstSailingDate       *time.Time `json:"estSailingDate"`
 | |
| 	ShipPort             string     `json:"shipPort"`
 | |
| 	DischargePort        string     `json:"dischargePort"`
 | |
| 	DischargePortEng     string     `json:"dischargePortEng"`
 | |
| 	BanFlag              int64      `json:"banFlag"`
 | |
| 	CreatedStaffId       int64      `json:"createdStaffId"`
 | |
| 	CreatedAt            *time.Time `json:"createdAt"`
 | |
| 	UpdatedAt            *time.Time `json:"updatedAt"`
 | |
| }
 | |
| 
 | |
| // List @TITLE 列表
 | |
| func (e *exchangeSettlement) List(ctx context.Context, args ArgsExchangeSettlementList) (reply ReplyExchangeSettlementList, err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	err = xClient.Call(ctx, "List", args, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| type ReplyExchangeSettlementInfo struct {
 | |
| 	ReplyShipmentInfo
 | |
| 	ExchangeSettlementNo string     `json:"exchangeSettlementNo"`
 | |
| 	ShipmentId           int64      `json:"shipmentId"`
 | |
| 	EstSailingDate       *time.Time `json:"estSailingDate"`
 | |
| 	InvoiceDate          *time.Time `json:"invoiceDate"`
 | |
| 	ReadyDate            *time.Time `json:"readyDate"`
 | |
| 	ShipPort             string     `json:"shipPort"`
 | |
| 	DischargePort        string     `json:"dischargePort"`
 | |
| 	DischargePortEng     string     `json:"dischargePortEng"`
 | |
| 	Destination          string     `json:"destination"`
 | |
| 	CreditSerial         string     `json:"creditSerial"`
 | |
| 	RecBank              string     `json:"recBank"`
 | |
| 	RecBankEng           string     `json:"recBankEng"`
 | |
| 	RecBankName          string     `json:"recBankName"`
 | |
| 	RecBankNameEng       string     `json:"recBankNameEng"`
 | |
| 	RecBankCardNo        string     `json:"recBankCardNo"`
 | |
| 	RecBankCardName      string     `json:"recBankCardName"`
 | |
| 	ShipmentNo           string     `json:"shipmentNo"`
 | |
| 	CnoSno               string     `json:"cnoSno"`
 | |
| 	Declare1             string     `json:"declare1"`
 | |
| 	Declare2             string     `json:"declare2"`
 | |
| 	Info                 string     `json:"info"`
 | |
| 	CustomsInvoiceDate   *time.Time `json:"customsInvoiceDate"`
 | |
| 	VesselNameVoyage     string     `json:"vesselNameVoyage"`
 | |
| 	BanFlag              int64      `json:"banFlag"`
 | |
| 	RecBankAddress       string     `json:"recBankAddress"`
 | |
| 	Type                 int64      `json:"type"`
 | |
| }
 | |
| 
 | |
| // Info @TITLE 详情
 | |
| func (e *exchangeSettlement) Info(ctx context.Context, exchangeSettlementId int64) (reply ReplyExchangeSettlementInfo, err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	err = xClient.Call(ctx, "Info", exchangeSettlementId, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| // Products @TITLE 获取产品
 | |
| func (e *exchangeSettlement) Products(ctx context.Context, exchangeSettlementId int64) (reply []SaleProductItem, err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	err = xClient.Call(ctx, "Products", exchangeSettlementId, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| // Gifts @TITLE 获取赠品
 | |
| func (e *exchangeSettlement) Gifts(ctx context.Context, exchangeSettlementId int64) (reply []GiftItem, err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	err = xClient.Call(ctx, "Gifts", exchangeSettlementId, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| type ArgsExchangeSettlementGen struct {
 | |
| 	ShipmentId             int64   // 订舱id
 | |
| 	ExchangeSettlementNo   string  // 结汇单号
 | |
| 	StaffId                int64   // 操作员工
 | |
| 	Type                   int64   // 类型 1=总票 2=分票
 | |
| 	ShipmentSaleProductIds []int64 // 订舱产品id
 | |
| 	ShipmentGiftIds        []int64 // 订舱赠品id
 | |
| }
 | |
| 
 | |
| // Gen @TITLE 生成
 | |
| func (e *exchangeSettlement) Gen(ctx context.Context, args ArgsExchangeSettlementGen) (err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	reply := 0
 | |
| 	err = xClient.Call(ctx, "Gen", args, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| // Cancel @TITLE 作废
 | |
| func (e *exchangeSettlement) Cancel(ctx context.Context, exchangeSettlementId int64) (err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	reply := 0
 | |
| 	err = xClient.Call(ctx, "Cancel", exchangeSettlementId, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| // Customs @TITLE 报关信息
 | |
| func (e *exchangeSettlement) Customs(ctx context.Context, exchangeSettlementId int64) (reply bean2.ReplyCustoms, err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	err = xClient.Call(ctx, "Customs", exchangeSettlementId, &reply)
 | |
| 	return
 | |
| }
 | |
| 
 | |
| type ArgsExchangeSettlementEdit struct {
 | |
| 	ExchangeSettlementId int64 // 结汇单id
 | |
| 	ArgsExchangeSettlementData
 | |
| }
 | |
| 
 | |
| type ArgsExchangeSettlementData struct {
 | |
| 	EstSailingDate     *time.Time // 预计发运日期
 | |
| 	InvoiceDate        *time.Time // 发票日期
 | |
| 	ReadyDate          *time.Time // 预计发运日期
 | |
| 	ShipPort           string     // 港口
 | |
| 	DischargePort      string     // 卸货港口
 | |
| 	DischargePortEng   string     // 卸货港口英文
 | |
| 	Destination        string     // 目的地
 | |
| 	CreditSerial       string     // 信用证号
 | |
| 	RecBank            string     // 收款银行
 | |
| 	RecBankEng         string     // 收款银行英文
 | |
| 	RecBankName        string     // 收款银行名称
 | |
| 	RecBankNameEng     string     // 收款银行名称英文
 | |
| 	RecBankCardNo      string     // 收款银行卡号
 | |
| 	RecBankCardName    string     // 收款银行卡名
 | |
| 	RecBankAddress     string     // 收汇银行地址
 | |
| 	ShipmentNo         string     // shipmentNO
 | |
| 	CnoSno             string     // CONTAINER NO./SEAL NO.
 | |
| 	Declare1           string     // 声明1
 | |
| 	Declare2           string     // 声明2
 | |
| 	Info               string     // 备注
 | |
| 	CustomsInvoiceDate *time.Time // 清关发票日期
 | |
| 	VesselNameVoyage   string     // 船名航次
 | |
| }
 | |
| 
 | |
| // Edit @TITLE 编辑
 | |
| func (e *exchangeSettlement) Edit(ctx context.Context, args ArgsExchangeSettlementEdit) (err error) {
 | |
| 	xClient, err := client.GetClient(e)
 | |
| 	if err != nil {
 | |
| 		return
 | |
| 	}
 | |
| 	reply := 0
 | |
| 	err = xClient.Call(ctx, "Edit", args, &reply)
 | |
| 	return
 | |
| }
 |