Some checks failed
Go / build (push) Failing after 19s
- 新增联系人保存与删除逻辑处理 - 新增工厂信息保存逻辑,支持银行、财务等详细信息 - 部门与员工模块接口参数调整,统一使用实体对象返回 - 优化部门与员工的增删改查操作,去除冗余代码 - 统一使用 constant 包管理业务类型常量 - 增加性别转换与整型数组转字符串工具函数 - RPC 注册新增工厂与联系人服务路由 - 调整客户端调用参数结构,增强代码可读性与维护性
56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package logic
|
|
|
|
import (
|
|
"ik3cloud/app/common"
|
|
"ik3cloud/app/config"
|
|
"ik3cloud/app/lib/ik3cloud"
|
|
|
|
ik3cloud2 "git.kumo.work/shama/service/ik3cloud"
|
|
"git.kumo.work/shama/service/ik3cloud/constant"
|
|
)
|
|
|
|
var ContactLogic = &contactLogic{}
|
|
|
|
type contactLogic struct {
|
|
}
|
|
|
|
// Save @TITLE 保存联系人
|
|
func (c *contactLogic) Save(companyType constant.Action, datas []ik3cloud2.ContactItem) (entities []ik3cloud2.Entity, err error) {
|
|
var model []map[string]any
|
|
for _, data := range datas {
|
|
fex := ""
|
|
if common.InArray(data.Sex, []string{"男", "M"}) {
|
|
fex = "SEX01_SYS"
|
|
} else if common.InArray(data.Sex, []string{"女", "F"}) {
|
|
fex = "SEX02_SYS"
|
|
}
|
|
model = append(model, map[string]any{
|
|
"FCONTACTID": data.ContactId,
|
|
"FCreateOrgId": map[string]any{
|
|
"FNumber": config.Config.Ik3cloud.OrganizationNumber,
|
|
},
|
|
"FNumber": data.Number,
|
|
"FName": data.Name,
|
|
"Fex": map[string]any{
|
|
"FNumber": fex,
|
|
}, // 性别
|
|
"FPost": data.Job, // 职务
|
|
"FCompanyType": companyType,
|
|
"FCompany": map[string]any{
|
|
"FNumber": data.CompanyNumber,
|
|
},
|
|
"FTel": data.Tel,
|
|
"FMobile": data.Phone,
|
|
"FFax": data.Fax,
|
|
"FEmail": data.Email,
|
|
"FIsDefaultContact": data.IsDefault,
|
|
})
|
|
}
|
|
return ik3cloud.Client.MultiSave(constant.ActionContact, nil, model)
|
|
}
|
|
|
|
// Delete @TITLE 删除联系人
|
|
func (c *contactLogic) Delete(numbers []string, ids []int64) error {
|
|
return ik3cloud.Client.Delete(constant.ActionContact, numbers, ids)
|
|
}
|