瀏覽代碼

新增隆众调研指标数据获取

hongze 3 年之前
父節點
當前提交
17ec31f40d
共有 4 個文件被更改,包括 502 次插入18 次删除
  1. 232 3
      models/data_source_longzhong.go
  2. 2 0
      models/db.go
  3. 235 6
      services/data_source_longzhong.go
  4. 33 9
      services/task.go

+ 232 - 3
models/data_source_longzhong.go

@@ -403,11 +403,240 @@ WHERE price_id = ? `
 	return
 }
 
-
-func GetDisplayTime(longzhonginfoId int)(display_time string,err error)  {
+func GetDisplayTime(longzhonginfoId int) (display_time string, err error) {
 	o := orm.NewOrm()
 	o.Using("edb")
 	sql := ` SELECT max(a.display_time) AS display_time FROM longzhongdata AS a WHERE a.longzhonginfo_id=? `
 	err = o.Raw(sql, longzhonginfoId).QueryRow(&display_time)
 	return
-}
+}
+
+type SurveyProduct struct {
+	Message  string `json:"message"`
+	Response struct {
+		List []struct {
+			AreaName             interface{} `json:"areaName"`
+			BreedID              string      `json:"breedId"`
+			BreedName            string      `json:"breedName"`
+			Custom               string      `json:"custom"`
+			CustomID             string      `json:"customId"`
+			CustomType           int64       `json:"customType"`
+			Device               string      `json:"device"`
+			DeviceID             string      `json:"deviceId"`
+			Frequency            int64       `json:"frequency"`
+			InputMode            int64       `json:"inputMode"`
+			InputValue           interface{} `json:"inputValue"`
+			Labels               interface{} `json:"labels"`
+			ProductCraft         string      `json:"productCraft"`
+			ProductCraftID       string      `json:"productCraftId"`
+			ProductLine          string      `json:"productLine"`
+			ProjectQuotaID       int64       `json:"projectQuotaId"`
+			ProvinceName         interface{} `json:"provinceName"`
+			QuotaID              string      `json:"quotaId"`
+			QuotaName            string      `json:"quotaName"`
+			QuotaSampleID        int64       `json:"quotaSampleId"`
+			ResearchStartDate    interface{} `json:"researchStartDate"`
+			ResearchStopDate     interface{} `json:"researchStopDate"`
+			SampleID             string      `json:"sampleId"`
+			SampleName           string      `json:"sampleName"`
+			SampleType           int64       `json:"sampleType"`
+			TaskActualFinishTime interface{} `json:"taskActualFinishTime"`
+			TaskShouldFinishTime interface{} `json:"taskShouldFinishTime"`
+			UnitID               string      `json:"unitId"`
+			UnitName             string      `json:"unitName"`
+		} `json:"list"`
+		PageNum  int64 `json:"pageNum"`
+		PageSize int64 `json:"pageSize"`
+		Pages    int64 `json:"pages"`
+		Total    int64 `json:"total"`
+	} `json:"response"`
+	Status string `json:"status"`
+}
+
+type LongzhongSurveyProduct struct {
+	SurveyProductId      int `orm:"column(survey_product_id);pk"`
+	ProjectQuotaId       int64
+	BreedId              string
+	BreedName            string
+	QuotaId              string
+	QuotaName            string
+	UnitId               string
+	UnitName             string
+	SampleType           int64
+	SampleId             string
+	SampleName           string
+	DeviceId             string
+	Device               string
+	ProductCraftId       string
+	ProductCraft         string
+	ProductLine          string
+	InputMode            int64
+	Frequency            int64
+	InputValue           string
+	TaskShouldFinishTime int
+	CustomId             string
+	CustomType           int64
+	Custom               string
+	QuotaSampleId        int64
+	StartDate            string
+	EndDate              string
+}
+
+//判断指标数据是否已经录入
+func GetLongzhongSurveyProductCount(quotaSampleId int64) (count int, err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := `SELECT COUNT(1) AS count FROM longzhong_survey_product WHERE quota_sample_id=? `
+	err = o.Raw(sql, quotaSampleId).QueryRow(&count)
+	return
+}
+
+func AddLongzhongSurveyProduct(item *LongzhongSurveyProduct) (err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	_, err = o.Insert(item)
+	return
+}
+
+func ModifLongzhongSurveyProduct(item *LongzhongSurveyProduct) (err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := `UPDATE  longzhong_survey_product
+			SET
+			  breed_id = ?,
+			  breed_name = ?,
+			  quota_id= ?,
+			  quota_name=?,
+			  unit_id = ?,
+			  unit_name = ?,
+			  project_quota_id = ?
+			WHERE quota_sample_id = ? `
+	_, err = o.Raw(sql, item.BreedId, item.BreedName, item.QuotaId, item.QuotaName, item.UnitId, item.UnitName, item.ProjectQuotaId, item.QuotaSampleId).Exec()
+	return
+}
+
+//判断指标数据是否已经录入
+func GetLongzhongSurveyList() (items []*LongzhongSurveyProduct, err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := `SELECT * FROM longzhong_survey_product ORDER BY survey_product_id ASC`
+	_, err = o.Raw(sql).QueryRows(&items)
+	return
+}
+
+type LongzhongSurveyData struct {
+	SurveyDataId         int `orm:"column(survey_data_id);pk"`
+	SurveyProductId      int
+	ProjectQuotaId       int64
+	BreedId              string
+	BreedName            string
+	QuotaId              string
+	QuotaName            string
+	UnitId               string
+	UnitName             string
+	SampleType           int64
+	SampleId             string
+	SampleName           string
+	DeviceId             string
+	Device               string
+	ProductCraftId       string
+	ProductCraft         string
+	ProductLine          string
+	InputMode            int64
+	Frequency            int64
+	InputValue           string
+	TaskShouldFinishTime int64
+	CustomId             string
+	CustomType           int64
+	Custom               string
+	QuotaSampleId        int64
+	TaskActualFinishTime int64
+	AreaName             string
+	ProvinceName         string
+	ResearchStartData    int64
+	ResearchStopData     int64
+	DataTime             string
+}
+
+func AddLongzhongSurveyData(item *LongzhongSurveyData) (err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	_, err = o.Insert(item)
+	return
+}
+
+type LzSurveyData struct {
+	Message  string `json:"message"`
+	Response struct {
+		List []struct {
+			AreaName             interface{} `json:"areaName"`
+			BreedID              string      `json:"breedId"`
+			BreedName            string      `json:"breedName"`
+			Custom               string      `json:"custom"`
+			CustomID             string      `json:"customId"`
+			CustomType           int64       `json:"customType"`
+			Device               string      `json:"device"`
+			DeviceID             string      `json:"deviceId"`
+			Frequency            int64       `json:"frequency"`
+			InputMode            int64       `json:"inputMode"`
+			InputValue           string      `json:"inputValue"`
+			Labels               interface{} `json:"labels"`
+			ProductCraft         string      `json:"productCraft"`
+			ProductCraftID       string      `json:"productCraftId"`
+			ProductLine          string      `json:"productLine"`
+			ProjectQuotaID       int64       `json:"projectQuotaId"`
+			ProvinceName         interface{} `json:"provinceName"`
+			QuotaID              string      `json:"quotaId"`
+			QuotaName            string      `json:"quotaName"`
+			QuotaSampleID        int64       `json:"quotaSampleId"`
+			ResearchStartDate    int64       `json:"researchStartDate"`
+			ResearchStopDate     int64       `json:"researchStopDate"`
+			SampleID             string      `json:"sampleId"`
+			SampleName           string      `json:"sampleName"`
+			SampleType           int64       `json:"sampleType"`
+			TaskActualFinishTime int64       `json:"taskActualFinishTime"`
+			TaskShouldFinishTime int64       `json:"taskShouldFinishTime"`
+			UnitID               string      `json:"unitId"`
+			UnitName             string      `json:"unitName"`
+		} `json:"list"`
+		PageNum  int64 `json:"pageNum"`
+		PageSize int64 `json:"pageSize"`
+		Pages    int64 `json:"pages"`
+		Total    int64 `json:"total"`
+	} `json:"response"`
+	Status string `json:"status"`
+}
+
+//判断指标数据是否已经录入
+func GetLzSurveyDataCount(surveyProductId, quotaSampleId int, dataTime string) (count int, err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := `SELECT COUNT(1) AS count FROM longzhong_survey_data WHERE survey_product_id=? AND quota_sample_id=? AND data_time=? `
+	err = o.Raw(sql, surveyProductId, quotaSampleId, dataTime).QueryRow(&count)
+	return
+}
+
+type LzSurveyMaxAndMinInfo struct {
+	MinDate  string  `description:"最小日期"`
+	MaxDate  string  `description:"最大日期"`
+	MinValue float64 `description:"最小值"`
+	MaxValue float64 `description:"最大值"`
+}
+
+func GetLzSurveyMaxAndMinInfo(surveyProductId, quotaSampleId int) (item *LzSurveyMaxAndMinInfo, err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := ``
+	sql = ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date,MIN(input_value) AS min_value,MAX(input_value) AS max_value 
+           FROM longzhong_survey_data WHERE survey_product_id=? AND quota_sample_id=? `
+	err = o.Raw(sql, surveyProductId, quotaSampleId).QueryRow(&item)
+	return
+}
+
+func ModifyLzSurveyMaxAndMinInfo(item *LzSurveyMaxAndMinInfo, surveyProductId int) (err error) {
+	o := orm.NewOrm()
+	o.Using("edb")
+	sql := ` UPDATE longzhong_survey_product SET start_date=?,end_date=?,min_value=?,max_value=? WHERE survey_product_id=? `
+	_, err = o.Raw(sql, item.MinDate, item.MaxDate, item.MinValue, item.MaxValue, surveyProductId).Exec()
+	return
+}

+ 2 - 0
models/db.go

@@ -63,5 +63,7 @@ func init() {
 		new(data_manage.EdbDataWind),
 		new(data_manage.EdbDataThs),
 		new(data_manage.EdbDataPb),
+		new(LongzhongSurveyProduct),
+		new(LongzhongSurveyData),
 	)
 }

+ 235 - 6
services/data_source_longzhong.go

@@ -1,6 +1,7 @@
 package services
 
 import (
+	"context"
 	"encoding/json"
 	"errors"
 	"fmt"
@@ -13,7 +14,6 @@ import (
 	"rdluck_tools/http"
 	"strconv"
 	"time"
-	"context"
 )
 
 //获取隆众信息表中指标
@@ -223,7 +223,7 @@ func GetLzProductDetail(cont context.Context) (err error) {
 	utils.LzFileLog.Info("start GetLzProductDetail")
 	defer func() {
 		if err != nil {
-			utils.LzFileLog.Info("Err:"+err.Error())
+			utils.LzFileLog.Info("Err:" + err.Error())
 			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"GetLzProductDetail:失败提醒", "ErrMsg:"+err.Error(), utils.EmailSendToUsers)
 		}
 	}()
@@ -250,7 +250,7 @@ func GetLzProductDetail(cont context.Context) (err error) {
 			}
 
 			fmt.Println("page:", i, totalPage)
-			utils.LzFileLog.Info("Page:%s",strconv.Itoa(i))
+			utils.LzFileLog.Info("Page:%s", strconv.Itoa(i))
 			timestamp := fmt.Sprintf("%d", time.Now().Unix())
 			token := utils.MD5(username + timestamp + utils.MD5(password))
 
@@ -268,14 +268,14 @@ func GetLzProductDetail(cont context.Context) (err error) {
 			body, err := http.Post(postUrl, param.Encode())
 
 			if err != nil {
-				utils.LzFileLog.Info("Post Err:%s",err.Error())
+				utils.LzFileLog.Info("Post Err:%s", err.Error())
 				return err
 			}
-			utils.LzFileLog.Info("GetLzProductDetail Result: %s",string(body))
+			utils.LzFileLog.Info("GetLzProductDetail Result: %s", string(body))
 			resp := new(models.LzProductInfoDetailResp)
 			err = json.Unmarshal(body, &resp)
 			if err != nil {
-				utils.LzFileLog.Info("Unmarshal Err:%s",err.Error())
+				utils.LzFileLog.Info("Unmarshal Err:%s", err.Error())
 				return err
 			}
 			if resp.Code != "1" {
@@ -942,3 +942,232 @@ func LzPriceExportExcel() {
 		return
 	}
 }
+
+//隆众-调研指标
+func GetLzSurveyProduct(cont context.Context) (err error) {
+	var msg string
+	defer func() {
+		if err != nil {
+			fmt.Println("Err:" + err.Error())
+			go utils.SendEmail("获取隆众调研指标失败"+time.Now().Format("2006-01-02 15:04:05"), ";Err:"+err.Error(), utils.EmailSendToUsers)
+		}
+		if msg != "" {
+			fmt.Println("msg:", msg)
+			go utils.SendEmail("获取隆众调研指标失败"+time.Now().Format("2006-01-02 15:04:05"), ";msg:"+msg, utils.EmailSendToUsers)
+		}
+	}()
+
+	username := "hzmd"
+	password := "HZMD2020"
+
+	pageIndex := 0
+	for {
+		pageIndex++
+		getUrl := `https://openapi.oilchem.net/research/getProduct?passWord=` + password + `&userName=` + username + `&pageSize=100&pageNum=` + strconv.Itoa(pageIndex)
+		body, err := http.Get(getUrl)
+		if err != nil {
+			msg = "获取隆众调研指标失败:Err" + err.Error()
+			return err
+		}
+		utils.FileLog.Info("%s", string(body))
+		infoItem := new(models.SurveyProduct)
+		err = json.Unmarshal(body, &infoItem)
+		if err != nil {
+			msg = "获取隆众调研指标失败:Unmarshal Err " + err.Error() + " ;body:" + string(body)
+			return err
+		}
+		if infoItem.Status != "200" {
+			msg = "获取隆众调研指标失败:body " + string(body)
+			return nil
+		}
+		for _, n := range infoItem.Response.List {
+			count, err := models.GetLongzhongSurveyProductCount(n.QuotaSampleID)
+			if err != nil {
+				msg = "判断隆众调研指标是否存在失败:err " + err.Error()
+				return err
+			}
+			item := new(models.LongzhongSurveyProduct)
+			item.ProjectQuotaId = n.ProjectQuotaID
+			item.BreedId = n.BreedID
+			item.BreedName = n.BreedName
+			item.QuotaId = n.QuotaID
+			item.QuotaName = n.QuotaName
+			item.UnitId = n.UnitID
+			item.UnitName = n.UnitName
+			item.SampleType = n.SampleType
+			item.SampleId = n.SampleID
+			item.SampleName = n.SampleName
+			item.DeviceId = n.DeviceID
+			item.Device = n.Device
+			item.ProductCraftId = n.ProductCraftID
+			item.ProductCraft = n.ProductCraft
+			item.ProductLine = n.ProductLine
+			item.InputMode = n.InputMode
+			item.Frequency = n.Frequency
+			item.CustomId = n.CustomID
+			item.CustomType = n.CustomType
+			item.Custom = n.Custom
+			item.QuotaSampleId = n.QuotaSampleID
+			if count > 0 {
+				fmt.Println("存在", n.QuotaName, n.QuotaSampleID)
+				//修改
+				err = models.ModifLongzhongSurveyProduct(item)
+				if err != nil {
+					msg = "修改隆众价格指标失败:err " + err.Error()
+					return err
+				}
+			} else {
+				err = models.AddLongzhongSurveyProduct(item)
+				if err != nil {
+					msg = "新增隆众价格指标失败:err " + err.Error()
+					return err
+				}
+			}
+		}
+		pageIndex = pageIndex + 1
+		totalPage := utils.PageCount(int(infoItem.Response.Total), 100)
+		if pageIndex > totalPage {
+			break
+		}
+	}
+	return
+}
+
+//隆众-调研指标数据
+func GetLzSurveyProductData(cont context.Context) (err error) {
+	var msg string
+	defer func() {
+		if err != nil {
+			fmt.Println("Err:" + err.Error())
+			go utils.SendEmail("获取隆众调研指标数据失败"+time.Now().Format("2006-01-02 15:04:05"), ";Err:"+err.Error(), utils.EmailSendToUsers)
+		}
+		if msg != "" {
+			fmt.Println("msg:", msg)
+			go utils.SendEmail("获取隆众调研指标数据失败"+time.Now().Format("2006-01-02 15:04:05"), ";msg:"+msg, utils.EmailSendToUsers)
+			utils.FileLog.Info("%s", msg)
+		}
+	}()
+
+	priceInfoList, err := models.GetLongzhongSurveyList()
+	if err != nil {
+		msg = "获取隆众调研指标数据失败,Err:" + err.Error()
+		return
+	}
+	username := "hzmd"
+	password := "HZMD2020"
+
+	paramMap := make(map[string]interface{})
+	paramMap["userName"] = username
+	paramMap["passWord"] = password
+	paramMap["pageSize"] = 100
+
+	startDate := time.Now().AddDate(-4, 0, 0).UnixNano() / 1e6
+	endDate := time.Now().UnixNano() / 1e6
+
+	for k, v := range priceInfoList {
+		pageIndex := 1
+		if v.EndDate != "" {
+			endDateTime, _ := time.Parse(utils.FormatDate, v.EndDate)
+			startDate = endDateTime.UnixNano() / 1e6
+		}
+		for {
+			paramMap["pageNum"] = pageIndex
+			paramMap["projectQuotaId"] = v.ProjectQuotaId
+			paramMap["quotaSampleId"] = v.QuotaSampleId
+			paramMap["researchStartDateTime"] = startDate
+			paramMap["researchEndDateTime"] = endDate
+
+			fmt.Println(k, v)
+			getUrl := `https://openapi.oilchem.net/research/productPage`
+			postData, err := json.Marshal(paramMap)
+			if err != nil {
+				fmt.Println("postData Err:", err.Error())
+			}
+			body, err := http.Post(getUrl, string(postData), "application/json")
+			if err != nil {
+				msg = "获取隆众调研指标数据失败:Err" + err.Error()
+				return err
+			}
+			utils.FileLog.Info(string(body))
+			dataList := new(models.LzSurveyData)
+			err = json.Unmarshal(body, &dataList)
+			if err != nil {
+				msg = "获取隆众调研指标数据失败:Unmarshal Err " + err.Error() + " ;body:" + string(body)
+				return err
+			}
+			if dataList.Status != "200" {
+				msg = "获取隆众调研指标数据失败:body " + string(body)
+				return nil
+			}
+			for _, n := range dataList.Response.List {
+				//dateTime := time.Unix(n.TaskActualFinishTime/1000, 0)
+				//dateTimeStr := dateTime.Format(utils.FormatDate)
+
+				shouldDateTime := time.Unix(n.TaskShouldFinishTime/1000, 0)
+				shouldDateTimeStr := shouldDateTime.Format(utils.FormatDate)
+
+				//fmt.Println("QuotaSampleID:", n.QuotaSampleID, "taskActualFinishTime:", dateTimeStr, "taskShouldFinishTime:", shouldDateTimeStr)
+				count, err := models.GetLzSurveyDataCount(v.SurveyProductId, int(v.QuotaSampleId), shouldDateTimeStr)
+				if err != nil {
+					msg = "获取隆众调研指标数据失败:err " + err.Error()
+					return err
+				}
+				if count <= 0 {
+					item := new(models.LongzhongSurveyData)
+					item.SurveyProductId = v.SurveyProductId
+					item.ProjectQuotaId = n.ProjectQuotaID
+					item.BreedId = n.BreedID
+					item.BreedName = n.BreedName
+					item.QuotaId = n.QuotaID
+					item.QuotaName = n.QuotaName
+					item.UnitId = n.UnitID
+					item.UnitName = n.UnitName
+					item.SampleType = n.SampleType
+					item.SampleId = n.SampleID
+					item.SampleName = n.SampleName
+					item.DeviceId = n.DeviceID
+					item.Device = n.Device
+					item.ProductCraftId = n.ProductCraftID
+					item.ProductCraft = n.ProductCraft
+					item.ProductLine = n.ProductLine
+					item.InputMode = n.InputMode
+					item.Frequency = n.Frequency
+					item.InputValue = n.InputValue
+					item.TaskShouldFinishTime = n.TaskShouldFinishTime
+					item.CustomId = n.CustomID
+					item.CustomType = n.CustomType
+					item.Custom = n.Custom
+					item.QuotaSampleId = n.QuotaSampleID
+					item.TaskActualFinishTime = n.TaskActualFinishTime
+					//item.AreaName = n.AreaName.(string)
+					//item.ProvinceName = n.ProvinceName.(string)
+					item.ResearchStartData = n.ResearchStartDate
+					item.ResearchStopData = n.ResearchStopDate
+					item.DataTime = shouldDateTimeStr
+					err = models.AddLongzhongSurveyData(item)
+					if err != nil {
+						msg = "新增调研指标数据失败:err " + err.Error()
+						return err
+					}
+				}
+			}
+			pageIndex = pageIndex + 1
+			totalPage := utils.PageCount(int(dataList.Response.Total), 100)
+			if pageIndex > totalPage {
+				break
+			}
+		}
+
+		item, err := models.GetLzSurveyMaxAndMinInfo(v.SurveyProductId, int(v.QuotaSampleId))
+		if err != nil {
+			return err
+		}
+		if item != nil && item.MaxDate != "" && item.MinDate != "" {
+			err = models.ModifyLzSurveyMaxAndMinInfo(item, v.SurveyProductId)
+			if err != nil {
+				return err
+			}
+		}
+	}
+	return
+}

+ 33 - 9
services/task.go

@@ -56,18 +56,25 @@ func Task() {
 func releaseTask() {
 
 	//隆众指标获取
-	getLzProductList := task.NewTask("getLzProductList", "0 0 11-19/1 * * * ", GetLzProductList)
-	task.AddTask("getLzProductList", getLzProductList)
+	//getLzProductList := task.NewTask("getLzProductList", "0 0 11-19/1 * * * ", GetLzProductList)
+	//task.AddTask("getLzProductList", getLzProductList)
 	//隆众指标数据获取
-	getLzProductDetail := task.NewTask("getLzProductDetail", "0 5 11-19/1 * * * ", GetLzProductDetail)
-	task.AddTask("getLzProductDetail", getLzProductDetail)
+	//getLzProductDetail := task.NewTask("getLzProductDetail", "0 5 11-19/1 * * * ", GetLzProductDetail)
+	//task.AddTask("getLzProductDetail", getLzProductDetail)
 
 	//隆众价格指标获取
-	getLzProductPriceProduct := task.NewTask("getLzProductPriceProduct", "0 5 11-19/1 * * * ", GetLzProductPriceProduct)
-	task.AddTask("getLzProductPriceProduct", getLzProductPriceProduct)
+	//getLzProductPriceProduct := task.NewTask("getLzProductPriceProduct", "0 5 11-19/1 * * * ", GetLzProductPriceProduct)
+	//task.AddTask("getLzProductPriceProduct", getLzProductPriceProduct)
 	//隆众价格指标数据获取
-	getLzProductPriceData := task.NewTask("getLzProductPriceData", "0 10 11-19/1 * * * ", GetLzProductPriceData)
-	task.AddTask("getLzProductPriceData", getLzProductPriceData)
+	//getLzProductPriceData := task.NewTask("getLzProductPriceData", "0 10 11-19/1 * * * ", GetLzProductPriceData)
+	//task.AddTask("getLzProductPriceData", getLzProductPriceData)
+
+	//隆众调研指标获取
+	getLzSurveyProduct := task.NewTask("getLzSurveyProduct", "0 5 11-19/1 * * * ", GetLzSurveyProduct)
+	task.AddTask("getLzSurveyProduct", getLzSurveyProduct)
+	//隆众调研指标数据获取
+	getLzSurveyProductData := task.NewTask("getLzSurveyProductData", "0 10 11-19/1 * * * ", GetLzSurveyProductData)
+	task.AddTask("getLzSurveyProductData", getLzSurveyProductData)
 
 	//发送邮件
 	sendEmail := task.NewTask("sendEmail", "0 0 12 * * 0 ", SendEmail)
@@ -144,4 +151,21 @@ func RefreshCalculateData(cont context.Context) (err error) {
 	//刷新公历转农历数据
 	//go data.RefreshDataFromQuarterAll()
 	return
-}
+}
+
+//func Task() {
+//	fmt.Println("start")
+//	cont := new(context.Context)
+//	GetLzSurveyProductData(*cont)
+//	//startDate := time.Now().AddDate(-30, 0, 0).UnixNano() / 1e6
+//
+//	//fmt.Println(startDate)
+//	//fmt.Println(endDate)
+//	fmt.Println("end")
+//}
+
+/*
+endData:=time.Now().UnixNano()/1e6
+	dateTime:=time.Unix(endData/1000,0)
+	fmt.Println(dateTime)
+ */