Compare commits
18 Commits
e2da0185b8
...
fix_accoun
| Author | SHA1 | Date | |
|---|---|---|---|
| 11b4f6fdf2 | |||
| e0f18fb837 | |||
| 6928ef5088 | |||
| e08c49d40f | |||
| 78393b37d5 | |||
| 165109e9fd | |||
| 5cd534571d | |||
| 8614837410 | |||
| 89999b7df3 | |||
| 2326632e9d | |||
| 1975cccdb1 | |||
| 34a9bcdd37 | |||
| 96993c312a | |||
| 8de8393c07 | |||
| 908fa48a84 | |||
| fa23a28fab | |||
| 9c2d9e2f3f | |||
| a2abdd3b11 |
@@ -81,3 +81,9 @@ const (
|
|||||||
FlagTrue Flag = 1 // 是
|
FlagTrue Flag = 1 // 是
|
||||||
FlagFalse Flag = 2 // 否
|
FlagFalse Flag = 2 // 否
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type DomesticFeeType = int64 // 国内扣费类型 1=外币 2=人民币
|
||||||
|
const (
|
||||||
|
DomesticFeeTypeForeign DomesticFeeType = 1 // 外币
|
||||||
|
DomesticFeeTypeRMB DomesticFeeType = 2 // 人民币
|
||||||
|
)
|
||||||
|
|||||||
@@ -12,4 +12,7 @@ type Erp struct {
|
|||||||
Contact contact
|
Contact contact
|
||||||
Template template
|
Template template
|
||||||
Accounting accounting
|
Accounting accounting
|
||||||
|
Payable payable
|
||||||
|
Receivable receivable
|
||||||
|
Receipt receipt
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ package erp
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.kumo.work/shama/service/client"
|
"git.kumo.work/shama/service/client"
|
||||||
factory2 "git.kumo.work/shama/service/erp/factory"
|
factory2 "git.kumo.work/shama/service/erp/factory"
|
||||||
"git.kumo.work/shama/service/lib/bean"
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type factory struct {
|
type factory struct {
|
||||||
@@ -209,3 +210,13 @@ func (f *factory) Edit(ctx context.Context, args ArgsFactoryEdit) (err error) {
|
|||||||
reply := 0
|
reply := 0
|
||||||
return xClient.Call(ctx, "Edit", args, &reply)
|
return xClient.Call(ctx, "Edit", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ik3cloud @TITLE 金蝶同步
|
||||||
|
func (f *factory) Ik3cloud(ctx context.Context, factoryId int64) (err error) {
|
||||||
|
xClient, err := client.GetClient(f)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
return xClient.Call(ctx, "Ik3cloud", factoryId, &reply)
|
||||||
|
}
|
||||||
|
|||||||
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
|
||||||
|
}
|
||||||
24
ik3cloud/constant/constant.go
Normal file
24
ik3cloud/constant/constant.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package constant
|
||||||
|
|
||||||
|
type Action = string // 方法
|
||||||
|
|
||||||
|
const (
|
||||||
|
ActionDepartment Action = "BD_Department" // 部门
|
||||||
|
ActionStaff Action = "BD_Empinfo" // 员工
|
||||||
|
ActionStaffPosition Action = "BD_NEWSTAFF" // 职位
|
||||||
|
ActionOperatorType Action = "BD_OPERATOR" // 业务员类型
|
||||||
|
ActionPosition Action = "HR_ORG_HRPOST" // 职位
|
||||||
|
ActionFactory Action = "BD_Supplier" // 工厂
|
||||||
|
ActionContact Action = "BD_CommonContact" // 联系人
|
||||||
|
ActionCustom Action = "BD_Customer" // 客户
|
||||||
|
ActionReceivable Action = "AR_receivable" // 付款单
|
||||||
|
ActionPayable Action = "AP_Payable" // 付款单
|
||||||
|
ActionProduct Action = "BD_MATERIAL" // 物料
|
||||||
|
)
|
||||||
|
|
||||||
|
type OperatorType = string
|
||||||
|
|
||||||
|
const (
|
||||||
|
OperatorTypeXSY OperatorType = "XSY" // 业务员
|
||||||
|
OperatorTypeCGY OperatorType = "CGY" // 采购员
|
||||||
|
)
|
||||||
49
ik3cloud/contact.go
Normal file
49
ik3cloud/contact.go
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/ik3cloud/constant"
|
||||||
|
)
|
||||||
|
|
||||||
|
type contact struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsContactSave struct {
|
||||||
|
CompanyType constant.Action
|
||||||
|
Contacts []ContactItem
|
||||||
|
}
|
||||||
|
type ContactItem struct {
|
||||||
|
ContactId int64 // 部门id
|
||||||
|
Number string // 部门编码
|
||||||
|
Name string // 部门名称
|
||||||
|
Sex string // 性别
|
||||||
|
Job string // 职位
|
||||||
|
Tel string // 电话
|
||||||
|
Phone string // 手机
|
||||||
|
Fax string // 传真
|
||||||
|
Email string // 邮箱
|
||||||
|
IsDefault bool // 是否默认/主联系人
|
||||||
|
CompanyNumber string // 关联订单编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save @TITLE 保存联系人
|
||||||
|
func (c *contact) Save(ctx context.Context, args ArgsContactSave) (entities []Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Save", args, &entities)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete @TITLE 删除联系人
|
||||||
|
func (c *contact) Delete(ctx context.Context, args Unique) (err error) {
|
||||||
|
xClient, err := client.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var reply int
|
||||||
|
return xClient.Call(ctx, "Delete", args, &reply)
|
||||||
|
}
|
||||||
44
ik3cloud/custom.go
Normal file
44
ik3cloud/custom.go
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
type custom struct {
|
||||||
|
}
|
||||||
|
type ArgsCustomSave struct {
|
||||||
|
CustomId int64 // 客户id
|
||||||
|
Number string // 编码
|
||||||
|
Name string // 名称
|
||||||
|
ShortName string // 简称
|
||||||
|
Address string // 地址
|
||||||
|
ZipCode string // 邮编
|
||||||
|
Website string // 网站
|
||||||
|
Tel string // 电话
|
||||||
|
Fax string // 传真
|
||||||
|
Contacts []CustomItem
|
||||||
|
}
|
||||||
|
|
||||||
|
type CustomItem struct {
|
||||||
|
ContactNumber string // 联系人编号
|
||||||
|
Name string // 部门名称
|
||||||
|
Sex string // 性别
|
||||||
|
Job string // 职位
|
||||||
|
Tel string // 电话
|
||||||
|
Phone string // 手机
|
||||||
|
Fax string // 传真
|
||||||
|
Email string // 邮箱
|
||||||
|
IsDefault bool // 是否默认/主联系人
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save @TITLE 保存客户
|
||||||
|
func (c *custom) Save(ctx context.Context, args ArgsCustomSave) (entity Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Save", args, &entity)
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -27,38 +27,24 @@ func (d *department) All(ctx context.Context) (reply []DepartmentItem, err error
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsDepartmentAdd struct {
|
type ArgsDepartmentSave struct {
|
||||||
|
DepartmentId int64 // 部门id
|
||||||
Number string // 部门编码
|
Number string // 部门编码
|
||||||
Name string // 部门名称
|
Name string // 部门名称
|
||||||
ParentNumber string // 上级部门编码
|
ParentNumber string // 上级部门编码
|
||||||
GroupNumber string // 分组编码
|
GroupNumber string // 分组编码
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add @TITLE 添加部门
|
// Save @TITLE 保存部门
|
||||||
func (d *department) Add(ctx context.Context, args ArgsDepartmentAdd) (departmentId int64, err error) {
|
func (d *department) Save(ctx context.Context, args ArgsDepartmentSave) (entity Entity, err error) {
|
||||||
xClient, err := client.GetClient(d)
|
xClient, err := client.GetClient(d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = xClient.Call(ctx, "Add", args, &departmentId)
|
err = xClient.Call(ctx, "Save", args, &entity)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsDepartmentEdit struct {
|
|
||||||
DepartmentId int64 // 部门id
|
|
||||||
ArgsDepartmentAdd
|
|
||||||
}
|
|
||||||
|
|
||||||
// Edit @TITLE 编辑部门
|
|
||||||
func (d *department) Edit(ctx context.Context, args ArgsDepartmentEdit) (err error) {
|
|
||||||
xClient, err := client.GetClient(d)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var reply int
|
|
||||||
return xClient.Call(ctx, "Edit", args, &reply)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete @TITLE 删除部门
|
// Delete @TITLE 删除部门
|
||||||
func (d *department) Delete(ctx context.Context, numbers []string) (err error) {
|
func (d *department) Delete(ctx context.Context, numbers []string) (err error) {
|
||||||
xClient, err := client.GetClient(d)
|
xClient, err := client.GetClient(d)
|
||||||
|
|||||||
48
ik3cloud/factory.go
Normal file
48
ik3cloud/factory.go
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
type factory struct {
|
||||||
|
}
|
||||||
|
type ArgsFactorySave struct {
|
||||||
|
FactoryId int64 // 工厂id
|
||||||
|
Number string // 工厂编码
|
||||||
|
Name string // 工厂名称
|
||||||
|
ShortName string // 简称
|
||||||
|
Address string // 地址
|
||||||
|
ZipCode string
|
||||||
|
LegalPerson string
|
||||||
|
TaxNumber string
|
||||||
|
RegAddress string
|
||||||
|
Bank string
|
||||||
|
BankAccount string
|
||||||
|
Contacts []FactoryContactItem
|
||||||
|
DepartmentNumber string // 部门编号
|
||||||
|
StaffNumber string // 员工编号
|
||||||
|
}
|
||||||
|
|
||||||
|
type FactoryContactItem struct {
|
||||||
|
ContactNumber string // 联系人编号
|
||||||
|
Name string // 部门名称
|
||||||
|
Sex string // 性别
|
||||||
|
Job string // 职位
|
||||||
|
Tel string // 电话
|
||||||
|
Phone string // 手机
|
||||||
|
Fax string // 传真
|
||||||
|
Email string // 邮箱
|
||||||
|
IsDefault bool // 是否默认/主联系人
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save @TITLE 保存工厂
|
||||||
|
func (f *factory) Save(ctx context.Context, args ArgsFactorySave) (entity Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(f)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Save", args, &entity)
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -3,4 +3,21 @@ package ik3cloud
|
|||||||
type Ik3cloud struct {
|
type Ik3cloud struct {
|
||||||
Department department // 部门
|
Department department // 部门
|
||||||
Staff staff // 员工
|
Staff staff // 员工
|
||||||
|
Position position // 职位
|
||||||
|
Contact contact // 联系人
|
||||||
|
Factory factory // 工厂
|
||||||
|
Custom custom // 客户
|
||||||
|
Product product // 产品
|
||||||
|
Receivable receivable // 应收
|
||||||
|
Payable payable // 应付
|
||||||
|
}
|
||||||
|
type Entity struct {
|
||||||
|
Id int64 `json:"Id"`
|
||||||
|
Number string `json:"Number"`
|
||||||
|
DIndex int `json:"DIndex"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Unique struct {
|
||||||
|
Numbers []string // 编码
|
||||||
|
Ids []int64 // 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
|
||||||
|
}
|
||||||
37
ik3cloud/position.go
Normal file
37
ik3cloud/position.go
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
type position struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsPositionSave struct {
|
||||||
|
PositionId int64 // 职位id
|
||||||
|
Number string // 职位编码
|
||||||
|
Name string // 职位名称
|
||||||
|
DepartmentNumber string // 部门编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save @TITLE 保存部门
|
||||||
|
func (p *position) Save(ctx context.Context, args ArgsPositionSave) (entity Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(p)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Save", args, &entity)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete @TITLE 删除部门
|
||||||
|
func (p *position) Delete(ctx context.Context, numbers []string) (err error) {
|
||||||
|
xClient, err := client.GetClient(p)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var reply int
|
||||||
|
return xClient.Call(ctx, "Delete", numbers, &reply)
|
||||||
|
}
|
||||||
25
ik3cloud/product.go
Normal file
25
ik3cloud/product.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
type product struct {
|
||||||
|
}
|
||||||
|
type ProductSaveItem struct {
|
||||||
|
ProductId int64 // 付款单id
|
||||||
|
Number string // 编码
|
||||||
|
Name string // 名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save @TITLE 保存客户
|
||||||
|
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, &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
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"git.kumo.work/shama/service/client"
|
"git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/ik3cloud/constant"
|
||||||
"git.kumo.work/shama/service/lib/bean"
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,7 +43,8 @@ func (s *staff) List(ctx context.Context, args ArgsStaffList) (reply ReplyStaffL
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsStaffAdd struct {
|
type ArgsStaffSave struct {
|
||||||
|
StaffId int64 // 员工id
|
||||||
Name string // 姓名
|
Name string // 姓名
|
||||||
Number string // 编码
|
Number string // 编码
|
||||||
Mobile any // 手机号
|
Mobile any // 手机号
|
||||||
@@ -50,57 +52,76 @@ type ArgsStaffAdd struct {
|
|||||||
Email string // 邮箱
|
Email string // 邮箱
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add @TITLE 添加员工
|
// Save @TITLE 保存员工
|
||||||
func (s *staff) Add(ctx context.Context, args ArgsStaffAdd) (staffId int64, err error) {
|
func (s *staff) Save(ctx context.Context, args ArgsStaffSave) (entity Entity, err error) {
|
||||||
xClient, err := client.GetClient(s)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = xClient.Call(ctx, "Add", args, &staffId)
|
err = xClient.Call(ctx, "Save", args, &entity)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsStaffEdit struct {
|
|
||||||
StaffId int64 // 员工id
|
|
||||||
ArgsStaffAdd
|
|
||||||
}
|
|
||||||
|
|
||||||
// Edit @TITLE 员工编辑
|
|
||||||
func (s *staff) Edit(ctx context.Context, args ArgsStaffEdit) (err error) {
|
|
||||||
xClient, err := client.GetClient(s)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var reply int
|
|
||||||
return xClient.Call(ctx, "Edit", args, &reply)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable @TITLE 禁用员工
|
// Disable @TITLE 禁用员工
|
||||||
func (s *staff) Disable(ctx context.Context, numbers []string) (err error) {
|
func (s *staff) Disable(ctx context.Context, args Unique) (err error) {
|
||||||
xClient, err := client.GetClient(s)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Disable", numbers, &reply)
|
return xClient.Call(ctx, "Disable", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable @TITLE 启用员工
|
// Enable @TITLE 启用员工
|
||||||
func (s *staff) Enable(ctx context.Context, numbers []string) (err error) {
|
func (s *staff) Enable(ctx context.Context, args Unique) (err error) {
|
||||||
xClient, err := client.GetClient(s)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Enable", numbers, &reply)
|
return xClient.Call(ctx, "Enable", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete @TITLE 删除员工
|
// Delete @TITLE 删除员工
|
||||||
func (s *staff) Delete(ctx context.Context, numbers []string) (err error) {
|
func (s *staff) Delete(ctx context.Context, args Unique) (err error) {
|
||||||
xClient, err := client.GetClient(s)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Delete", numbers, &reply)
|
return xClient.Call(ctx, "Delete", args, &reply)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsStaffPosition struct {
|
||||||
|
StaffPositionId int64 // 员工职位id
|
||||||
|
Number string // 编码
|
||||||
|
StaffNumber string // 员工编码
|
||||||
|
DepartmentNumber string // 部门编码
|
||||||
|
PositionNumber string // 职位编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// Position @TITLE 员工职位
|
||||||
|
func (s *staff) Position(ctx context.Context, args ArgsStaffPosition) (entity Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(s)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Position", args, &entity)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type StaffOperatorItem struct {
|
||||||
|
OperatorId int64 // 类型id
|
||||||
|
OperatorType constant.OperatorType // 业务类型
|
||||||
|
StaffPositionNumbers []string // 员工职位编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// Operator @TITLE 业务类型
|
||||||
|
func (s *staff) Operator(ctx context.Context, args []StaffOperatorItem) (entities []Entity, err error) {
|
||||||
|
xClient, err := client.GetClient(s)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Operator", args, &entities)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,17 +96,29 @@ func (d *department) SetStaff(ctx context.Context, args ArgsDepartmentSetStaff)
|
|||||||
return xClient.Call(ctx, "SetStaff", args, &reply)
|
return xClient.Call(ctx, "SetStaff", args, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsDepartmentIk3cloud struct {
|
type ReplyDepartmentIk3cloudInfo struct {
|
||||||
DepartmentId int64 // 部门id
|
Id int64 `json:"id"` // 金蝶员工id
|
||||||
Number string // 金蝶部门编号
|
Number string `json:"number"` // 金蝶员工编码
|
||||||
|
PositionId int64 `json:"positionId"` // 金蝶部门职位id
|
||||||
|
PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ik3cloudInfo @TITLE 金蝶同步信息
|
||||||
|
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, &reply)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ik3cloud @TITLE 金蝶集成
|
// Ik3cloud @TITLE 金蝶集成
|
||||||
func (d *department) Ik3cloud(ctx context.Context, args ArgsDepartmentIk3cloud) (err error) {
|
func (d *department) Ik3cloud(ctx context.Context, departmentId int64) (err error) {
|
||||||
xClient, err := client.GetClient(d)
|
xClient, err := client.GetClient(d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Ik3cloud", args, &reply)
|
return xClient.Call(ctx, "Ik3cloud", departmentId, &reply)
|
||||||
}
|
}
|
||||||
|
|||||||
27
oa/staff.go
27
oa/staff.go
@@ -266,17 +266,34 @@ func (s *staff) Enable(ctx context.Context, staffIds []int64) (err error) {
|
|||||||
return xClient.Call(ctx, "Enable", staffIds, &reply)
|
return xClient.Call(ctx, "Enable", staffIds, &reply)
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsStaffIk3cloud struct {
|
type ReplyStaffIk3cloudInfo struct {
|
||||||
StaffId int64 // 员工id
|
Id int64 `json:"id"` // 金蝶员工id
|
||||||
Number string // 金蝶员工编号
|
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) (reply ReplyStaffIk3cloudInfo, err error) {
|
||||||
|
xClient, err := client.GetClient(s)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &reply)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ik3cloud @TITLE 金蝶集成
|
// Ik3cloud @TITLE 金蝶集成
|
||||||
func (s *staff) Ik3cloud(ctx context.Context, args ArgsStaffIk3cloud) (err error) {
|
func (s *staff) Ik3cloud(ctx context.Context, staffId int64) (err error) {
|
||||||
xClient, err := client.GetClient(s)
|
xClient, err := client.GetClient(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var reply int
|
var reply int
|
||||||
return xClient.Call(ctx, "Ik3cloud", args, &reply)
|
return xClient.Call(ctx, "Ik3cloud", staffId, &reply)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user