Compare commits
7 Commits
fix_accoun
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c1ff46e933 | |||
| 81492da604 | |||
| b5a164788c | |||
| 929366ed0b | |||
| fce4272da9 | |||
| 436c60c2d0 | |||
| d682f333a1 |
106
erp/dict.go
Normal file
106
erp/dict.go
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
package erp
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
client2 "git.kumo.work/shama/service/client"
|
||||||
|
dict2 "git.kumo.work/shama/service/erp/dict"
|
||||||
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
|
)
|
||||||
|
|
||||||
|
type dict struct {
|
||||||
|
dict2.Dict
|
||||||
|
}
|
||||||
|
type ArgsDictList struct {
|
||||||
|
Page bean.Page
|
||||||
|
Search DictSearch
|
||||||
|
}
|
||||||
|
type DictSearch struct {
|
||||||
|
Name string `label:"名称"`
|
||||||
|
Value2 string `label:"属性值2"`
|
||||||
|
CategoryId int64 `label:"分类ID"`
|
||||||
|
CategoryCode string `label:"分类编码"`
|
||||||
|
}
|
||||||
|
type ReplyDictList struct {
|
||||||
|
List []DictItem `json:"list"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DictItem struct {
|
||||||
|
Id int64 `json:"id"`
|
||||||
|
CategoryId int64 `json:"categoryId"`
|
||||||
|
CategoryCode string `json:"categoryCode"`
|
||||||
|
Sort int64 `json:"sort"`
|
||||||
|
Value1 string `json:"value1"`
|
||||||
|
Value2 string `json:"value2"`
|
||||||
|
Value3 string `json:"value3"`
|
||||||
|
Value4 string `json:"value4"`
|
||||||
|
Value5 string `json:"value5"`
|
||||||
|
Value6 string `json:"value6"`
|
||||||
|
Value7 string `json:"value7"`
|
||||||
|
Value8 string `json:"value8"`
|
||||||
|
CreatedAt *time.Time `json:"createdAt"`
|
||||||
|
UpdatedAt *time.Time `json:"updatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List @TITLE 字典列表
|
||||||
|
func (d *dict) List(ctx context.Context, args ArgsDictList) (reply ReplyDictList, err error) {
|
||||||
|
xClient, err := client2.GetClient(d)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "List", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsDictAdd struct {
|
||||||
|
CategoryId int64 `binding:"required" label:"类目ID"`
|
||||||
|
Sort int64 `label:"排序"`
|
||||||
|
Value1 string `label:"属性值"`
|
||||||
|
Value2 string `label:"属性值"`
|
||||||
|
Value3 string `label:"属性值"`
|
||||||
|
Value4 string `label:"属性值"`
|
||||||
|
Value5 string `label:"属性值"`
|
||||||
|
Value6 string `label:"属性值"`
|
||||||
|
Value7 string `label:"属性值"`
|
||||||
|
Value8 string `label:"属性值"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add @TITLE 添加字典
|
||||||
|
func (d *dict) Add(ctx context.Context, args ArgsDictAdd) (err error) {
|
||||||
|
xClient, err := client2.GetClient(d)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Add", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsDictEdit struct {
|
||||||
|
DictId int64 `binding:"required" label:"字典ID"`
|
||||||
|
ArgsDictAdd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit @TITLE 编辑字典
|
||||||
|
func (d *dict) Edit(ctx context.Context, args ArgsDictEdit) (err error) {
|
||||||
|
xClient, err := client2.GetClient(d)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Edit", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete @TITLE 删除字典
|
||||||
|
func (d *dict) Delete(ctx context.Context, dictIds []int64) (err error) {
|
||||||
|
xClient, err := client2.GetClient(d)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Delete", dictIds, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
107
erp/dict/category.go
Normal file
107
erp/dict/category.go
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
package dict
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
client2 "git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
|
)
|
||||||
|
|
||||||
|
type category struct {
|
||||||
|
}
|
||||||
|
type ArgsCategoryList struct {
|
||||||
|
Page bean.Page
|
||||||
|
Search CategorySearch
|
||||||
|
}
|
||||||
|
type CategorySearch struct {
|
||||||
|
Name string `label:"名称"`
|
||||||
|
GroupName string `label:"分组名"`
|
||||||
|
}
|
||||||
|
type ReplyCategoryList struct {
|
||||||
|
List []CategoryItem `json:"list"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CategoryItem struct {
|
||||||
|
Id int64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
Sort int64 `json:"sort"`
|
||||||
|
Info string `json:"info"`
|
||||||
|
GroupName string `json:"groupName"`
|
||||||
|
Label1 string `json:"label1"`
|
||||||
|
Label2 string `json:"label2"`
|
||||||
|
Label3 string `json:"label3"`
|
||||||
|
Label4 string `json:"label4"`
|
||||||
|
Label5 string `json:"label5"`
|
||||||
|
Label6 string `json:"label6"`
|
||||||
|
Label7 string `json:"label7"`
|
||||||
|
Label8 string `json:"label8"`
|
||||||
|
CreatedAt *time.Time `json:"createdAt"`
|
||||||
|
UpdatedAt *time.Time `json:"updatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List @TITLE 分类列表
|
||||||
|
func (c *category) List(ctx context.Context, args ArgsCategoryList) (reply ReplyCategoryList, err error) {
|
||||||
|
xClient, err := client2.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "List", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsCategoryAdd struct {
|
||||||
|
Name string `binding:"required" label:"名称"`
|
||||||
|
Code string `binding:"required" label:"唯一编码"`
|
||||||
|
Sort int64 `label:"排序"`
|
||||||
|
Info string `label:"备注"`
|
||||||
|
GroupName string `label:"分组名"`
|
||||||
|
Label1 string `label:"属性名称"`
|
||||||
|
Label2 string `label:"属性名称"`
|
||||||
|
Label3 string `label:"属性名称"`
|
||||||
|
Label4 string `label:"属性名称"`
|
||||||
|
Label5 string `label:"属性名称"`
|
||||||
|
Label6 string `label:"属性名称"`
|
||||||
|
Label7 string `label:"属性名称"`
|
||||||
|
Label8 string `label:"属性名称"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add @TITLE 添加分类
|
||||||
|
func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) {
|
||||||
|
xClient, err := client2.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Add", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsCategoryEdit struct {
|
||||||
|
CategoryId int64 `binding:"required" label:"分类Id"`
|
||||||
|
ArgsCategoryAdd
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit @TITLE 编辑分类
|
||||||
|
func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error) {
|
||||||
|
xClient, err := client2.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Edit", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete @TITLE 删除分类
|
||||||
|
func (c *category) Delete(ctx context.Context, categoryIds []int64) (err error) {
|
||||||
|
xClient, err := client2.GetClient(c)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
reply := 0
|
||||||
|
err = xClient.Call(ctx, "Delete", categoryIds, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
6
erp/dict/dict.go
Normal file
6
erp/dict/dict.go
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
package dict
|
||||||
|
|
||||||
|
type Dict struct {
|
||||||
|
Font font
|
||||||
|
Category category
|
||||||
|
}
|
||||||
39
erp/dict/font.go
Normal file
39
erp/dict/font.go
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package dict
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
|
)
|
||||||
|
|
||||||
|
type font struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsFontList struct {
|
||||||
|
Page bean.Page
|
||||||
|
Search FontSearch
|
||||||
|
}
|
||||||
|
type FontSearch struct {
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
type ReplyFontList struct {
|
||||||
|
List []FontItem `json:"list"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
type FontItem struct {
|
||||||
|
Id int64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Path string `json:"path"`
|
||||||
|
BoldPath string `json:"boldPath"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List @TITLE 列表
|
||||||
|
func (f *font) List(ctx context.Context, args ArgsFontList) (reply ReplyFontList, err error) {
|
||||||
|
xClient, err := client.GetClient(f)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "List", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
@@ -15,4 +15,7 @@ type Erp struct {
|
|||||||
Payable payable
|
Payable payable
|
||||||
Receivable receivable
|
Receivable receivable
|
||||||
Receipt receipt
|
Receipt receipt
|
||||||
|
Expense expense
|
||||||
|
Request request
|
||||||
|
Dict dict
|
||||||
}
|
}
|
||||||
|
|||||||
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
|
||||||
|
}
|
||||||
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
|
||||||
|
}
|
||||||
@@ -11,9 +11,14 @@ const (
|
|||||||
ActionFactory Action = "BD_Supplier" // 工厂
|
ActionFactory Action = "BD_Supplier" // 工厂
|
||||||
ActionContact Action = "BD_CommonContact" // 联系人
|
ActionContact Action = "BD_CommonContact" // 联系人
|
||||||
ActionCustom Action = "BD_Customer" // 客户
|
ActionCustom Action = "BD_Customer" // 客户
|
||||||
ActionReceivable Action = "AR_receivable" // 付款单
|
ActionReceivable Action = "AR_receivable" // 应收单
|
||||||
ActionPayable Action = "AP_Payable" // 付款单
|
ActionPayable Action = "AP_Payable" // 应付单
|
||||||
ActionProduct Action = "BD_MATERIAL" // 物料
|
ActionProduct Action = "BD_MATERIAL" // 物料
|
||||||
|
ActionCurrency Action = "BD_Currency" // 币种
|
||||||
|
ActionSettleType Action = "BD_SETTLETYPE" // 结算方式
|
||||||
|
ActionRecPayPurpose Action = "CN_RECPAYPURPOSE" // 收付款用途
|
||||||
|
ActionExpense Action = "BD_Expense" // 费用项目
|
||||||
|
ActionPayment Action = "AP_PAYBILL" // 付款单
|
||||||
)
|
)
|
||||||
|
|
||||||
type OperatorType = string
|
type OperatorType = string
|
||||||
@@ -22,3 +27,11 @@ const (
|
|||||||
OperatorTypeXSY OperatorType = "XSY" // 业务员
|
OperatorTypeXSY OperatorType = "XSY" // 业务员
|
||||||
OperatorTypeCGY OperatorType = "CGY" // 采购员
|
OperatorTypeCGY OperatorType = "CGY" // 采购员
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type PaymentType = string
|
||||||
|
|
||||||
|
const (
|
||||||
|
PaymentTypePurchase PaymentType = "FKDLX09_SYS" // 采购付款单
|
||||||
|
PaymentTypeCost PaymentType = "FKDLX10_SYS" // 费用付款单
|
||||||
|
PaymentTypeRequest PaymentType = "FKDLX11_SYS" // 报销付款单
|
||||||
|
)
|
||||||
|
|||||||
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
|
||||||
|
}
|
||||||
@@ -10,6 +10,8 @@ type Ik3cloud struct {
|
|||||||
Product product // 产品
|
Product product // 产品
|
||||||
Receivable receivable // 应收
|
Receivable receivable // 应收
|
||||||
Payable payable // 应付
|
Payable payable // 应付
|
||||||
|
Dict dict // 字典
|
||||||
|
Payment payment // 付款单
|
||||||
}
|
}
|
||||||
type Entity struct {
|
type Entity struct {
|
||||||
Id int64 `json:"Id"`
|
Id int64 `json:"Id"`
|
||||||
|
|||||||
47
ik3cloud/payment.go
Normal file
47
ik3cloud/payment.go
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package ik3cloud
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/ik3cloud/constant"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
|
)
|
||||||
|
|
||||||
|
type payment struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsPaymentSave struct {
|
||||||
|
PaymentId int64 // 付款单id
|
||||||
|
Number string // 付款单编号
|
||||||
|
PaymentType constant.PaymentType // 付款类型
|
||||||
|
PayeeNameType string // 收款单位类型
|
||||||
|
PayeeName string // 收款单位
|
||||||
|
CurrencyNumber string // 币种
|
||||||
|
DepartmentNumber string // 采购部门
|
||||||
|
StaffNumber string // 采购员
|
||||||
|
Remarks string // 备注
|
||||||
|
Costs []PaymentCostItem // 费用
|
||||||
|
Rate decimal.Decimal // 汇率
|
||||||
|
Date time.Time // 业务日期 2006-01-02 15:04:05
|
||||||
|
}
|
||||||
|
type PaymentCostItem struct {
|
||||||
|
Amount decimal.Decimal // 金额
|
||||||
|
Date time.Time // 费用日期
|
||||||
|
InvoiceSerial string // 发票号
|
||||||
|
DepartmentNumber string // 核算部门
|
||||||
|
SettlementMethod string // 结算方式
|
||||||
|
PaymentPurpose string // 付款用途
|
||||||
|
ExpenseItem 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
|
||||||
|
}
|
||||||
@@ -2,8 +2,10 @@ package ik3cloud
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.kumo.work/shama/service/client"
|
"git.kumo.work/shama/service/client"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
)
|
)
|
||||||
|
|
||||||
type receivable struct {
|
type receivable struct {
|
||||||
@@ -12,6 +14,24 @@ type ArgsReceivableSave struct {
|
|||||||
ReceivableId int64 // 应收单id
|
ReceivableId int64 // 应收单id
|
||||||
Number string // 编码
|
Number string // 编码
|
||||||
CustomNumber string // 客户编码
|
CustomNumber string // 客户编码
|
||||||
|
CurrencyNumber string // 币种
|
||||||
|
DepartmentNumber string // 部门
|
||||||
|
StaffXsyNumber string // 业务员
|
||||||
|
Products []ReceivableProductItem // 商品
|
||||||
|
Rate decimal.Decimal // 汇率
|
||||||
|
Date time.Time // 日期
|
||||||
|
}
|
||||||
|
|
||||||
|
type ReceivableProductItem struct {
|
||||||
|
Number string // 商品编码
|
||||||
|
Name string // 商品名称
|
||||||
|
Count int64 // 数量
|
||||||
|
UnitPrice decimal.Decimal // 含税单价
|
||||||
|
AddTaxRate decimal.Decimal // 税率
|
||||||
|
ExTaxUnitPrice decimal.Decimal // 不含税单价
|
||||||
|
TaxAmount decimal.Decimal // 税额
|
||||||
|
UnitAmount decimal.Decimal // 含税金额
|
||||||
|
ExTaxUnitAmount decimal.Decimal // 不含税金额
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save @TITLE 保存应收
|
// Save @TITLE 保存应收
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ func (d *department) Info(ctx context.Context, departmentId int64) (reply Depart
|
|||||||
return
|
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 {
|
type ArgsDepartmentEdit struct {
|
||||||
DepartmentId int64 // 部门id
|
DepartmentId int64 // 部门id
|
||||||
ArgsDepartmentAdd
|
ArgsDepartmentAdd
|
||||||
|
|||||||
Reference in New Issue
Block a user