Compare commits
13 Commits
8de8393c07
...
fix_accoun
| Author | SHA1 | Date | |
|---|---|---|---|
| 11b4f6fdf2 | |||
| e0f18fb837 | |||
| 6928ef5088 | |||
| e08c49d40f | |||
| 78393b37d5 | |||
| 165109e9fd | |||
| 5cd534571d | |||
| 8614837410 | |||
| 89999b7df3 | |||
| 2326632e9d | |||
| 1975cccdb1 | |||
| 34a9bcdd37 | |||
| 96993c312a |
@@ -81,3 +81,9 @@ const (
|
||||
FlagTrue Flag = 1 // 是
|
||||
FlagFalse Flag = 2 // 否
|
||||
)
|
||||
|
||||
type DomesticFeeType = int64 // 国内扣费类型 1=外币 2=人民币
|
||||
const (
|
||||
DomesticFeeTypeForeign DomesticFeeType = 1 // 外币
|
||||
DomesticFeeTypeRMB DomesticFeeType = 2 // 人民币
|
||||
)
|
||||
|
||||
@@ -12,4 +12,7 @@ type Erp struct {
|
||||
Contact contact
|
||||
Template template
|
||||
Accounting accounting
|
||||
Payable payable
|
||||
Receivable receivable
|
||||
Receipt receipt
|
||||
}
|
||||
|
||||
115
erp/payable.go
Normal file
115
erp/payable.go
Normal file
@@ -0,0 +1,115 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type payable struct {
|
||||
}
|
||||
type ArgsPayableList struct {
|
||||
Page bean.Page
|
||||
Search PayableSearch
|
||||
}
|
||||
type PayableSearch struct {
|
||||
PayableSerial string // 付款单据号
|
||||
FactoryId int64 // 工厂id
|
||||
AccountingSerial string // 做账单号
|
||||
CreatedAtStart *time.Time // 创建开始时间
|
||||
CreatedAtEnd *time.Time // 创建结束时间
|
||||
IsConfirm int64 // 是否确认
|
||||
}
|
||||
type ReplyPayableList struct {
|
||||
List []PayableItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type PayableItem struct {
|
||||
Id int64 `json:"id"`
|
||||
PayableSerial string `json:"payableSerial"`
|
||||
FactoryName string `json:"factoryName"`
|
||||
AccountingSerial string `json:"accountingSerial"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
IsConfirm int64 `json:"isConfirm"`
|
||||
PurchaseStaffId int64 `json:"purchaseStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (p *payable) List(ctx context.Context, args ArgsPayableList) (reply ReplyPayableList, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyPayableInfo struct {
|
||||
Id int64 `json:"id"`
|
||||
PayableSerial string `json:"payableSerial"`
|
||||
AccountingSerial string `json:"accountingSerial"`
|
||||
FactoryName string `json:"factoryName"`
|
||||
FactoryBank string `json:"factoryBank"`
|
||||
FactoryBankAccount string `json:"factoryBankAccount"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
PurchaseStaffId int64 `json:"purchaseStaffId"`
|
||||
IsConfirm int64 `json:"isConfirm"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Products []PayableProductItem `json:"products"`
|
||||
Costs []PayableCostItem `json:"costs"`
|
||||
}
|
||||
|
||||
type PayableProductItem struct {
|
||||
Id int64 `json:"id"`
|
||||
AccountingProductId int64 `json:"accountingProductId"`
|
||||
Name string `json:"name"`
|
||||
Serial string `json:"serial"`
|
||||
PayableCount int64 `json:"payableCount"`
|
||||
AddTaxRate decimal.Decimal `json:"addTaxRate"`
|
||||
UnitPrice decimal.Decimal `json:"unitPrice"`
|
||||
ExTaxUnitPrice decimal.Decimal `json:"exTaxUnitPrice"`
|
||||
UnitAmount decimal.Decimal `json:"unitAmount"`
|
||||
ExTaxUnitAmount decimal.Decimal `json:"exTaxUnitAmount"`
|
||||
TaxAmount decimal.Decimal `json:"taxAmount"`
|
||||
}
|
||||
|
||||
type PayableCostItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Remarks string `json:"remarks"`
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (p *payable) Info(ctx context.Context, payableId int64) (reply ReplyPayableInfo, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", payableId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// Confirm @TITLE 确认
|
||||
func (p *payable) Confirm(ctx context.Context, payableId int64) (err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Confirm", payableId, &reply)
|
||||
}
|
||||
129
erp/receipt.go
Normal file
129
erp/receipt.go
Normal file
@@ -0,0 +1,129 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
receipt2 "git.kumo.work/shama/service/erp/receipt"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type receipt struct {
|
||||
receipt2.Receipt
|
||||
}
|
||||
type ArgsReceiptList struct {
|
||||
Page bean.Page
|
||||
Search ReceiptSearch
|
||||
}
|
||||
type ReceiptSearch struct {
|
||||
ReceiptSerial string // 收汇单号
|
||||
PayName string // 付款单位
|
||||
BankName string // 结汇银行
|
||||
ReceiptDateStart *time.Time // 创建开始时间
|
||||
ReceiptDateEnd *time.Time // 创建结束时间
|
||||
}
|
||||
type ReplyReceiptList struct {
|
||||
List []ReceiptItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type ReceiptItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ReceiptSerial string `json:"receiptSerial"`
|
||||
PayName string `json:"payName"`
|
||||
ReceiptDate time.Time `json:"receiptDate"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
BankName string `json:"bankName"`
|
||||
EntryAmount decimal.Decimal `json:"entryAmount"`
|
||||
ReceivableFxAmount decimal.Decimal `json:"receivableFxAmount"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (r *receipt) List(ctx context.Context, args ArgsReceiptList) (reply ReplyReceiptList, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsReceiptAdd struct {
|
||||
StaffId int64
|
||||
ReceiptAdd
|
||||
}
|
||||
type ReceiptAdd struct {
|
||||
ReceiptDate time.Time // 收汇日期
|
||||
Currency string // 币种
|
||||
CurrencyName string // 币种名称
|
||||
CurrencySymbol string // 币种符号
|
||||
CurrencyRate decimal.Decimal // 币种汇率
|
||||
PayName string // 付款单位
|
||||
BankName string // 结汇银行
|
||||
EntryAmount decimal.Decimal // 外币入账金额
|
||||
ForeignFee decimal.Decimal // 国外扣费
|
||||
DomesticFee decimal.Decimal // 国内扣费
|
||||
DomesticFeeType DomesticFeeType // 国内扣费类型 1=外币 2=人民币
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (r *receipt) Add(ctx context.Context, args ArgsReceiptAdd) (receiptId int64, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &receiptId)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyReceiptInfo struct {
|
||||
Id int64 `json:"id"`
|
||||
ReceiptSerial string `json:"receiptSerial"`
|
||||
ReceiptDate time.Time `json:"receiptDate"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
PayName string `json:"payName"`
|
||||
BankName string `json:"bankName"`
|
||||
EntryAmount decimal.Decimal `json:"entryAmount"`
|
||||
ForeignFee decimal.Decimal `json:"foreignFee"`
|
||||
DomesticFee decimal.Decimal `json:"domesticFee"`
|
||||
DomesticFeeType int64 `json:"domesticFeeType"`
|
||||
ReceivableFxAmount decimal.Decimal `json:"receivableFxAmount"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (r *receipt) Info(ctx context.Context, receiptId int64) (reply ReplyReceiptInfo, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", receiptId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsReceiptEdit struct {
|
||||
ReceiptId int64
|
||||
ReceiptAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (r *receipt) Edit(ctx context.Context, args ArgsReceiptEdit) (err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
127
erp/receipt/claim.go
Normal file
127
erp/receipt/claim.go
Normal file
@@ -0,0 +1,127 @@
|
||||
package receipt
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type claim struct {
|
||||
}
|
||||
|
||||
type ArgsClaimList struct {
|
||||
Page bean.Page
|
||||
Search ClaimSearch
|
||||
}
|
||||
type ClaimSearch struct {
|
||||
ReceiptId int64 // 收汇单ID
|
||||
}
|
||||
type ReplyClaimList struct {
|
||||
List []ClaimItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type ClaimItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ReceivableId int64 `json:"receivableId"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
CustomName string `json:"customName"`
|
||||
IsConfirm int64 `json:"isConfirm"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (c *claim) List(ctx context.Context, args ArgsClaimList) (reply ReplyClaimList, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsClaimAdd struct {
|
||||
StaffId int64
|
||||
ClaimAdd
|
||||
}
|
||||
type ClaimAdd struct {
|
||||
ReceiptId int64 // 收汇单ID
|
||||
ReceivableId int64 // 应收单ID
|
||||
Amount decimal.Decimal // 应收金额
|
||||
Remarks string // 备注
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (c *claim) Add(ctx context.Context, args ArgsClaimAdd) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsClaimEdit struct {
|
||||
ClaimId int64
|
||||
ClaimAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (c *claim) Edit(ctx context.Context, args ArgsClaimEdit) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsClaimDelete struct {
|
||||
ReceiptId int64 // 收汇单ID
|
||||
ClaimIds []int64
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除
|
||||
func (c *claim) Delete(ctx context.Context, args ArgsClaimDelete) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Delete", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsClaimConfirm struct {
|
||||
ReceiptId int64 // 收汇单ID
|
||||
ClaimIds []int64
|
||||
}
|
||||
|
||||
// Confirm @TITLE 确认
|
||||
func (c *claim) Confirm(ctx context.Context, args ArgsClaimConfirm) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Confirm", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsClaimCancelConfirm struct {
|
||||
ReceiptId int64 // 收汇单ID
|
||||
ClaimIds []int64
|
||||
}
|
||||
|
||||
// CancelConfirm @TITLE 取消确认
|
||||
func (c *claim) CancelConfirm(ctx context.Context, args ArgsClaimCancelConfirm) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "CancelConfirm", args, &reply)
|
||||
}
|
||||
5
erp/receipt/receipt.go
Normal file
5
erp/receipt/receipt.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package receipt
|
||||
|
||||
type Receipt struct {
|
||||
Claim claim
|
||||
}
|
||||
96
erp/receivable.go
Normal file
96
erp/receivable.go
Normal file
@@ -0,0 +1,96 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type receivable struct {
|
||||
}
|
||||
type ArgsReceivableList struct {
|
||||
Page bean.Page
|
||||
Search ReceivableSearch
|
||||
}
|
||||
type ReceivableSearch struct {
|
||||
ReceivableSerial string // 收款单据号
|
||||
CustomId int64 // 客户id
|
||||
InvoiceSerial string // 出运发票号
|
||||
CreatedAtStart *time.Time // 创建开始时间
|
||||
CreatedAtEnd *time.Time // 创建结束时间
|
||||
}
|
||||
type ReplyReceivableList struct {
|
||||
List []ReceivableItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type ReceivableItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ReceivableSerial string `json:"receivableSerial"`
|
||||
CustomName string `json:"customName"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
ReceivableAmount decimal.Decimal `json:"receivableAmount"`
|
||||
ReceivedAmount decimal.Decimal `json:"receivedAmount"`
|
||||
OutstandingAmount decimal.Decimal `json:"outstandingAmount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CreatedStaffID int64 `json:"createdStaffID"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (r *receivable) List(ctx context.Context, args ArgsReceivableList) (reply ReplyReceivableList, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyReceivableInfo struct {
|
||||
Id int64 `json:"id"`
|
||||
ReceivableSerial string `json:"receivableSerial"`
|
||||
CustomName string `json:"customName"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
ReceivableAmount decimal.Decimal `json:"receivableAmount"`
|
||||
ReceivedAmount decimal.Decimal `json:"receivedAmount"`
|
||||
OutstandingAmount decimal.Decimal `json:"outstandingAmount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CreatedStaffID int64 `json:"createdStaffID"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
Products []ReceivableProductItem `json:"products"`
|
||||
}
|
||||
|
||||
type ReceivableProductItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ShipmentProductId int64 `json:"shipmentProductId"`
|
||||
Name string `json:"name"`
|
||||
Serial string `json:"serial"`
|
||||
ReceivableCount int64 `json:"receivableCount"`
|
||||
AddTaxRate decimal.Decimal `json:"addTaxRate"`
|
||||
UnitPrice decimal.Decimal `json:"unitPrice"`
|
||||
ExTaxUnitPrice decimal.Decimal `json:"exTaxUnitPrice"`
|
||||
UnitAmount decimal.Decimal `json:"unitAmount"`
|
||||
ExTaxUnitAmount decimal.Decimal `json:"exTaxUnitAmount"`
|
||||
TaxAmount decimal.Decimal `json:"taxAmount"`
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (r *receivable) Info(ctx context.Context, receivableId int64) (reply ReplyReceivableInfo, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", receivableId, &reply)
|
||||
return
|
||||
}
|
||||
@@ -11,7 +11,8 @@ const (
|
||||
ActionFactory Action = "BD_Supplier" // 工厂
|
||||
ActionContact Action = "BD_CommonContact" // 联系人
|
||||
ActionCustom Action = "BD_Customer" // 客户
|
||||
ActionPayment Action = "AR_receivable" // 付款单
|
||||
ActionReceivable Action = "AR_receivable" // 付款单
|
||||
ActionPayable Action = "AP_Payable" // 付款单
|
||||
ActionProduct Action = "BD_MATERIAL" // 物料
|
||||
)
|
||||
|
||||
|
||||
@@ -18,9 +18,10 @@ type ArgsCustomSave struct {
|
||||
Website string // 网站
|
||||
Tel string // 电话
|
||||
Fax string // 传真
|
||||
Contacts []CustomItem
|
||||
}
|
||||
|
||||
type FactoryCustomItem struct {
|
||||
type CustomItem struct {
|
||||
ContactNumber string // 联系人编号
|
||||
Name string // 部门名称
|
||||
Sex string // 性别
|
||||
|
||||
@@ -21,6 +21,8 @@ type ArgsFactorySave struct {
|
||||
Bank string
|
||||
BankAccount string
|
||||
Contacts []FactoryContactItem
|
||||
DepartmentNumber string // 部门编号
|
||||
StaffNumber string // 员工编号
|
||||
}
|
||||
|
||||
type FactoryContactItem struct {
|
||||
|
||||
@@ -7,8 +7,9 @@ type Ik3cloud struct {
|
||||
Contact contact // 联系人
|
||||
Factory factory // 工厂
|
||||
Custom custom // 客户
|
||||
Payment payment // 付款
|
||||
Product product // 产品
|
||||
Receivable receivable // 应收
|
||||
Payable payable // 应付
|
||||
}
|
||||
type Entity struct {
|
||||
Id int64 `json:"Id"`
|
||||
|
||||
26
ik3cloud/payable.go
Normal file
26
ik3cloud/payable.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package ik3cloud
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
)
|
||||
|
||||
type payable struct {
|
||||
}
|
||||
type ArgsPayableSave struct {
|
||||
PayableId int64 // 应付单id
|
||||
Number string // 编码
|
||||
CustomNumber string // 客户编码
|
||||
FactoryNumber string // 工厂编码
|
||||
}
|
||||
|
||||
// Save @TITLE 保存应付
|
||||
func (p *payable) Save(ctx context.Context, args ArgsPayableSave) (entity Entity, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
return
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package ik3cloud
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
)
|
||||
|
||||
type payment struct {
|
||||
}
|
||||
type ArgsPaymentSave struct {
|
||||
PaymentId int64 // 付款单id
|
||||
Number string // 编码
|
||||
CustomNumber string // 客户编码
|
||||
}
|
||||
|
||||
// Save @TITLE 保存客户
|
||||
func (p *payment) Save(ctx context.Context, args ArgsPaymentSave) (entity Entity, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
return
|
||||
}
|
||||
@@ -8,18 +8,18 @@ import (
|
||||
|
||||
type product struct {
|
||||
}
|
||||
type ArgsProductSave struct {
|
||||
type ProductSaveItem struct {
|
||||
ProductId int64 // 付款单id
|
||||
Number string // 编码
|
||||
Name string // 名称
|
||||
}
|
||||
|
||||
// Save @TITLE 保存客户
|
||||
func (p *product) Save(ctx context.Context, args ArgsProductSave) (entity Entity, err error) {
|
||||
func (p *product) Save(ctx context.Context, args []ProductSaveItem) (entities []Entity, err error) {
|
||||
xClient, err := client.GetClient(p)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
err = xClient.Call(ctx, "Save", args, &entities)
|
||||
return
|
||||
}
|
||||
|
||||
25
ik3cloud/receivable.go
Normal file
25
ik3cloud/receivable.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package ik3cloud
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
)
|
||||
|
||||
type receivable struct {
|
||||
}
|
||||
type ArgsReceivableSave struct {
|
||||
ReceivableId int64 // 应收单id
|
||||
Number string // 编码
|
||||
CustomNumber string // 客户编码
|
||||
}
|
||||
|
||||
// Save @TITLE 保存应收
|
||||
func (r *receivable) Save(ctx context.Context, args ArgsReceivableSave) (entity Entity, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
return
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/ik3cloud"
|
||||
)
|
||||
|
||||
type department struct {
|
||||
@@ -97,13 +96,20 @@ func (d *department) SetStaff(ctx context.Context, args ArgsDepartmentSetStaff)
|
||||
return xClient.Call(ctx, "SetStaff", args, &reply)
|
||||
}
|
||||
|
||||
type ReplyDepartmentIk3cloudInfo struct {
|
||||
Id int64 `json:"id"` // 金蝶员工id
|
||||
Number string `json:"number"` // 金蝶员工编码
|
||||
PositionId int64 `json:"positionId"` // 金蝶部门职位id
|
||||
PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码
|
||||
}
|
||||
|
||||
// Ik3cloudInfo @TITLE 金蝶同步信息
|
||||
func (d *department) Ik3cloudInfo(ctx context.Context, departmentId int64) (entity ik3cloud.Entity, err error) {
|
||||
func (d *department) Ik3cloudInfo(ctx context.Context, departmentId int64) (reply ReplyDepartmentIk3cloudInfo, err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", departmentId, &entity)
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", departmentId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
17
oa/staff.go
17
oa/staff.go
@@ -5,7 +5,6 @@ import (
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/ik3cloud"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
)
|
||||
|
||||
@@ -267,13 +266,25 @@ func (s *staff) Enable(ctx context.Context, staffIds []int64) (err error) {
|
||||
return xClient.Call(ctx, "Enable", staffIds, &reply)
|
||||
}
|
||||
|
||||
type ReplyStaffIk3cloudInfo struct {
|
||||
Id int64 `json:"id"` // 金蝶员工id
|
||||
Number string `json:"number"` // 金蝶员工编码
|
||||
PositionId int64 `json:"positionId"` // 金蝶部门职位id
|
||||
PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码
|
||||
XsyId int64 `json:"xsyId"` // 金蝶员工销售员id
|
||||
XsyNumber string `json:"xsyNumber"` // 金蝶员工销售员编码
|
||||
CgyId int64 `json:"cgyId"` // 金蝶员工采购员id
|
||||
CgyNumber string `json:"cgyNumber"` // 金蝶员工采购员编码
|
||||
Department ReplyDepartmentIk3cloudInfo `json:"department"`
|
||||
}
|
||||
|
||||
// Ik3cloudInfo @TITLE 金蝶同步信息
|
||||
func (s *staff) Ik3cloudInfo(ctx context.Context, staffId int64) (entity ik3cloud.Entity, err error) {
|
||||
func (s *staff) Ik3cloudInfo(ctx context.Context, staffId int64) (reply ReplyStaffIk3cloudInfo, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &entity)
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user