Compare commits
24 Commits
e2da0185b8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 81492da604 | |||
| b5a164788c | |||
| 929366ed0b | |||
| fce4272da9 | |||
| 436c60c2d0 | |||
| d682f333a1 | |||
| 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 // 是
|
||||
FlagFalse Flag = 2 // 否
|
||||
)
|
||||
|
||||
type DomesticFeeType = int64 // 国内扣费类型 1=外币 2=人民币
|
||||
const (
|
||||
DomesticFeeTypeForeign DomesticFeeType = 1 // 外币
|
||||
DomesticFeeTypeRMB DomesticFeeType = 2 // 人民币
|
||||
)
|
||||
|
||||
@@ -12,4 +12,9 @@ type Erp struct {
|
||||
Contact contact
|
||||
Template template
|
||||
Accounting accounting
|
||||
Payable payable
|
||||
Receivable receivable
|
||||
Receipt receipt
|
||||
Expense expense
|
||||
Request request
|
||||
}
|
||||
|
||||
113
erp/expense.go
Normal file
113
erp/expense.go
Normal file
@@ -0,0 +1,113 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
expense2 "git.kumo.work/shama/service/erp/expense"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type expense struct {
|
||||
expense2.Expense
|
||||
}
|
||||
type ArgsExpenseList struct {
|
||||
Page bean.Page
|
||||
Search ExpenseSearch
|
||||
}
|
||||
type ExpenseSearch struct {
|
||||
ExpenseSerial string // 报销单号
|
||||
CreatedAtStart *time.Time // 创建开始时间
|
||||
CreatedAtEnd *time.Time // 创建结束时间
|
||||
}
|
||||
type ReplyExpenseList struct {
|
||||
List []ExpenseItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type ExpenseItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ExpenseSerial string `json:"expenseSerial"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
Remarks string `json:"remarks"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (r *expense) List(ctx context.Context, args ArgsExpenseList) (reply ReplyExpenseList, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsExpenseAdd struct {
|
||||
StaffId int64
|
||||
ExpenseAdd
|
||||
}
|
||||
type ExpenseAdd struct {
|
||||
Currency string // 币种
|
||||
CurrencyName string // 币种名称
|
||||
CurrencySymbol string // 币种符号
|
||||
CurrencyRate decimal.Decimal // 币种汇率
|
||||
Remarks string // 备注
|
||||
Amount decimal.Decimal // 金额
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (r *expense) Add(ctx context.Context, args ArgsExpenseAdd) (expenseId int64, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &expenseId)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyExpenseInfo struct {
|
||||
Id int64 `json:"id"`
|
||||
ExpenseSerial string `json:"expenseSerial"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Remarks string `json:"remarks"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (r *expense) Info(ctx context.Context, expenseId int64) (reply ReplyExpenseInfo, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", expenseId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsExpenseEdit struct {
|
||||
ExpenseId int64
|
||||
ExpenseAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (r *expense) Edit(ctx context.Context, args ArgsExpenseEdit) (err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
95
erp/expense/cost.go
Normal file
95
erp/expense/cost.go
Normal file
@@ -0,0 +1,95 @@
|
||||
package expense
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type cost struct {
|
||||
}
|
||||
type ArgsCostList struct {
|
||||
Page bean.Page
|
||||
Search CostSearch
|
||||
}
|
||||
type CostSearch struct {
|
||||
ExpenseId int64 // 报销单ID
|
||||
}
|
||||
type ReplyCostList struct {
|
||||
List []CostItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type CostItem struct {
|
||||
Id int64 `json:"id"`
|
||||
ExpenseId int64 `json:"expenseId"`
|
||||
Date time.Time `json:"date"`
|
||||
Type int64 `json:"type"`
|
||||
Value string `json:"value"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
DepartmentId int64 `json:"departmentId"`
|
||||
InvoiceSerial string `json:"invoiceSerial"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (c *cost) List(ctx context.Context, args ArgsCostList) (reply ReplyCostList, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsCostAdd struct {
|
||||
ExpenseId int64 // 报销单ID
|
||||
Date time.Time // 费用日期
|
||||
Type int64 // 费用类型
|
||||
Value string // 费用名称
|
||||
Amount decimal.Decimal // 金额
|
||||
DepartmentId int64 // 部门
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (c *cost) Add(ctx context.Context, args ArgsCostAdd) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCostEdit struct {
|
||||
CostId int64
|
||||
ArgsCostAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (c *cost) Edit(ctx context.Context, args ArgsCostEdit) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCostDelete struct {
|
||||
ExpenseId int64 // 报销单ID
|
||||
CostIds []int64
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除
|
||||
func (c *cost) Delete(ctx context.Context, args ArgsCostDelete) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Delete", args, &reply)
|
||||
}
|
||||
5
erp/expense/expense.go
Normal file
5
erp/expense/expense.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package expense
|
||||
|
||||
type Expense struct {
|
||||
Cost cost
|
||||
}
|
||||
@@ -2,10 +2,11 @@ package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
factory2 "git.kumo.work/shama/service/erp/factory"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"time"
|
||||
)
|
||||
|
||||
type factory struct {
|
||||
@@ -209,3 +210,13 @@ func (f *factory) Edit(ctx context.Context, args ArgsFactoryEdit) (err error) {
|
||||
reply := 0
|
||||
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
|
||||
}
|
||||
125
erp/request.go
Normal file
125
erp/request.go
Normal file
@@ -0,0 +1,125 @@
|
||||
package erp
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
request2 "git.kumo.work/shama/service/erp/request"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type request struct {
|
||||
request2.Request
|
||||
}
|
||||
type ArgsRequestList struct {
|
||||
Page bean.Page
|
||||
Search RequestSearch
|
||||
}
|
||||
type RequestSearch struct {
|
||||
RequestSerial string // 报销单号
|
||||
CreatedAtStart *time.Time // 创建开始时间
|
||||
CreatedAtEnd *time.Time // 创建结束时间
|
||||
}
|
||||
type ReplyRequestList struct {
|
||||
List []RequestItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type RequestItem struct {
|
||||
Id int64 `json:"id"`
|
||||
FactoryId int64 `json:"factoryId"`
|
||||
FactoryName string `json:"factoryName"`
|
||||
FactoryBank string `json:"factoryBank"`
|
||||
FactoryBankAccount string `json:"factoryBankAccount"`
|
||||
RequestSerial string `json:"requestSerial"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
Remarks string `json:"remarks"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (r *request) List(ctx context.Context, args ArgsRequestList) (reply ReplyRequestList, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsRequestAdd struct {
|
||||
StaffId int64
|
||||
RequestAdd
|
||||
}
|
||||
type RequestAdd struct {
|
||||
FactoryId int64 // 工厂id
|
||||
FactoryName string // 工厂名称
|
||||
FactoryBank string // 银行
|
||||
FactoryBankAccount string // 银行账号
|
||||
Currency string // 币种
|
||||
CurrencyName string // 币种名称
|
||||
CurrencySymbol string // 币种符号
|
||||
CurrencyRate decimal.Decimal // 币种汇率
|
||||
Remarks string // 备注
|
||||
Amount decimal.Decimal // 金额
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (r *request) Add(ctx context.Context, args ArgsRequestAdd) (requestId int64, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &requestId)
|
||||
return
|
||||
}
|
||||
|
||||
type ReplyRequestInfo struct {
|
||||
Id int64 `json:"id"`
|
||||
RequestSerial string `json:"requestSerial"`
|
||||
FactoryId int64 `json:"factoryId"`
|
||||
FactoryName string `json:"factoryName"`
|
||||
FactoryBank string `json:"factoryBank"`
|
||||
FactoryBankAccount string `json:"factoryBankAccount"`
|
||||
Currency string `json:"currency"`
|
||||
CurrencyName string `json:"currencyName"`
|
||||
CurrencySymbol string `json:"currencySymbol"`
|
||||
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
Remarks string `json:"remarks"`
|
||||
CreatedStaffId int64 `json:"createdStaffId"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// Info @TITLE 详情
|
||||
func (r *request) Info(ctx context.Context, requestId int64) (reply ReplyRequestInfo, err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Info", requestId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsRequestEdit struct {
|
||||
RequestId int64
|
||||
RequestAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (r *request) Edit(ctx context.Context, args ArgsRequestEdit) (err error) {
|
||||
xClient, err := client.GetClient(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
90
erp/request/cost.go
Normal file
90
erp/request/cost.go
Normal file
@@ -0,0 +1,90 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type cost struct {
|
||||
}
|
||||
type ArgsCostList struct {
|
||||
Page bean.Page
|
||||
Search CostSearch
|
||||
}
|
||||
type CostSearch struct {
|
||||
RequestId int64 // 报销单ID
|
||||
}
|
||||
type ReplyCostList struct {
|
||||
List []CostItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
type CostItem struct {
|
||||
Id int64 `json:"id"`
|
||||
RequestId int64 `json:"requestId"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
DepartmentId int64 `json:"departmentId"`
|
||||
Remarks string `json:"remarks"`
|
||||
CreatedAt *time.Time `json:"createdAt"`
|
||||
UpdatedAt *time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// List @TITLE 列表
|
||||
func (c *cost) List(ctx context.Context, args ArgsCostList) (reply ReplyCostList, err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "List", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsCostAdd struct {
|
||||
RequestId int64 // 报销单ID
|
||||
Amount decimal.Decimal // 金额
|
||||
DepartmentId int64 // 部门
|
||||
Remarks string // 备注
|
||||
}
|
||||
|
||||
// Add @TITLE 添加
|
||||
func (c *cost) Add(ctx context.Context, args ArgsCostAdd) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Add", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCostEdit struct {
|
||||
CostId int64
|
||||
ArgsCostAdd
|
||||
}
|
||||
|
||||
// Edit @TITLE 编辑
|
||||
func (c *cost) Edit(ctx context.Context, args ArgsCostEdit) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Edit", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsCostDelete struct {
|
||||
RequestId int64 // 报销单ID
|
||||
CostIds []int64
|
||||
}
|
||||
|
||||
// Delete @TITLE 删除
|
||||
func (c *cost) Delete(ctx context.Context, args ArgsCostDelete) (err error) {
|
||||
xClient, err := client.GetClient(c)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reply := 0
|
||||
return xClient.Call(ctx, "Delete", args, &reply)
|
||||
}
|
||||
5
erp/request/request.go
Normal file
5
erp/request/request.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package request
|
||||
|
||||
type Request struct {
|
||||
Cost cost
|
||||
}
|
||||
27
ik3cloud/constant/constant.go
Normal file
27
ik3cloud/constant/constant.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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" // 物料
|
||||
ActionCurrency Action = "BD_Currency" // 币种
|
||||
ActionSettleType Action = "BD_SETTLETYPE" // 结算方式
|
||||
ActionRecPayPurpose Action = "CN_RECPAYPURPOSE" // 收付款用途
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type ArgsDepartmentAdd struct {
|
||||
type ArgsDepartmentSave struct {
|
||||
DepartmentId int64 // 部门id
|
||||
Number string // 部门编码
|
||||
Name string // 部门名称
|
||||
ParentNumber string // 上级部门编码
|
||||
GroupNumber string // 分组编码
|
||||
}
|
||||
|
||||
// Add @TITLE 添加部门
|
||||
func (d *department) Add(ctx context.Context, args ArgsDepartmentAdd) (departmentId int64, err error) {
|
||||
// Save @TITLE 保存部门
|
||||
func (d *department) Save(ctx context.Context, args ArgsDepartmentSave) (entity Entity, err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &departmentId)
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
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 删除部门
|
||||
func (d *department) Delete(ctx context.Context, numbers []string) (err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
|
||||
31
ik3cloud/dict.go
Normal file
31
ik3cloud/dict.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package ik3cloud
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/ik3cloud/constant"
|
||||
)
|
||||
|
||||
type dict struct {
|
||||
}
|
||||
type DictItem struct {
|
||||
Field1 any `json:"field1"`
|
||||
Field2 any `json:"field2"`
|
||||
Field3 any `json:"field3"`
|
||||
Field4 any `json:"field4"`
|
||||
Field5 any `json:"field5"`
|
||||
Field6 any `json:"field6"`
|
||||
Field7 any `json:"field7"`
|
||||
Field8 any `json:"field8"`
|
||||
}
|
||||
|
||||
// All @TITLE 获取字典
|
||||
func (d *dict) All(ctx context.Context, companyType constant.Action) (reply []DictItem, err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "All", companyType, &reply)
|
||||
return
|
||||
}
|
||||
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,22 @@ package ik3cloud
|
||||
type Ik3cloud struct {
|
||||
Department department // 部门
|
||||
Staff staff // 员工
|
||||
Position position // 职位
|
||||
Contact contact // 联系人
|
||||
Factory factory // 工厂
|
||||
Custom custom // 客户
|
||||
Product product // 产品
|
||||
Receivable receivable // 应收
|
||||
Payable payable // 应付
|
||||
Dict dict // 字典
|
||||
}
|
||||
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"
|
||||
|
||||
"git.kumo.work/shama/service/client"
|
||||
"git.kumo.work/shama/service/ik3cloud/constant"
|
||||
"git.kumo.work/shama/service/lib/bean"
|
||||
)
|
||||
|
||||
@@ -42,65 +43,85 @@ func (s *staff) List(ctx context.Context, args ArgsStaffList) (reply ReplyStaffL
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsStaffAdd struct {
|
||||
Name string // 姓名
|
||||
Number string // 编码
|
||||
Mobile any // 手机号
|
||||
Tel string // 座机
|
||||
Email string // 邮箱
|
||||
type ArgsStaffSave struct {
|
||||
StaffId int64 // 员工id
|
||||
Name string // 姓名
|
||||
Number string // 编码
|
||||
Mobile any // 手机号
|
||||
Tel string // 座机
|
||||
Email string // 邮箱
|
||||
}
|
||||
|
||||
// Add @TITLE 添加员工
|
||||
func (s *staff) Add(ctx context.Context, args ArgsStaffAdd) (staffId int64, err error) {
|
||||
// Save @TITLE 保存员工
|
||||
func (s *staff) Save(ctx context.Context, args ArgsStaffSave) (entity Entity, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Add", args, &staffId)
|
||||
err = xClient.Call(ctx, "Save", args, &entity)
|
||||
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 禁用员工
|
||||
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)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var reply int
|
||||
return xClient.Call(ctx, "Disable", numbers, &reply)
|
||||
return xClient.Call(ctx, "Disable", args, &reply)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var reply int
|
||||
return xClient.Call(ctx, "Enable", numbers, &reply)
|
||||
return xClient.Call(ctx, "Enable", args, &reply)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
@@ -56,6 +56,16 @@ func (d *department) Info(ctx context.Context, departmentId int64) (reply Depart
|
||||
return
|
||||
}
|
||||
|
||||
// Infos @TITLE 部门详情
|
||||
func (d *department) Infos(ctx context.Context, departmentIds []int64) (reply []DepartmentItem, err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Infos", departmentIds, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsDepartmentEdit struct {
|
||||
DepartmentId int64 // 部门id
|
||||
ArgsDepartmentAdd
|
||||
@@ -96,17 +106,29 @@ func (d *department) SetStaff(ctx context.Context, args ArgsDepartmentSetStaff)
|
||||
return xClient.Call(ctx, "SetStaff", args, &reply)
|
||||
}
|
||||
|
||||
type ArgsDepartmentIk3cloud struct {
|
||||
DepartmentId int64 // 部门id
|
||||
Number string // 金蝶部门编号
|
||||
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) (reply ReplyDepartmentIk3cloudInfo, err error) {
|
||||
xClient, err := client.GetClient(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", departmentId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
type ArgsStaffIk3cloud struct {
|
||||
StaffId int64 // 员工id
|
||||
Number string // 金蝶员工编号
|
||||
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) (reply ReplyStaffIk3cloudInfo, err error) {
|
||||
xClient, err := client.GetClient(s)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = xClient.Call(ctx, "Ik3cloudInfo", staffId, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var reply int
|
||||
return xClient.Call(ctx, "Ik3cloud", args, &reply)
|
||||
return xClient.Call(ctx, "Ik3cloud", staffId, &reply)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user