| | |
| | | if err != nil { |
| | | return "", errors.New("获取模版记录失败:" + err.Error()) |
| | | } |
| | | |
| | | fmt.Println(template) |
| | | // 根据模板路径获取模板消息 |
| | | readerCloser, err := http.HttpGetWithReadCloser(template.FileUrl) |
| | | if err != nil { |
| | |
| | | f.SetCellValue(sheet, "L3", date[5:7]) // 月 |
| | | f.SetCellValue(sheet, "N3", date[8:10]) // 日 |
| | | |
| | | var entityIDs []string |
| | | for _, v := range operation.Details { |
| | | entityIDs = append(entityIDs, v.ProductId) |
| | | } |
| | | attributeMap := make(map[string]uint) |
| | | attributeValueMap := make(map[string]string) |
| | | attributes, err := models.NewAttributeSearch().SetEntityType(1).FindNotTotal() |
| | |
| | | for _, v := range attributes { |
| | | attributeMap[v.Name] = v.ID |
| | | } |
| | | attributeValues, err := models.NewAttributeValueSearch().FindNotTotal() |
| | | attributeValues, err := models.NewAttributeValueSearch().SetEntityIDs(entityIDs).FindNotTotal() |
| | | if err != nil { |
| | | return "", errors.New("获取动态属性值失败:" + err.Error()) |
| | | } |
| | |
| | | logx.Errorf("file upload err: %v", err) |
| | | return "", err |
| | | } |
| | | |
| | | return fileUrl, nil |
| | | } |
| | | |