Browse Source

Merge branch 'feature/eta2.2.1_usda_fas' into debug

# Conflicts:
#	utils/constants.go
xyxie 5 months ago
parent
commit
eac6a86db5
2 changed files with 6 additions and 6 deletions
  1. 5 5
      controllers/data_manage/usda_fas_data.go
  2. 1 1
      utils/constants.go

+ 5 - 5
controllers/data_manage/usda_fas_data.go

@@ -1021,8 +1021,9 @@ func (this *BaseFromUsdaFasController) ExportUsdaFasList() {
 
 	classifyId, _ := this.GetInt("ClassifyId")
 	indexCode := this.GetString("IndexCode")
-	if classifyId < 0 {
-		br.Msg = "请选择分类"
+
+	if classifyId <= 0 && indexCode == "" {
+		br.Msg = "请选择分类或者指标"
 		return
 	}
 	dir, _ := os.Executable()
@@ -1061,9 +1062,6 @@ func (this *BaseFromUsdaFasController) ExportUsdaFasList() {
 			condition += ` AND classify_id=?`
 			pars = append(pars, classifyId)
 		}
-	} else {
-		condition += ` AND classify_id=?`
-		pars = append(pars, classifyId)
 	}
 	if indexCode != "" {
 		condition += ` AND index_code=? `
@@ -1238,8 +1236,10 @@ func (this *BaseFromUsdaFasController) ExportUsdaFasList() {
 	fileName := classifyName
 	if indexCode != "" && len(indexList) == 1 {
 		fileName = indexList[0].IndexName
+		fileName = strings.Replace(fileName, ": ", "_", -1)
 	}
 	fileName += time.Now().Format("06.01.02") + `.xlsx` //文件名称
+	//fmt.Println(fileName)
 	this.Ctx.Output.Download(downLoadnFilePath, fileName)
 	defer func() {
 		os.Remove(downLoadnFilePath)

+ 1 - 1
utils/constants.go

@@ -180,8 +180,8 @@ const (
 	DATA_SOURCE_OILCHEM                              = 89       // 隆众资讯 -> 89
 	DATA_SOURCE_CALCULATE_RANGEANLYSIS               = 87       //区间计算->87
 	DATA_SOURCE_PREDICT_CALCULATE_RANGEANLYSIS       = 90       // 预测指标区间计算->90
-	DATA_SOURCE_LY                                   = 91       // 粮油商务网
 	DATA_SOURCE_FENWEI                               = 77       // 汾渭数据->92
+	DATA_SOURCE_LY                                   = 91       // 粮油商务网
 	DATA_SOURCE_HISUGAR                              = 93       // 泛糖科技 -> 93
 	DATA_SOURCE_TRADE_ANALYSIS                       = 92       // 持仓分析
 	DATA_SOURCE_USDA_FAS                             = 96       //美国农业部