zwxi 7 月之前
父節點
當前提交
8b983bdf05
共有 1 個文件被更改,包括 0 次插入253 次删除
  1. 0 253
      controllers/oilchem_data.go

+ 0 - 253
controllers/oilchem_data.go

@@ -222,259 +222,6 @@ func (this *TradeCommonController) OilchemSearchList() {
 	br.Data = list
 }
 
-// ExportCoalList
-// @Title 导出隆众资讯数据
-// @Description 导出隆众资讯数据
-// @Param	ClassifyId query int true	"数据id"
-// @Param   IndexName   query   string  true       "名称关键词"
-// @Param   IndexCode   query   string  true       "指标唯一编码"
-// @Param   TypeName   query   string  true       "分类"
-// @Param   Frequency   query   string  false       "频度"
-// @Param   UnitName   query   string  false       "单位"
-// @Success 200  导出成功
-// @router /export/mtjh [get]
-//func (this *TradeCommonController) ExportMtjhList() {
-//	br := new(models.BaseResponse).Init()
-//	defer func() {
-//		this.Data["json"] = br
-//		this.ServeJSON()
-//	}()
-//	area := this.GetString("Area")
-//	indexCode := this.GetString("IndexCode") //指标唯一编码
-//
-//	secNameList := make([]*models.EdbdataExportList, 0)
-//
-//	dir, _ := os.Executable()
-//	exPath := filepath.Dir(dir)
-//
-//	downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
-//	xlsxFile := xlsx.NewFile()
-//
-//	//不为空就是导出分类表
-//	if indexCode == "" {
-//		//获取指标
-//		var secNameList []*string
-//		var err error
-//
-//		secNameList, err = data_manage.GetClassifyMtjhByArea(area)
-//		if err != nil {
-//			fmt.Println("获取数据失败,Err:" + err.Error())
-//			return
-//		}
-//
-//		if len(secNameList) <= 0 {
-//			fmt.Println("secNameList长度为0")
-//			return
-//		}
-//		sheetNew, err := xlsxFile.AddSheet(area)
-//
-//		if err != nil {
-//			fmt.Println("新增Sheet失败", err.Error())
-//			return
-//		}
-//		//sheetNew.SetColWidth()
-//		//获取指标数据
-//		windRow := sheetNew.AddRow()
-//		secNameRow := sheetNew.AddRow()
-//		indexCodeRow := sheetNew.AddRow()
-//		frequencyRow := sheetNew.AddRow()
-//		unitRow := sheetNew.AddRow()
-//		lastModifyDateRow := sheetNew.AddRow()
-//		//获取分类下指标最大数据量
-//		var dataMax int
-//
-//		dataMax, err = data_manage.GetCoalMtjhMaxCount(area)
-//		if err != nil {
-//			fmt.Println("获取指标最大数据量失败", err.Error())
-//			return
-//		}
-//
-//		setRowIndex := 6
-//		for k, sv := range secNameList {
-//			//获取数据
-//			dataList, err := data_manage.GetBaseFromMtjhIndexByCode(*sv)
-//			if err != nil {
-//				br.Msg = "获取数据失败"
-//				br.ErrMsg = "获取数据失败,Err:" + err.Error()
-//				return
-//			}
-//			windRow.AddCell().SetValue(area)
-//			secNameRow.AddCell().SetValue("指标名称")
-//			indexCodeRow.AddCell().SetValue("指标ID")
-//			frequencyRow.AddCell().SetValue("频率")
-//			unitRow.AddCell().SetValue("单位")
-//			lastModifyDateRow.AddCell().SetValue("更新时间")
-//
-//			secNameRow.AddCell().SetValue(dataList[0].IndexName)
-//			indexCodeRow.AddCell().SetValue(dataList[0].IndexCode)
-//			frequencyRow.AddCell().SetValue(dataList[0].Frequency)
-//			unitRow.AddCell().SetValue(dataList[0].Unit)
-//			lastModifyDateRow.AddCell().SetValue(dataList[0].ModifyTime)
-//
-//			windRow.AddCell()
-//			windRow.AddCell()
-//			secNameRow.AddCell()
-//			indexCodeRow.AddCell()
-//			frequencyRow.AddCell()
-//			unitRow.AddCell()
-//			lastModifyDateRow.AddCell()
-//			min := k * 3
-//			sheetNew.SetColWidth(min, min, 15)
-//
-//			if len(dataList) <= 0 {
-//				for n := 0; n < dataMax; n++ {
-//					rowIndex := setRowIndex + n
-//					row := sheetNew.Row(rowIndex)
-//					row.AddCell()
-//					row.AddCell()
-//					row.AddCell()
-//				}
-//			} else {
-//				endRowIndex := 0
-//				for rk, dv := range dataList {
-//					rowIndex := setRowIndex + rk
-//					row := sheetNew.Row(rowIndex)
-//
-//					displayDate, _ := time.Parse(utils.FormatDate, dv.DataTime)
-//					displayDateCell := row.AddCell()
-//					style := new(xlsx.Style)
-//					style.ApplyAlignment = true
-//					style.Alignment.WrapText = true
-//					displayDateCell.SetStyle(style)
-//					displayDateCell.SetDate(displayDate)
-//
-//					row.AddCell().SetValue(dv.DealValue)
-//					row.AddCell()
-//					endRowIndex = rowIndex
-//				}
-//				if len(dataList) < dataMax {
-//					dataLen := dataMax - len(dataList)
-//					for n := 0; n < dataLen; n++ {
-//						rowIndex := (endRowIndex + 1) + n
-//						row := sheetNew.Row(rowIndex)
-//						row.AddCell()
-//						row.AddCell()
-//						row.AddCell()
-//					}
-//				}
-//			}
-//		}
-//	} else {
-//		sheet, err := xlsxFile.AddSheet("指标")
-//		if err != nil {
-//			br.Msg = "新增Sheet失败"
-//			br.ErrMsg = "新增Sheet失败,Err:" + err.Error()
-//			return
-//		}
-//		//获取数据
-//		dataList, err := data_manage.GetBaseFromMtjhIndexByCode(indexCode)
-//		if err != nil {
-//			br.Msg = "获取数据失败"
-//			br.ErrMsg = "获取数据失败,Err:" + err.Error()
-//			return
-//		}
-//
-//		mapping, err := data_manage.GetMtjhMappingItemByCode(indexCode)
-//		if err != nil {
-//			br.Msg = "获取煤炭数据失败"
-//			br.ErrMsg = "获取煤炭度数据失败,Err:" + err.Error()
-//			return
-//		}
-//		//获取指标数据
-//		windRow := sheet.AddRow()
-//		windRow.AddCell().SetValue("隆众资讯")
-//		rowSecName := sheet.AddRow()
-//		celSecName := rowSecName.AddCell()
-//		celSecName.SetValue("指标名称")
-//		cellSenName := rowSecName.AddCell()
-//		cellSenName.SetValue(mapping.IndexName)
-//		indexCodeRow := sheet.AddRow()
-//		indexCodeRow.AddCell().SetValue("指标ID")
-//		indexCodeRow.AddCell().SetValue(indexCode)
-//
-//		rowFrequency := sheet.AddRow()
-//		celFrequency := rowFrequency.AddCell()
-//		celFrequency.SetValue("频率")
-//		rowFrequency.AddCell().SetValue(mapping.Frequency)
-//
-//		rowUnit := sheet.AddRow()
-//		celUnit := rowUnit.AddCell()
-//		celUnit.SetValue("单位")
-//		cellUnit := rowUnit.AddCell()
-//		cellUnit.SetValue(mapping.Unit)
-//
-//		rowModifyDate := sheet.AddRow()
-//		rowModifyCell := rowModifyDate.AddCell()
-//		rowModifyCell.SetValue("更新时间")
-//		rowModifyCell = rowModifyDate.AddCell()
-//		rowModifyCell.SetValue(dataList[len(dataList)-1].ModifyTime)
-//
-//		fmt.Println("len(dataList):", len(dataList))
-//		dataMax, err := data_manage.GetMtjhCount(indexCode)
-//		if err != nil {
-//			fmt.Println("获取指标最大数据量失败", err.Error())
-//			return
-//		}
-//		fmt.Println("dataMax:", dataMax)
-//		if len(dataList) <= 0 {
-//			for n := 0; n < dataMax; n++ {
-//				rowIndex := 6 + n
-//				row := sheet.Row(rowIndex)
-//				row.AddCell()
-//				row.AddCell()
-//				row.AddCell()
-//			}
-//		} else {
-//			endRowIndex := 0
-//			for rk, dv := range dataList {
-//				rowIndex := 6 + rk
-//				row := sheet.Row(rowIndex)
-//				displayDate, _ := time.Parse(utils.FormatDate, dv.DataTime)
-//				displayDateCell := row.AddCell()
-//				style := new(xlsx.Style)
-//				style.ApplyAlignment = true
-//				style.Alignment.WrapText = true
-//				displayDateCell.SetStyle(style)
-//				displayDateCell.SetDate(displayDate)
-//
-//				row.AddCell().SetValue(dv.DealValue)
-//				row.AddCell()
-//				endRowIndex = rowIndex
-//			}
-//			if len(dataList) < dataMax {
-//				dataLen := dataMax - len(dataList)
-//				for n := 0; n < dataLen; n++ {
-//					rowIndex := (endRowIndex + 1) + n
-//					row := sheet.Row(rowIndex)
-//					row.AddCell()
-//					row.AddCell()
-//					row.AddCell()
-//				}
-//			}
-//		}
-//	}
-//
-//	err := xlsxFile.Save(downLoadnFilePath)
-//	if err != nil {
-//		br.Msg = "保存文件失败"
-//		br.ErrMsg = "保存文件失败"
-//		return
-//	}
-//	fileName := `隆众资讯数据`
-//	if len(secNameList) > 0 {
-//		fileName = secNameList[0].ClassifyName
-//	}
-//	fileName += time.Now().Format(utils.FormatDateUnSpace) + `.xlsx` //文件名称
-//	this.Ctx.Output.Download(downLoadnFilePath, fileName)
-//	defer func() {
-//		os.Remove(downLoadnFilePath)
-//	}()
-//	br.Ret = 200
-//	br.Success = true
-//	br.Msg = "success"
-//
-//}
-
 // BatchIndexList
 // @Title 隆众资讯批量操作指标列表
 // @Description 隆众资讯批量操作指标列表