Browse Source

修改二育成本bug

xyxie 1 năm trước cách đây
mục cha
commit
8ab0d3765a
3 tập tin đã thay đổi với 8 bổ sung6 xóa
  1. 0 1
      go.mod
  2. 1 1
      services/base_from_yongyi_v2/base.go
  3. 7 4
      services/base_from_yongyi_v2/week20.go

+ 0 - 1
go.mod

@@ -8,7 +8,6 @@ require (
 	github.com/gonum/stat v0.0.0-20181125101827-41a0da705a5b
 	github.com/mozillazg/go-pinyin v0.20.0
 	github.com/patrickmn/go-cache v2.1.0+incompatible
-	github.com/rdlucklib/rdluck_tools v1.0.3
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/shakinm/xlsReader v0.9.12
 	github.com/shopspring/decimal v1.3.1

+ 1 - 1
services/base_from_yongyi_v2/base.go

@@ -130,7 +130,7 @@ func init() {
 		"月度-生产指标(2021.5.7新增)":  {"生产指标", "月度-生产指标(2021.5.7新增)", "月度", "头"}, //多个单位:头,%
 		"月度-生产指标2":             {"生产指标", "月度-生产指标2", "月度", "头"},            //多个单位:头,%
 		"月度-二元三元能繁比例":          {"能繁母猪存栏量", "月度-二元三元能繁比例", "月度", "%"},      //多个单位:头,%
-		"月度-能繁母猪存栏量":           {"能繁母猪存栏量", "月度-能繁母猪存栏量", "月度", "头"},
+		"月度-能繁母猪存栏量":           {"月度能繁母猪存栏量", "月度-能繁母猪存栏量", "月度", "头"},
 		"月度-原种场二元后备母猪销量及出栏日龄":  {"原种场二元后备母猪销量及出栏日龄", "月度-原种场二元后备母猪销量及出栏日龄", "月度", "头"},
 		"涌益样本测算":               {"涌益样本测算", "涌益样本测算", "月度", "窝"}, //多个单位:头,%,窝,公斤,元/公斤
 	}

+ 7 - 4
services/base_from_yongyi_v2/week20.go

@@ -313,6 +313,7 @@ func HandleYongyiExcelWeekly13(f *excelize.File, sheetName string) (indexList []
 				}
 				dateName := fmt.Sprintf("%s_%s", date, name)
 				dateNameWeight := fmt.Sprintf("%s_%s_%s", date, name, weight)
+				fmt.Println(dateNameWeight)
 				unitMap[dateNameWeight] = GetWeekly13IndexUnit(name)
 				if v, ok1 := dateNameMap[dateName]; ok1 {
 					vf, _ := strconv.ParseFloat(v, 64)
@@ -344,11 +345,11 @@ func HandleYongyiExcelWeekly13(f *excelize.File, sheetName string) (indexList []
 				fmt.Printf("当前第%d列 \n", k)
 				if k == 0 {
 					continue
-				} else if k == 1 {
-					// 体重
-					weight = strings.TrimSpace(text)
-					continue
 				} else {
+					if k == 1 {
+						// 体重
+						weight = strings.TrimSpace(text)
+					}
 					if text == "" {
 						continue
 					}
@@ -403,6 +404,8 @@ func HandleYongyiExcelWeekly13(f *excelize.File, sheetName string) (indexList []
 		}
 	}
 	for _, v := range indexMap {
+		fmt.Printf("IndexName:%s\n", v.IndexName)
+		fmt.Printf("IndexCode:%s\n", v.IndexCode)
 		indexList = append(indexList, v)
 	}
 	return