Explorar el Código

add:涌益三期部分月度指标解析

zqbao hace 8 meses
padre
commit
1ecfbd9db5

+ 27 - 2
services/base_from_yongyi_v2/base.go

@@ -4,6 +4,7 @@ import (
 	"eta/eta_data_analysis/models"
 	"eta/eta_data_analysis/utils"
 	"fmt"
+	"regexp"
 	"strconv"
 	"strings"
 	"time"
@@ -63,6 +64,15 @@ func getClassifySortMap() map[string]int {
 		"周度-养殖利润":              48,
 		"周度-华东冻品价格":            49,
 		"运费":                   50,
+		"国产冻品2-4号肉价格":          51,
+		"小猪(50公斤以下)存栏":         52,
+		"中猪(50-80公斤)存栏":        53,
+		"大猪(80公斤以上)月度存栏":       54,
+		"月度猪肉供应占比":             55,
+		"历史出栏体重":               56,
+		"重要部位冻品进口":             57,
+		"各存栏规模":                58,
+		"进口肉":                  59,
 	}
 	return classifyMap
 }
@@ -142,6 +152,15 @@ func init() {
 		"周度-养殖利润":              {"外购育肥", "周度-养殖利润", "周度", "元/头"},
 		"华东冻品价格":               {"华东冻品价格", "周度-华东冻品价格", "周度", "元/公斤"},
 		"运费":                   {"9.6米拉猪车主流运费", "运费", "周度", "元/公里"},
+		"国产冻品2-4号肉价格":          {"", "国产冻品2-4号肉价格", "月度", "元/吨"},
+		"月度-小猪(50公斤以下)存栏":      {"小猪(50公斤以下)月度存栏", "小猪(50公斤以下)存栏", "月度", "头"},
+		"月度-中猪(50-80公斤)存栏":     {"中猪(50-80公斤)月度存栏", "中猪(50-80公斤)存栏", "月度", "头"},
+		"月度-大猪(80公斤以上)月度存栏":    {"大猪(80公斤以上)月度存栏", "大猪(80公斤以上)月度存栏", "月度", "头"},
+		"月度猪肉供应占比":             {"月度猪肉供应占比", "月度猪肉供应占比", "月度", "%"},
+		"历史出栏体重":               {"商品猪历史出栏体重", "历史出栏体重", "周度", "公斤"},
+		"重要部位冻品进口":             {"重要部位冻品进口", "重要部位冻品进口", "月度", "-"},
+		"各存栏规模":                {"半年度各规模存栏", "各存栏规模", "半年度", "%"},
+		"进口肉":                  {"-", "进口肉", "月度", "-"},
 	}
 }
 
@@ -261,8 +280,8 @@ func isValueValid(value string) bool {
 	if value == "" {
 		return false
 	}
-	_, err := strconv.ParseFloat(value, 64)
-	return err == nil
+	re := regexp.MustCompile(`^-?(\d+(\.\d+)?|\.\d+)(%)?$`)
+	return re.MatchString(value)
 }
 
 func excelDateToTimeDateStr(excelDate int) string {
@@ -317,3 +336,9 @@ func getCellValue(cell string) (val string, ok bool) {
 	}
 	return "", false
 }
+
+func LastDayOfMonth(year int, month time.Month) string {
+	firstDay := time.Date(year, month, 1, 0, 0, 0, 0, time.Local)
+	nextMonth := firstDay.AddDate(0, 1, 0)
+	return nextMonth.Add(-time.Nanosecond * 1).Format(utils.FormatDate)
+}

+ 88 - 5
services/base_from_yongyi_v2/week40.go

@@ -714,6 +714,7 @@ func HandleYongyiExcelWeekly37(f *excelize.File, sheetName string) (indexList []
 			}
 		}
 	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly37 周度-养殖利润 指标列表:%v", indexList))
 	return
 }
 
@@ -845,7 +846,7 @@ func HandleYongyiExcelWeekly38(f *excelize.File, sheetName string) (indexList []
 			}
 		}
 	}
-	fmt.Println(len(indexList))
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly38 华东冻品价格 更新指标数量:%d", len(indexList)))
 	return
 }
 
@@ -870,6 +871,7 @@ func HandleYongyiExcelWeekly39(f *excelize.File, sheetName string) (indexList []
 		return
 	}
 	var dataTime string
+	var sort int
 	indexInfoMap := make(map[string]*models.YongyiExcelIndex)
 	for i, row := range rows {
 		if i <= 1 {
@@ -896,11 +898,11 @@ func HandleYongyiExcelWeekly39(f *excelize.File, sheetName string) (indexList []
 			tmpYongyiIndex.IndexName = indexName
 			tmpYongyiIndex.ClassifyName = classifyName
 			tmpYongyiIndex.ClassifySort = classifySort
-			tmpIndexName := strings.ReplaceAll(indexName, "/", "")
-			tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(tmpIndexName)
+			tmpIndexNameSuffix := fmt.Sprintf("%s至%s", fromSrc, toDst)
+			tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(tmpIndexNameSuffix)
 			tmpYongyiIndex.Frequency = frequency
 			tmpYongyiIndex.Unit = unit
-			tmpYongyiIndex.Sort = 0
+			tmpYongyiIndex.Sort = sort
 			tmpYongyiIndex.ExcelDataMap = make(map[string]string)
 			val, ok := getCellValue(row[2])
 			if !ok {
@@ -909,6 +911,7 @@ func HandleYongyiExcelWeekly39(f *excelize.File, sheetName string) (indexList []
 			tmpYongyiIndex.ExcelDataMap[dataTime] = val
 			indexInfoMap[indexName] = tmpYongyiIndex
 			indexList = append(indexList, tmpYongyiIndex)
+			sort++
 		} else {
 			val, ok := getCellValue(row[2])
 			if !ok {
@@ -917,6 +920,86 @@ func HandleYongyiExcelWeekly39(f *excelize.File, sheetName string) (indexList []
 			indexInfo.ExcelDataMap[dataTime] = val
 		}
 	}
-	fmt.Println(len(indexList))
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly39 运费 更新指标数量:%d", len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly40 国产冻品2-4号肉价格
+func HandleYongyiExcelWeekly40(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly40 国产冻品2-4号肉价格 ErrMsg: %s", err.Error()))
+		}
+	}()
+	rows, err := f.GetRows(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetRows err: %s", err.Error())
+		return
+	}
+	className, classSort, frequency, unit, _, namePrefixPingin := GetBaseInfo(sheetName)
+
+	var indexName string
+	var sort int
+	re := regexp.MustCompile(`[+-]?[0-9]*\.?[0-9]+`)
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	monthIndexMap := make(map[int]int)
+	indexInfoMap := make(map[string]*models.YongyiExcelIndex)
+	for _, row := range rows {
+		if len(row) == 0 {
+			indexName = ""
+			continue
+		}
+		if strings.Contains(row[0], "冻猪") {
+			indexName = strings.TrimSpace(row[0])
+		}
+		if indexName == "" {
+			continue
+		}
+		var year int
+		for i, cell := range row {
+			if i == 0 && strings.Contains(cell, "年销价") {
+				if tmp := re.FindString(cell); tmp != "" {
+					year, err = strconv.Atoi("20" + tmp)
+					if err != nil {
+						continue
+					}
+				}
+			} else if strings.Contains(cell, "月") {
+				if month := re.FindString(cell); month != "" {
+					mo, err := strconv.Atoi(month)
+					if err != nil {
+						continue
+					}
+					monthIndexMap[i] = mo
+				}
+			}
+			if re.MatchString(cell) {
+				if indexInfo, ok := indexInfoMap[indexName]; !ok {
+					if isValueValid(cell) {
+						tmpYongyiIndex := new(models.YongyiExcelIndex)
+						tmpYongyiIndex.IndexName = indexName
+						tmpYongyiIndex.ClassifyName = className
+						tmpYongyiIndex.ClassifySort = classSort
+						tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(indexName)
+						tmpYongyiIndex.Frequency = frequency
+						tmpYongyiIndex.Unit = unit
+						tmpYongyiIndex.Sort = sort
+						tmpYongyiIndex.ExcelDataMap = make(map[string]string)
+						date := LastDayOfMonth(year, time.Month(monthIndexMap[i]))
+						tmpYongyiIndex.ExcelDataMap[date] = cell
+						indexInfoMap[indexName] = tmpYongyiIndex
+						indexList = append(indexList, tmpYongyiIndex)
+						sort++
+					}
+				} else {
+					if isValueValid(cell) {
+						date := LastDayOfMonth(year, time.Month(monthIndexMap[i]))
+						indexInfo.ExcelDataMap[date] = cell
+					}
+				}
+			}
+		}
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly40 国产冻品2-4号肉价格 更新指标数量:%d", len(indexList)))
 	return
 }

+ 464 - 0
services/base_from_yongyi_v2/week50.go

@@ -0,0 +1,464 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
+
+	"github.com/xuri/excelize/v2"
+)
+
+// HandleYongyiExcelWeekly41 月度-小猪(50斤以下)存栏
+func HandleYongyiExcelWeekly41(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly40 国产冻品2-4号肉价格 ErrMsg: %s", err.Error()))
+		}
+	}()
+	cols, err := f.GetCols(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetCols err: %s", err.Error())
+		return
+	}
+
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+
+	sort := 0
+	var preIndexName string
+	dateIndexList := make([]string, 0)
+	indexInfoMap := make(map[string]*models.YongyiExcelIndex)
+	indexNamePart2 := map[string]struct{}{"全国": {}, "华北": {}, "东北": {}, "华中": {}, "华东": {}, "华南": {}, "西南": {}}
+
+	for i, col := range cols {
+		if len(col) <= 3 {
+			continue
+		}
+		if i == 0 && col[1] == "日期" {
+			for _, cell := range col {
+				tmpDateTime, err := time.Parse("2006年1月", cell)
+				if err != nil {
+					dateIndexList = append(dateIndexList, "")
+				} else {
+					dateTime := LastDayOfMonth(tmpDateTime.Year(), tmpDateTime.Month())
+					dateIndexList = append(dateIndexList, dateTime)
+				}
+			}
+		}
+		if len(dateIndexList) == 0 {
+			continue
+		}
+		if col[1] != "" && col[1] != "日期" {
+			var indexName, indexNameSuffix string
+			if _, ok := indexNamePart2[col[1]]; ok {
+				preIndexName = col[1]
+				indexName = fmt.Sprintf("%s/%s", namePrefix, col[1])
+				indexNameSuffix = col[1]
+			} else if col[1] == "环比" {
+				indexName = fmt.Sprintf("%s(%s)/%s", namePrefix, col[1], preIndexName)
+				indexNameSuffix = fmt.Sprintf("(%s)%s", col[1], preIndexName)
+			} else {
+				continue
+			}
+			for j, cell := range col {
+				if !isValueValid(cell) {
+					continue
+				}
+				if indexInfo, ok := indexInfoMap[indexName]; !ok {
+					tmpYongyiIndex := new(models.YongyiExcelIndex)
+					tmpYongyiIndex.ClassifyName = classifyName
+					tmpYongyiIndex.ClassifySort = classifySort
+					tmpYongyiIndex.Frequency = frequency
+					tmpYongyiIndex.Unit = unit
+					tmpYongyiIndex.IndexName = indexName
+					tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(indexNameSuffix)
+					tmpYongyiIndex.Sort = sort
+					tmpYongyiIndex.ExcelDataMap = make(map[string]string)
+					if string(cell[len(cell)-1]) == `%` {
+						tmpYongyiIndex.Unit = `%`
+						tmpYongyiIndex.ExcelDataMap[dateIndexList[j]] = cell[:len(cell)-1]
+					} else {
+						tmpYongyiIndex.ExcelDataMap[dateIndexList[j]] = cell
+					}
+					indexInfoMap[indexName] = tmpYongyiIndex
+					indexList = append(indexList, tmpYongyiIndex)
+					sort++
+				} else {
+					if string(cell[len(cell)-1]) == `%` {
+						indexInfo.ExcelDataMap[dateIndexList[j]] = cell[:len(cell)-1]
+					} else {
+						indexInfo.ExcelDataMap[dateIndexList[j]] = cell
+					}
+				}
+			}
+		}
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly41 %s 更新指标数量:%d", sheetName, len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly42 月度猪肉供应占比
+func HandleYongyiExcelWeekly42(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly40 月度猪肉供应占比 ErrMsg: %s", err.Error()))
+		}
+	}()
+	rows, err := f.GetRows(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetRows err: %s", err.Error())
+		return
+	}
+
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+
+	re := regexp.MustCompile(`[+-]?[0-9]*\.?[0-9]+`)
+	yearIndexMap := make(map[int]string)
+
+	yongyiExcelIndex := new(models.YongyiExcelIndex)
+	yongyiExcelIndex.ClassifyName = classifyName
+	yongyiExcelIndex.ClassifySort = classifySort
+	yongyiExcelIndex.Frequency = frequency
+	yongyiExcelIndex.Unit = unit
+	yongyiExcelIndex.IndexName = namePrefix
+	yongyiExcelIndex.IndexCode = namePrefixPingin
+	yongyiExcelIndex.Sort = 0
+	yongyiExcelIndex.ExcelDataMap = make(map[string]string)
+	indexList = append(indexList, yongyiExcelIndex)
+	for i, row := range rows {
+		if i == 0 {
+			// 记录年份索引
+			for j, cell := range row {
+				if isValueValid(cell) {
+					yearIndexMap[j] = cell
+				}
+			}
+		} else {
+			var month string
+			for j, cell := range row {
+				if j == 0 {
+					if tmp := re.FindString(cell); tmp != "" {
+						month = tmp
+						continue
+					}
+				}
+				if month == "" {
+					break
+				}
+				tmpYear, err := strconv.Atoi(yearIndexMap[j])
+				if err != nil {
+					continue
+				}
+				tmpMonth, err := strconv.Atoi(month)
+				if err != nil {
+					continue
+				}
+				dataTime := LastDayOfMonth(tmpYear, time.Month(tmpMonth))
+				if isValueValid(cell) {
+					newCell := strings.ReplaceAll(cell, "%", "")
+					yongyiExcelIndex.ExcelDataMap[dataTime] = newCell
+				}
+			}
+		}
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly42 %s 更新指标数量:%d", sheetName, len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly43 历史出栏体重
+func HandleYongyiExcelWeekly43(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly43 %s ErrMsg: %s", sheetName, err.Error()))
+		}
+	}()
+	rows, err := f.GetRows(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetRows err: %s", err.Error())
+		return
+	}
+	re := regexp.MustCompile(`\d+`)
+
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	yongyiExcelIndex := new(models.YongyiExcelIndex)
+	yongyiExcelIndex.ClassifyName = classifyName
+	yongyiExcelIndex.ClassifySort = classifySort
+	yongyiExcelIndex.Frequency = frequency
+	yongyiExcelIndex.Unit = unit
+	yongyiExcelIndex.IndexName = namePrefix
+	yongyiExcelIndex.IndexCode = namePrefixPingin
+	yongyiExcelIndex.Sort = 0
+	yongyiExcelIndex.ExcelDataMap = make(map[string]string)
+	indexList = append(indexList, yongyiExcelIndex)
+	for i, row := range rows {
+		if i == 0 {
+			continue
+		}
+		if len(row) < 2 {
+			continue
+		}
+		dateArr := re.FindAllString(row[0], -1)
+		year, err := strconv.Atoi(dateArr[0])
+		if err != nil {
+			continue
+		}
+		week, err := strconv.Atoi(dateArr[1])
+		if err != nil {
+			continue
+		}
+		if !isValueValid(row[1]) {
+			continue
+		}
+		date := getSundayOfWeek(year, week)
+		yongyiExcelIndex.ExcelDataMap[date] = row[1]
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly43 %s 更新指标数量:%d", sheetName, len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly44 重要部位冻品进口
+func HandleYongyiExcelWeekly44(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly44 %s ErrMsg: %s", sheetName, err.Error()))
+		}
+	}()
+	cols, err := f.GetCols(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetCols err: %s", err.Error())
+		return
+	}
+
+	classifyName, classifySort, frequency, _, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+
+	sort := 0
+	re := regexp.MustCompile(`\d+`)
+	dateIndexMap := make(map[int]string)
+	for i, col := range cols {
+		if i == 0 {
+			for j, cell := range col {
+				dateArr := re.FindAllString(cell, -1)
+				if len(dateArr) != 2 {
+					continue
+				}
+				year, err := strconv.Atoi(dateArr[0])
+				if err != nil {
+					continue
+				}
+				month, err := strconv.Atoi(dateArr[1])
+				if err != nil {
+					continue
+				}
+				dateIndexMap[j] = LastDayOfMonth(year, time.Month(month))
+			}
+		} else {
+			if len(col) < 2 {
+				continue
+			}
+			if col[1] == "" {
+				continue
+			}
+			indexName := fmt.Sprintf("%s/%s", namePrefix, col[1])
+			yongyiExcelIndex := new(models.YongyiExcelIndex)
+			yongyiExcelIndex.ClassifyName = classifyName
+			yongyiExcelIndex.ClassifySort = classifySort
+			yongyiExcelIndex.Frequency = frequency
+			yongyiExcelIndex.IndexName = indexName
+			yongyiExcelIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(col[1])
+			yongyiExcelIndex.Sort = sort
+			yongyiExcelIndex.ExcelDataMap = make(map[string]string)
+			if col[1] == "柜数" {
+				yongyiExcelIndex.Unit = "个"
+			} else if col[1] == "合计" {
+				yongyiExcelIndex.Unit = "kg"
+			} else {
+				continue
+			}
+			for j, cell := range col {
+				if j == 0 {
+					continue
+				}
+				cell = strings.ReplaceAll(cell, ",", "")
+				if !isValueValid(cell) {
+					continue
+				}
+				yongyiExcelIndex.ExcelDataMap[dateIndexMap[j]] = cell
+			}
+			indexList = append(indexList, yongyiExcelIndex)
+			sort++
+		}
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly44 %s 更新指标数量:%d", sheetName, len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly45 各存栏规模
+func HandleYongyiExcelWeekly45(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly45 %s ErrMsg: %s", sheetName, err.Error()))
+		}
+	}()
+	rows, err := f.GetRows(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetRows err: %s", err.Error())
+		return
+	}
+
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+
+	sort := 0
+	re := regexp.MustCompile(`\d+`)
+	indexNamePart3 := make([]string, 0)
+	indexInfoMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		if i == 0 {
+			continue
+		}
+		if i == 1 {
+			for j, cell := range row {
+				if j >= 2 {
+					indexNamePart3 = append(indexNamePart3, cell)
+				} else {
+					indexNamePart3 = append(indexNamePart3, "")
+				}
+			}
+		}
+		if len(row) == 0 {
+			break
+		}
+		if i > 1 && len(row) > 2 {
+			var date string
+			for j, cell := range row {
+				if j == 0 {
+					dateArr := re.FindAllString(cell, -1)
+					if len(dateArr) != 2 {
+						break
+					}
+					year, err := strconv.Atoi(dateArr[0])
+					if err != nil {
+						break
+					}
+					month, err := strconv.Atoi(dateArr[1])
+					if err != nil {
+						break
+					}
+					date = LastDayOfMonth(year, time.Month(month))
+				}
+				if !isValueValid(cell) {
+					continue
+				}
+				indexName := fmt.Sprintf("%s/%s/%s", namePrefix, row[1], indexNamePart3[j])
+				if indexInfo, ok := indexInfoMap[indexName]; !ok {
+					tmpYongyiIndex := new(models.YongyiExcelIndex)
+					tmpYongyiIndex.ClassifyName = classifyName
+					tmpYongyiIndex.ClassifySort = classifySort
+					tmpYongyiIndex.Frequency = frequency
+					tmpYongyiIndex.Unit = unit
+					tmpYongyiIndex.IndexName = indexName
+					tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(row[1]+indexNamePart3[j])
+					tmpYongyiIndex.Sort = sort
+					tmpYongyiIndex.ExcelDataMap = make(map[string]string)
+					newCell := strings.ReplaceAll(cell, "%", "")
+					tmpYongyiIndex.ExcelDataMap[date] = newCell
+					indexInfoMap[indexName] = tmpYongyiIndex
+					indexList = append(indexList, tmpYongyiIndex)
+					sort++
+				} else {
+					newCell := strings.ReplaceAll(cell, "%", "")
+					indexInfo.ExcelDataMap[date] = newCell
+				}
+			}
+		}
+	}
+	utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly45 %s 更新指标数量:%d", sheetName, len(indexList)))
+	return
+}
+
+// HandleYongyiExcelWeekly46 进口肉
+func HandleYongyiExcelWeekly46(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly46 %s ErrMsg: %s", sheetName, err.Error()))
+		}
+	}()
+	cols, err := f.GetCols(sheetName)
+	if err != nil {
+		err = fmt.Errorf("f GetCols err: %s", err.Error())
+		return
+	}
+
+	classifyName, classifySort, frequency, _, _, namePrefixPingin := GetBaseInfo(sheetName)
+
+	sort := 0
+	var indexName string
+	re := regexp.MustCompile(`\d+`)
+	indexInfoMap := make(map[string]*models.YongyiExcelIndex)
+	for _, col := range cols {
+		if indexName == "" {
+			indexName = col[1]
+			continue
+		}
+		if len(col) == 0 {
+			indexName = ""
+			continue
+		}
+		if indexName != "" && strings.Contains(indexName, "猪肉进口量") {
+			indexName = "猪肉进口量"
+			var year int
+			if strings.Contains(col[2], "年") {
+				year, err = strconv.Atoi(re.FindString(col[2]))
+				if err != nil {
+					continue
+				}
+			}
+			for j, cell := range col {
+				if !isValueValid(cell) {
+					continue
+				}
+				monthArr := strings.Split(cols[0][j], "-")
+				var month int
+				switch len(monthArr[1]) {
+				case 2:
+					month, err = strconv.Atoi(re.FindString(monthArr[1]))
+					if err != nil {
+						continue
+					}
+				case 1:
+					month, err = strconv.Atoi(re.FindString(monthArr[0]))
+					if err != nil {
+						continue
+					}
+				}
+				date := LastDayOfMonth(year, time.Month(month))
+				if date == "" {
+					continue
+				}
+				if indexInfo, ok := indexInfoMap[indexName]; !ok {
+					tmpYongyiIndex := new(models.YongyiExcelIndex)
+					tmpYongyiIndex.ClassifyName = classifyName
+					tmpYongyiIndex.ClassifySort = classifySort
+					tmpYongyiIndex.Frequency = frequency
+					tmpYongyiIndex.Unit = "万吨"
+					tmpYongyiIndex.IndexName = indexName
+					tmpYongyiIndex.IndexCode = namePrefixPingin + utils.GetFirstPingYin(indexName)
+					tmpYongyiIndex.Sort = sort
+					tmpYongyiIndex.ExcelDataMap = make(map[string]string)
+					tmpYongyiIndex.ExcelDataMap[date] = cell
+					indexInfoMap[indexName] = tmpYongyiIndex
+					indexList = append(indexList, tmpYongyiIndex)
+					sort++
+				} else {
+					indexInfo.ExcelDataMap[date] = cell
+				}
+			}
+		} else if indexName != "" && strings.Contains(indexName, "猪肉及杂碎进口量") {
+			// preName := "猪肉及杂碎进口量"
+
+		}
+	}
+	return
+}