Compare commits

...

9 Commits

Author SHA1 Message Date
81492da604 feat(k3cloud): 新增字典服务模块
- 在服务结构体中添加 Dict 字典服务字段
- 初始化字典服务模块以支持数据字典功能
2025-12-12 17:24:21 +08:00
b5a164788c fix(client): 移除对 ik3cloud 的硬编码配置
- 删除了针对 ik3cloud 的特殊处理逻辑
- 统一使用 consul 进行服务发现
- 简化客户端初始化流程
- 修复潜在的配置冲突问题
- 提高代码可维护性
- 减少不必要的条件分支
2025-12-12 17:21:34 +08:00
929366ed0b feat(ik3cloud): 新增字典服务与币种结算方式收付款用途常量
- 新增 DictItem 结构体定义字段 field1 至 field8
- 实现 dict.All 方法用于获取字典数据
- 添加 BD_Currency、BD_SETTLETYPE 和 CN_RECPAYPURPOSE 常量
- 在 client.go 中为 ik3cloud 服务增加本地调试发现逻辑
2025-12-12 17:20:22 +08:00
fce4272da9 feat(erp): 添加报销单及其费用管理功能
- 在 ERP 服务中新增 Request 模块,用于处理报销单相关逻辑
- 实现报销单的增删改查接口,支持列表、详情及编辑操作
- 新增费用管理模块 Cost,支持费用项的添加、修改、删除和列表查询
- 定义完整的请求与响应结构体,包括分页、搜索条件和返回数据格式
- 集成客户端调用逻辑,通过 RPC 方式与其他服务通信
- 引入 decimal 包处理金额字段,确保数值精度
- 添加时间戳字段用于记录创建和更新时间
2025-12-12 15:57:33 +08:00
436c60c2d0 feat(erp): 添加费用报销模块
- 新增费用报销主模块结构体及接口定义
- 实现费用列表、添加、编辑、删除功能
- 定义费用项数据结构和传输参数
- 集成客户端调用逻辑
- 支持分页查询和搜索条件过滤
- 提供费用详情查看接口
2025-12-12 15:11:58 +08:00
d682f333a1 Merge pull request 'fix_account' (#1) from fix_account into master
Reviewed-on: #1
2025-12-11 16:40:21 +08:00
11b4f6fdf2 chore(client): 更新客户端模块
- 修改了客户端模块的依赖配置
- 更新了模块版本号
- 优化了模块导入路径
- 修复了模块间的依赖冲突
- 清理了冗余的模块引用
- 提升了模块加载性能
2025-12-11 16:12:43 +08:00
e0f18fb837 feat(erp): 新增收汇管理模块及相关功能
- 新增收汇单据管理,支持列表、详情、新增、编辑功能
- 新增收汇认领管理,支持认领列表、新增、编辑、删除、确认及取消确认功能
- 新增国内扣费类型常量定义(外币、人民币)
- 优化服务发现逻辑,针对特定 basePath 使用本地调试地址
- 修复应收模块方法接收者命名问题,统一为 r *receivable
2025-12-11 11:04:32 +08:00
6928ef5088 refactor(client): 移除本地开发环境的硬编码配置
- 删除针对本地开发环境的硬编码服务发现配置
- 统一使用 Consul 作为服务发现机制
- 简化客户端初始化逻辑
- 提升代码可维护性和一致性
- 避免在生产环境中潜在的配置冲突
- 强制依赖注册中心以确保服务治理统一性
2025-12-09 14:15:49 +08:00
17 changed files with 755 additions and 16 deletions

View File

@@ -61,18 +61,9 @@ func GetClient(s interface{}) (*RpcClient, error) {
mutex.Lock()
xClient, ok = mClient.Load(key)
if !ok {
var d client.ServiceDiscovery
var err error
if basePath == "ik3cloud" {
d, err = client.NewPeer2PeerDiscovery("tcp@localhost:8081", "")
if err != nil {
return nil, errors.New("系统异常")
}
} else {
d, err = consulClient.NewConsulDiscovery(basePath, servicePath, config.RpcConfig.RegistryServer, nil)
if err != nil {
return nil, errors.New("系统异常")
}
d, err := consulClient.NewConsulDiscovery(basePath, servicePath, config.RpcConfig.RegistryServer, nil)
if err != nil {
return nil, errors.New("系统异常")
}
option := client.DefaultOption
option.Retries = 3

View File

@@ -81,3 +81,9 @@ const (
FlagTrue Flag = 1 // 是
FlagFalse Flag = 2 // 否
)
type DomesticFeeType = int64 // 国内扣费类型 1=外币 2=人民币
const (
DomesticFeeTypeForeign DomesticFeeType = 1 // 外币
DomesticFeeTypeRMB DomesticFeeType = 2 // 人民币
)

View File

@@ -14,4 +14,7 @@ type Erp struct {
Accounting accounting
Payable payable
Receivable receivable
Receipt receipt
Expense expense
Request request
}

113
erp/expense.go Normal file
View 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
View 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
View File

@@ -0,0 +1,5 @@
package expense
type Expense struct {
Cost cost
}

129
erp/receipt.go Normal file
View 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
View 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
View File

@@ -0,0 +1,5 @@
package receipt
type Receipt struct {
Claim claim
}

View File

@@ -44,8 +44,8 @@ type ReceivableItem struct {
}
// List @TITLE 列表
func (p *receivable) List(ctx context.Context, args ArgsReceivableList) (reply ReplyReceivableList, err error) {
xClient, err := client.GetClient(p)
func (r *receivable) List(ctx context.Context, args ArgsReceivableList) (reply ReplyReceivableList, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
@@ -86,8 +86,8 @@ type ReceivableProductItem struct {
}
// Info @TITLE 详情
func (p *receivable) Info(ctx context.Context, receivableId int64) (reply ReplyReceivableInfo, err error) {
xClient, err := client.GetClient(p)
func (r *receivable) Info(ctx context.Context, receivableId int64) (reply ReplyReceivableInfo, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}

125
erp/request.go Normal file
View 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
View 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
View File

@@ -0,0 +1,5 @@
package request
type Request struct {
Cost cost
}

View File

@@ -14,6 +14,9 @@ const (
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

31
ik3cloud/dict.go Normal file
View 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
}

View File

@@ -10,6 +10,7 @@ type Ik3cloud struct {
Product product // 产品
Receivable receivable // 应收
Payable payable // 应付
Dict dict // 字典
}
type Entity struct {
Id int64 `json:"Id"`

View File

@@ -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