正在显示
1 个修改的文件
包含
24 行增加
和
21 行删除
@@ -1008,6 +1008,29 @@ func (c *OrderInfoController) ImportOrderFromExcel() { | @@ -1008,6 +1008,29 @@ func (c *OrderInfoController) ImportOrderFromExcel() { | ||
1008 | price, _ := strconv.ParseFloat(row[10], 64) // 单价 | 1008 | price, _ := strconv.ParseFloat(row[10], 64) // 单价 |
1009 | percent, _ := strconv.ParseFloat(row[11], 64) // 合伙人分红比例 | 1009 | percent, _ := strconv.ParseFloat(row[11], 64) // 合伙人分红比例 |
1010 | 1010 | ||
1011 | + // 获取partnerId | ||
1012 | + var partnerInfo *domain.PartnerInfo | ||
1013 | + | ||
1014 | + orderQueryData := orderQuery.GetPartnerIdQuery{ | ||
1015 | + Code: row[4], | ||
1016 | + PartnerCategory: 0, | ||
1017 | + CompanyId: companyId, | ||
1018 | + } | ||
1019 | + | ||
1020 | + // 1: 事业合伙、2: 业务合伙、3: 研发合伙、4: 业务-产品应用合伙 | ||
1021 | + switch row[6] { | ||
1022 | + case "事业合伙": | ||
1023 | + orderQueryData.PartnerCategory = 1 | ||
1024 | + case "业务合伙": | ||
1025 | + orderQueryData.PartnerCategory = 2 | ||
1026 | + case "研发合伙": | ||
1027 | + orderQueryData.PartnerCategory = 3 | ||
1028 | + case "业务-产品应用合伙": | ||
1029 | + orderQueryData.PartnerCategory = 4 | ||
1030 | + default: | ||
1031 | + orderQueryData.PartnerCategory = 0 | ||
1032 | + } | ||
1033 | + | ||
1011 | // 初始化建订单命令集 | 1034 | // 初始化建订单命令集 |
1012 | orderCommands[hashString] = &orderCmd.CreateOrderCommand{ | 1035 | orderCommands[hashString] = &orderCmd.CreateOrderCommand{ |
1013 | OrderType: 0, | 1036 | OrderType: 0, |
@@ -1027,30 +1050,10 @@ func (c *OrderInfoController) ImportOrderFromExcel() { | @@ -1027,30 +1050,10 @@ func (c *OrderInfoController) ImportOrderFromExcel() { | ||
1027 | }, | 1050 | }, |
1028 | }, | 1051 | }, |
1029 | CompanyId: companyId, | 1052 | CompanyId: companyId, |
1030 | - PartnerCategory: 1, | 1053 | + PartnerCategory: int64(orderQueryData.PartnerCategory), |
1031 | LineNumbers: []int{i}, // 记录行号 | 1054 | LineNumbers: []int{i}, // 记录行号 |
1032 | } | 1055 | } |
1033 | 1056 | ||
1034 | - // 获取partnerId | ||
1035 | - var partnerInfo *domain.PartnerInfo | ||
1036 | - orderQueryData := orderQuery.GetPartnerIdQuery{ | ||
1037 | - Code: row[4], | ||
1038 | - PartnerCategory: 0, | ||
1039 | - CompanyId: companyId, | ||
1040 | - } | ||
1041 | - // 1: 事业合伙、2: 业务合伙、3: 研发合伙、4: 业务-产品应用合伙 | ||
1042 | - switch row[6] { | ||
1043 | - case "事业合伙": | ||
1044 | - orderQueryData.PartnerCategory = 1 | ||
1045 | - case "业务合伙": | ||
1046 | - orderQueryData.PartnerCategory = 2 | ||
1047 | - case "研发合伙": | ||
1048 | - orderQueryData.PartnerCategory = 3 | ||
1049 | - case "业务-产品应用合伙": | ||
1050 | - orderQueryData.PartnerCategory = 4 | ||
1051 | - default: | ||
1052 | - orderQueryData.PartnerCategory = 0 | ||
1053 | - } | ||
1054 | partnerInfo, err = orderSrv.GetPartnerIdByCodeAndCategory(orderQueryData) | 1057 | partnerInfo, err = orderSrv.GetPartnerIdByCodeAndCategory(orderQueryData) |
1055 | if err != nil || partnerInfo == nil { // 检索合伙人错误 | 1058 | if err != nil || partnerInfo == nil { // 检索合伙人错误 |
1056 | var tmpRow []string | 1059 | var tmpRow []string |
-
请 注册 或 登录 后发表评论