Răsfoiți Sursa

调整涌益咨询指标录入

xyxie 1 an în urmă
părinte
comite
ef70647d9b

+ 8 - 17
services/base_from_yongyi.go

@@ -50,12 +50,12 @@ func HandleYongyiExcelDaily(uploadPath string) (err error) {
 		switch sheet.Name {
 		case "出栏价":
 			indexList, err = base_from_yongyi.HandleYongyiExcelDaily1(sheet)
-		case "标肥价差":
+		/*case "标肥价差":
 			indexList, err = base_from_yongyi.HandleYongyiExcelDaily2(sheet)
 		case "价格+宰量":
 			indexList, err = base_from_yongyi.HandleYongyiExcelDaily3(sheet)
 		case "屠宰企业日度屠宰量":
-			indexList, err = base_from_yongyi.HandleYongyiExcelDaily4(sheet)
+			indexList, err = base_from_yongyi.HandleYongyiExcelDaily4(sheet)*/
 		default:
 			continue
 		}
@@ -106,28 +106,19 @@ func HandleYongyiExcelWeekly(uploadPath string) (err error) {
 		case "周度-屠宰厂宰前活猪重":
 			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly3(sheet)
 		case "周度-各体重段价差":
-			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly4(sheet)*/
-		/*case "周度-50公斤二元母猪价格":
-		case "周度-规模场15公斤仔猪出栏价":
-		case "周度-宰后结算价":
-		case "周度-冻品库存":
+			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly4(sheet)
+		case "周度-50公斤二元母猪价格", "周度-规模场15公斤仔猪出栏价", "周度-宰后结算价", "周度-冻品库存", "周度-猪肉价(前三等级白条均价)":
 			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly5(sheet)
-		case "周度-冻品库存多样本":
-			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly6(sheet)
-		case "周度-猪肉价(前三等级白条均价)":
-			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly5(sheet)
-		case "月度出栏完成率":
+		case "周度-冻品库存多样本", "月度出栏完成率":
 			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly6(sheet)
 		case "月度计划出栏量":
 			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly7(sheet)
 		case "月度-能繁母猪存栏(2020年2月新增)":
 			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly8(sheet)
-		case "月度-小猪存栏(2020年5月新增)":
-		case "月度-中猪存栏(2020年5月新增)":
-		case "月度-大猪存栏(2020年5月新增)":
-			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly9(sheet)*/
+		case "月度-小猪存栏(2020年5月新增)", "月度-中猪存栏(2020年5月新增)", "月度-大猪存栏(2020年5月新增)":
+			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly9(sheet)
 		case "月度-商品猪出栏量":
-			indexList, err = base_from_yongyi.HandleYongyiExcelWeekly10(sheet)
+		indexList, err = base_from_yongyi.HandleYongyiExcelWeekly10(sheet)*/
 		default:
 			continue
 		}

+ 111 - 22
services/base_from_yongyi/daily.go

@@ -5,6 +5,7 @@ import (
 	"eta/eta_data_analysis/utils"
 	"fmt"
 	"github.com/tealeg/xlsx"
+	"strconv"
 	"strings"
 	"time"
 )
@@ -15,19 +16,24 @@ func HandleYongyiExcelDaily1(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 	frequency := "日度"
 	unit := "元/公斤"
 	namePrefix := "商品猪出栏价"
-	namePrefixPingin := "yyzxspzclj"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 	//sheet := dailyPriceSheet
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	dateMap := make(map[int]string)
 	nameMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
+	stopFlag := false
 	// 指标名称
 	indexMap := make(map[string]*models.YongyiExcelIndex)
 	for i := 0; i < maxRow; i++ {
 		fmt.Printf("当前第%d行 \n", i)
+		if stopFlag {
+			break
+		}
 		if i == 0 { // 首行,表示时间
 			row := sheet.Row(i)
 			cells := row.Cells
@@ -61,19 +67,36 @@ func HandleYongyiExcelDaily1(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 			cells := row.Cells
 			province := ""
 			for k, cell := range cells {
-				fmt.Printf("当前第%d列 \n", k)
 				text := cell.String()
+				fmt.Printf("当前第%d列,内容为%s \n", k, text)
 				if k == 0 {
 					province = text
+					if province == "全国均价" {
+						stopFlag = true
+						break
+					}
 					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", sheet.Name, i, k, e))
+						continue
+					}
 				}
 
 				date, ok1 := dateMap[k]
 				if !ok1 {
-					err = fmt.Errorf("找不到对应的日期,第%d行,第%d列", i, k)
-					return
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
 				}
 				name, ok2 := nameMap[k]
 				if !ok2 {
@@ -106,10 +129,10 @@ func HandleYongyiExcelDaily1(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					// todo 排序
-					indexItem.Sort = i + k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -136,12 +159,17 @@ func HandleYongyiExcelDaily2(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 	dateMap := make(map[int]string)
 	nameMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
+	stopFlag := false
 	// 指标名称
 	indexMap := make(map[string]*models.YongyiExcelIndex)
 	for i := 0; i < maxRow; i++ {
 		fmt.Printf("当前第%d行 \n", i)
+		if stopFlag {
+			break
+		}
 		if i == 0 { // 首行,表示时间
 			row := sheet.Row(i)
 			cells := row.Cells
@@ -179,13 +207,30 @@ func HandleYongyiExcelDaily2(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 				text := cell.String()
 				if k == 0 {
 					province = text
+					if province == "" {
+						stopFlag = true
+						break
+					}
 					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", sheet.Name, i, k, e))
+						continue
+					}
 				}
 
 				date, ok1 := dateMap[k]
 				if !ok1 {
-					err = fmt.Errorf("找不到对应的日期,第%d行,第%d列", i, k)
-					return
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
 				}
 				name, ok2 := nameMap[k]
 				if !ok2 {
@@ -201,20 +246,19 @@ func HandleYongyiExcelDaily2(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 					// 只处理以上三个类型,其余过滤
 					continue
 				}
-				var namePrefixPingin string
+
 				if name == "150公斤左右较标猪" {
 					name = "150公斤较标猪价差"
-					namePrefixPingin = "150gjjbzjc"
 				} else if name == "175公斤左右较标猪" {
 					name = "175公斤较标猪价差"
-					namePrefixPingin = "175gjjbzjc"
-				} else if name == "市场标重猪价" {
-					namePrefixPingin = "scbzzj"
+				} else if name == "全国均价" {
+					name = "全国"
 				}
 				fullIndexName := fmt.Sprintf("%s/%s", name, province)
 				indexItem, okIndex := indexMap[fullIndexName]
 
 				provincePingyin := utils.GetFullPingYin(province)
+				namePrefixPingin := utils.GetFirstPingYin(name)
 				fullIndexNamePingyin := fmt.Sprintf("%s%s%s", pingYinPrefix, namePrefixPingin, provincePingyin)
 
 				if !okIndex {
@@ -224,10 +268,10 @@ func HandleYongyiExcelDaily2(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					// todo 排序
-					indexItem.Sort = i + k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -252,11 +296,16 @@ func HandleYongyiExcelDaily3(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	nameMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
+	stopFlag := false
 	// 指标名称
 	indexMap := make(map[string]*models.YongyiExcelIndex)
 	for i := 0; i < maxRow; i++ {
+		if stopFlag {
+			break
+		}
 		fmt.Printf("当前第%d行 \n", i)
 		if i == 0 { // 首行,名称
 			row := sheet.Row(i)
@@ -278,7 +327,24 @@ func HandleYongyiExcelDaily3(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 						text = dateText.Format(utils.FormatDate)
 					}
 					date = text
+					if text == "" {
+						stopFlag = true
+						break
+					}
 					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", sheet.Name, i, k, e))
+						continue
+					}
 				}
 
 				name, ok2 := nameMap[k]
@@ -310,9 +376,10 @@ func HandleYongyiExcelDaily3(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -333,18 +400,22 @@ func HandleYongyiExcelDaily4(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 	frequency := "日度"
 	unit := "头/日"
 	namePrefix := "商品猪日屠宰量"
-	pingYinPrefix := "yyzx"
-	namePrefixPingin := "spzrtzl"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	dateMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
+	stopFlag := false
 	// 指标名称
 	indexMap := make(map[string]*models.YongyiExcelIndex)
 	for i := 0; i < maxRow; i++ {
 		fmt.Printf("当前第%d行 \n", i)
+		if stopFlag {
+			break
+		}
 		if i == 0 { // 首行,表示时间
 			row := sheet.Row(i)
 			cells := row.Cells
@@ -379,13 +450,30 @@ func HandleYongyiExcelDaily4(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 				text := cell.String()
 				if k == 0 {
 					province = text
+					if province == "合计(单位:头)" {
+						stopFlag = true
+						break
+					}
 					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", sheet.Name, i, k, e))
+						continue
+					}
 				}
 
 				date, ok1 := dateMap[k]
 				if !ok1 {
-					err = fmt.Errorf("找不到对应的日期,第%d行,第%d列", i, k)
-					return
+					utils.FileLog.Info(fmt.Sprintf("找不到对应的日期,第%d行,第%d列, text:%s", i, k, text))
+					continue
 				}
 				fmt.Printf("当前第%d行第%d列, 当前省份%s \n", i, k, province)
 				// 处理指标名称
@@ -394,7 +482,7 @@ func HandleYongyiExcelDaily4(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, province)
 
 				provincePingyin := utils.GetFullPingYin(province)
-				fullIndexNamePingyin := fmt.Sprintf("%s%s%s", pingYinPrefix, namePrefixPingin, provincePingyin)
+				fullIndexNamePingyin := fmt.Sprintf("%s%s", namePrefixPingin, provincePingyin)
 
 				indexItem, okIndex := indexMap[fullIndexName]
 
@@ -405,9 +493,10 @@ func HandleYongyiExcelDaily4(sheet *xlsx.Sheet) (indexList []*models.YongyiExcel
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = i
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 

+ 86 - 46
services/base_from_yongyi/week.go

@@ -24,12 +24,12 @@ func init() {
 	}
 	YongyiWeeklySheetMap6 = map[string]*models.YongyiSheet{
 		"周度-冻品库存多样本": {"冻品库存多样本", "周度-冻品库存多样本", "周度", "%"},
-		"月度出栏完成率":    {"", "月度出栏完成率", "旬度", "%"},
+		"月度出栏完成率":    {"出栏完成率", "月度出栏完成率", "旬度", "%"},
 	}
 	YongyiWeeklySheetMap9 = map[string]*models.YongyiSheet{
-		"月度-小猪存栏(2020年5月新增)": {"商品猪出栏价", "月度-小猪存栏(2020年5月新增)", "月度", "元/公斤"},
-		"月度-中猪存栏(2020年5月新增)": {"", "月度-中猪存栏(2020年5月新增)", "月度", "元/公斤"},
-		"月度-大猪存栏(2020年5月新增)": {"", "月度-大猪存栏(2020年5月新增)", "月度", "元/公斤"},
+		"月度-小猪存栏(2020年5月新增)": {"50kg以下小猪存栏量", "月度-小猪存栏(2020年5月新增)", "月度", "头"},
+		"月度-中猪存栏(2020年5月新增)": {"中猪存栏量", "月度-中猪存栏(2020年5月新增)", "月度", ""},
+		"月度-大猪存栏(2020年5月新增)": {"大猪存栏量", "月度-大猪存栏(2020年5月新增)", "月度", ""},
 	}
 }
 
@@ -47,13 +47,14 @@ func HandleYongyiExcelWeekly1(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	frequency := "周度"
 	unit := "元/公斤"
 	namePrefix := "商品猪出栏价"
-	namePrefixPingin := "yyzxspzclj"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	provinceMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -101,16 +102,22 @@ func HandleYongyiExcelWeekly1(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					date = r.Date.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", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -146,9 +153,10 @@ func HandleYongyiExcelWeekly1(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -170,13 +178,14 @@ func HandleYongyiExcelWeekly2(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	frequency := "周度"
 	unit := "公斤"
 	namePrefix := "商品猪出栏体重"
-	namePrefixPingin := "yyzxspzcltz"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	provinceMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -225,8 +234,8 @@ func HandleYongyiExcelWeekly2(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					date = r.Date.Format(utils.FormatDate)
 					fmt.Println(date)
@@ -244,6 +253,7 @@ func HandleYongyiExcelWeekly2(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -282,10 +292,10 @@ func HandleYongyiExcelWeekly2(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					// todo 排序
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -307,12 +317,13 @@ func HandleYongyiExcelWeekly3(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	frequency := "周度"
 	unit := "公斤"
 	namePrefix := "商品猪宰前活猪重"
-	namePrefixPingin := "yyzxspzzqhzz"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	provinceMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -357,6 +368,7 @@ func HandleYongyiExcelWeekly3(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 					date = r.Date.Format(utils.FormatDate)
@@ -374,6 +386,7 @@ func HandleYongyiExcelWeekly3(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -402,9 +415,10 @@ func HandleYongyiExcelWeekly3(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("indexItem%s", indexItem.IndexCode)
 
@@ -431,6 +445,7 @@ func HandleYongyiExcelWeekly4(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	provinceMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -463,8 +478,8 @@ func HandleYongyiExcelWeekly4(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					date = r.Date.Format(utils.FormatDate)
 					fmt.Println(date)
@@ -482,8 +497,12 @@ func HandleYongyiExcelWeekly4(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					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", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -512,10 +531,10 @@ func HandleYongyiExcelWeekly4(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					// todo 排序
-					//indexItem.Sort = i*1000 + k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
 
@@ -558,6 +577,7 @@ func HandleYongyiExcelWeekly5(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	provinceMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -599,8 +619,8 @@ func HandleYongyiExcelWeekly5(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					date = r.Date.Format(utils.FormatDate)
 					fmt.Println(date)
@@ -610,8 +630,12 @@ func HandleYongyiExcelWeekly5(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					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", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -638,9 +662,10 @@ func HandleYongyiExcelWeekly5(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
 
@@ -677,6 +702,7 @@ func HandleYongyiExcelWeekly6(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -706,8 +732,8 @@ func HandleYongyiExcelWeekly6(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecord{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					date = r.Date.Format(utils.FormatDate)
 					fmt.Println(date)
@@ -717,8 +743,12 @@ func HandleYongyiExcelWeekly6(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					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", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -732,6 +762,9 @@ func HandleYongyiExcelWeekly6(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 				// 处理指标名称
 				fullIndexName := fmt.Sprintf("%s/%s", namePrefix, area)
 				areaPingyin := utils.GetFirstPingYin(area)
+				if sheet.Name == "月度出栏完成率" {
+					areaPingyin = utils.GetFullPingYin(area)
+				}
 				fullIndexNamePingyin := namePrefixPingin + areaPingyin
 
 				indexItem, okIndex := indexMap[fullIndexName]
@@ -742,9 +775,10 @@ func HandleYongyiExcelWeekly6(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s", indexItem.IndexCode)
 
@@ -766,13 +800,14 @@ func HandleYongyiExcelWeekly7(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	frequency := "月度"
 	unit := "%"
 	namePrefix := "月度计划出栏量环比"
-	namePrefixPingin := "yyzxydjhcllhb"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	provinceMap := make(map[int]string)
 	firstMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -811,8 +846,8 @@ func HandleYongyiExcelWeekly7(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecordFirst{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					// 查询当月的最后一天
 					monthDate := r.Date.Format(utils.FormatYearMonthDate)
@@ -831,6 +866,7 @@ func HandleYongyiExcelWeekly7(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -868,9 +904,10 @@ func HandleYongyiExcelWeekly7(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
 
@@ -892,12 +929,13 @@ func HandleYongyiExcelWeekly8(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	frequency := "月度"
 	unit := "头"
 	namePrefix := "能繁母猪存栏量"
-	namePrefixPingin := "yyzxnfmzcll"
+	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -927,8 +965,8 @@ func HandleYongyiExcelWeekly8(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecordFirst{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						utils.FileLog.Info(fmt.Sprintf("读取行,时间列失败 Err:%s", e))
-						break
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					// 查询当月的最后一天
 					monthDate := r.Date.Format(utils.FormatYearMonthDate)
@@ -947,6 +985,7 @@ func HandleYongyiExcelWeekly8(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -973,9 +1012,10 @@ func HandleYongyiExcelWeekly8(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
 
@@ -1003,16 +1043,11 @@ func HandleYongyiExcelWeekly9(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 	namePrefix := info.NamePrefix
 	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)
 
-	/*classifyName := "月度-小猪存栏(2020年5月新增)"
-	frequency := "月度"
-	unit := "头"
-	namePrefix := "50kg以下小猪存栏量"
-	namePrefixPingin := "yyzx" + utils.GetFirstPingYin(namePrefix)*/
-
 	// 遍历行读取
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -1042,8 +1077,8 @@ func HandleYongyiExcelWeekly9(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					tmpRow := row
 					r := &ExcelDateRecordFirst{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					// 查询当月的最后一天
 					monthDate := r.Date.Format(utils.FormatYearMonthDate)
@@ -1062,6 +1097,7 @@ func HandleYongyiExcelWeekly9(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -1088,9 +1124,10 @@ func HandleYongyiExcelWeekly9(sheet *xlsx.Sheet) (indexList []*models.YongyiExce
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)
 
@@ -1118,6 +1155,7 @@ func HandleYongyiExcelWeekly10(sheet *xlsx.Sheet) (indexList []*models.YongyiExc
 	indexList = make([]*models.YongyiExcelIndex, 0)
 	areaMap := make(map[int]string)
 	maxRow := sheet.MaxRow
+	sort := 0
 	fmt.Println("最大行")
 	fmt.Println(maxRow)
 	// 指标名称
@@ -1147,8 +1185,8 @@ func HandleYongyiExcelWeekly10(sheet *xlsx.Sheet) (indexList []*models.YongyiExc
 					tmpRow := row
 					r := &ExcelDateRecordFirst{}
 					if e := tmpRow.ReadStruct(r); e != nil {
-						err = fmt.Errorf("读取行,时间列失败 Err:%s", e)
-						return
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 读取行,时间列失败 Err:%s", sheet.Name, i, k, e))
+						continue
 					}
 					// 查询当月的最后一天
 					monthDate := r.Date.Format(utils.FormatYearMonthDate)
@@ -1167,6 +1205,7 @@ func HandleYongyiExcelWeekly10(sheet *xlsx.Sheet) (indexList []*models.YongyiExc
 					}
 					_, e := strconv.ParseFloat(text, 64)
 					if e != nil {
+						utils.FileLog.Info(fmt.Sprintf("sheet:%s 第%d行, 第%d列 strconv.ParseFloat Err:%s", sheet.Name, i, k, e))
 						continue
 					}
 				}
@@ -1193,9 +1232,10 @@ func HandleYongyiExcelWeekly10(sheet *xlsx.Sheet) (indexList []*models.YongyiExc
 					indexItem.ClassifyName = classifyName
 					indexItem.IndexCode = fullIndexNamePingyin
 					indexItem.Frequency = frequency
-					indexItem.Sort = k
+					indexItem.Sort = sort
 					indexItem.Unit = unit
 					indexItem.ExcelDataMap = make(map[string]string)
+					sort++
 				}
 				fmt.Printf("IndexCode: %s\n", indexItem.IndexCode)