xyxie 1 жил өмнө
parent
commit
46915ebb0b

+ 9 - 0
services/base.go

@@ -49,3 +49,12 @@ func HttpPost(url, postData string, params ...string) ([]byte, error) {
 	}
 	return b, err
 }
+
+func HttpGet(url string) ([]byte, error) {
+	res, err := http.Get(url)
+	if err != nil {
+		return nil, err
+	}
+	defer res.Body.Close()
+	return ioutil.ReadAll(res.Body)
+}

+ 315 - 24
services/base_from_yongyi.go

@@ -4,17 +4,16 @@ import (
 	"context"
 	"encoding/json"
 	"eta/eta_data_analysis/models"
-	"eta/eta_data_analysis/services/base_from_yongyi"
+	"eta/eta_data_analysis/services/base_from_yongyi_v2"
 	"eta/eta_data_analysis/utils"
 	"fmt"
 	"github.com/patrickmn/go-cache"
-	"github.com/rdlucklib/rdluck_tools/http"
-	"github.com/tealeg/xlsx/v3"
+	"github.com/xuri/excelize/v2"
 	"io/fs"
 	"os"
+	"path"
 	"path/filepath"
 	"strings"
-	"syscall"
 	"time"
 )
 
@@ -43,7 +42,7 @@ import (
 */
 func HandleYongyiExcelDaily(filePath string) (err error) {
 	//filePath := fmt.Sprintf("%s/%s_day.xlsx", utils.YongyiFilePath, time.Now().Format(utils.FormatDate))
-	xlFile, err := xlsx.OpenFile(filePath)
+	/*xlFile, err := xlsx.OpenFile(filePath)
 	if err != nil {
 		err = fmt.Errorf("打开文件失败, Err: %s", err)
 		utils.FileLog.Info(fmt.Sprintf("打开文件:%s 失败, Err: %s", filePath, err))
@@ -88,14 +87,14 @@ func HandleYongyiExcelDaily(filePath string) (err error) {
 				continue
 			}
 		}
-	}
+	}*/
 
 	return
 }
 
 func HandleYongyiExcelWeekly(filePath string) (err error) {
 	// filePath := fmt.Sprintf("%s/%s_week.xlsx", utils.YongyiFilePath, time.Now().Format(utils.FormatDate))
-	xlFile, err := xlsx.OpenFile(filePath)
+	/*xlFile, err := xlsx.OpenFile(filePath)
 	if err != nil {
 		err = fmt.Errorf("打开文件失败, Err: %s", err)
 		utils.FileLog.Info(fmt.Sprintf("打开文件:%s 失败, Err: %s", filePath, err))
@@ -152,7 +151,7 @@ func HandleYongyiExcelWeekly(filePath string) (err error) {
 				continue
 			}
 		}
-	}
+	}*/
 	return
 }
 
@@ -179,7 +178,7 @@ func YongyiDownloadDaily(cont context.Context) (err error) {
 	}
 	url := fmt.Sprintf("%s?dayFlag=1&weekFlag=0", YongyiDownloadUrl)
 	fmt.Println("YongyiDownload URL:" + url)
-	body, err := http.Get(url)
+	body, err := HttpGet(url)
 	if err != nil {
 		utils.FileLog.Info("YongyiDownload Err:" + err.Error())
 		return
@@ -193,10 +192,6 @@ func YongyiDownloadDaily(cont context.Context) (err error) {
 // @datetime 2023-12-19 09:39:05
 func YongyiDownloadWeekyly(cont context.Context) (err error) {
 	weekFlag := 1
-	week := time.Now().Weekday()
-	if week != time.Thursday { //每周四,处理周度文件
-		return
-	}
 	// 判断文件是否已经下载,如果已经下载到则无需重复下载
 	var cacheClient *cache.Cache
 	if cacheClient == nil {
@@ -206,16 +201,41 @@ func YongyiDownloadWeekyly(cont context.Context) (err error) {
 	// 获取本周的时间范围, 即当前时间
 	endDate := time.Now().Format(utils.FormatDatePoint)
 	startDate := time.Now().AddDate(0, 0, -6).Format(utils.FormatDatePoint)
-	path := fmt.Sprintf("%s/%s-%s%s", utils.YongyiFilePath, startDate, endDate, "涌益咨询 周度数据.xlsx")
+	dataFileExsit := false
+	chartFileExist := false
+	path := fmt.Sprintf("%s/%s-%s%s", utils.YongyiFilePath, startDate, endDate, "涌益咨询周度数据.xlsx")
 	fmt.Println("YongyiDownloadWeekyly: " + path)
 	_, ok := cacheClient.Get(path)
 	if ok {
 		utils.FileLog.Info("YongyiDownloadWeekyly: 文件已存在无需再下载")
+		dataFileExsit = true
+	} else {
+		// 从已处理的表格中查询是否已存在,如果已存在,也无需下载
+		_, err = os.Stat(path)
+		if err == nil { //文件或者目录存在
+			dataFileExsit = true
+		}
+	}
+
+	path = fmt.Sprintf("%s/%s-%s%s", utils.YongyiFilePath, startDate, endDate, "周度图表版图.xlsx")
+	fmt.Println("YongyiDownloadWeekyly: " + path)
+	_, ok = cacheClient.Get(path)
+	if ok {
+		utils.FileLog.Info("YongyiDownloadWeekyly: 文件已存在无需再下载")
+		chartFileExist = true
+	} else {
+		// 从已处理的表格中查询是否已存在,如果已存在,也无需下载
+		_, err = os.Stat(path)
+		if err == nil { //文件或者目录存在
+			chartFileExist = true
+		}
+	}
+	if dataFileExsit && chartFileExist {
 		return
 	}
 	url := fmt.Sprintf("%s?dayFlag=0&weekFlag=%d", YongyiDownloadUrl, weekFlag)
 	fmt.Println("YongyiDownload URL:" + url)
-	body, err := http.Get(url)
+	body, err := HttpGet(url)
 	if err != nil {
 		utils.FileLog.Info("YongyiDownload Err:" + err.Error())
 		return
@@ -243,33 +263,75 @@ func ReadWatchYongyiFile(cont context.Context) (err error) {
 		}
 		if !info.IsDir() {
 			fmt.Println("ReadWatchYongyiFile path" + path)
-			fileInfo, err := os.Stat(path)
-			if err != nil {
-				fmt.Println("os.Stat:", err.Error())
+			fileInfo, e := os.Stat(path)
+			if e != nil {
+				fmt.Println("ReadWatchYongyiFile os.Stat:", e.Error())
 			}
 			winFileAttr := fileInfo.Sys().(*syscall.Win32FileAttributeData)
 			modifyTimeStr := utils.SecondToTime(winFileAttr.LastWriteTime.Nanoseconds() / 1e9).Format(utils.FormatDateTime)
 			fmt.Println("ReadWatchYongyiFile modifyTimeStr" + modifyTimeStr)
 			existModifyTime, ok := cacheClient.Get(path)
+			moveFlag := false
 			if ok {
+				// 更新
 				fmt.Println("ReadWatchYongyiFile existModifyTime" + existModifyTime.(string))
 				existModifyTimeStr := existModifyTime.(string)
 				if existModifyTimeStr != modifyTimeStr {
 					if strings.Contains(path, "涌益咨询") && strings.Contains(path, "日度") {
 						time.Sleep(time.Second * 10)
-						err = HandleYongyiExcelDaily(path)
-					} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度") {
+						err = HandleYongyiExcelDailyV2(path)
+						if err == nil {
+							moveFlag = true
+						}
+						// todo 移动文件到新目录下
+					} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度图表版图") {
 						time.Sleep(time.Second * 10)
-						err = HandleYongyiExcelWeekly(path)
+						err = HandleYongyiExcelWeeklyChart(path)
+						if err == nil {
+							moveFlag = true
+						}
+					} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度数据") {
+						time.Sleep(time.Second * 10)
+						err = HandleYongyiExcelWeeklyV2(path)
+						if err == nil {
+							moveFlag = true
+						}
 					}
 				}
 			} else {
+				// 新增
 				if strings.Contains(path, "涌益咨询") && strings.Contains(path, "日度") {
 					time.Sleep(time.Second * 10)
-					err = HandleYongyiExcelDaily(path)
-				} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度") {
+					err = HandleYongyiExcelDailyV2(path)
+					if err == nil {
+						moveFlag = true
+					}
+				} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度图表版图") {
+					time.Sleep(time.Second * 10)
+					err = HandleYongyiExcelWeeklyChart(path)
+					if err == nil {
+						moveFlag = true
+					}
+				} else if strings.Contains(path, "涌益咨询") && strings.Contains(path, "周度数据") {
 					time.Sleep(time.Second * 10)
-					err = HandleYongyiExcelWeekly(path)
+					err = HandleYongyiExcelWeeklyV2(path)
+					if err == nil {
+						moveFlag = true
+					}
+				}
+			}
+			if moveFlag {
+				// 移动文件至已处理目录
+				e = utils.CreateDirIfNotExists(utils.YongyiReadFilePath)
+				if e != nil {
+					//err = fmt.Errorf("CreateDirIfNotExists err: %s", e.Error())
+					fmt.Printf("ReadWatchYongyiFile CreateDirIfNotExists err: %s\n", e.Error())
+				}
+				destPath := filepath.Join(utils.YongyiReadFilePath, info.Name())
+				e = os.Rename(path, destPath)
+				if e != nil {
+					//err = fmt.Errorf("file move err: %s", e.Error())
+					fmt.Printf("ReadWatchYongyiFile file move err: %s\n", e.Error())
 				}
 			}
 			cacheClient.Delete(path)
@@ -279,3 +341,232 @@ func ReadWatchYongyiFile(cont context.Context) (err error) {
 	})
 	return
 }
+
+var YongyiDailyHandlers = map[string]func(f *excelize.File, sheetName string) ([]*models.YongyiExcelIndex, error){
+	"出栏价":       base_from_yongyi_v2.HandleYongyiExcelDaily1,
+	"标肥价差":      base_from_yongyi_v2.HandleYongyiExcelDaily2,
+	"价格+宰量":     base_from_yongyi_v2.HandleYongyiExcelDaily3,
+	"屠宰企业日度屠宰量": base_from_yongyi_v2.HandleYongyiExcelDaily4,
+}
+
+var YongyiWeeklyHandlers = map[string]func(f *excelize.File, sheetName string) ([]*models.YongyiExcelIndex, error){
+	"周度-商品猪出栏价":            base_from_yongyi_v2.HandleYongyiExcelWeekly1,
+	"周度-体重":                base_from_yongyi_v2.HandleYongyiExcelWeekly2,
+	"周度-屠宰厂宰前活猪重":          base_from_yongyi_v2.HandleYongyiExcelWeekly3,
+	"周度-各体重段价差":            base_from_yongyi_v2.HandleYongyiExcelWeekly4,
+	"周度-50公斤二元母猪价格":        base_from_yongyi_v2.HandleYongyiExcelWeekly5,
+	"周度-规模场15公斤仔猪出栏价":      base_from_yongyi_v2.HandleYongyiExcelWeekly5,
+	"周度-宰后结算价":             base_from_yongyi_v2.HandleYongyiExcelWeekly5,
+	"周度-冻品库存":              base_from_yongyi_v2.HandleYongyiExcelWeekly5,
+	"周度-猪肉价(前三等级白条均价)":     base_from_yongyi_v2.HandleYongyiExcelWeekly5,
+	"周度-冻品库存多样本":           base_from_yongyi_v2.HandleYongyiExcelWeekly6,
+	"月度出栏完成率":              base_from_yongyi_v2.HandleYongyiExcelWeekly6,
+	"月度计划出栏量":              base_from_yongyi_v2.HandleYongyiExcelWeekly7,
+	"月度-能繁母猪存栏(2020年2月新增)": base_from_yongyi_v2.HandleYongyiExcelWeekly8,
+	"月度-小猪存栏(2020年5月新增)":   base_from_yongyi_v2.HandleYongyiExcelWeekly9,
+	"月度-中猪存栏(2020年5月新增)":   base_from_yongyi_v2.HandleYongyiExcelWeekly9,
+	"月度-大猪存栏(2020年5月新增)":   base_from_yongyi_v2.HandleYongyiExcelWeekly9,
+	"月度-商品猪出栏量":            base_from_yongyi_v2.HandleYongyiExcelWeekly10,
+	"历史猪价":                 base_from_yongyi_v2.HandleYongyiExcelWeekly12,
+	"二育成本":                 base_from_yongyi_v2.HandleYongyiExcelWeekly13,
+	"二育销量":                 base_from_yongyi_v2.HandleYongyiExcelWeekly14,
+	"育肥栏舍利用率":              base_from_yongyi_v2.HandleYongyiExcelWeekly15,
+	"周度-养殖利润最新":            base_from_yongyi_v2.HandleYongyiExcelWeekly16,
+	"周度-当期、预期成本":           base_from_yongyi_v2.HandleYongyiExcelWeekly17,
+	"育肥全价料出厂价":             base_from_yongyi_v2.HandleYongyiExcelWeekly18,
+	"周度-成本计算附件":            base_from_yongyi_v2.HandleYongyiExcelWeekly19,
+	"周度-毛白价差":              base_from_yongyi_v2.HandleYongyiExcelWeekly20,
+	"仔猪、母猪":                base_from_yongyi_v2.HandleYongyiExcelWeekly21,
+	"周度-河南屠宰白条成本":          base_from_yongyi_v2.HandleYongyiExcelWeekly22,
+	"周度-淘汰母猪价格":            base_from_yongyi_v2.HandleYongyiExcelWeekly23, //todo 少两个指标,云南和贵州,数据都不符合规范
+	"鲜销率":                  base_from_yongyi_v2.HandleYongyiExcelWeekly24, //todo 等待解析(正月初六-二月初四)2022.2.6-3.6
+	"周度-猪肉产品价格":            base_from_yongyi_v2.HandleYongyiExcelWeekly25,
+	"周度-屠宰企业日度屠宰量":         base_from_yongyi_v2.HandleYongyiExcelWeekly26,
+	"周度-屠宰新2022.10.28":     base_from_yongyi_v2.HandleYongyiExcelWeekly27,
+	"月度-淘汰母猪屠宰厂宰杀量":        base_from_yongyi_v2.HandleYongyiExcelWeekly28,
+	"月度-猪料销量":              base_from_yongyi_v2.HandleYongyiExcelWeekly29,
+	"月度-屠宰企业开工率":           base_from_yongyi_v2.HandleYongyiExcelWeekly30,
+	"月度-屠宰厂公母比例":           base_from_yongyi_v2.HandleYongyiExcelWeekly31,
+	"月度-生产指标(2021.5.7新增)":  base_from_yongyi_v2.HandleYongyiExcelWeekly32,
+	"月度-生产指标2":             base_from_yongyi_v2.HandleYongyiExcelWeekly33,
+	"月度-二元三元能繁比例":          base_from_yongyi_v2.HandleYongyiExcelWeekly34, //todo 2019年1-6月
+	"月度-能繁母猪存栏量":           base_from_yongyi_v2.HandleYongyiExcelWeekly35,
+	"月度-原种场二元后备母猪销量及出栏日龄":  base_from_yongyi_v2.HandleYongyiExcelWeekly11,
+}
+var YongyiWeeklyChartHandlers = map[string]func(f *excelize.File, sheetName string) ([]*models.YongyiExcelIndex, error){
+	"涌益样本测算": base_from_yongyi_v2.HandleYongyiExcelWeekly36,
+}
+
+func HandleYongyiExcelDailyV2(filePath string) (err error) {
+	//filePath = fmt.Sprintf("/Users/xiexiaoyuan/Downloads/2024年2月2日涌益咨询日度数据.xlsx")
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelDailyV2 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelDailyV2 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	_ = path.Base(filePath)
+	f, e := excelize.OpenFile(filePath)
+	if e != nil {
+		err = fmt.Errorf("open file err: %s", e.Error())
+		return
+	}
+	defer func() {
+		if e = f.Close(); e != nil {
+			err = fmt.Errorf("f close err: %s", e.Error())
+		}
+	}()
+	terminalCode := utils.TerminalCode
+	for _, sheetName := range f.GetSheetMap() {
+		// 检查是否有对应的处理函数
+		handler, ok := YongyiDailyHandlers[sheetName]
+		if !ok {
+			continue // 如果没有,则跳过当前sheet
+		}
+
+		// 调用处理函数,并处理可能发生的错误
+		indexList, e := handler(f, sheetName)
+		if e != nil {
+			utils.FileLog.Info(fmt.Sprintf("解析sheet:%s 失败, Err: %s", sheetName, err))
+			continue
+		}
+		if len(indexList) > 0 {
+			params := make(map[string]interface{})
+			params["List"] = indexList
+			params["TerminalCode"] = terminalCode
+			result, e := PostEdbLib(params, utils.LIB_ROUTE_YONGYI_HANDLE)
+			if e != nil {
+				b, _ := json.Marshal(params)
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s PostEdbLib err: %s, params: %s", sheetName, e.Error(), string(b)))
+				continue
+			}
+			resp := new(models.BaseEdbLibResponse)
+			if e := json.Unmarshal(result, &resp); e != nil {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s json.Unmarshal err: %s", sheetName, e))
+				continue
+			}
+			if resp.Ret != 200 {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s Msg: %s, ErrMsg: %s", sheetName, resp.Msg, resp.ErrMsg))
+				continue
+			}
+		}
+	}
+	return
+}
+
+func HandleYongyiExcelWeeklyV2(filePath string) (err error) {
+	//filePath = fmt.Sprintf("/Users/xiexiaoyuan/Downloads/涌益生猪项目数据库-3/2024.1.26-2024.2.1涌益咨询周度数据.xlsx")
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeeklyV2 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeeklyV2 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	_ = path.Base(filePath)
+	f, e := excelize.OpenFile(filePath)
+	if e != nil {
+		err = fmt.Errorf("open file err: %s", e.Error())
+		return
+	}
+	defer func() {
+		if e = f.Close(); e != nil {
+			err = fmt.Errorf("f close err: %s", e.Error())
+		}
+	}()
+	terminalCode := utils.TerminalCode
+	for _, sheetName := range f.GetSheetMap() {
+		// 检查是否有对应的处理函数
+		handler, ok := YongyiWeeklyHandlers[sheetName]
+		if !ok {
+			continue // 如果没有,则跳过当前sheet
+		}
+
+		// 调用处理函数,并处理可能发生的错误
+		indexList, e := handler(f, sheetName)
+		if e != nil {
+			utils.FileLog.Info(fmt.Sprintf("解析sheet:%s 失败, Err: %s", sheetName, err))
+			continue
+		}
+		if len(indexList) > 0 {
+			params := make(map[string]interface{})
+			params["List"] = indexList
+			params["TerminalCode"] = terminalCode
+			result, e := PostEdbLib(params, utils.LIB_ROUTE_YONGYI_HANDLE)
+			if e != nil {
+				b, _ := json.Marshal(params)
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s PostEdbLib err: %s, params: %s", sheetName, e.Error(), string(b)))
+				continue
+			}
+			resp := new(models.BaseEdbLibResponse)
+			if e := json.Unmarshal(result, &resp); e != nil {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s json.Unmarshal err: %s", sheetName, e))
+				continue
+			}
+			if resp.Ret != 200 {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s Msg: %s, ErrMsg: %s", sheetName, resp.Msg, resp.ErrMsg))
+				continue
+			}
+		}
+	}
+	return
+}
+
+func HandleYongyiExcelWeeklyChart(filePath string) (err error) {
+	//filePath = fmt.Sprintf("/Users/xiexiaoyuan/Downloads/涌益生猪项目数据库-3/2024.1.26-2024.2.1周度图表版图.xlsx")
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeeklyChart ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeeklyChart ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	_ = path.Base(filePath)
+	f, e := excelize.OpenFile(filePath)
+	if e != nil {
+		err = fmt.Errorf("open file err: %s", e.Error())
+		return
+	}
+	defer func() {
+		if e = f.Close(); e != nil {
+			err = fmt.Errorf("f close err: %s", e.Error())
+		}
+	}()
+	terminalCode := utils.TerminalCode
+	for _, sheetName := range f.GetSheetMap() {
+		// 检查是否有对应的处理函数
+		handler, ok := YongyiWeeklyChartHandlers[sheetName]
+		if !ok {
+			continue // 如果没有,则跳过当前sheet
+		}
+
+		// 调用处理函数,并处理可能发生的错误
+		indexList, e := handler(f, sheetName)
+		if e != nil {
+			utils.FileLog.Info(fmt.Sprintf("解析sheet:%s 失败, Err: %s", sheetName, err))
+			continue
+		}
+		if len(indexList) > 0 {
+			params := make(map[string]interface{})
+			params["List"] = indexList
+			params["TerminalCode"] = terminalCode
+			result, e := PostEdbLib(params, utils.LIB_ROUTE_YONGYI_HANDLE)
+			if e != nil {
+				b, _ := json.Marshal(params)
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s PostEdbLib err: %s, params: %s", sheetName, e.Error(), string(b)))
+				continue
+			}
+			resp := new(models.BaseEdbLibResponse)
+			if e := json.Unmarshal(result, &resp); e != nil {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s json.Unmarshal err: %s", sheetName, e))
+				continue
+			}
+			if resp.Ret != 200 {
+				utils.FileLog.Info(fmt.Sprintf("sheet :%s Msg: %s, ErrMsg: %s", sheetName, resp.Msg, resp.ErrMsg))
+				continue
+			}
+		}
+	}
+	return
+}

+ 240 - 0
services/base_from_yongyi_v2/base.go

@@ -0,0 +1,240 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strings"
+)
+
+func getClassifySortMap() map[string]int {
+	classifyMap := map[string]int{
+		"日度-商品猪出栏价":            1,
+		"日度-商品猪标肥价差":           2,
+		"日度-商品猪全国均价和宰量":        3,
+		"日度-屠宰企业屠宰量":           4,
+		"历史猪价":                 5,
+		"周度-商品猪出栏价":            6,
+		"周度-体重":                7,
+		"周度-屠宰厂宰前活猪重":          8,
+		"周度-各体重段价差":            9,
+		"二育成本":                 10,
+		"二育销量":                 11,
+		"育肥栏舍利用率":              12,
+		"周度-养殖利润最新":            13,
+		"周度-当期、预期成本":           14,
+		"周度-育肥全价料出厂价":          15,
+		"周度-成本计算附件":            16,
+		"周度-毛白价差":              17,
+		"周度-50公斤二元母猪价格":        18,
+		"周度-规模场15公斤仔猪出栏价":      19,
+		"仔猪、母猪":                20,
+		"周度-河南屠宰白条成本":          21,
+		"周度-淘汰母猪价格":            22,
+		"周度-宰后结算价":             23,
+		"周度-冻品库存":              24,
+		"周度-冻品库存多样本":           25,
+		"周度-鲜销率":               26,
+		"周度-猪肉价(前三等级白条均价)":     27,
+		"周度-猪肉产品价格":            28,
+		"周度-屠宰企业日度屠宰量":         29,
+		"周度-屠宰新2022.10.28":     30,
+		"月度出栏完成率":              31,
+		"月度计划出栏量":              32,
+		"月度-淘汰母猪屠宰厂宰杀量":        33,
+		"月度-猪料销量":              34,
+		"月度-屠宰企业开工率":           35,
+		"月度-屠宰厂公母比例":           36,
+		"月度-生产指标(2021.5.7新增)":  37,
+		"月度-生产指标2":             38,
+		"月度-二元三元能繁比例":          39,
+		"月度-能繁母猪存栏(2020年2月新增)": 40,
+		"月度-小猪存栏(2020年5月新增)":   41,
+		"月度-中猪存栏(2020年5月新增)":   42,
+		"月度-大猪存栏(2020年5月新增)":   43,
+		"月度-商品猪出栏量":            44,
+		"月度-能繁母猪存栏量":           45,
+		"月度-原种场二元后备母猪销量及出栏日龄":  46,
+		"涌益样本测算":               47,
+	}
+	return classifyMap
+}
+
+var YongyiWeeklySheetMap5 map[string]*models.YongyiSheet
+var YongyiWeeklySheetMap6 map[string]*models.YongyiSheet
+var YongyiWeeklySheetMap9 map[string]*models.YongyiSheet
+
+var YongyiBaseInfoMap map[string]*models.YongyiSheet
+
+func init() {
+	YongyiWeeklySheetMap5 = map[string]*models.YongyiSheet{
+		"周度-50公斤二元母猪价格":    {"50公斤二元母猪价格", "周度-50公斤二元母猪价格", "周度", "元/头"},
+		"周度-规模场15公斤仔猪出栏价":  {"规模场15公斤仔猪出栏价", "周度-规模场15公斤仔猪出栏价", "周度", "元/头"},
+		"周度-宰后结算价":         {"宰后结算价", "周度-宰后结算价", "周度", "元/公斤"},
+		"周度-冻品库存":          {"冻品库存", "周度-冻品库存", "周度", "%"},
+		"周度-猪肉价(前三等级白条均价)": {"前三等级白条均价", "周度-猪肉价(前三等级白条均价)", "周度", "元/公斤"},
+	}
+	YongyiWeeklySheetMap6 = map[string]*models.YongyiSheet{
+		"周度-冻品库存多样本": {"冻品库存多样本", "周度-冻品库存多样本", "周度", "%"},
+		"月度出栏完成率":    {"出栏完成率", "月度出栏完成率", "旬度", "%"},
+	}
+	YongyiWeeklySheetMap9 = map[string]*models.YongyiSheet{
+		"月度-小猪存栏(2020年5月新增)": {"50kg以下小猪存栏量", "月度-小猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-中猪存栏(2020年5月新增)": {"中猪存栏量", "月度-中猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-大猪存栏(2020年5月新增)": {"大猪存栏量", "月度-大猪存栏(2020年5月新增)", "月度", "头"},
+	}
+
+	YongyiBaseInfoMap = map[string]*models.YongyiSheet{
+		"出栏价":                  {"商品猪出栏价", "日度-商品猪出栏价", "日度", "元/公斤"},
+		"标肥价差":                 {"", "日度-商品猪标肥价差", "日度", "元/公斤"},
+		"价格+宰量":                {"", "日度-商品猪全国均价和宰量", "日度", "元/公斤"},
+		"屠宰企业日度屠宰量":            {"商品猪日屠宰量", "日度-屠宰企业屠宰量", "日度", "头"},
+		"周度-商品猪出栏价":            {"商品猪出栏价", "周度-商品猪出栏价", "周度", "元/公斤"},
+		"周度-体重":                {"商品猪出栏体重", "周度-体重", "周度", "公斤"},
+		"周度-屠宰厂宰前活猪重":          {"商品猪宰前活猪重", "周度-屠宰厂宰前活猪重", "周度", "公斤"},
+		"周度-各体重段价差":            {"", "周度-各体重段价差", "周度", "元/斤"},
+		"周度-50公斤二元母猪价格":        {"50公斤二元母猪价格", "周度-50公斤二元母猪价格", "周度", "元/头"},
+		"周度-规模场15公斤仔猪出栏价":      {"规模场15公斤仔猪出栏价", "周度-规模场15公斤仔猪出栏价", "周度", "元/头"},
+		"周度-宰后结算价":             {"宰后结算价", "周度-宰后结算价", "周度", "元/公斤"},
+		"周度-冻品库存":              {"冻品库存", "周度-冻品库存", "周度", "%"},
+		"周度-冻品库存多样本":           {"冻品库存多样本", "周度-冻品库存多样本", "周度", "%"},
+		"周度-猪肉价(前三等级白条均价)":     {"前三等级白条均价", "周度-猪肉价(前三等级白条均价)", "周度", "元/公斤"},
+		"月度出栏完成率":              {"出栏完成率", "月度出栏完成率", "旬度", "%"},
+		"月度计划出栏量":              {"月度计划出栏量环比", "月度计划出栏量", "月度", "%"},
+		"月度-能繁母猪存栏(2020年2月新增)": {"能繁母猪存栏量", "月度-能繁母猪存栏(2020年2月新增)", "月度", "头"},
+		"月度-小猪存栏(2020年5月新增)":   {"50kg以下小猪存栏量", "月度-小猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-中猪存栏(2020年5月新增)":   {"中猪存栏量", "月度-中猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-大猪存栏(2020年5月新增)":   {"大猪存栏量", "月度-大猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-商品猪出栏量":            {"商品猪出栏量", "月度-商品猪出栏量", "月度", "头"},
+		"历史猪价":                 {"历史猪价", "历史猪价", "月度", "元/公斤"},
+		"二育成本":                 {"", "二育成本", "周度", "kg"}, //单位有四种kg、无, 元/kg, 元
+		"二育销量":                 {"二育销量", "二育销量", "周度", "%"},
+		"育肥栏舍利用率":              {"育肥栏舍利用率", "育肥栏舍利用率", "旬度", "%"},
+		"周度-养殖利润最新":            {"出栏肥猪利润", "周度-养殖利润最新", "周度", "元/头"},
+		"周度-当期、预期成本":           {"", "周度-当期、预期成本", "周度", "元/kg"},
+		"育肥全价料出厂价":             {"育肥全价料出厂均价参考", "育肥全价料出厂价", "周度", "元/吨"},
+		"周度-成本计算附件":            {"", "周度-成本计算附件", "周度", "元/头"}, //多个单位:元/头,%,kg,元
+		"周度-毛白价差":              {"毛白价差", "周度-毛白价差", "周度", "元/公斤"},
+		"仔猪、母猪":                {"仔猪价", "仔猪、母猪", "周度", "元/头"},             //多个前缀,仔猪价,二元母猪价
+		"周度-河南屠宰白条成本":          {"河南屠宰白条成本", "周度-河南屠宰白条成本", "周度", "元/kg"}, //多个单位:kg,元/kg,元/头
+		"周度-淘汰母猪价格":            {"淘汰母猪价格", "周度-淘汰母猪价格", "周度", "元/斤"},
+		"鲜销率":                  {"鲜销率", "鲜销率", "周度", "%"},
+		"周度-猪肉产品价格":            {"猪肉产品价格", "周度-猪肉产品价格", "周度", "元/公斤"},
+		"周度-屠宰企业日度屠宰量":         {"屠宰企业日度屠宰量", "周度-屠宰企业日度屠宰量", "周度", "头"},
+		"周度-屠宰新2022.10.28":     {"不同规模屠宰厂宰杀量", "周度-屠宰新2022.10.28", "周度", "头"},
+		"月度-淘汰母猪屠宰厂宰杀量":        {"淘汰母猪屠宰厂宰杀量", "月度-淘汰母猪屠宰厂宰杀量", "月度", "头"},
+		"月度-猪料销量":              {"饲料销量(环比)", "月度-猪料销量", "月度", "头"}, //todo 单位有问题
+		"月度-屠宰企业开工率":           {"", "月度-屠宰企业开工率", "月度", "%"},
+		"月度-屠宰厂公母比例":           {"屠宰厂", "月度-屠宰厂公母比例", "月度", "头"},           //多个单位:头,%
+		"月度-生产指标(2021.5.7新增)":  {"生产指标", "月度-生产指标(2021.5.7新增)", "月度", "头"}, //多个单位:头,%
+		"月度-生产指标2":             {"生产指标", "月度-生产指标2", "月度", "头"},            //多个单位:头,%
+		"月度-二元三元能繁比例":          {"能繁母猪存栏量", "月度-二元三元能繁比例", "月度", "%"},      //多个单位:头,%
+		"月度-能繁母猪存栏量":           {"能繁母猪存栏量", "月度-能繁母猪存栏量", "月度", "头"},
+		"月度-原种场二元后备母猪销量及出栏日龄":  {"原种场二元后备母猪销量及出栏日龄", "月度-原种场二元后备母猪销量及出栏日龄", "月度", "头"},
+		"涌益样本测算":               {"涌益样本测算", "涌益样本测算", "月度", "窝"}, //多个单位:头,%,窝,公斤,元/公斤
+	}
+}
+
+func GetBaseInfo(sheetName string) (classifyName string, classifySort int, frequency string, unit string, namePrefix string, namePrefixPingin string) {
+	// 获取指标分类
+	info, ok := YongyiBaseInfoMap[sheetName]
+	if !ok {
+		return
+	}
+	classifyName = info.ClassifyName
+	classifyMap := getClassifySortMap()
+	classifySort, _ = classifyMap[classifyName]
+	frequency = info.Frequency
+	unit = info.Unit
+	namePrefix = info.NamePrefix
+	namePrefixPingin = "yyzx" + utils.GetFirstPingYin(namePrefix)
+	return
+}
+
+func GetMergeCells(f *excelize.File, sheet string) (mergeCellMap map[int]map[int]string, err error) {
+	mergedCells, err := f.GetMergeCells(sheet)
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+
+	mergeCellMap = make(map[int]map[int]string)
+	// 遍历所有合并单元格范围
+	for _, cellRange := range mergedCells {
+		fmt.Println("Merged Cell Range:", cellRange)
+		cellVal := cellRange.GetCellValue()
+		// 解析合并单元格范围,例如 "A1:B2"
+		startCell, endCell := cellRange.GetStartAxis(), cellRange.GetEndAxis()
+		if err != nil {
+			fmt.Println(err)
+			continue
+		}
+
+		// 解析起始单元格的下标
+		startCol, startRow, err := excelize.CellNameToCoordinates(startCell)
+		if err != nil {
+			fmt.Println(err)
+			continue
+		}
+
+		// 解析结束单元格的下标
+		endCol, endRow, err := excelize.CellNameToCoordinates(endCell)
+		if err != nil {
+			fmt.Println(err)
+			continue
+		}
+
+		// 打印合并单元格的起始和结束下标
+		fmt.Printf("Start: Row %d, Col %d\n", startRow, startCol)
+		fmt.Printf("End: Row %d, Col %d\n", endRow, endCol)
+		//把合并的单元格整理成单个单元格,用于计算
+		for i := startRow; i <= endRow; i++ {
+			cellMap, ok := mergeCellMap[i-1]
+			if !ok {
+				cellMap = make(map[int]string)
+			}
+			for j := startCol; j <= endCol; j++ {
+				cellMap[j-1] = strings.TrimSpace(cellVal)
+			}
+			mergeCellMap[i-1] = cellMap
+		}
+	}
+	return
+}
+
+// GetWeekly13IndexName 二育成本指标名称处理
+func GetWeekly13IndexName(name, level string) string {
+	switch {
+	case strings.Contains(name, "二育主流采购体重段"):
+		return fmt.Sprintf("二育主流%s采购体重段", level)
+	case strings.Contains(name, "计划出栏体重"):
+		return fmt.Sprintf("计划%s出栏体重", level)
+	case strings.Contains(name, "料肉比"):
+		return fmt.Sprintf("%s料肉比", level)
+	case strings.Contains(name, "采购成本"):
+		return fmt.Sprintf("%s采购成本", level)
+	case strings.Contains(name, "运费+损耗"):
+		return fmt.Sprintf("%s运费+损耗", level)
+	case strings.Contains(name, "增重饲料成本"):
+		return fmt.Sprintf("%s增重饲料成本", level)
+	case strings.Contains(name, "二育成本"):
+		return fmt.Sprintf("%s二育成本", level)
+	}
+	return name
+}
+
+// GetWeekly13IndexUnit 二育成本指标名称处理
+func GetWeekly13IndexUnit(name string) string {
+	switch {
+	case strings.Contains(name, "二育主流采购体重段") || strings.Contains(name, "计划出栏体重"):
+		return "kg"
+	case strings.Contains(name, "料肉比"):
+		return "无"
+	case strings.Contains(name, "采购成本") || strings.Contains(name, "运费+损耗") || strings.Contains(name, "二育成本"):
+		return "元/kg"
+	case strings.Contains(name, "增重饲料成本"):
+		return "元"
+	}
+	return name
+}

+ 144 - 0
services/base_from_yongyi_v2/chartWeek.go

@@ -0,0 +1,144 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelWeekly36 涌溢样本测算
+func HandleYongyiExcelWeekly36(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly36 涌溢样本测算 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly36 涌溢样本测算 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	nameMap := make(map[int]string)
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 {
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				if strings.Contains(name, "时间") || name == "肉产量(吨)" || name == "肉产量(万吨)" {
+					continue
+				}
+				switch {
+				case strings.Contains(name, "分娩母猪窝数"):
+					unit = "窝"
+				case strings.Contains(name, "窝均健仔数"):
+					unit = "头"
+				case strings.Contains(name, "次月断奶成活率"):
+					unit = "%"
+				case strings.Contains(name, "育肥出栏成活率"):
+					unit = "%"
+				case strings.Contains(name, "出栏量"):
+					name = "出栏量"
+					unit = "头"
+				case strings.Contains(name, "出栏体重(公斤)"):
+					name = "出栏体重"
+					unit = "公斤"
+				case strings.Contains(name, "出肉率"):
+					unit = "%"
+				case strings.Contains(name, "肉产量(公斤)"):
+					name = "肉产量"
+					unit = "公斤"
+				case strings.Contains(name, "猪价(元/公斤)"):
+					name = "猪价"
+					unit = "元/公斤"
+				}
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 548 - 0
services/base_from_yongyi_v2/daily.go

@@ -0,0 +1,548 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelDaily1 日度-商品猪出栏价
+func HandleYongyiExcelDaily1(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelDaily1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelDaily1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+	nameMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		// 首行,表示时间
+		if i == 0 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k > 1 && text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							// 日期
+							v = strings.TrimSpace(v)
+							var dateT time.Time
+							dateT, e = time.ParseInLocation("01-2-06", v, time.Local)
+							if e != nil {
+								utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+								continue
+							}
+							dateMap[j] = dateT.Format(utils.FormatDate)
+						}
+					}
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+				}
+			}
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			province := ""
+			for k, text := range row {
+				text = strings.TrimSpace(text)
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					province = text
+					continue
+				} else if k == 1 {
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				date, ok1 := dateMap[k]
+				if !ok1 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name == "全国均价" {
+					name = "全国"
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s/%s", namePrefix, province, name)
+
+				if name != "规模场" && name != "小散户" && name != "均价" {
+					// 只处理以上三个类型,其余过滤
+					continue
+				}
+
+				if fullIndexName == "商品猪出栏价/全国/均价" {
+					continue
+				}
+
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := fmt.Sprintf("%s%s%s", namePrefixPingin, provincePingyin, namePingin)
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelDaily2 日度-商品猪标肥价差
+func HandleYongyiExcelDaily2(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelDaily2 日度-商品猪标肥价差 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelDaily2 日度-商品猪标肥价差 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, _, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+	nameMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		// 首行,表示时间
+		if i == 0 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							// 日期
+							v = strings.TrimSpace(v)
+							var dateT time.Time
+							dateT, e = time.ParseInLocation("01-2-06", v, time.Local)
+							if e != nil {
+								utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+								continue
+							}
+							dateMap[j] = dateT.Format(utils.FormatDate)
+						}
+					}
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+				}
+			}
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			province := ""
+			for k, text := range row {
+				text = strings.TrimSpace(text)
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					province = text
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				date, ok1 := dateMap[k]
+				if !ok1 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if province == "全国均价" {
+					province = "全国"
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+
+				// 过滤特殊的指标 放到对应的指标名称的下方
+
+				if name != "市场标重猪" && name != "150公斤左右较标猪" && name != "175公斤左右较标猪" {
+					// 只处理以上三个类型,其余过滤
+					continue
+				}
+
+				if name == "150公斤左右较标猪" {
+					name = "150公斤较标猪价差"
+				} else if name == "175公斤左右较标猪" {
+					name = "175公斤较标猪价差"
+				} else if name == "市场标重猪" {
+					name = "市场标重猪价"
+				} else if name == "全国均价" {
+					name = "全国"
+				}
+				fullIndexName := fmt.Sprintf("%s/%s", name, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := fmt.Sprintf("%s%s%s", namePrefixPingin, namePingin, provincePingyin)
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelDaily3 日度-商品猪全国均价和宰量
+func HandleYongyiExcelDaily3(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelDaily3 日度-商品猪全国均价和宰量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelDaily3 日度-商品猪全国均价和宰量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, _, _ := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				text = strings.TrimSpace(text)
+				if text != "" {
+					// 日期
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				text = strings.TrimSpace(text)
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "全国均价" && name != "日屠宰量" {
+					// 只处理以上三个类型,其余过滤
+					continue
+				}
+				var fullIndexNamePingyin string
+				if name == "全国均价" {
+					name = "商品猪出拦价/全国/均价"
+					fullIndexNamePingyin = "yyzxspzcljquanguojj"
+					unit = "元/公斤"
+				} else if name == "日屠宰量" {
+					name = "商品猪日屠宰量/全国"
+					fullIndexNamePingyin = "yyzxspzrtzlquanguo"
+					unit = "头/日"
+				}
+				fullIndexName := name
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelDaily4 日度-屠宰企业屠宰量
+func HandleYongyiExcelDaily4(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelDaily4 日度-屠宰企业屠宰量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelDaily4 日度-屠宰企业屠宰量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+				}
+			}
+		} else { //数据列
+			province := ""
+			for k, text := range row {
+				text = strings.TrimSpace(text)
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					province = text
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				date, ok1 := dateMap[k]
+				if !ok1 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
+				}
+				if province == "合计(单位:头)" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+
+				// 过滤特殊的指标 放到对应的指标名称的下方
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := fmt.Sprintf("%s%s", namePrefixPingin, provincePingyin)
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 1364 - 0
services/base_from_yongyi_v2/week10.go

@@ -0,0 +1,1364 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelWeekly1 周度-商品猪出栏价
+func HandleYongyiExcelWeekly1(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+	provinceMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		// 首行,表示时间
+		if i == 0 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k > 1 && text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+							provinceMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				area, ok1 := areaMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的区域,第%d行,第%d列", i, k)
+					return
+				}
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s/%s", namePrefix, area, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				areaPingin := utils.GetFirstPingYin(area)
+				fullIndexNamePingyin := namePrefixPingin + areaPingin + provincePingyin
+
+				if province == "全  国1" || province == "全  国2" || province == "全国1" || province == "全国2" {
+					province = strings.ReplaceAll(province, " ", "")
+					fullIndexName = fmt.Sprintf("%s/%s", namePrefix, province)
+					fullIndexNamePingyin = namePrefixPingin + provincePingyin
+				}
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly2 周度-体重
+func HandleYongyiExcelWeekly2(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 { // 首行,表示时间
+
+			for k, text := range row {
+				if k > 2 && text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+							provinceMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			name := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 2 {
+					name = text
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				area, ok1 := areaMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的区域,第%d行,第%d列", i, k)
+					return
+				}
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s/%s/%s", namePrefix, area, province, name)
+				provincePingyin := utils.GetFullPingYin(province)
+				areaPingin := utils.GetFirstPingYin(area)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + areaPingin + provincePingyin + namePingin
+
+				if province == "全  国1" || province == "全  国2" || province == "全国1" || province == "全国2" {
+					province = strings.ReplaceAll(province, " ", "")
+					fullIndexName = fmt.Sprintf("%s/%s/%s", namePrefix, province, name)
+					fullIndexNamePingyin = namePrefixPingin + provincePingyin + namePingin
+				}
+				if name == "90kg以下" || name == "150kg以上" {
+					unit = "%"
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly3 周度-屠宰厂宰前活猪重
+func HandleYongyiExcelWeekly3(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i < 2 {
+			continue
+		}
+		if i == 2 { // 首行,表示时间
+
+			for k, text := range row {
+				if k > 2 && text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							provinceMap[j] = v
+						}
+					}
+					provinceMap[k] = text
+				}
+			}
+		} else if i == 3 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 2 {
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if province == "较上周" {
+					continue
+				} else if province == "全国平均" {
+					province = "全国"
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly4 周度-各体重段价差
+func HandleYongyiExcelWeekly4(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, _, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							provinceMap[j] = v
+						}
+					}
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			name := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 2 {
+					name = text
+					if name == "标猪" {
+						name += "价格"
+					} else {
+						name += "猪价格"
+					}
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "标猪价格" && name != "150kg猪价格" && name != "175kg猪价格" && name != "200kg猪价格" {
+					continue
+				}
+
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", name, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly5 周度-50公斤二元母猪价格
+func HandleYongyiExcelWeekly5(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 {
+
+			for k, text := range row {
+				if k > 1 && text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							provinceMap[j] = v
+						}
+					}
+					provinceMap[k] = text
+				}
+			}
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if province == "全  国1" || province == "全  国2" || province == "全国1" || province == "全国2" {
+					province = strings.ReplaceAll(province, " ", "")
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly6 周度-冻品库存多样本
+func HandleYongyiExcelWeekly6(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01/02/2006", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				area, ok2 := areaMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, area)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, area)
+				areaPingyin := utils.GetFirstPingYin(area)
+				if sheetName == "月度出栏完成率" {
+					areaPingyin = utils.GetFullPingYin(area)
+				}
+				fullIndexNamePingyin := namePrefixPingin + areaPingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly7 月度计划出栏量
+func HandleYongyiExcelWeekly7(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+	firstMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 {
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							firstMap[j] = v
+						}
+					}
+					firstMap[k] = text
+				}
+			}
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok1 := provinceMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if province == "本月计划较上月实际销售" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份: %s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				if province == "数量" {
+					first, ok2 := firstMap[k]
+					if !ok2 {
+						continue
+					}
+					fullIndexName = first
+					firstPingyin := utils.GetFirstPingYin(first)
+					fullIndexNamePingyin = "yyzx" + firstPingyin
+					unit = "万头"
+				}
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly8 月度-能繁母猪存栏(2020年2月新增)
+func HandleYongyiExcelWeekly8(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i <= 2 {
+			continue
+		} else if i == 3 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				area, ok1 := areaMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if area == "环比" || area == "日期" || area == "同比" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份: %s \n", i, k, area)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, area)
+				areaPingyin := utils.GetFirstPingYin(area)
+				fullIndexNamePingyin := namePrefixPingin + areaPingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly9 月度-小猪存栏(2020年5月新增)
+func HandleYongyiExcelWeekly9(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i <= 1 {
+			continue
+		} else if i == 2 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				area, ok1 := areaMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if area == "环比" || area == "日期" || area == "同比" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份: %s \n", i, k, area)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, area)
+				areaPingyin := utils.GetFirstPingYin(area)
+				fullIndexNamePingyin := namePrefixPingin + areaPingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly10 月度-商品猪出栏量
+func HandleYongyiExcelWeekly10(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly1 周度-商品猪出栏价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly1 周度-商品猪出栏价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	areaMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				area, ok1 := areaMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if area == "环比" || area == "日期" || area == "同比" || area == "较非瘟前" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份: %s \n", i, k, area)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, area)
+				areaPingyin := utils.GetFirstPingYin(area)
+				fullIndexNamePingyin := namePrefixPingin + areaPingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 1290 - 0
services/base_from_yongyi_v2/week20.go

@@ -0,0 +1,1290 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelWeekly11 月度-原种场二元后备母猪销量及出栏日龄
+func HandleYongyiExcelWeekly11(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly11 月度-原种场二元后备母猪销量及出栏日龄 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly11 月度-原种场二元后备母猪销量及出栏日龄 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k >= 7 && text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k <= 6 {
+					continue
+				} else if k == 7 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok3 := nameMap[k]
+				if !ok3 {
+					err = fmt.Errorf("找不到对应的指标名称,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "数量" {
+					continue
+				}
+				name = "二元母猪销量"
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				areaPingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + areaPingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly12 历史猪价
+func HandleYongyiExcelWeekly12(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly12 月度-历史猪价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly12 月度-历史猪价 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	yearMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 {
+			continue
+		} else if i == 1 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k > 1 && text != "" {
+					text = strings.TrimSpace(text)
+					yearMap[k] = text
+				}
+			}
+		} else { //数据列
+			month := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					// 日期
+					month = strings.TrimSpace(text)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				year, ok := yearMap[k]
+				if !ok {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, "年份不存在"))
+					continue
+				}
+				var dateT time.Time
+				dateT, e = time.ParseInLocation("2006年1月", fmt.Sprintf("%s%s", year, month), time.Local)
+				if e != nil {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+					continue
+				}
+				date := dateT.Format(utils.FormatDate)
+				fmt.Println(date)
+
+				// 处理指标名称
+				fullIndexName := namePrefix
+				fullIndexNamePingyin := namePrefixPingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly13 二育成本
+func HandleYongyiExcelWeekly13(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly13 二育成本 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly13 二育成本 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, _, _, _ := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+	dateMap := make(map[int]string)
+	dateNameMap := make(map[string]string)
+	finalNameMap := make(map[string]string)
+	unitMap := make(map[string]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 || i == 1 {
+			continue
+		} else if i == 2 {
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			weight := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月2日", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					dateMap[i] = date
+					fmt.Println(date)
+					continue
+				} else {
+					if k == 1 {
+						// 体重
+						weight = strings.TrimSpace(text)
+					}
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				name, ok := nameMap[k]
+				if !ok {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取 名称失败 Err:%s", sheetName, i, k, "名称不存在"))
+					continue
+				}
+				dateName := fmt.Sprintf("%s_%s", date, name)
+				dateNameWeight := fmt.Sprintf("%s_%s_%s", date, name, weight)
+				unitMap[dateNameWeight] = GetWeekly13IndexUnit(name)
+				if v, ok1 := dateNameMap[dateName]; ok1 {
+					vf, _ := strconv.ParseFloat(v, 64)
+					wf, _ := strconv.ParseFloat(weight, 64)
+					if vf > wf {
+						dateNameWeightPrev := fmt.Sprintf("%s_%s_%s", date, name, v)
+						finalNameMap[dateNameWeightPrev] = GetWeekly13IndexName(name, "高")
+						finalNameMap[dateNameWeight] = GetWeekly13IndexName(name, "低")
+					} else {
+						finalNameMap[dateNameWeight] = GetWeekly13IndexName(name, "高")
+					}
+				} else {
+					dateNameMap[dateName] = weight
+					//默认是低
+					finalNameMap[dateNameWeight] = GetWeekly13IndexName(name, "低")
+				}
+			}
+		}
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 || i == 1 || i == 2 {
+			continue
+		} else { //数据列
+			date := dateMap[i]
+			weight := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					// 体重
+					weight = strings.TrimSpace(text)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				name, ok := nameMap[k]
+				if !ok {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取 名称失败 Err:%s", sheetName, i, k, "名称不存在"))
+					continue
+				}
+				finalName, ok := finalNameMap[fmt.Sprintf("%s_%s_%s", date, name, weight)]
+				if !ok {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取 名称失败 Err:%s", sheetName, i, k, "最终名称不存在"))
+					continue
+				}
+				unitNew, ok := unitMap[fmt.Sprintf("%s_%s_%s", date, name, weight)]
+				if !ok {
+					utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取 名称失败 Err:%s", sheetName, i, k, "最终名称不存在"))
+					continue
+				}
+				// 处理指标名称
+				fullIndexName := finalName
+				fullIndexNamePingyin := utils.GetFullPingYin(fullIndexName)
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unitNew
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly14 二育销量
+func HandleYongyiExcelWeekly14(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly14 二育销量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly14 二育销量ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i <= 2 {
+			continue
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					if text != "" {
+						text = strings.TrimSpace(text)
+						var dateT time.Time
+						dateSlice := strings.Split(text, "-")
+						if len(dateSlice) <= 1 {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, text))
+							continue
+						}
+						dateT, e = time.ParseInLocation("2006年1月2日", dateSlice[0]+"日", time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+						date = dateT.Format("2006年1月") + dateSlice[1]
+						dateT, e = time.ParseInLocation("2006年1月2日", date, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+						date = dateT.Format(utils.FormatDate)
+						fmt.Println("date: " + date)
+					}
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name := "二育占实际销量(十天)"
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				provincePingyin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly15 育肥栏舍利用率
+func HandleYongyiExcelWeekly15(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly15 育肥栏舍利用率 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly15 育肥栏舍利用率ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+					fmt.Println("date: " + dateMap[k])
+				}
+			}
+		} else { //数据列
+			province := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					province = strings.TrimSpace(text)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				date, ok2 := dateMap[k]
+				if !ok2 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的时间,第%d行,第%d列", i, k))
+					continue
+				}
+
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly16 周度-养殖利润最新
+func HandleYongyiExcelWeekly16(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly16 周度-养殖利润最新 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly16 周度-养殖利润最新ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+
+		if i == 0 {
+			continue
+		} else if i <= 1 || i == 2 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							nameMap[j] = v
+						}
+					}
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok1 := nameMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "外购仔猪育肥" && name != "合同农户\n(放养部分)" {
+					if !strings.Contains(name, "母猪") {
+						name = fmt.Sprintf("母猪%s", name)
+					}
+				}
+				if name == "合同农户\n(放养部分)" {
+					name = "合同农户(放养部分)"
+				}
+
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				areaPingyin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + areaPingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly17 周度-当期、预期成本
+func HandleYongyiExcelWeekly17(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly17 周度-当期、预期成本 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly17 周度-当期、预期成本 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+
+	sort := 0
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i > 22 {
+			break
+		}
+		if i == 0 {
+			namePrefix = "出栏肥猪成本"
+			namePrefixPingin = "yyzx" + utils.GetFirstPingYin(namePrefix)
+			continue
+		} else if i == 11 {
+			namePrefix = "断奶仔猪对应育肥至标猪出栏成本"
+			namePrefixPingin = "yyzx" + utils.GetFirstPingYin(namePrefix)
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text) //2024.1.12-2024.1.18
+					dateSlice := strings.Split(text, "-")
+					if len(dateSlice) <= 1 {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006.1.2", dateSlice[1], time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+					fmt.Println("date: " + dateMap[k])
+				}
+			}
+		} else { //数据列
+			name := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 || k == 2 {
+					text = strings.TrimSpace(text)
+					if text != "" {
+						name = text
+					}
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				date, ok2 := dateMap[k]
+				if !ok2 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的时间,第%d行,第%d列", i, k))
+					continue
+				}
+				if name != "外购仔猪育肥" && name != "合同农户(放养部分)" {
+					if !strings.Contains(name, "母猪") {
+						name = fmt.Sprintf("母猪%s", name)
+					}
+				}
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				provincePingyin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly18 育肥全价料出厂价
+func HandleYongyiExcelWeekly18(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly18 育肥全价料出厂价 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly18 育肥全价料出厂价ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i <= 2 {
+			continue
+		} else if i == 3 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("01-2-06", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				if province == "均价" {
+					province = "全国均价"
+					fullIndexName = fmt.Sprintf("%s/%s", namePrefix, province)
+					fullIndexNamePingyin = namePrefixPingin + provincePingyin
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly19 周度-成本计算附件
+func HandleYongyiExcelWeekly19(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly19 周度-成本计算附件 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly19 周度-成本计算附件 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, _, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	dateMap := make(map[int]string)
+	areaMap := make(map[int]string)
+	valNameMap := make(map[int]string)
+	sort := 0
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	name := ""
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+		if i == 0 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if k > 9 && text != "" {
+					var dateT time.Time
+					text = strings.TrimSpace(text) //2024.1.12-2024.1.18
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							dateSlice := strings.Split(v, "-")
+							if len(dateSlice) <= 1 {
+								utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+								continue
+							}
+
+							dateT, e = time.ParseInLocation("2006.1.2", dateSlice[1], time.Local)
+							if e != nil {
+								utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+								continue
+							}
+							dateMap[j] = dateT.Format(utils.FormatDate)
+						}
+					}
+					dateSlice := strings.Split(text, "-")
+					if len(dateSlice) <= 1 {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+
+					dateT, e = time.ParseInLocation("2006.1.2", dateSlice[1], time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					dateMap[k] = dateT.Format(utils.FormatDate)
+					fmt.Println("date: " + dateMap[k])
+				}
+			}
+		} else if i == 1 {
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							areaMap[j] = v
+						}
+					}
+					areaMap[k] = text
+				}
+			}
+		} else if i == 2 {
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					valNameMap[k] = text
+				}
+			}
+		} else { //数据列
+
+			subName := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 || k == 2 {
+					text = strings.TrimSpace(text)
+					if text != "" {
+						name = text
+					}
+					fmt.Printf("name: %s \n", name)
+					continue
+				} else if k == 3 || k == 4 {
+					text = strings.TrimSpace(text)
+					if text != "" {
+						subName = text
+					}
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				valName, ok1 := valNameMap[k]
+				if !ok1 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的时间,第%d行,第%d列", i, k))
+					continue
+				}
+
+				area, ok2 := areaMap[k]
+				if !ok2 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的时间,第%d行,第%d列", i, k))
+					continue
+				}
+				area = strings.Replace(area, "本周", "", 1)
+				date, ok2 := dateMap[k]
+				if !ok2 {
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的时间,第%d行,第%d列", i, k))
+					continue
+				}
+				if strings.Contains(name, "-") && !strings.Contains(name, "母猪") {
+					name = "母猪" + name
+				}
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", area, name)
+				provincePingyin := utils.GetFirstPingYin(area + name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+				if strings.Contains(valName, "成本") {
+					if strings.Contains(area, "出栏肥猪") || name == "料肉比" || name == "上市均重(公斤)" || name == "育肥成活率(中高水平)" || name == "1周" {
+						continue
+					} else {
+						fullIndexName = fmt.Sprintf("%s/%s/%s", area, name, "成本")
+						provincePingyin = utils.GetFirstPingYin(area + name + "成本")
+						fullIndexNamePingyin = namePrefixPingin + provincePingyin
+					}
+				} else {
+					if subName != "" {
+						fullIndexName = fmt.Sprintf("%s/%s/%s", area, name, subName)
+						provincePingyin = utils.GetFirstPingYin(area + name + subName)
+						fullIndexNamePingyin = namePrefixPingin + provincePingyin
+					}
+				}
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				//fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly20 周度-毛白价差
+func HandleYongyiExcelWeekly20(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly20 周度-毛白价差 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly20 周度-毛白价差 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+	sort := 0
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		// 首行,表示时间
+		if i == 0 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if text != "" {
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					// 日期
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "前三级别白条价" && name != "生猪出栏价" {
+					continue
+				}
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				provincePingyin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("indexItem%s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 1187 - 0
services/base_from_yongyi_v2/week30.go

@@ -0,0 +1,1187 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelWeekly21 仔猪、母猪
+func HandleYongyiExcelWeekly21(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly21 仔猪、母猪 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly21 仔猪、母猪 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			name := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 1 {
+					name = text
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if strings.Contains(name, "二元母猪价") {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s/%s", namePrefix, name, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin + provincePingyin
+				if strings.Contains(name, "二元母猪价") {
+					fullIndexName = fmt.Sprintf("%s/%s", name, province)
+					fullIndexNamePingyin = "yyzx" + namePingin + provincePingyin
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly22 周度-河南屠宰白条成本
+func HandleYongyiExcelWeekly22(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly22 周度-河南屠宰白条成本 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly22 周度-河南屠宰白条成本 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+
+	sort := 0
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				nameSlice := strings.Split(name, "\n")
+				nameSlice = strings.Split(name, "(")
+				unitNew := unit
+				if len(nameSlice) > 1 {
+					name = nameSlice[0]
+				}
+				switch name {
+				case "生猪重量", "净白条重":
+					unitNew = "kg"
+				case "生猪结算", "白条成本", "6个等级白条均价":
+					unitNew = "元/kg"
+				case "副产品回", "屠宰费用", "白条头均利润":
+					unitNew = "元/头"
+				}
+				if name == "预冷损耗" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unitNew
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly23 周度-淘汰母猪价格
+func HandleYongyiExcelWeekly23(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly23 周度-淘汰母猪价格 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly23 周度-淘汰母猪价格 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly24 鲜销率
+func HandleYongyiExcelWeekly24(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly24 鲜销率 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly24 鲜销率 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i <= 1 || i > 2 && i <= 5 {
+			continue
+		} else if i == 2 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly25 周度-猪肉产品价格
+func HandleYongyiExcelWeekly25(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly25 周度-猪肉产品价格 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly25 周度-猪肉产品价格 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			name := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					dateSlice := strings.Split(text, "(")
+					if len(dateSlice) > 1 {
+						text = dateSlice[0]
+					}
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						dateT, e = time.ParseInLocation("01-02-06", text, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 2 {
+					name = text
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if strings.Contains(name, "二元母猪价") {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s/%s", namePrefix, name, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin + provincePingyin
+				if strings.Contains(name, "二元母猪价") {
+					fullIndexName = fmt.Sprintf("%s/%s", name, province)
+					fullIndexNamePingyin = "yyzx" + namePingin + provincePingyin
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		fmt.Printf("IndexName: %s \n", v.IndexName)
+		fmt.Printf("IndexCode: %s \n", v.IndexCode)
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly26 周度-淘汰母猪价格
+func HandleYongyiExcelWeekly26(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly26 周度-屠宰企业日度屠宰量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly26 周度-屠宰企业日度屠宰量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					provinceMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006/1/2", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
+				provincePingyin := utils.GetFullPingYin(province)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin
+				if strings.Contains(province, "合计") {
+					province = "合计"
+					fullIndexName = fmt.Sprintf("%s/%s", namePrefix, province)
+					provincePingyin = utils.GetFirstPingYin(province)
+					fullIndexNamePingyin = namePrefixPingin + provincePingyin
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly27 周度-屠宰新2022.10.28
+func HandleYongyiExcelWeekly27(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly27 周度-屠宰新2022.10.28 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly27 周度-屠宰新2022.10.28 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					continue
+				} else if k == 1 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					//判断是否是数字,如果是数字,另外单独处理
+					if dateFloat, e := strconv.ParseFloat(text, 64); e == nil {
+						dateT, e = excelize.ExcelDateToTime(dateFloat, false)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					} else {
+						dateT, e = time.ParseInLocation("2006年1月2日", text, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					}
+					date = dateT.Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if name != "规模屠宰厂全国前10家" && name != "各省规模屠宰厂100家" && name != "县区+乡镇宰杀 70家" {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				// 处理指标名称不同规模屠宰厂宰杀量/县区+乡镇宰杀 70家
+				name = strings.Replace(name, " ", "", -1)
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly28 月度-淘汰母猪屠宰厂宰杀量
+func HandleYongyiExcelWeekly28(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly28 月度-淘汰母猪屠宰厂宰杀量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly28 月度-淘汰母猪屠宰厂宰杀量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	provinceMap := make(map[int]string)
+	nameMap := make(map[int]string)
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+		if i == 0 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							provinceMap[j] = v
+							nameMap[j] = v
+						}
+					}
+					provinceMap[k] = text
+				}
+			}
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else if k == 1 {
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				province, ok2 := provinceMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				name, ok1 := nameMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if strings.Contains(name, "环比") {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份: %s \n", i, k, province)
+				// 处理指标名称
+				fullIndexName := fmt.Sprintf("%s/%s%s", namePrefix, province, name)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly29 月度-猪料销量
+func HandleYongyiExcelWeekly29(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly29 月度-猪料销量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly29 月度-猪料销量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	nameMap := make(map[int]string)
+
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 { //表示表头
+			// 处理 index指标表
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					//判断是否是数字,如果是数字,另外单独处理
+					if dateFloat, e := strconv.ParseFloat(text, 64); e == nil {
+						dateT, e = excelize.ExcelDateToTime(dateFloat, false)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					} else {
+						dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly30 月度-屠宰企业开工率
+func HandleYongyiExcelWeekly30(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly30 月度-屠宰企业开工率 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly30 月度-屠宰企业开工率 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	fmt.Println("最大行")
+
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i > 0 { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name := "屠宰企业开工率全国平均"
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+
+				fullIndexName := fmt.Sprintf("%s%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 627 - 0
services/base_from_yongyi_v2/week40.go

@@ -0,0 +1,627 @@
+package base_from_yongyi_v2
+
+import (
+	"eta/eta_data_analysis/models"
+	"eta/eta_data_analysis/utils"
+	"fmt"
+	"github.com/xuri/excelize/v2"
+	"strconv"
+	"strings"
+	"time"
+)
+
+// HandleYongyiExcelWeekly31 月度-屠宰厂公母比例
+func HandleYongyiExcelWeekly31(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly31 月度-屠宰厂公母比例 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly31 月度-屠宰厂公母比例 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	nameMap := make(map[int]string)
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						text = strings.TrimSpace(text)
+						dateSlice := strings.Split(text, "-")
+						if len(dateSlice) <= 1 {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, text))
+							continue
+						}
+						dateT, e = time.ParseInLocation("2006年1月2日", dateSlice[0], time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+						date = dateT.Format("2006年1月") + dateSlice[1]
+						dateT, e = time.ParseInLocation("2006年1月2日", date, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+						date = dateT.Format(utils.FormatDate)
+					} else {
+						// 查询当月的最后一天
+						monthDate := dateT.Format(utils.FormatYearMonthDate)
+						firstDayStr := monthDate + "-01"
+						tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+						date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					}
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				unit = "头"
+				if strings.Contains(name, "占比") {
+					unit = "%"
+				}
+				fullIndexName := fmt.Sprintf("%s%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly32 月度-生产指标(2021.5.7新增)
+func HandleYongyiExcelWeekly32(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly32 月度-生产指标(2021.5.7新增) ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly32 月度-生产指标(2021.5.7新增) ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	nameMap := make(map[int]string)
+	provinceMap := make(map[int]string)
+	mergeCellMap, err := GetMergeCells(f, sheetName)
+	if err != nil {
+		err = fmt.Errorf("获取合并单元格失败, sheetName: %s", sheetName)
+		return
+	}
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		currentMergeCells, mergeOk := mergeCellMap[i]
+		if i == 0 {
+			for k, text := range row {
+				if text != "" {
+					if mergeOk {
+						for j, v := range currentMergeCells {
+							provinceMap[j] = v
+						}
+					}
+					provinceMap[k] = text
+				}
+			}
+		} else if i == 1 {
+			for k, text := range row {
+				if text != "" {
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				province, ok1 := provinceMap[k]
+				if !ok1 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if strings.Contains(name, "环比") {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+
+				fullIndexName := fmt.Sprintf("%s/%s/%s", namePrefix, province, name)
+				provincePingyin := utils.GetFullPingYin(province)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + provincePingyin + namePingin
+
+				if province == "五省合计数量" || province == "五省平均水平" {
+					provincePingyin = utils.GetFirstPingYin(province)
+					fullIndexNamePingyin = namePrefixPingin + provincePingyin + namePingin
+				}
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly33 月度-生产指标2
+func HandleYongyiExcelWeekly33(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly33 月度-生产指标2ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly33 月度-生产指标2 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	nameMap := make(map[int]string)
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 {
+			for k, text := range row {
+				if text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+				unit = "头"
+				if strings.Contains(name, "率") {
+					unit = "%"
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly34 月度-二元三元能繁比例
+func HandleYongyiExcelWeekly34(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly34 月度-二元三元能繁比例ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly34 月度-二元三元能繁比例 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	year := ""
+	nameMap := make(map[int]string)
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			for k, text := range row {
+				if k > 3 && text != "" {
+					text = strings.TrimSpace(text)
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k <= 3 || k > 8 {
+					continue
+				} else if k == 4 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					//判断是否是数字,如果是数字,另外单独处理
+					if dateFloat, e := strconv.ParseFloat(text, 64); e == nil {
+						dateT, e = excelize.ExcelDateToTime(dateFloat, false)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					} else {
+						dateSlice := strings.Split(text, "年")
+						if len(dateSlice) >= 2 {
+							year = dateSlice[0]
+						} else {
+							text = fmt.Sprintf("%s年%s", year, text)
+						}
+						fmt.Println(text)
+
+						dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+						if e != nil {
+							utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+							continue
+						}
+					}
+
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				if date == "" {
+					continue
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+				name += "比例"
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}
+
+// HandleYongyiExcelWeekly35 月度-能繁母猪存栏量
+func HandleYongyiExcelWeekly35(f *excelize.File, sheetName string) (indexList []*models.YongyiExcelIndex, err error) {
+	defer func() {
+		if err != nil {
+			fmt.Printf("HandleYongyiExcelWeekly35 月度-能繁母猪存栏量 ErrMsg: %s\n", err.Error())
+			utils.FileLog.Info(fmt.Sprintf("HandleYongyiExcelWeekly35 月度-能繁母猪存栏量 ErrMsg: %s", err.Error()))
+		}
+	}()
+
+	rows, e := f.GetRows(sheetName)
+	if e != nil {
+		err = fmt.Errorf("f GetRows err: %s", e.Error())
+		return
+	}
+
+	// 获取指标分类
+	classifyName, classifySort, frequency, unit, namePrefix, namePrefixPingin := GetBaseInfo(sheetName)
+	// 遍历行读取
+	indexList = make([]*models.YongyiExcelIndex, 0)
+	sort := 0
+	nameMap := make(map[int]string)
+	// 指标名称
+	indexMap := make(map[string]*models.YongyiExcelIndex)
+	for i, row := range rows {
+		fmt.Printf("当前第%d行 \n", i)
+		if i == 0 {
+			continue
+		} else if i == 1 {
+			for k, text := range row {
+				if text != "" {
+					nameMap[k] = text
+				}
+			}
+		} else { //数据列
+			date := ""
+			for k, text := range row {
+				fmt.Printf("当前第%d列 \n", k)
+				if k == 0 {
+					text = strings.TrimSpace(text)
+					var dateT time.Time
+					dateT, e = time.ParseInLocation("2006年1月", text, time.Local)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheetName, i, k, e))
+						continue
+					}
+					// 查询当月的最后一天
+					monthDate := dateT.Format(utils.FormatYearMonthDate)
+					firstDayStr := monthDate + "-01"
+					tmpT, _ := time.ParseInLocation(utils.FormatDate, firstDayStr, time.Local)
+					date = tmpT.AddDate(0, 1, -1).Format(utils.FormatDate)
+					fmt.Println(date)
+					continue
+				} else {
+					// 判断出不是字符的,则过滤
+					if text == "" {
+						continue
+					}
+					if strings.Contains(text, "%") {
+						text = strings.Replace(text, "%", "", 1)
+					}
+					_, e := strconv.ParseFloat(text, 64)
+					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheetName, i, k, e))
+						continue
+					}
+				}
+				name, ok2 := nameMap[k]
+				if !ok2 {
+					err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k)
+					return
+				}
+				if strings.Contains(name, "环比") || strings.Contains(name, "同比") || strings.Contains(name, "日期") {
+					continue
+				}
+				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, name)
+
+				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, name)
+				namePingin := utils.GetFirstPingYin(name)
+				fullIndexNamePingyin := namePrefixPingin + namePingin
+				unit = "头"
+				if name == "较非瘟前" {
+					area, ok3 := nameMap[k-3]
+					if !ok3 {
+						err = fmt.Errorf("找不到对应的列名,第%d行,第%d列", i, k-3)
+						return
+					}
+					fullIndexName = fmt.Sprintf("%s/%s%s", namePrefix, area, name)
+					namePingin = utils.GetFirstPingYin(area + name)
+					fullIndexNamePingyin = namePrefixPingin + namePingin
+					unit = "%"
+				}
+				indexItem, okIndex := indexMap[fullIndexName]
+				if !okIndex {
+					// 新增指标
+					indexItem = new(models.YongyiExcelIndex)
+					indexItem.IndexName = fullIndexName
+					indexItem.ClassifyName = classifyName
+					indexItem.ClassifySort = classifySort
+					indexItem.IndexCode = fullIndexNamePingyin
+					indexItem.Frequency = frequency
+					indexItem.Sort = sort
+					indexItem.Unit = unit
+					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
+				}
+				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
+
+				indexItem.ExcelDataMap[date] = text
+				indexMap[fullIndexName] = indexItem
+				continue
+			}
+		}
+	}
+	for _, v := range indexMap {
+		indexList = append(indexList, v)
+	}
+	return
+}

+ 2 - 0
utils/common.go

@@ -30,6 +30,8 @@ import (
 
 // GetFirstPingYin 拼音首字母
 func GetFirstPingYin(name string) string {
+	name = strings.ReplaceAll(name, "(", "(")
+	name = strings.ReplaceAll(name, ")", ")")
 	a := pinyin.NewArgs()
 	a.Separator = ""
 	a.Style = pinyin.FirstLetter

+ 4 - 3
utils/config.go

@@ -38,8 +38,9 @@ var (
 
 // 涌益生猪
 var (
-	YongyiFilePath string //excel文件地址
-	YongyiOpen     string //是否配置涌益生猪数据源,1已配置
+	YongyiFilePath     string //excel文件地址
+	YongyiReadFilePath string //已读的excel文件地址
+	YongyiOpen         string //是否配置涌益生猪数据源,1已配置
 )
 
 // 中国煤炭网
@@ -52,7 +53,6 @@ var (
 	CoalMailAttachmentPythonVersion string // 获取邮件附件功能python版本
 )
 
-
 // 汾渭煤炭
 var (
 	FenweiFileDir    string // excel文件目录
@@ -108,6 +108,7 @@ func init() {
 	//涌益咨询文件夹配置
 	{
 		YongyiFilePath = config["yongyi_file_path"]
+		YongyiReadFilePath = config["yongyi_read_file_path"]
 		YongyiOpen = config["yongyi_open"]
 	}
 

+ 0 - 3
utils/constants.go

@@ -239,9 +239,6 @@ const (
 	LIB_ROUTE_COAL_MINE_JSM             = "/coal_mine/jsm"             //jsm三省煤炭网历史数据处理excel数据并入库 数据地址
 	LIB_ROUTE_COAL_MINE_COASTAL         = "/coal_mine/coastal"         //沿海煤炭网历史数据处理excel数据并入库 数据地址
 	LIB_ROUTE_COAL_MINE_INLAND          = "/coal_mine/inland"          //内陆三省煤炭网历史数据处理excel数据并入库 数据地址
-	LIB_ROUTE_COAL_MINE_JSM             = "/coal_mine/jsm"             //jsm三省煤炭网数据处理excel数据并入库 数据地址
-	LIB_ROUTE_COAL_MINE_COASTAL         = "/coal_mine/coastal"         //沿海煤炭网数据处理excel数据并入库 数据地址
-	LIB_ROUTE_COAL_MINE_INLAND          = "/coal_mine/inland"          //内陆三省煤炭网数据处理excel数据并入库 数据地址
 	LIB_ROUTE_COAL_MINE_FIRM            = "/coal_mine/firm"            //分公司旬度煤炭网数据处理excel数据并入库 数据地址
 	LIB_ROUTE_FENWEI_HANDLE             = "fenwei/handle/excel_data"   // 汾渭煤炭excel数据入库接口地址
 	LIB_ROUTE_FENWEI_CLASSIFY           = "fenwei/classify_tree"       // 汾渭煤炭分类接口地址