Some checks failed
Go / build (push) Failing after 19s
- 新增联系人保存与删除逻辑处理 - 新增工厂信息保存逻辑,支持银行、财务等详细信息 - 部门与员工模块接口参数调整,统一使用实体对象返回 - 优化部门与员工的增删改查操作,去除冗余代码 - 统一使用 constant 包管理业务类型常量 - 增加性别转换与整型数组转字符串工具函数 - RPC 注册新增工厂与联系人服务路由 - 调整客户端调用参数结构,增强代码可读性与维护性
82 lines
2.2 KiB
Go
82 lines
2.2 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 FactoryLogic = &factoryLogic{}
|
|
|
|
type factoryLogic struct {
|
|
}
|
|
|
|
// Save @TITLE 保存工厂
|
|
func (f *factoryLogic) Save(data ik3cloud2.ArgsFactorySave) (entity ik3cloud2.Entity, err error) {
|
|
var contants []map[string]any
|
|
for _, contact := range data.Contacts {
|
|
contants = append(contants, map[string]any{
|
|
"FContactNumber": contact.ContactNumber,
|
|
"FContact": contact.Name,
|
|
"FPost": contact.Job,
|
|
"FTel": contact.Tel,
|
|
"FMobile": contact.Phone,
|
|
"FFax": contact.Fax,
|
|
"FEmail": contact.Email,
|
|
"FGender": map[string]any{"FNumber": common.GetGender(contact.Sex)}, // 性别
|
|
"FContactIsDefault": contact.IsDefault,
|
|
})
|
|
}
|
|
return ik3cloud.Client.Save(constant.ActionFactory, nil, map[string]any{
|
|
"FSupplierId": data.FactoryId,
|
|
"FCreateOrgId": map[string]any{
|
|
"FNumber": config.Config.Ik3cloud.OrganizationNumber,
|
|
},
|
|
"FNumber": data.Number,
|
|
"FName": data.Name,
|
|
"FUseOrgId": map[string]any{
|
|
"FNumber": config.Config.Ik3cloud.OrganizationNumber,
|
|
},
|
|
"FShortName": data.ShortName,
|
|
"FBaseInfo": map[string]any{
|
|
"FAddress": data.Address,
|
|
"FZip": data.ZipCode,
|
|
"FLegalPerson": data.LegalPerson,
|
|
"FRegisterCode": data.TaxNumber,
|
|
"FTendPermit": data.TaxNumber,
|
|
"FSOCIALCRECODE": data.TaxNumber,
|
|
"FRegisterAddress": data.RegAddress,
|
|
//"FRegisterFund": 11.0,
|
|
"FSupplyClassify": "CG",
|
|
},
|
|
"FFinanceInfo": map[string]any{
|
|
"FPayCurrencyId": map[string]any{
|
|
"FNumber": "PRE001",
|
|
},
|
|
"FPayAdvanceAmount": 0,
|
|
"FTaxType": map[string]any{
|
|
"FNumber": "SFL02_SYS",
|
|
},
|
|
"FInvoiceType": 0,
|
|
"FTaxRateId": map[string]any{
|
|
"FNumber": "SL02_SYS",
|
|
},
|
|
},
|
|
"FBankInfo": []map[string]any{
|
|
{
|
|
"FBankCountry": map[string]any{
|
|
"FNumber": "China",
|
|
},
|
|
"FBankCode": data.BankAccount,
|
|
"FBankHolder": data.Name,
|
|
"FOpenBankName": data.Bank,
|
|
"FBankIsDefault": true,
|
|
},
|
|
},
|
|
"FSupplierContact": contants,
|
|
})
|
|
}
|