|
|
@ -200,13 +200,14 @@ func (h *HealthReportStat) PostReportAnswerListAll(c *gin.Context) { |
|
|
tadayTime := commonus.GetYesterDay() |
|
|
tadayTime := commonus.GetYesterDay() |
|
|
if reportAnswer.Date != "" { |
|
|
if reportAnswer.Date != "" { |
|
|
tadayTime = reportAnswer.Date |
|
|
tadayTime = reportAnswer.Date |
|
|
|
|
|
// fmt.Printf("时间是=》%v\n", reportAnswer.Date)
|
|
|
} |
|
|
} |
|
|
//判断日期是否已经统计
|
|
|
//判断日期是否已经统计
|
|
|
calCulTime := commonus.DateToTimeStamp(tadayTime + " 12:00:00") |
|
|
calCulTime := commonus.DateToTimeStamp(tadayTime + " 12:00:00") |
|
|
var reportInfo locationing.ReportAddress |
|
|
var reportInfo locationing.ReportAddress |
|
|
errInfo := global.GVA_DB_HealthReport.Where("calcultime = ?", calCulTime).First(&reportInfo).Error |
|
|
errInfo := global.GVA_DB_HealthReport.Where("calcultime = ?", calCulTime).First(&reportInfo).Error |
|
|
if errInfo == nil { |
|
|
if errInfo == nil { |
|
|
response.Result(102, errInfo, "该日期已经统计", c) |
|
|
response.Result(102, tadayTime, "该日期已经统计", c) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
//获取围栏地址
|
|
|
//获取围栏地址
|
|
|
@ -340,6 +341,7 @@ func (d *dataLockStatistics) getUserAnswerList(jobid, tadayTime string, page int |
|
|
d.mutext.Lock() |
|
|
d.mutext.Lock() |
|
|
defer d.mutext.Unlock() |
|
|
defer d.mutext.Unlock() |
|
|
calCulTime := tadayTime + " 12:00:00" |
|
|
calCulTime := tadayTime + " 12:00:00" |
|
|
|
|
|
fmt.Printf("page ------------> %v\n", page) |
|
|
// timeStamp := commonus.DateToTimeStamp(calCulTime)
|
|
|
// timeStamp := commonus.DateToTimeStamp(calCulTime)
|
|
|
// var judgeWriteInfoUser locationing.ReportAddress
|
|
|
// var judgeWriteInfoUser locationing.ReportAddress
|
|
|
// getReportAddressErr := global.GVA_DB_HealthReport.Where("calcultime = ?", timeStamp).Take(&judgeWriteInfoUser).Error
|
|
|
// getReportAddressErr := global.GVA_DB_HealthReport.Where("calcultime = ?", timeStamp).Take(&judgeWriteInfoUser).Error
|
|
|
@ -362,9 +364,12 @@ func (d *dataLockStatistics) getUserAnswerList(jobid, tadayTime string, page int |
|
|
writeInfoUser.Userid = v.Userid |
|
|
writeInfoUser.Userid = v.Userid |
|
|
writeInfoUser.AddTime = time.Now().Unix() |
|
|
writeInfoUser.AddTime = time.Now().Unix() |
|
|
writeInfoUser.Address = v_sun.Text |
|
|
writeInfoUser.Address = v_sun.Text |
|
|
|
|
|
AdmDivMap["riskLevel"] = 0 |
|
|
|
|
|
|
|
|
writeInfoUser.CalCulTime = commonus.DateToTimeStamp(calCulTime) |
|
|
writeInfoUser.CalCulTime = commonus.DateToTimeStamp(calCulTime) |
|
|
|
|
|
|
|
|
|
|
|
// fmt.Printf("时间值-----》%v @@@@@@@@@@@@@@@@@@@@ %v", calCulTime, commonus.DateToTimeStamp(calCulTime))
|
|
|
|
|
|
|
|
|
AdmDiv.Userid = v.Userid |
|
|
AdmDiv.Userid = v.Userid |
|
|
AdmDiv.Province = countSplit[0] + "省" |
|
|
AdmDiv.Province = countSplit[0] + "省" |
|
|
writeInfoUser.Province = countSplit[0] + "省" |
|
|
writeInfoUser.Province = countSplit[0] + "省" |
|
|
@ -382,10 +387,33 @@ func (d *dataLockStatistics) getUserAnswerList(jobid, tadayTime string, page int |
|
|
|
|
|
|
|
|
AdmDivMap["city"] = countSplitSun[0] + "市" |
|
|
AdmDivMap["city"] = countSplitSun[0] + "市" |
|
|
AdmDivMap["county"] = countSplitSun[1] + "市" |
|
|
AdmDivMap["county"] = countSplitSun[1] + "市" |
|
|
|
|
|
if isRiskYes == true { //判断是否要进行风险等级判定
|
|
|
|
|
|
for _, riskAre := range regionalRiskLevel { |
|
|
|
|
|
if riskAre.ProvinceName == countSplit[0] { |
|
|
|
|
|
if riskAre.CityName == countSplitSun[0] { |
|
|
|
|
|
writeInfoUser.RiskLevel = riskAre.RiskLevel |
|
|
|
|
|
AdmDivMap["riskLevel"] = riskAre.RiskLevel |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
AdmDiv.City = countSplitSun[0] + "市" |
|
|
AdmDiv.City = countSplitSun[0] + "市" |
|
|
writeInfoUser.City = countSplitSun[0] + "市" |
|
|
writeInfoUser.City = countSplitSun[0] + "市" |
|
|
AdmDivMap["city"] = countSplitSun[0] + "市" |
|
|
AdmDivMap["city"] = countSplitSun[0] + "市" |
|
|
|
|
|
|
|
|
|
|
|
if isRiskYes == true { //判断是否要进行风险等级判定
|
|
|
|
|
|
for _, riskAre := range regionalRiskLevel { |
|
|
|
|
|
if riskAre.ProvinceName == countSplit[0] { |
|
|
|
|
|
if riskAre.CityName == countSplitSun[0] { |
|
|
|
|
|
writeInfoUser.RiskLevel = riskAre.RiskLevel |
|
|
|
|
|
writeInfoUser.RiskLevel = riskAre.RiskLevel |
|
|
|
|
|
AdmDivMap["riskLevel"] = riskAre.RiskLevel |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if len(countSplitSun) == 2 { |
|
|
if len(countSplitSun) == 2 { |
|
|
countSplitSunes := strings.Split(countSplitSun[1], "县") |
|
|
countSplitSunes := strings.Split(countSplitSun[1], "县") |
|
|
if len(countSplitSun) > 1 { |
|
|
if len(countSplitSun) > 1 { |