作者 陈志颖

fix:修复合伙人类型错误

... ... @@ -1008,6 +1008,29 @@ func (c *OrderInfoController) ImportOrderFromExcel() {
price, _ := strconv.ParseFloat(row[10], 64) // 单价
percent, _ := strconv.ParseFloat(row[11], 64) // 合伙人分红比例
// 获取partnerId
var partnerInfo *domain.PartnerInfo
orderQueryData := orderQuery.GetPartnerIdQuery{
Code: row[4],
PartnerCategory: 0,
CompanyId: companyId,
}
// 1: 事业合伙、2: 业务合伙、3: 研发合伙、4: 业务-产品应用合伙
switch row[6] {
case "事业合伙":
orderQueryData.PartnerCategory = 1
case "业务合伙":
orderQueryData.PartnerCategory = 2
case "研发合伙":
orderQueryData.PartnerCategory = 3
case "业务-产品应用合伙":
orderQueryData.PartnerCategory = 4
default:
orderQueryData.PartnerCategory = 0
}
// 初始化建订单命令集
orderCommands[hashString] = &orderCmd.CreateOrderCommand{
OrderType: 0,
... ... @@ -1027,30 +1050,10 @@ func (c *OrderInfoController) ImportOrderFromExcel() {
},
},
CompanyId: companyId,
PartnerCategory: 1,
PartnerCategory: int64(orderQueryData.PartnerCategory),
LineNumbers: []int{i}, // 记录行号
}
// 获取partnerId
var partnerInfo *domain.PartnerInfo
orderQueryData := orderQuery.GetPartnerIdQuery{
Code: row[4],
PartnerCategory: 0,
CompanyId: companyId,
}
// 1: 事业合伙、2: 业务合伙、3: 研发合伙、4: 业务-产品应用合伙
switch row[6] {
case "事业合伙":
orderQueryData.PartnerCategory = 1
case "业务合伙":
orderQueryData.PartnerCategory = 2
case "研发合伙":
orderQueryData.PartnerCategory = 3
case "业务-产品应用合伙":
orderQueryData.PartnerCategory = 4
default:
orderQueryData.PartnerCategory = 0
}
partnerInfo, err = orderSrv.GetPartnerIdByCodeAndCategory(orderQueryData)
if err != nil || partnerInfo == nil { // 检索合伙人错误
var tmpRow []string
... ...