Roc 1 month ago
parent
commit
c9a70a0d1a

+ 13 - 0
controllers/data_source/data_source.go

@@ -260,6 +260,19 @@ func (c *DataSourceController) SearchByEs() {
 	//	}
 	//}
 
+	for _, v := range listMap {
+		classifyId, ok := v[classifyIdKey].(int)
+		if !ok {
+			v["ClassifyUniqueCode"] = ""
+			continue
+		}
+		v["ClassifyUniqueCode"] = strconv.Itoa(classifyId)
+		startDate := v["StartDate"].(string)
+		v["StartDate"] = utils.GormDateStrToDateStr(startDate)
+		endDate := v["EndDate"].(string)
+		v["EndDate"] = utils.GormDateStrToDateStr(endDate)
+	}
+
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := dataSourceModel.SearchDataSourceResp{
 		Paging: page,

+ 7 - 0
models/data_manage/lz_data.go

@@ -62,6 +62,13 @@ type LongzhongSurveyProduct struct {
 	LzCode               string    `gorm:"column:lz_code"`
 }
 
+func (m *LongzhongSurveyProduct) AfterFind(db *gorm.DB) (err error) {
+	m.StartDate = utils.GormDateStrToDateStr(m.StartDate)
+	m.EndDate = utils.GormDateStrToDateStr(m.StartDate)
+
+	return
+}
+
 func GetLongzhongSurveyProduct(breedId, frequency int) (items []*LongzhongSurveyProduct, err error) {
 	sql := `SELECT * FROM longzhong_survey_product WHERE breed_id=? AND frequency=? ORDER BY survey_product_id ASC`
 	o := global.DbMap[utils.DbNameManualIndex]

+ 1 - 1
models/data_source/data_source.go

@@ -2015,7 +2015,7 @@ type BaseFromMtjhIndex struct {
 	BaseFromMtjhIndexId int       `gorm:"column:base_from_mtjh_index_id;primaryKey"`
 	IndexCode           string    `description:"指标编码"`
 	IndexName           string    `description:"指标名称"`
-	DealValue           float64   `description:"成交量"`
+	DealValue           string    `description:"成交量"`
 	DataTime            time.Time `description:"数据日期"`
 	Unit                string    `description:"单位"`
 	Frequency           string    `description:"频度"`