|
@@ -2635,6 +2635,7 @@ func (this *TradeCommonController) MtjhData() {
|
|
|
product.Area = v.Area
|
|
|
product.Variety = v.Variety
|
|
|
product.Frequency = v.Frequency
|
|
|
+ product.CreateTime = v.CreateTime
|
|
|
|
|
|
total, err := data_manage.GetMtjhIndexDataCount(v.IndexCode)
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
@@ -2693,572 +2694,350 @@ func (this *TradeCommonController) MtjhSearchList() {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+func (this *TradeCommonController) MtjhSingleData() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ indexCode := this.GetString("IndexCode")
|
|
|
+ pageSize, _ := this.GetInt("PageSize")
|
|
|
+ currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ var startSize int
|
|
|
+
|
|
|
+ if pageSize <= 0 {
|
|
|
+ pageSize = utils.PageSize20
|
|
|
+ }
|
|
|
+ if currentIndex <= 0 {
|
|
|
+ currentIndex = 1
|
|
|
+ }
|
|
|
+ startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
+
|
|
|
+
|
|
|
+ mapping, err := data_manage.GetMtjhMappingItemByCode(indexCode)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取煤炭数据失败"
|
|
|
+ br.ErrMsg = "获取煤炭度数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ items, err := data_manage.GetBaseFromMtjhIndexByCode(indexCode, startSize, pageSize)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取煤炭数据失败"
|
|
|
+ br.ErrMsg = "获取煤炭度数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ resp := data_manage.BaseFromMtjhIndexList{
|
|
|
+ BaseFromMtjhMappingId: mapping.BaseFromMtjhMappingId,
|
|
|
+ IndexName: mapping.IndexName,
|
|
|
+ IndexCode: mapping.IndexCode,
|
|
|
+ Area: mapping.Area,
|
|
|
+ Port: mapping.Port,
|
|
|
+ Unit: mapping.Unit,
|
|
|
+ Frequency: mapping.Frequency,
|
|
|
+ CreateTime: mapping.CreateTime,
|
|
|
+ Variety: mapping.Variety,
|
|
|
+ DataList: items,
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = resp
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (this *TradeCommonController) MtjhFrequency() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+
|
|
|
+ area := this.GetString("Area")
|
|
|
+
|
|
|
+ list, err := data_manage.GetMtjhFrequencyByArea(area)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取煤炭频度数据失败"
|
|
|
+ br.ErrMsg = "获取煤炭频度数据失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "获取成功"
|
|
|
+ br.Data = list
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
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+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- br := new(models.BaseResponse).Init()
|
|
|
- defer func() {
|
|
|
- this.Data["json"] = br
|
|
|
- this.ServeJSON()
|
|
|
- }()
|
|
|
- classifyId, _ := this.GetInt("ClassifyId")
|
|
|
- var suffix string
|
|
|
- if classifyId == 1 {
|
|
|
- suffix = "jsm_index"
|
|
|
- } else if classifyId == 2 {
|
|
|
- suffix = "company_index"
|
|
|
- } else if classifyId == 3 {
|
|
|
- suffix = "firm_index"
|
|
|
- } else if classifyId == 4 {
|
|
|
- suffix = "coastal_index"
|
|
|
- } else if classifyId == 5 {
|
|
|
- suffix = "inland_index"
|
|
|
- }
|
|
|
- breedName := this.GetString("TypeName")
|
|
|
-
|
|
|
- secNameList := make([]*models.EdbdataExportList, 0)
|
|
|
-
|
|
|
- dir, _ := os.Executable()
|
|
|
- exPath := filepath.Dir(dir)
|
|
|
-
|
|
|
- downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
- xlsxFile := xlsx.NewFile()
|
|
|
-
|
|
|
-
|
|
|
- if breedName != "" {
|
|
|
-
|
|
|
- var secNameList []*string
|
|
|
- var err error
|
|
|
- if classifyId == 1 {
|
|
|
- secNameList, err = data_manage.GetClassifyJsmByGroupName(breedName)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("获取数据失败,Err:" + err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- secNameList, err = data_manage.GetClassifyFromCoalByGroupName(suffix, breedName)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("获取数据失败,Err:" + err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if len(secNameList) <= 0 {
|
|
|
- fmt.Println("secNameList长度为0")
|
|
|
- return
|
|
|
- }
|
|
|
- sheetNew, err := xlsxFile.AddSheet(breedName)
|
|
|
-
|
|
|
- if err != nil {
|
|
|
- fmt.Println("新增Sheet失败", err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- windRow := sheetNew.AddRow()
|
|
|
- secNameRow := sheetNew.AddRow()
|
|
|
- indexCodeRow := sheetNew.AddRow()
|
|
|
- frequencyRow := sheetNew.AddRow()
|
|
|
- unitRow := sheetNew.AddRow()
|
|
|
- lastModifyDateRow := sheetNew.AddRow()
|
|
|
-
|
|
|
- var dataMax int
|
|
|
- if classifyId == 1 {
|
|
|
- dataMax, err = data_manage.GetCoalJsmMaxCount(breedName)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("获取指标最大数据量失败", err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- dataMax, err = data_manage.GetCoalCompanyMaxCount(suffix, breedName)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("获取指标最大数据量失败", err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- setRowIndex := 6
|
|
|
- for k, sv := range secNameList {
|
|
|
-
|
|
|
- dataList, err := data_manage.GetBaseFromCoalIndexByCode(suffix, *sv)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取数据失败"
|
|
|
- br.ErrMsg = "获取数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- windRow.AddCell().SetValue(breedName)
|
|
|
- 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)
|
|
|
- if classifyId == 3 {
|
|
|
- displayDateCell := row.AddCell()
|
|
|
- displayDateCell.SetValue(dv.DataTime)
|
|
|
- } else {
|
|
|
- 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 {
|
|
|
- name := this.GetString("IndexName")
|
|
|
- indexCode := this.GetString("IndexCode")
|
|
|
- unit := this.GetString("UnitName")
|
|
|
- modifyTime := this.GetString("ModifyTime")
|
|
|
-
|
|
|
- sheet, err := xlsxFile.AddSheet("指标")
|
|
|
- if err != nil {
|
|
|
- br.Msg = "新增Sheet失败"
|
|
|
- br.ErrMsg = "新增Sheet失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- dataList, err := data_manage.GetBaseFromCoalIndexByCode(suffix, 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(name)
|
|
|
- indexCodeRow := sheet.AddRow()
|
|
|
- indexCodeRow.AddCell().SetValue("指标ID")
|
|
|
- indexCodeRow.AddCell().SetValue(indexCode)
|
|
|
-
|
|
|
- rowFrequency := sheet.AddRow()
|
|
|
- celFrequency := rowFrequency.AddCell()
|
|
|
- celFrequency.SetValue("频率")
|
|
|
- rowFrequency.AddCell().SetValue(dataList[0].Frequency)
|
|
|
-
|
|
|
- rowUnit := sheet.AddRow()
|
|
|
- celUnit := rowUnit.AddCell()
|
|
|
- celUnit.SetValue("单位")
|
|
|
- cellUnit := rowUnit.AddCell()
|
|
|
- cellUnit.SetValue(unit)
|
|
|
-
|
|
|
- rowModifyDate := sheet.AddRow()
|
|
|
- rowModifyCell := rowModifyDate.AddCell()
|
|
|
- rowModifyCell.SetValue("更新时间")
|
|
|
- rowModifyCell = rowModifyDate.AddCell()
|
|
|
- rowModifyCell.SetValue(modifyTime)
|
|
|
-
|
|
|
- fmt.Println("len(dataList):", len(dataList))
|
|
|
- dataMax, err := data_manage.GetCoalCount(suffix, breedName)
|
|
|
- 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("06.01.02") + `.xlsx`
|
|
|
- this.Ctx.Output.Download(downLoadnFilePath, fileName)
|
|
|
- defer func() {
|
|
|
- os.Remove(downLoadnFilePath)
|
|
|
- }()
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Msg = "success"
|
|
|
-
|
|
|
-}
|
|
|
-*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|