Compare commits

..

30 Commits

Author SHA1 Message Date
6520d78067 feat(erp): 添加禁用标记字段以支持状态过滤
- 在 expense.go 中添加 BanFlag 字段用于标识报销单状态
- 在 receipt.go 中添加 BanFlag 字段用于标识结汇单状态
- 在 request.go 中添加 BanFlag 字段用于标识申请单状态
- 所有新增字段均支持 1=禁用 2=启用 的状态定义
2025-12-19 17:22:10 +08:00
3c1fa079cf feat(receipt): 添加客户编号字段
- 在 Receipt 结构体中新增 CustomNumber 字段
- 用于存储客户的唯一标识信息
- 支持后续按客户编号查询和统计功能
2025-12-19 16:58:39 +08:00
eb4c3e3241 feat(ik3cloud): 新增收款单功能并完善作废接口
- 新增收款单常量定义及映射配置
- 新增收款单类型枚举定义
- 新增收款单服务模块,支持保存和作废操作
- 在应付、应收、付款模块中补充作废接口实现
- 定义收款单保存参数结构体及费用明细结构体
2025-12-19 16:31:29 +08:00
d44f208a84 feat(erp): 更新报销单据结构并移除工作流字段
- 在 payable.go 中添加 CostAmount 字段用于加减费用金额
- 移除 request.go 中 RequestIds 字段
- 移除 RequestItem 和 ReplyRequestList 结构中的 WorkflowId、WorkflowStatus 和 WorkflowReason 字段
2025-12-19 14:12:42 +08:00
0315faea07 feat(erp): 添加报销人字段并调整付款单结构
- 在 expense.go 的 Expense 结构体中添加 ExpenseStaffId 字段
- 在 expense.go 的 Add 和 Update 结构体中同步添加 ExpenseStaffId 字段
- 在 payment.go 中移除 SettlementMethod 和 PaymentPurpose 字段
- 在 payment.go 中保留 ExpenseItem 字段并调整其位置
2025-12-18 17:00:50 +08:00
5813fe05ce feat(erp): 添加工作流相关字段到费用和请求模型
- 在 expense.go 的 Expense 结构体中添加 WorkflowId、WorkflowStatus 和 WorkflowReason 字段
- 在 expense.go 的 ExpenseResponse 结构体中添加 WorkflowId、WorkflowStatus 和 WorkflowReason 字段
- 在 request.go 的 Request 结构体中添加 WorkflowId、WorkflowStatus 和 WorkflowReason 字段
- 在 request.go 的 RequestResponse 结构体中添加 WorkflowId、WorkflowStatus 和 WorkflowReason 字段
2025-12-18 16:37:42 +08:00
0a1d70d064 feat(erp): 为费用和请求结构体添加审计字段
- 在 expense 结构体中增加 Audit 字段
- 在 request 结构体中增加 Audit 字段
- 调整结构体字段顺序以保持一致性
2025-12-18 16:26:42 +08:00
f16cf90f12 feat(erp): 添加报销和申请审核提交功能
- 新增 expense 包下的审核提交接口
- 新增 request 包下的审核提交接口
- 实现审核提交的统一调用逻辑
- 支持指定审核人员进行审核操作
- 添加审核提交相关的参数结构体定义
2025-12-18 16:22:58 +08:00
8d5d6a6fb6 feat(erp): 新增报销单和申请单业务类型及查询功能
- 在常量定义中增加报销单和申请单业务类型
- 为报销单查询条件添加报销单ID列表过滤
- 为申请单查询条件添加申请单ID列表过滤
- 完善相关结构体字段定义以支持新功能
2025-12-18 16:20:35 +08:00
e3701c9514 feat(erp): 更新费用成本结构以支持发票编号和到期日期
- 将费用类型字段拆分为类型编号和类型名称
- 在费用添加参数中新增发票编号字段
- 在请求成本项中增加发票编号、到期日期和期望付款日期
- 更新相关结构体字段以适应新的业务需求
2025-12-18 16:03:28 +08:00
a165b59d61 feat(oa): 移除员工销售员和采购员编码字段
- 删除 XsyNumber 字段(金蝶员工销售员编码)
- 删除 CgyNumber 字段(金蝶员工采购员编码)
- 简化 Staff 结构体定义,仅保留必要字段
- 更新相关 JSON 标签以保持数据一致性
2025-12-18 14:32:12 +08:00
75e66aab81 chore: 更新部门和员工模块
- 修改了部门模块的代码结构
- 调整了员工模块的相关配置
- 优化了两个模块间的依赖关系
2025-12-18 14:31:55 +08:00
ec74ebbca5 feat(erp): 新增发票号字段并优化应付单结构
- 在erp/payable.go中新增InvoiceSerial字段
- 重构ik3cloud/payable.go的ArgsPayableSave结构体
- 添加时间、币种、部门等业务字段
- 引入decimal包处理金额相关字段
- 新增PayableProductItem结构体定义商品明细
- 添加产品列表支持多商品应付单据
- 增加税率、税额等税务相关字段
- 补充含税与不含税金额计算字段
2025-12-18 11:57:33 +08:00
1fa64111a4 fix(erp): 修改应收款项服务调用方法
- 将 receivable 服务中的 List 方法调用更改为 Info 方法调用
- 修复因方法名错误导致的数据获取问题
2025-12-17 16:45:49 +08:00
ace87cd73d feat(ik3cloud): 添加 Entity 结构体及 ID 序列化支持
- 新增 Entity 结构体定义,包含 Id、Number 和 DIndex 字段
- 实现 SetStringId 方法,支持将十六进制字符串转换为 int64 ID
- 实现 GetStringId 方法,支持将 int64 ID 转换为十六进制字符串
- 实现自定义 UnmarshalJSON 方法,支持解析不同类型的 Id 字段
- 支持 Number 和 DIndex 字段的 JSON 解析
- 添加必要的导入包:encoding/json、fmt 和 strconv
2025-12-17 16:17:32 +08:00
5b4a26d13d feat(k3cloud): 添加动作编号字段映射常量
- 为部门、员工、岗位等实体添加 FNumber 字段映射
- 为应收、应付单据添加 FBillNo 字段映射
- 扩展 ActionNumberField 映射表以支持更多业务实体
- 统一编号字段访问逻辑,提升代码可维护性
2025-12-17 15:25:02 +08:00
28d650a7bc feat(k3cloud): 添加ActionIdField映射常量
- 为不同Action类型定义对应的ID字段映射关系
- 支持部门、员工、岗位等18种业务实体的ID字段配置
- 提供统一的Action到数据库字段的映射查询接口
2025-12-17 15:10:38 +08:00
d39d8d8990 feat(k3cloud): 新增外销成本及退税相关字段
- 在 receivable 结构体中新增 ExportCost 字段表示外销成本
- 添加 MinusTaxRate 字段用于存储退税率
- 引入 MinusTaxAmount 字段记录退税额
- 完善结构体注释以明确各字段含义
2025-12-17 14:07:12 +08:00
56b80d91c7 refactor(erp): 调整 receivable 服务中的类型引用
- 移除了对 "erp/app/constant" 包的依赖
- 将 Ik3cloudStatus 字段的类型从 constant.Flag 更改为 Flag
- 简化了包导入结构,提高代码可维护性
2025-12-17 10:28:00 +08:00
fb053ec48c fix(erp): 更新 receivable 服务中的 Ik3cloudStatus 字段类型
- 将 Ik3cloudStatus 的类型从 constant.Flag 更改为 Flag
- 确保与系统其他部分的一致性
- 避免潜在的类型不匹配问题
2025-12-17 10:14:17 +08:00
32f6d85021 feat(erp): 新增应收款项同步功能
- 引入常量包以支持状态标识
- 在应收款项结构体中增加 Ik3cloudStatus 字段
- 实现 Ik3cloud 方法用于同步应收款项数据到云端
- 添加对客户端调用失败的错误处理机制
2025-12-17 09:43:57 +08:00
252def479a feat(ik3cloud): 添加资料信息服务
- 在Ik3cloud结构体中新增Information字段
- 扩展服务模块以支持资料信息管理功能
2025-12-17 09:31:24 +08:00
83014b8b29 feat(k3cloud): 添加应收单费用字段支持
- 新增发票号字段用于标识应收单据
- 添加国内运费字段记录本地运输成本
- 添加国外运费字段记录国际运输成本
- 添加出口佣金字段记录销售佣金信息
- 扩展应收单结构体以支持更多财务明细
2025-12-16 17:09:25 +08:00
e209510e1f feat(k3cloud): 新增辅助资料信息模块
- 在常量定义中增加辅助资料相关枚举类型
- 添加辅助资料信息保存接口及数据结构
- 实现辅助资料信息保存方法
- 定义辅助资料类型常量值
2025-12-16 17:03:17 +08:00
c1ff46e933 feat(erp): 新增字典和分类管理功能
- 添加 dict 包,包含字体、分类和字典相关结构体与方法
- 实现分类的增删改查接口
- 实现字典的增删改查接口
- 在 receivable.go 中扩展字段支持汇率、部门、业务员等信息
- 新增 payment.go 文件,实现付款单保存功能
- 引入 time 和 decimal 包以支持日期和金额类型字段
2025-12-16 15:03:34 +08:00
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
28 changed files with 1293 additions and 58 deletions

View File

@@ -12,6 +12,8 @@ const (
BusinessTypeShipmentModifyAudit BusinessType = "shipmentModifyAudit" // 订舱单修改单审核 BusinessTypeShipmentModifyAudit BusinessType = "shipmentModifyAudit" // 订舱单修改单审核
BusinessTypeAccountingAudit BusinessType = "accountingAudit" // 做账合同审核 BusinessTypeAccountingAudit BusinessType = "accountingAudit" // 做账合同审核
BusinessTypeAccountingAuditV2 BusinessType = "accountingAuditV2" // 做账合同审核 BusinessTypeAccountingAuditV2 BusinessType = "accountingAuditV2" // 做账合同审核
BusinessTypeExpense BusinessType = "expense" // 报销单
BusinessTypeRequest BusinessType = "request" // 申请单
) )
var BusinessTypeName = map[BusinessType]string{ var BusinessTypeName = map[BusinessType]string{

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

@@ -0,0 +1,6 @@
package dict
type Dict struct {
Font font
Category category
}

39
erp/dict/font.go Normal file
View 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
}

View File

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

143
erp/expense.go Normal file
View File

@@ -0,0 +1,143 @@
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 // 创建结束时间
ExpenseIds []int64 // 报销单id
BanFlag int64 // 禁用标记 1=禁用 2=启用
}
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"`
WorkflowId int64 `json:"workflowId"`
WorkflowStatus int64 `json:"workflowStatus"`
WorkflowReason string `json:"workflowReason"`
ExpenseStaffId int64 `json:"expenseStaffId"`
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 // 备注
ExpenseStaffId int64 // 报销人
}
// 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"`
WorkflowId int64 `json:"workflowId"`
WorkflowStatus int64 `json:"workflowStatus"`
WorkflowReason string `json:"workflowReason"`
ExpenseStaffId int64 `json:"expenseStaffId"`
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)
}
// Ik3cloud @TITLE 同步
func (r *expense) Ik3cloud(ctx context.Context, expenseId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", expenseId, &reply)
}
// Cancel @TITLE 作废
func (r *expense) Cancel(ctx context.Context, expenseId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", expenseId, &reply)
}

26
erp/expense/audit.go Normal file
View File

@@ -0,0 +1,26 @@
package expense
import (
"context"
"git.kumo.work/shama/service/client"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
ExpenseId int64 // 报销单id
AuditStaffIds []int64 // 审核人
}
// Submit @TITLE 提交审核
func (a *audit) Submit(ctx context.Context, args ArgsAuditSubmit) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Submit", args, &reply)
return
}

98
erp/expense/cost.go Normal file
View File

@@ -0,0 +1,98 @@
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"`
TypeNumber string `json:"typeNumber"`
TypeName string `json:"typeName"`
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 // 费用日期
TypeNumber string // 费用类型
TypeName string // 费用类型名称
Value string // 费用名称
Amount decimal.Decimal // 金额
DepartmentId int64 // 部门
InvoiceSerial 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 {
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)
}

6
erp/expense/expense.go Normal file
View File

@@ -0,0 +1,6 @@
package expense
type Expense struct {
Cost cost
Audit audit
}

View File

@@ -30,7 +30,6 @@ type ReplyPayableList struct {
type PayableItem struct { type PayableItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
PayableSerial string `json:"payableSerial"` PayableSerial string `json:"payableSerial"`
FactoryName string `json:"factoryName"`
AccountingSerial string `json:"accountingSerial"` AccountingSerial string `json:"accountingSerial"`
Amount decimal.Decimal `json:"amount"` Amount decimal.Decimal `json:"amount"`
Currency string `json:"currency"` Currency string `json:"currency"`
@@ -54,28 +53,27 @@ func (p *payable) List(ctx context.Context, args ArgsPayableList) (reply ReplyPa
} }
type ReplyPayableInfo struct { type ReplyPayableInfo struct {
Id int64 `json:"id"` Id int64 `json:"id"`
PayableSerial string `json:"payableSerial"` PayableSerial string `json:"payableSerial"`
AccountingSerial string `json:"accountingSerial"` AccountingSerial string `json:"accountingSerial"`
FactoryName string `json:"factoryName"` InvoiceSerial string `json:"invoiceSerial"`
FactoryBank string `json:"factoryBank"` Amount decimal.Decimal `json:"amount"`
FactoryBankAccount string `json:"factoryBankAccount"` Currency string `json:"currency"`
Amount decimal.Decimal `json:"amount"` CurrencyName string `json:"currencyName"`
Currency string `json:"currency"` CurrencyRate decimal.Decimal `json:"currencyRate"`
CurrencyName string `json:"currencyName"` CurrencySymbol string `json:"currencySymbol"`
CurrencyRate decimal.Decimal `json:"currencyRate"` PurchaseStaffId int64 `json:"purchaseStaffId"`
CurrencySymbol string `json:"currencySymbol"` IsConfirm int64 `json:"isConfirm"`
PurchaseStaffId int64 `json:"purchaseStaffId"` CreatedAt *time.Time `json:"createdAt"`
IsConfirm int64 `json:"isConfirm"` UpdatedAt *time.Time `json:"updatedAt"`
CreatedAt *time.Time `json:"createdAt"` Products []PayableProductItem `json:"products"`
UpdatedAt *time.Time `json:"updatedAt"` Costs []PayableCostItem `json:"costs"`
Products []PayableProductItem `json:"products"`
Costs []PayableCostItem `json:"costs"`
} }
type PayableProductItem struct { type PayableProductItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
AccountingProductId int64 `json:"accountingProductId"` AccountingProductId int64 `json:"accountingProductId"`
FactoryName string `json:"factoryName"`
Name string `json:"name"` Name string `json:"name"`
Serial string `json:"serial"` Serial string `json:"serial"`
PayableCount int64 `json:"payableCount"` PayableCount int64 `json:"payableCount"`
@@ -88,10 +86,11 @@ type PayableProductItem struct {
} }
type PayableCostItem struct { type PayableCostItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
Name string `json:"name"` FactoryName string `json:"factoryName"`
Amount decimal.Decimal `json:"amount"` Name string `json:"name"`
Remarks string `json:"remarks"` Amount decimal.Decimal `json:"amount"`
Remarks string `json:"remarks"`
} }
// Info @TITLE 详情 // Info @TITLE 详情
@@ -113,3 +112,13 @@ func (p *payable) Confirm(ctx context.Context, payableId int64) (err error) {
reply := 0 reply := 0
return xClient.Call(ctx, "Confirm", payableId, &reply) return xClient.Call(ctx, "Confirm", payableId, &reply)
} }
// Ik3cloud @TITLE 金蝶同步
func (p *payable) Ik3cloud(ctx context.Context, payableId int64) (err error) {
xClient, err := client.GetClient(p)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", payableId, &reply)
}

View File

@@ -19,10 +19,12 @@ type ArgsReceiptList struct {
} }
type ReceiptSearch struct { type ReceiptSearch struct {
ReceiptSerial string // 收汇单号 ReceiptSerial string // 收汇单号
PayName string // 付款单位 CustomId int64 // 客户筛选
CustomName string // 客户筛选
BankName string // 结汇银行 BankName string // 结汇银行
ReceiptDateStart *time.Time // 创建开始时间 ReceiptDateStart *time.Time // 创建开始时间
ReceiptDateEnd *time.Time // 创建结束时间 ReceiptDateEnd *time.Time // 创建结束时间
BanFlag int64 // 禁用标记 1=禁用 2=启用
} }
type ReplyReceiptList struct { type ReplyReceiptList struct {
List []ReceiptItem `json:"list"` List []ReceiptItem `json:"list"`
@@ -31,7 +33,8 @@ type ReplyReceiptList struct {
type ReceiptItem struct { type ReceiptItem struct {
Id int64 `json:"id"` Id int64 `json:"id"`
ReceiptSerial string `json:"receiptSerial"` ReceiptSerial string `json:"receiptSerial"`
PayName string `json:"payName"` CustomId int64 `json:"customId"`
CustomName string `json:"customName"`
ReceiptDate time.Time `json:"receiptDate"` ReceiptDate time.Time `json:"receiptDate"`
Currency string `json:"currency"` Currency string `json:"currency"`
CurrencyName string `json:"currencyName"` CurrencyName string `json:"currencyName"`
@@ -65,7 +68,7 @@ type ReceiptAdd struct {
CurrencyName string // 币种名称 CurrencyName string // 币种名称
CurrencySymbol string // 币种符号 CurrencySymbol string // 币种符号
CurrencyRate decimal.Decimal // 币种汇率 CurrencyRate decimal.Decimal // 币种汇率
PayName string // 付款单位 CustomId int64 // 客户id
BankName string // 结汇银行 BankName string // 结汇银行
EntryAmount decimal.Decimal // 外币入账金额 EntryAmount decimal.Decimal // 外币入账金额
ForeignFee decimal.Decimal // 国外扣费 ForeignFee decimal.Decimal // 国外扣费
@@ -91,7 +94,8 @@ type ReplyReceiptInfo struct {
CurrencyName string `json:"currencyName"` CurrencyName string `json:"currencyName"`
CurrencySymbol string `json:"currencySymbol"` CurrencySymbol string `json:"currencySymbol"`
CurrencyRate decimal.Decimal `json:"currencyRate"` CurrencyRate decimal.Decimal `json:"currencyRate"`
PayName string `json:"payName"` CustomId int64 `json:"customId"`
CustomName string `json:"customName"`
BankName string `json:"bankName"` BankName string `json:"bankName"`
EntryAmount decimal.Decimal `json:"entryAmount"` EntryAmount decimal.Decimal `json:"entryAmount"`
ForeignFee decimal.Decimal `json:"foreignFee"` ForeignFee decimal.Decimal `json:"foreignFee"`
@@ -127,3 +131,23 @@ func (r *receipt) Edit(ctx context.Context, args ArgsReceiptEdit) (err error) {
reply := 0 reply := 0
return xClient.Call(ctx, "Edit", args, &reply) return xClient.Call(ctx, "Edit", args, &reply)
} }
// Ik3cloud @TITLE 金蝶同步
func (r *receipt) Ik3cloud(ctx context.Context, receiptId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", receiptId, &reply)
}
// Cancel @TITLE 作废
func (r *receipt) Cancel(ctx context.Context, receiptId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", receiptId, &reply)
}

View File

@@ -18,6 +18,7 @@ type ArgsReceivableList struct {
type ReceivableSearch struct { type ReceivableSearch struct {
ReceivableSerial string // 收款单据号 ReceivableSerial string // 收款单据号
CustomId int64 // 客户id CustomId int64 // 客户id
CustomName string // 客户名称
InvoiceSerial string // 出运发票号 InvoiceSerial string // 出运发票号
CreatedAtStart *time.Time // 创建开始时间 CreatedAtStart *time.Time // 创建开始时间
CreatedAtEnd *time.Time // 创建结束时间 CreatedAtEnd *time.Time // 创建结束时间
@@ -39,6 +40,7 @@ type ReceivableItem struct {
CurrencyRate decimal.Decimal `json:"currencyRate"` CurrencyRate decimal.Decimal `json:"currencyRate"`
CurrencySymbol string `json:"currencySymbol"` CurrencySymbol string `json:"currencySymbol"`
CreatedStaffID int64 `json:"createdStaffID"` CreatedStaffID int64 `json:"createdStaffID"`
Ik3cloudStatus Flag `json:"ik3CloudStatus"`
CreatedAt *time.Time `json:"createdAt"` CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"` UpdatedAt *time.Time `json:"updatedAt"`
} }
@@ -66,6 +68,7 @@ type ReplyReceivableInfo struct {
CurrencyRate decimal.Decimal `json:"currencyRate"` CurrencyRate decimal.Decimal `json:"currencyRate"`
CurrencySymbol string `json:"currencySymbol"` CurrencySymbol string `json:"currencySymbol"`
CreatedStaffID int64 `json:"createdStaffID"` CreatedStaffID int64 `json:"createdStaffID"`
Ik3cloudStatus Flag `json:"ik3CloudStatus"`
CreatedAt *time.Time `json:"createdAt"` CreatedAt *time.Time `json:"createdAt"`
UpdatedAt *time.Time `json:"updatedAt"` UpdatedAt *time.Time `json:"updatedAt"`
Products []ReceivableProductItem `json:"products"` Products []ReceivableProductItem `json:"products"`
@@ -91,6 +94,16 @@ func (r *receivable) Info(ctx context.Context, receivableId int64) (reply ReplyR
if err != nil { if err != nil {
return return
} }
err = xClient.Call(ctx, "List", receivableId, &reply) err = xClient.Call(ctx, "Info", receivableId, &reply)
return return
} }
// Ik3cloud @TITLE 同步
func (r *receivable) Ik3cloud(ctx context.Context, receivableId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", receivableId, &reply)
}

153
erp/request.go Normal file
View File

@@ -0,0 +1,153 @@
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 // 创建结束时间
RequestIds []int64 // 申请单id
BanFlag int64 // 禁用标记 1=禁用 2=启用
}
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"`
WorkflowId int64 `json:"workflowId"`
WorkflowStatus int64 `json:"workflowStatus"`
WorkflowReason string `json:"workflowReason"`
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"`
WorkflowId int64 `json:"workflowId"`
WorkflowStatus int64 `json:"workflowStatus"`
WorkflowReason string `json:"workflowReason"`
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)
}
// Ik3cloud @TITLE 同步
func (r *request) Ik3cloud(ctx context.Context, requestId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Ik3cloud", requestId, &reply)
}
// Cancel @TITLE 作废
func (r *request) Cancel(ctx context.Context, requestId int64) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", requestId, &reply)
}

26
erp/request/audit.go Normal file
View File

@@ -0,0 +1,26 @@
package request
import (
"context"
"git.kumo.work/shama/service/client"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
RequestId int64 // 申请单id
AuditStaffIds []int64 // 审核人
}
// Submit @TITLE 提交审核
func (a *audit) Submit(ctx context.Context, args ArgsAuditSubmit) (err error) {
xClient, err := client.GetClient(a)
if err != nil {
return
}
reply := 0
err = xClient.Call(ctx, "Submit", args, &reply)
return
}

100
erp/request/cost.go Normal file
View File

@@ -0,0 +1,100 @@
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"`
TypeNumber string `json:"typeNumber"`
TypeName string `json:"typeName"`
Amount decimal.Decimal `json:"amount"`
DepartmentId int64 `json:"departmentId"`
InvoiceSerial string `json:"invoiceSerial"`
Remarks string `json:"remarks"`
DueDate *time.Time `json:"dueDate"`
ExpectedPayDate *time.Time `json:"expectedPayDate"`
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
TypeNumber string // 费用类型
TypeName string // 费用类型名称
Amount decimal.Decimal // 金额
DepartmentId int64 // 部门
Remarks string // 备注
InvoiceSerial string // 发票号
DueDate *time.Time // 到期日期
ExpectedPayDate *time.Time // 期望付款日期
}
// 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)
}

6
erp/request/request.go Normal file
View File

@@ -0,0 +1,6 @@
package request
type Request struct {
Cost cost
Audit audit
}

View File

@@ -3,22 +3,91 @@ package constant
type Action = string // 方法 type Action = string // 方法
const ( const (
ActionDepartment Action = "BD_Department" // 部门 ActionDepartment Action = "BD_Department" // 部门
ActionStaff Action = "BD_Empinfo" // 员工 ActionStaff Action = "BD_Empinfo" // 员工
ActionStaffPosition Action = "BD_NEWSTAFF" // 职位 ActionStaffPosition Action = "BD_NEWSTAFF" // 职位
ActionOperatorType Action = "BD_OPERATOR" // 业务员类型 ActionOperatorType Action = "BD_OPERATOR" // 业务员类型
ActionPosition Action = "HR_ORG_HRPOST" // 职位 ActionPosition Action = "HR_ORG_HRPOST" // 职位
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" // 付款单
ActionInformation Action = "BOS_ASSISTANTDATA_DETAIL" // 辅助资料
ActionReceiptAction Action = "AR_RECEIVEBILL" // 收款单
) )
var ActionIdField = map[Action]string{
ActionDepartment: "FDEPTID",
ActionStaff: "FID",
ActionStaffPosition: "FSTAFFID",
ActionOperatorType: "FOperatorId",
ActionPosition: "FPOSTID",
ActionFactory: "FSupplierId",
ActionContact: "FCONTACTID",
ActionCustom: "FCUSTID",
ActionReceivable: "FID",
ActionPayable: "FID",
ActionProduct: "FMATERIALID",
ActionCurrency: "",
ActionSettleType: "",
ActionRecPayPurpose: "",
ActionExpense: "",
ActionPayment: "FID",
ActionInformation: "FEntryID",
ActionReceiptAction: "FID",
}
var ActionNumberField = map[Action]string{
ActionDepartment: "FNumber",
ActionStaff: "FNumber",
ActionStaffPosition: "FNumber",
ActionOperatorType: "FNumber",
ActionPosition: "FNumber",
ActionFactory: "FNumber",
ActionContact: "FNumber",
ActionCustom: "FNumber",
ActionReceivable: "FBillNo",
ActionPayable: "FBillNo",
ActionProduct: "FNumber",
ActionCurrency: "FNumber",
ActionSettleType: "FNumber",
ActionRecPayPurpose: "FNumber",
ActionExpense: "FNumber",
ActionPayment: "FBillNo",
ActionInformation: "FNumber",
ActionReceiptAction: "FBillNo",
}
type OperatorType = string type OperatorType = string
const ( 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" // 报销付款单
)
type ReceiptType = string
const (
ReceiptTypeReceiptFx ReceiptType = "SKDLX08_SYS" // 收汇水单
ReceiptTypeReceipt ReceiptType = "SKDLX09_SYS" // 收款单
)
type InformationType = string
const (
InformationTypeInvoiceSerial InformationType = "FYP" // 采购付款单
)

View File

@@ -46,11 +46,11 @@ func (d *department) Save(ctx context.Context, args ArgsDepartmentSave) (entity
} }
// Delete @TITLE 删除部门 // Delete @TITLE 删除部门
func (d *department) Delete(ctx context.Context, numbers []string) (err error) { func (d *department) Delete(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(d) xClient, err := client.GetClient(d)
if err != nil { if err != nil {
return return
} }
var reply int var reply int
return xClient.Call(ctx, "Delete", numbers, &reply) return xClient.Call(ctx, "Delete", args, &reply)
} }

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

@@ -1,22 +1,74 @@
package ik3cloud package ik3cloud
import (
"encoding/json"
"fmt"
"strconv"
)
type Ik3cloud struct { type Ik3cloud struct {
Department department // 部门 Department department // 部门
Staff staff // 员工 Staff staff // 员工
Position position // 职位 Position position // 职位
Contact contact // 联系人 Contact contact // 联系人
Factory factory // 工厂 Factory factory // 工厂
Custom custom // 客户 Custom custom // 客户
Product product // 产品 Product product // 产品
Receivable receivable // 应收 Receivable receivable // 应收
Payable payable // 应付 Payable payable // 应付
Dict dict // 字典
Payment payment // 付款单
Information information // 资料
Receipt receipt // 收款单
} }
type Entity struct { type Entity struct {
Id int64 `json:"Id"` Id int64 `json:"Id"`
Number string `json:"Number"` Number string `json:"Number"`
DIndex int `json:"DIndex"` DIndex int `json:"DIndex"`
} }
// SetStringId @TITLE 设置字符串id
func (e *Entity) SetStringId(stringId string) {
e.Id, _ = strconv.ParseInt(stringId, 16, 64)
}
// GetStringId @TITLE 获取字符串id
func (e *Entity) GetStringId() string {
return strconv.FormatInt(e.Id, 16)
}
func (e *Entity) UnmarshalJSON(data []byte) error {
var raw map[string]interface{}
if err := json.Unmarshal(data, &raw); err != nil {
return err
}
// 处理 Id 字段,支持字符串和数字类型
if idVal, ok := raw["Id"]; ok {
switch v := idVal.(type) {
case string:
e.SetStringId(v)
case float64: // JSON 中的数字默认为 float64
e.Id = int64(v)
case int64:
e.Id = v
default:
return fmt.Errorf("unsupported type for Id: %T", v)
}
}
// 其他字段处理
if num, ok := raw["Number"].(string); ok {
e.Number = num
}
if dIndex, ok := raw["DIndex"].(float64); ok {
e.DIndex = int(dIndex)
}
return nil
}
type Unique struct { type Unique struct {
Numbers []string // 编码 Numbers []string // 编码
Ids []int64 // id Ids []int64 // id

28
ik3cloud/information.go Normal file
View File

@@ -0,0 +1,28 @@
package ik3cloud
import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/ik3cloud/constant"
)
type information struct {
}
type InformationSaveItem struct {
InformationId int64
Number string
Value string
Type constant.InformationType // 资料类型
}
// Save @TITLE 保存
func (i *information) Save(ctx context.Context, args []InformationSaveItem) (entities []Entity, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return
}
err = xClient.Call(ctx, "Save", args, &entities)
return
}

View File

@@ -2,17 +2,40 @@ package ik3cloud
import ( import (
"context" "context"
"time"
"git.kumo.work/shama/service/client" "git.kumo.work/shama/service/client"
"github.com/shopspring/decimal"
) )
type payable struct { type payable struct {
} }
type ArgsPayableSave struct { type ArgsPayableSave struct {
PayableId int64 // 应付单id PayableId int64 // 应付单id
Number string // 编码 Number string // 编码
CustomNumber string // 客户编码 InvoiceSerial string // 发票号
FactoryNumber string // 工厂编码 CustomNumber string // 客户编码
FactoryNumber string // 工厂编码
Date time.Time // 日期
CurrencyNumber string // 币种
DepartmentNumber string // 部门
StaffCgyNumber string // 业务员
Rate decimal.Decimal // 汇率
Products []PayableProductItem // 商品
}
type PayableProductItem struct {
FactoryNumber string // 工厂编码
Number string // 商品编码
Name string // 商品名称
Count int64 // 数量
UnitPrice decimal.Decimal // 含税单价
AddTaxRate decimal.Decimal // 税率
ExTaxUnitPrice decimal.Decimal // 不含税单价
TaxAmount decimal.Decimal // 税额
UnitAmount decimal.Decimal // 含税金额
ExTaxUnitAmount decimal.Decimal // 不含税金额
CostAmount decimal.Decimal // 加减费用金额
} }
// Save @TITLE 保存应付 // Save @TITLE 保存应付
@@ -24,3 +47,13 @@ func (p *payable) Save(ctx context.Context, args ArgsPayableSave) (entity Entity
err = xClient.Call(ctx, "Save", args, &entity) err = xClient.Call(ctx, "Save", args, &entity)
return return
} }
// Cancel @TITLE 作废
func (p *payable) Cancel(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(p)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", args, &reply)
}

57
ik3cloud/payment.go Normal file
View File

@@ -0,0 +1,57 @@
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
}
// Cancel @TITLE 作废
func (p *payment) Cancel(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(p)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", args, &reply)
}

53
ik3cloud/receipt.go Normal file
View File

@@ -0,0 +1,53 @@
package ik3cloud
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/ik3cloud/constant"
"github.com/shopspring/decimal"
)
type receipt struct {
}
type ArgsReceiptSave struct {
ReceiptId int64 // 收款单ID
Number string // 单据编号
ReceiptType constant.ReceiptType // 收款单类型
Date time.Time // 收款单日期
DepartmentNumber string // 部门编号
StaffXsyNumber string // 业务员编号
CurrencyNumber string // 币种编号
Rate decimal.Decimal // 汇率
Remarks string // 备注
Costs []ReceiptCost // 费用明细
CustomNumber string // 客户编号
}
type ReceiptCost struct {
InvoiceSerial string // 发票号
DepartmentNumber string // 部门编号
Amount decimal.Decimal // 金额
Remarks string // 备注
}
// Save @TITLE 保存收款单
func (r *receipt) Save(ctx context.Context, args ArgsReceiptSave) (entity Entity, err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
err = xClient.Call(ctx, "Save", args, &entity)
return
}
// Cancel @TITLE 作废
func (r *receipt) Cancel(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", args, &reply)
}

View File

@@ -2,16 +2,43 @@ 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 {
} }
type ArgsReceivableSave struct { type ArgsReceivableSave struct {
ReceivableId int64 // 应收单id ReceivableId int64 // 应收单id
Number string // 编码 InvoiceSerial string // 发票号
CustomNumber string // 客户编码 Number string // 编码
CustomNumber string // 客户编码
CurrencyNumber string // 币种
DepartmentNumber string // 部门
StaffXsyNumber string // 业务员
Products []ReceivableProductItem // 商品
Rate decimal.Decimal // 汇率
Date time.Time // 日期
DomesticShippingCost decimal.Decimal // 国内运费
ForeignShippingCost decimal.Decimal // 国外运费
ForeignCommission decimal.Decimal // 出口佣金
}
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 // 不含税金额
ExportCost decimal.Decimal // 外销成本
MinusTaxRate decimal.Decimal // 退税率
MinusTaxAmount decimal.Decimal // 退税额
} }
// Save @TITLE 保存应收 // Save @TITLE 保存应收
@@ -23,3 +50,13 @@ func (r *receivable) Save(ctx context.Context, args ArgsReceivableSave) (entity
err = xClient.Call(ctx, "Save", args, &entity) err = xClient.Call(ctx, "Save", args, &entity)
return return
} }
// Cancel @TITLE 作废
func (r *receivable) Cancel(ctx context.Context, args Unique) (err error) {
xClient, err := client.GetClient(r)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "Cancel", args, &reply)
}

View File

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

View File

@@ -272,9 +272,7 @@ type ReplyStaffIk3cloudInfo struct {
PositionId int64 `json:"positionId"` // 金蝶部门职位id PositionId int64 `json:"positionId"` // 金蝶部门职位id
PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码 PositionNumber string `json:"positionNumber"` // 金蝶部门职位编码
XsyId int64 `json:"xsyId"` // 金蝶员工销售员id XsyId int64 `json:"xsyId"` // 金蝶员工销售员id
XsyNumber string `json:"xsyNumber"` // 金蝶员工销售员编码
CgyId int64 `json:"cgyId"` // 金蝶员工采购员id CgyId int64 `json:"cgyId"` // 金蝶员工采购员id
CgyNumber string `json:"cgyNumber"` // 金蝶员工采购员编码
Department ReplyDepartmentIk3cloudInfo `json:"department"` Department ReplyDepartmentIk3cloudInfo `json:"department"`
} }