Compare commits

...

18 Commits

Author SHA1 Message Date
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
e08c49d40f feat(erp): 添加应收款项服务
- 在ERP服务中新增应收款项模块
- 扩展服务结构体以支持应收账款功能
- 为财务系统增加新的业务领域支持
2025-12-09 14:10:26 +08:00
78393b37d5 feat(erp): 新增收款管理服务接口
- 新增收款单列表查询接口
- 新增收款单详情查询接口
- 定义收款单相关数据结构
- 实现与ERP客户端通信逻辑
- 添加分页和搜索参数支持
- 集成decimal库处理金额计算
2025-12-09 14:09:17 +08:00
165109e9fd feat(erp): 添加应付账款确认功能
- 实现 Confirm 方法用于确认应付账款
- 使用 RPC 客户端调用远程 Confirm 接口
- 返回确认操作的结果状态
2025-12-09 13:27:32 +08:00
5cd534571d fix(erp): 修改应付账款列表接口返回值类型
- 将 List 方法的 total 返回值类型从 int64 改为 error
- 修复了方法签名与实际返回值不匹配的问题
2025-12-09 13:16:01 +08:00
8614837410 feat(erp): 添加应付模块功能
- 新增应付模块,支持应付列表和详情接口
- 添加应付单据的保存功能
- 实现与客户端的通信调用逻辑
- 定义应付相关的数据结构和参数类型
- 支持分页查询和搜索条件过滤
2025-12-09 13:11:14 +08:00
89999b7df3 feat(k3cloud): 更新客户和产品数据结构以支持联系人信息
- 在自定义结构体中新增联系人字段,用于存储多个联系人信息
- 将FactoryCustomItem重命名为CustomItem,统一命名规范
- 修改产品保存参数类型ArgsProductSave为ProductSaveItem
- 调整产品保存接口实现,支持批量保存产品数据
- 更新产品保存方法签名,返回实体列表而非单个实体
2025-12-05 16:16:14 +08:00
2326632e9d refactor(oa): 移除未使用的 oa 包引用
- 删除了 service/oa/staff.go 中对 "git.kumo.work/shama/service/oa" 包的导入
- 清理了未使用的代码依赖,减少包体积
- 提高了代码可读性和维护性
- 避免潜在的循环依赖问题
2025-12-04 16:39:27 +08:00
1975cccdb1 feat(oa): 添加员工金蝶信息中的部门字段
- 在ReplyStaffIk3cloudInfo结构体中新增Department字段
- 引入oa包以支持部门信息的嵌套结构
- 保持原有金蝶员工相关字段不变,扩展数据结构兼容性
2025-12-04 15:54:25 +08:00
34a9bcdd37 fix(oa): 修改金蝶部门职位ID字段命名
- 将 PositionID 字段重命名为 PositionId 以符合JSON命名规范
- 更新相关结构体标签以确保正确的序列化和反序列化
- 保持与其他金蝶系统集成的一致性
2025-12-04 15:10:20 +08:00
96993c312a feat(oa): 更新部门和员工金蝶信息接口返回结构
- 修改部门服务中 Ik3cloudInfo 方法的返回结构体为 ReplyDepartmentIk3cloudInfo
- 新增 ReplyDepartmentIk3cloudInfo 结构体定义,包含金蝶相关字段
- 修改员工服务中 Ik3cloudInfo 方法的返回结构体为 ReplyStaffIk3cloudInfo
- 新增 ReplyStaffIk3cloudInfo 结构体定义,扩展更多金蝶相关信息字段
- 调整工厂保存参数结构体 ArgsFactorySave,增加部门编号和员工编号字段
- 移除部门和员工服务对 ik3cloud 包的直接依赖引用
2025-12-04 15:08:52 +08:00
8de8393c07 feat(ik3cloud): 新增员工职位和业务员类型功能
- 在 constant.go 中新增员工职位和业务员类型常量定义
- 在 ik3cloud.go 中新增 Position 字段以支持职位相关操作
- 在 staff.go 中实现员工职位和业务员类型的查询方法
- 新增 position.go 文件,实现职位的保存和删除功能
2025-12-04 14:17:07 +08:00
908fa48a84 feat(ik3cloud): 新增客户、付款单和物料模块
- 新增客户模块,支持客户信息保存功能
- 新增付款单模块,支持付款单据保存功能
- 新增物料模块,支持物料信息保存功能
- 修改部门和员工模块接口,统一使用Save方法替代原有的Add和Edit方法
- 调整金蝶集成接口参数,简化调用方式
- 更新常量定义,增加客户、付款单和物料相关枚举值
2025-12-03 13:49:31 +08:00
fa23a28fab feat(ik3cloud): 新增工厂与联系人管理功能
- 添加常量定义文件,包含部门、员工、工厂和联系人相关操作类型
- 实现联系人保存与删除接口,支持联系人信息的完整字段
- 实现工厂信息保存接口,包含工厂基本信息及联系人列表
- 定义工厂联系人结构体,支持多个联系人关联工厂信息
- 集成客户端调用逻辑,通过RPC方式与外部服务通信
2025-11-27 11:44:44 +08:00
9c2d9e2f3f Merge remote-tracking branch 'origin/master' 2025-11-27 11:40:50 +08:00
a2abdd3b11 feat(ik3cloud): 扩展Ik3cloud服务结构并优化员工接口
- 在Ik3cloud结构体中新增Contact和Factory字段
- 定义Entity结构体用于统一返回格式
- 定义Unique结构体用于批量操作参数
- 修改员工添加接口返回值为Entity结构体
- 修改员工禁用、启用和删除接口参数为Unique结构体
2025-11-27 11:40:26 +08:00
21 changed files with 883 additions and 60 deletions

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

@@ -12,4 +12,7 @@ type Erp struct {
Contact contact
Template template
Accounting accounting
Payable payable
Receivable receivable
Receipt receipt
}

View File

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

96
erp/receivable.go Normal file
View 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
}

View File

@@ -0,0 +1,24 @@
package constant
type Action = string // 方法
const (
ActionDepartment Action = "BD_Department" // 部门
ActionStaff Action = "BD_Empinfo" // 员工
ActionStaffPosition Action = "BD_NEWSTAFF" // 职位
ActionOperatorType Action = "BD_OPERATOR" // 业务员类型
ActionPosition Action = "HR_ORG_HRPOST" // 职位
ActionFactory Action = "BD_Supplier" // 工厂
ActionContact Action = "BD_CommonContact" // 联系人
ActionCustom Action = "BD_Customer" // 客户
ActionReceivable Action = "AR_receivable" // 付款单
ActionPayable Action = "AP_Payable" // 付款单
ActionProduct Action = "BD_MATERIAL" // 物料
)
type OperatorType = string
const (
OperatorTypeXSY OperatorType = "XSY" // 业务员
OperatorTypeCGY OperatorType = "CGY" // 采购员
)

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

View File

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

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

View File

@@ -3,4 +3,21 @@ package ik3cloud
type Ik3cloud struct {
Department department // 部门
Staff staff // 员工
Position position // 职位
Contact contact // 联系人
Factory factory // 工厂
Custom custom // 客户
Product product // 产品
Receivable receivable // 应收
Payable payable // 应付
}
type Entity struct {
Id int64 `json:"Id"`
Number string `json:"Number"`
DIndex int `json:"DIndex"`
}
type Unique struct {
Numbers []string // 编码
Ids []int64 // id
}

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

View File

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

View File

@@ -96,17 +96,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)
}

View File

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