|
@@ -7,6 +7,7 @@ import (
|
|
|
"ColdVerify_local/lib"
|
|
|
"ColdVerify_local/logs"
|
|
|
"ColdVerify_local/models/Certificate"
|
|
|
+ "ColdVerify_local/models/Device"
|
|
|
"ColdVerify_local/models/System"
|
|
|
"ColdVerify_local/models/Task"
|
|
|
"errors"
|
|
@@ -21,6 +22,7 @@ import (
|
|
|
"gonum.org/v1/plot/vg"
|
|
|
"gonum.org/v1/plot/vg/draw"
|
|
|
"math"
|
|
|
+ "net/http"
|
|
|
"os"
|
|
|
"sort"
|
|
|
"strconv"
|
|
@@ -441,13 +443,7 @@ func extractSecondElement(s string) string {
|
|
|
}
|
|
|
return s // return original string if splitting doesn't give expected parts
|
|
|
}
|
|
|
-func chunkBy[T any](list []T, size int) [][]T {
|
|
|
- var chunks [][]T
|
|
|
- for size < len(list) {
|
|
|
- list, chunks = list[size:], append(chunks, list[0:size:size])
|
|
|
- }
|
|
|
- return append(chunks, list)
|
|
|
-}
|
|
|
+
|
|
|
func splitData(data []string, threshold float64, idWidthMap map[string]float64) [][]string {
|
|
|
var result [][]string
|
|
|
var currentBatch []string
|
|
@@ -1353,6 +1349,120 @@ func (c *TaskDataController) TaskData_Import_TaskData() {
|
|
|
c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
c.ServeJSON()
|
|
|
|
|
|
+} // 重置 SN数据
|
|
|
+func (c *TaskDataController) CopyTaskDataSN() {
|
|
|
+ // 获取登录用户的uuid
|
|
|
+ T_uuid, _ := lib.GetAdminT_Uuid(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id")
|
|
|
+ T_task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "获取任务信息失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ To_T_task_id := c.GetString("To_T_task_id")
|
|
|
+ To_T_task_r, err := Task.Read_Task(To_T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "获取任务信息失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ StartTime := c.GetString("StartTime") + ":00"
|
|
|
+ _, ok := lib.TimeStrToTime(StartTime)
|
|
|
+ if !ok {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "时间格式错误!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ EndTime := c.GetString("EndTime") + ":00"
|
|
|
+ _, ok = lib.TimeStrToTime(EndTime)
|
|
|
+ if !ok {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "时间格式错误!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ SN_List := strings.Split(strings.Trim(c.GetString("SN_List"), "|"), "|")
|
|
|
+
|
|
|
+ for _, v := range SN_List {
|
|
|
+ sn_id := strings.Split(v, ",")
|
|
|
+ if len(sn_id) != 2 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ sn, id_str := sn_id[0], sn_id[1]
|
|
|
+ _, is := Device.Read_DeviceClassList_T_class_T_sn(To_T_task_r.T_class, sn)
|
|
|
+ if !is {
|
|
|
+ dc, is_ := Device.Read_DeviceClassList_T_class_T_sn(T_task_r.T_class, sn)
|
|
|
+ if is_ {
|
|
|
+ dcr := Device.DeviceClassList{
|
|
|
+ T_class: To_T_task_r.T_class,
|
|
|
+ T_id: dc.T_id,
|
|
|
+ T_sn: dc.T_sn,
|
|
|
+ T_failure_time: dc.T_failure_time,
|
|
|
+ T_pdf: dc.T_pdf,
|
|
|
+ T_Certificate_sn: dc.T_Certificate_sn,
|
|
|
+ T_remark: dc.T_remark,
|
|
|
+ T_State: 1,
|
|
|
+ }
|
|
|
+ Device.Add_DeviceClassList(dcr)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Task.Import_Task_Back(sn, id_str, T_task_id, To_T_task_id, StartTime, EndTime)
|
|
|
+
|
|
|
+ }
|
|
|
+ System.Add_UserLogs_T(T_uuid, "复制任务数据", fmt.Sprintf("复制任务数据(%s->%s)[%s|%s]", T_task_id, To_T_task_id, StartTime, EndTime), SN_List)
|
|
|
+
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
+ c.ServeJSON()
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// 复制到
|
|
|
+func (c *TaskDataController) Import_TaskData_SN() {
|
|
|
+ // 获取登录用户的uuid
|
|
|
+ T_uuid, _ := lib.GetAdminT_Uuid(c.Ctx.GetCookie("User_tokey"), c.GetString("User_tokey"))
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id")
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "获取任务信息失败!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ T_sn := c.GetString("T_sn")
|
|
|
+ System.Add_UserLogs_T(T_uuid, "重置 SN数据", "Z_TaskData_"+T_task_id, T_sn)
|
|
|
+ DeviceClass_r, is := Device.Read_DeviceClassList_T_class_T_sn(Task_r.T_class, T_sn)
|
|
|
+ if !is {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: T_sn + " 没找到!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 开始时间 := ""
|
|
|
+ 结束时间 := ""
|
|
|
+
|
|
|
+ 部点终端_list := Device.Read_DeviceClassList_List_id(Task_r.T_class)
|
|
|
+ for _, v := range 部点终端_list {
|
|
|
+ List_data, _ := Task.Read_TaskData_ById_List(Task_r.T_task_id, v.T_sn, v.T_id, "", "", 0, 9999)
|
|
|
+
|
|
|
+ if len(List_data) < 10 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ 开始时间 = List_data[len(List_data)-1].T_time
|
|
|
+ 结束时间 = List_data[0].T_time
|
|
|
+
|
|
|
+ }
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 202, Msg: "数据 没找到 一条可用的!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ Task.Import_TaskData_Back(T_sn, DeviceClass_r.T_id, Task_r.T_task_id, 开始时间, 结束时间)
|
|
|
+
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
+ c.ServeJSON()
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 更新线上数据
|
|
@@ -1599,7 +1709,7 @@ func (c *TaskDataController) RepairSensorData() {
|
|
|
n, _ := time.Parse("2006-01-02 15:04:05", next)
|
|
|
interval := n.Unix() - c.Unix()
|
|
|
//logs.Debug("时间间隔:", interval, "保存时间:", saveTime)
|
|
|
- fmt.Println("当前:", current, "下一个:", next)
|
|
|
+ //fmt.Println("当前:", current, "下一个:", next)
|
|
|
if int(interval) > saveTime {
|
|
|
ttInterval := list[i+1].T_t - list[i].T_t
|
|
|
ttt := list[i].T_t // 温度临时变量
|
|
@@ -1932,14 +2042,14 @@ func (c *TaskDataController) CopyFromPositionAverageSN() {
|
|
|
// return
|
|
|
//}
|
|
|
StartTime := c.GetString("StartTime")
|
|
|
- startTime, ok := lib.TimeStrToTime(StartTime)
|
|
|
+ _, ok := lib.TimeStrToTime(StartTime)
|
|
|
if !ok {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "时间格式错误!"}
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
EndTime := c.GetString("EndTime")
|
|
|
- endTime, ok := lib.TimeStrToTime(EndTime)
|
|
|
+ _, ok = lib.TimeStrToTime(EndTime)
|
|
|
if !ok {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "时间格式错误!"}
|
|
|
c.ServeJSON()
|
|
@@ -1956,7 +2066,10 @@ func (c *TaskDataController) CopyFromPositionAverageSN() {
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
- CopyEndTime := copyTime.Add(endTime.Sub(startTime)).Format("2006-01-02 15:04:05")
|
|
|
+ //CopyEndTime := copyTime.Add(endTime.Sub(startTime)).Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ T_switch_t, _ := c.GetBool("T_switch_t", true)
|
|
|
+ T_switch_h, _ := c.GetBool("T_switch_h", true)
|
|
|
|
|
|
SN_List := strings.Split(strings.Trim(c.GetString("SN_List"), "|"), "|")
|
|
|
if len(SN_List) != 2 {
|
|
@@ -2018,11 +2131,11 @@ func (c *TaskDataController) CopyFromPositionAverageSN() {
|
|
|
ct = ct.Add(time.Second * time.Duration(T_saveT))
|
|
|
}
|
|
|
|
|
|
- Task.DeleteTaskDataByTimeRange(Task_r.T_task_id, CopySN, CopyID, CopyTime, CopyEndTime)
|
|
|
+ //Task.DeleteTaskDataByTimeRange(Task_r.T_task_id, CopySN, CopyID, CopyTime, CopyEndTime)
|
|
|
|
|
|
go func(TaskDataList []Task.TaskData_, task_id string) {
|
|
|
for _, taskData := range TaskDataList {
|
|
|
- Task.InsertTaskData(task_id, taskData)
|
|
|
+ Task.InsertTaskData_TH(task_id, T_switch_t, T_switch_h, taskData)
|
|
|
}
|
|
|
}(list, Task_r.T_task_id)
|
|
|
|
|
@@ -2723,3 +2836,2096 @@ func (c *TaskDataController) Certificate_List() {
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+/*
|
|
|
+===========================
|
|
|
+ 自动填写标签
|
|
|
+========================
|
|
|
+*/
|
|
|
+
|
|
|
+// 自动填写标签数据 标签列表
|
|
|
+func (c *TaskDataController) ListJson() {
|
|
|
+ mySlice := []string{ // 20250310
|
|
|
+ //"柜内所有测点",
|
|
|
+ "均匀性布点",
|
|
|
+ "产品存放区域测点",
|
|
|
+ "冷藏柜内部最高温",
|
|
|
+ "冷藏柜内部最低温",
|
|
|
+ "外部环境分割线最高温",
|
|
|
+ "外部环境分割线最低温",
|
|
|
+ "冷藏柜外部环境测点最高温",
|
|
|
+ "冷藏柜外部环境测点最低温",
|
|
|
+ "内部环境分割线最低温",
|
|
|
+ "内部环境分割线最高温",
|
|
|
+ "冰排释冷开始时间",
|
|
|
+ "冰排释冷结束时间",
|
|
|
+ "冰排释冷分割线最高温",
|
|
|
+ "冰排释冷分割线最低温",
|
|
|
+ "静态第一次开箱注释",
|
|
|
+ "静态第二次开箱注释",
|
|
|
+ "静态第三次开箱注释",
|
|
|
+ "动态第一次开箱注释",
|
|
|
+ "动态第二次开箱注释",
|
|
|
+ "动态第三次开箱注释",
|
|
|
+ "保温箱温度设定值",
|
|
|
+ "风机温度设定值",
|
|
|
+ "保温箱准备开始时间",
|
|
|
+ "冰排预冷保温箱准备结束时间",
|
|
|
+ "温度自动监测设备放置位置开始时间",
|
|
|
+ "温度自动监测设备放置位置结束时间",
|
|
|
+ "温度分布特性开始时间",
|
|
|
+ "温度分布特性结束时间",
|
|
|
+ "最长保温时限开始时间",
|
|
|
+ "最长保温时限结束时间",
|
|
|
+ "温度分布特性的测试与分析(满载)开始时间",
|
|
|
+ "温度分布特性的测试与分析(空载)开始时间",
|
|
|
+ "温度分布特性的测试与分析(满载)结束时间",
|
|
|
+ "温度分布特性的测试与分析(空载)结束时间",
|
|
|
+ "温控设备运行参数及使用状况测试(满载)开始时间",
|
|
|
+ "温控设备运行参数及使用状况测试(空载)开始时间",
|
|
|
+ "温控设备运行参数及使用状况测试(满载)结束时间",
|
|
|
+ "温控设备运行参数及使用状况测试(空载)结束时间",
|
|
|
+ "(满载)温度偏差均匀度波动度分析时间区间",
|
|
|
+ "(空载)温度偏差均匀度波动度分析时间区间",
|
|
|
+ "运行确认及偏差处理(满载)开始时间",
|
|
|
+ "运行确认及偏差处理(空载)开始时间",
|
|
|
+ "满载风机启动时间点注释",
|
|
|
+ "满载风机停止时间点注释",
|
|
|
+ "满载测试结束风机停止时间注释",
|
|
|
+ "空载风机启动时间点注释",
|
|
|
+ "空载风机停止时间点注释",
|
|
|
+ "空载测试结束风机停止时间注释",
|
|
|
+ "第一次开门开始时间",
|
|
|
+ "第一次开门结束时间",
|
|
|
+ "满载风机启动时间点",
|
|
|
+ "空载风机启动时间点",
|
|
|
+ "满载风机停止时间点",
|
|
|
+ "空载风机停止时间点",
|
|
|
+ "满载测试结束风机停止时间",
|
|
|
+ "空载测试结束风机停止时间",
|
|
|
+ "满载第一次关门温度恢复时间",
|
|
|
+ "空载第一次关门温度恢复时间",
|
|
|
+ "满载开门最长需要多少分钟恢复",
|
|
|
+ "空载开门最长需要多少分钟恢复",
|
|
|
+ "冷藏库作业口外部环境分割线最低温",
|
|
|
+ "冷藏库作业口外部环境分割线最高温",
|
|
|
+ "冷藏库外部环境测点最高温",
|
|
|
+ "冷藏库外部环境测点最低温",
|
|
|
+ "冷藏库内部最高温",
|
|
|
+ "冷藏库内部最低温",
|
|
|
+ }
|
|
|
+
|
|
|
+ c.Data["json"] = mySlice
|
|
|
+ c.ServeJSON() // 使用 ServeJSON
|
|
|
+}
|
|
|
+
|
|
|
+/* ----------------------------------------------------------------------------------- */
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载测试结束风机停止时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ fmt.Println("list:", list)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) < 7 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续5个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println("CalculateHumps_list:", CalculateHumps_list)
|
|
|
+ //start := CalculateHumps_list[6].Start // 驼峰开始
|
|
|
+ //peak := CalculateHumps_list[0]["peak"].(Task.TaskData) // 驼峰最高
|
|
|
+ end := CalculateHumps_list[4].End // 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: end.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载测试结束风机停止时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) < 7 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续5个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //start := CalculateHumps_list[6].Start // 驼峰开始
|
|
|
+ //peak := CalculateHumps_list[0]["peak"].(Task.TaskData) // 驼峰最高
|
|
|
+ end := CalculateHumps_list[4].End // 驼峰结束// 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: end.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载风机停止时间点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续1个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //start := CalculateHumps_list[0]["start"].(Task.TaskData) // 驼峰开始
|
|
|
+ //peak := CalculateHumps_list[0]["peak"].(Task.TaskData) // 驼峰最高
|
|
|
+ end := CalculateHumps_list[0].End // 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+ fmt.Println(end)
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: end.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载风机停止时间点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续1个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //start := CalculateHumps_list[0]["start"].(Task.TaskData) // 驼峰开始
|
|
|
+ //peak := CalculateHumps_list[0]["peak"].(Task.TaskData) // 驼峰最高
|
|
|
+ end := CalculateHumps_list[0].End // 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: end.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A空载风机启动时间点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续1个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //start := CalculateHumps_list[0]["start"].(Task.TaskData) // 驼峰开始
|
|
|
+ peak := CalculateHumps_list[0].Peak // 驼峰最高
|
|
|
+ //end := CalculateHumps_list[0]["end"].(Task.TaskData) // 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: peak.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A满载风机启动时间点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 均匀性布点 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(均匀性布点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 产品存放区域测点 := c.GetString("产品存放区域测点") // v26nplogbwt1
|
|
|
+ if len(产品存放区域测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 产品存放区域测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 均匀性布点 = 均匀性布点 + "|" + 产品存放区域测点
|
|
|
+
|
|
|
+ 开始时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(开始时间) == 0 || 开始时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 结束时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(结束时间) == 0 || 结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 均匀性布点, 开始时间, 结束时间)
|
|
|
+ CalculateHumps_list := Task.CalculateHumps(list)
|
|
|
+
|
|
|
+ if len(CalculateHumps_list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到连续1个循环 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //start := CalculateHumps_list[0]["start"].(Task.TaskData) // 驼峰开始
|
|
|
+ peak := CalculateHumps_list[0].Peak // 驼峰最高
|
|
|
+ //end := CalculateHumps_list[0]["end"].(Task.TaskData) // 驼峰结束
|
|
|
+ // .Format("2006-01-02 15:04:05")
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: peak.T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A冷藏柜内部最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A冷藏柜内部最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度控制范围最小值") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最小值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A第一次开门结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("开空结") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ 时间 = c.GetString("开满结") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 开空结 或 开满结 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A第一次开门开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("开空开") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ 时间 = c.GetString("开满开") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 开空开 或 开满开 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载测试结束风机停止时间注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("空载测试结束风机停止时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 空载测试结束风机停止时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载风机停止时间点注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("空载风机停止时间点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 空载风机停止时间点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载风机启动时间点注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("空载风机启动时间点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 空载风机启动时间点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载测试结束风机停止时间注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("满载测试结束风机停止时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 满载测试结束风机停止时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载风机停止时间点注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("满载风机停止时间点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 满载风机停止时间点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A柜内所有测点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("均匀性布点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 均匀性布点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A均匀性布点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("柜内所有测点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 柜内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A产品存放区域测点() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("柜内所有测点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 柜内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载风机启动时间点注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("满载风机启动时间点") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 满载风机启动时间点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A运行确认及偏差处理空载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A运行确认及偏差处理满载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A空载温度偏差均匀度波动度分析时间区间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间1 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间1) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 时间2 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间2) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间1 + "|" + 时间2})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A满载温度偏差均匀度波动度分析时间区间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间1 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间1) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 时间2 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间2) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间1 + "|" + 时间2})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温控设备运行参数及使用状况测试空载结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温控设备运行参数及使用状况测试满载结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温控设备运行参数及使用状况测试空载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温控设备运行参数及使用状况测试满载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温度分布特性的测试与分析空载结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温度分布特性的测试与分析满载结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A温度分布特性的测试与分析空载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(空载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(空载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A温度分布特性的测试与分析满载开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("监测系统配置的测点终端参数及安装位置确认(满载)开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 监测系统配置的测点终端参数及安装位置确认(满载)开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A最长保温时限结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度自动监测设备放置位置结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A最长保温时限开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A温度分布特性结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度自动监测设备放置位置结束时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A温度分布特性开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 箱内所有测点|温度自动监测设备放置位置开始时间
|
|
|
+// 1}取 平均值 ,高于等于 [温度范围最高值] 并持续5分钟,取 第一个超标时的时间值
|
|
|
+// 2}[温湿度系统测点] 取最后时间点
|
|
|
+func (c *TaskDataController) A温度自动监测设备放置位置结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 箱内所有测点 := c.GetString("箱内所有测点") // v26nplogbwt1
|
|
|
+ if len(箱内所有测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 箱内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最高值_ := c.GetString("温度范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度范围最高值_) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最高值 := lib.To_float32(温度范围最高值_)
|
|
|
+
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 箱内所有测点, 温度自动监测设备放置位置开始时间, "")
|
|
|
+ if len(list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 箱内所有测点|温度自动监测设备放置位置开始时间 数据!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for i := 0; i < (len(list) - 7); i++ {
|
|
|
+ if list[i].T_t >= 温度范围最高值 {
|
|
|
+ if list[i].T_t <= list[i+1].T_t &&
|
|
|
+ list[i+1].T_t <= list[i+2].T_t &&
|
|
|
+ list[i+2].T_t <= list[i+3].T_t &&
|
|
|
+ list[i+3].T_t <= list[i+4].T_t &&
|
|
|
+ list[i+4].T_t <= list[i+5].T_t &&
|
|
|
+ list[i+5].T_t <= list[i+6].T_t {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: list[i].T_time})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 高于等于 [温度范围最高值] 并持续5分钟 数据!"})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 温湿度系统测点 第一条数据时间
|
|
|
+func (c *TaskDataController) A温度自动监测设备放置位置开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 温湿度系统测点 := c.GetString("温湿度系统测点") // v26nplogbwt1
|
|
|
+ if len(温湿度系统测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温湿度系统测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_AES(Task_r.T_task_id, 温湿度系统测点, "", "", "", 0, 1)
|
|
|
+ if len(list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 温湿度系统测点 数据!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: list[0].T_time})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A保温箱准备开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 箱内所有测点|现场测试开始时间|温度自动监测设备放置位置开始时间
|
|
|
+// 温度低于(温度范围最高值 - 0.5),= 低于温度当前时的时间点
|
|
|
+func (c *TaskDataController) A冰排预冷保温箱准备结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 箱内所有测点 := c.GetString("箱内所有测点") // v26nplogbwt1
|
|
|
+ if len(箱内所有测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 箱内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最高值_ := c.GetString("温度范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度范围最高值_) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最高值 := lib.To_float32(温度范围最高值_) - 0.5
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_SQL(Task_r.T_task_id, " AND t_t <= "+lib.To_string(温度范围最高值)+" ", 箱内所有测点, "", 现场测试开始时间, "", 0, 1)
|
|
|
+ if len(list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 温度低于(温度范围最高值 - 0.5) !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: list[0].T_time})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 保温箱温度设定值 = (温度范围最高值 - 温度范围最低值)/ 2
|
|
|
+func (c *TaskDataController) A保温箱温度设定值() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 温度范围最高值 := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度范围最高值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最低值 := c.GetString("温度控制范围最小值") // v26nplogbwt1
|
|
|
+ if len(温度范围最低值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最小值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: lib.To_string((lib.To_float32(温度范围最高值) + lib.To_float32(温度范围最低值)) / 2)})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 风机温度设定值=(制冷机组温控设定最低值+制冷机组温控设定最高值)/2
|
|
|
+func (c *TaskDataController) A风机温度设定值() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 制冷机组温控设定最低值 := c.GetString("制冷机组温控设定最低值") // v26nplogbwt1
|
|
|
+ if len(制冷机组温控设定最低值) != 0 || 制冷机组温控设定最低值 != "null" {
|
|
|
+ if !strings.Contains(制冷机组温控设定最低值, "档") {
|
|
|
+ 制冷机组温控设定最高值 := c.GetString("制冷机组温控设定最高值") // v26nplogbwt1
|
|
|
+ if len(制冷机组温控设定最高值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 制冷机组温控设定最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 制冷机组温控设定最低值_, _ := lib.StringToFloat32(制冷机组温控设定最低值)
|
|
|
+ 制冷机组温控设定最高值_, _ := lib.StringToFloat32(制冷机组温控设定最高值)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: lib.To_string((制冷机组温控设定最低值_ + 制冷机组温控设定最高值_) / 2)})
|
|
|
+ return
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 温度控制范围最高值 := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最高值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 温度控制范围最小值 := c.GetString("温度控制范围最小值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最小值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最小值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ T := (lib.To_float32(温度控制范围最高值) + lib.To_float32(温度控制范围最小值)) / 2
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: lib.To2(T)})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A动态第三次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("动态三次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A动态第二次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("动态二次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A动态第一次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("动态第一次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A静态第三次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("静态三次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A静态第二次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("静态二次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A静态第一次开箱注释() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 时间 := c.GetString("静态第一次开箱开始时间") // v26nplogbwt1
|
|
|
+ if len(时间) == 0 || 时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 时间 + "/" + 时间})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 冰排释冷监测设备|冰排释冷开始时间 当前 温度数据
|
|
|
+func (c *TaskDataController) A冰排释冷分割线最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷监测设备 := c.GetString("冰排释冷监测设备") // v26nplogbwt1
|
|
|
+ if len(冰排释冷监测设备) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷开始时间 := c.GetString("冰排释冷开始时间") // v26nplogbwt1
|
|
|
+ if len(冰排释冷开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_AES(Task_r.T_task_id, 冰排释冷监测设备, "", 冰排释冷开始时间, 冰排释冷开始时间, 0, 1)
|
|
|
+ if len(list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备|冰排释冷开始时间 当前 温度数据 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(list[0].T_t*10))/10)})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 冰排释冷监测设备|冰排释冷结束时间 当前 温度数据
|
|
|
+func (c *TaskDataController) A冰排释冷分割线最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷监测设备 := c.GetString("冰排释冷监测设备") // v26nplogbwt1
|
|
|
+ if len(冰排释冷监测设备) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷结束时间 := c.GetString("冰排释冷结束时间") // v26nplogbwt1
|
|
|
+ if len(冰排释冷结束时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_AES(Task_r.T_task_id, 冰排释冷监测设备, "", 冰排释冷结束时间, 冰排释冷结束时间, 0, 1)
|
|
|
+ if len(list) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备|冰排释冷结束时间 当前 温度数据 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(list[0].T_t*10))/10)})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 冰排释冷监测设备|现场测试开始时间|温度自动监测设备放置位置开始时间
|
|
|
+// [冰排释冷开始时间] 时间后 ,超过 [温度范围最低值 ]度,第一条超标数据点时间
|
|
|
+func (c *TaskDataController) A冰排释冷结束时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷监测设备 := c.GetString("冰排释冷监测设备") // v26nplogbwt1
|
|
|
+ if len(冰排释冷监测设备) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度范围最低值 := c.GetString("温度范围最低值") // v26nplogbwt1
|
|
|
+ if len(温度范围最低值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度范围最低值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 冰排释冷开始时间 := c.GetString("冰排释冷开始时间") // v26nplogbwt1
|
|
|
+ if len(冰排释冷开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_AES(Task_r.T_task_id, 冰排释冷监测设备, "", 冰排释冷开始时间, 温度自动监测设备放置位置开始时间, 0, 9999)
|
|
|
+ for _, v := range list {
|
|
|
+ if v.T_t >= lib.To_float32(温度范围最低值) {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: v.T_time})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 [冰排释冷开始时间] 时间后 ,超过 [温度范围最低值]度,第一条超标数据点时间 失败!"})
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 冰排释冷监测设备|现场测试开始时间|温度自动监测设备放置位置开始时间
|
|
|
+// V型数据,下降持续5分钟,持续上升 5 分钟,取上升点的第一条数据
|
|
|
+// 40 2025-02-27 12:08 2025-02-27 14:40
|
|
|
+func (c *TaskDataController) A冰排释冷开始时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冰排释冷监测设备 := c.GetString("冰排释冷监测设备") // v26nplogbwt1
|
|
|
+ if len(冰排释冷监测设备) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冰排释冷监测设备 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, _ := Task.Read_TaskData_ById_List_AES(Task_r.T_task_id, 冰排释冷监测设备, "", 现场测试开始时间, 温度自动监测设备放置位置开始时间, 0, 9999)
|
|
|
+ list_id, found := Task.FindVTrend(list)
|
|
|
+ if !found {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 V型趋势 失败!,下降持续5分钟,上升持续5分钟"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: list[list_id].T_time})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 保温箱外环境测点|温度自动监测设备放置位置开始时间|温度自动监测设备放置位置结束时间
|
|
|
+// 061 2025-02-27 14:40 2025-02-28 21:46
|
|
|
+func (c *TaskDataController) A外部环境分割线最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 保温箱外环境测点 := c.GetString("保温箱外环境测点") // v26nplogbwt1
|
|
|
+ if len(保温箱外环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 保温箱外环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置结束时间 := c.GetString("温度自动监测设备放置位置结束时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置结束时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ _, maxT := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 保温箱外环境测点, "", 温度自动监测设备放置位置开始时间, 温度自动监测设备放置位置结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(maxT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 保温箱外环境测点|温度自动监测设备放置位置开始时间|温度自动监测设备放置位置结束时间
|
|
|
+func (c *TaskDataController) A外部环境分割线最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 保温箱外环境测点 := c.GetString("保温箱外环境测点") // v26nplogbwt1
|
|
|
+ if len(保温箱外环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 保温箱外环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("温度自动监测设备放置位置开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置结束时间 := c.GetString("温度自动监测设备放置位置结束时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置结束时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度自动监测设备放置位置结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ minT, _ := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 保温箱外环境测点, "", 温度自动监测设备放置位置开始时间, 温度自动监测设备放置位置结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(minT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 保温箱外环境测点|温度自动监测设备放置位置开始时间|温度自动监测设备放置位置结束时间
|
|
|
+// 061 2025-02-27 14:40 2025-02-28 21:46
|
|
|
+func (c *TaskDataController) A冷藏柜外部环境测点最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 保温箱外环境测点 := c.GetString("冷藏柜外部环境测点") // v26nplogbwt1
|
|
|
+ if len(保温箱外环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冷藏柜外部环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置结束时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ _, maxT := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 保温箱外环境测点, "", 温度自动监测设备放置位置开始时间, 温度自动监测设备放置位置结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(maxT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+// 保温箱外环境测点|温度自动监测设备放置位置开始时间|温度自动监测设备放置位置结束时间
|
|
|
+func (c *TaskDataController) A冷藏柜外部环境测点最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 保温箱外环境测点 := c.GetString("冷藏柜外部环境测点") // v26nplogbwt1
|
|
|
+ if len(保温箱外环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冷藏柜外部环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度自动监测设备放置位置结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(温度自动监测设备放置位置结束时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ minT, _ := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 保温箱外环境测点, "", 温度自动监测设备放置位置开始时间, 温度自动监测设备放置位置结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(minT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A内部环境分割线最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 温度范围最低值 := c.GetString("温度控制范围最小值") // v26nplogbwt1
|
|
|
+ if len(温度范围最低值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最小值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 温度范围最低值})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A内部环境分割线最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 温度范围最高值 := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度范围最高值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 温度范围最高值})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载第一次关门温度恢复时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 柜内所有测点 := c.GetString("柜内所有测点") // v26nplogbwt1
|
|
|
+ if len(柜内所有测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 柜内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度控制范围最高值_ := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最高值_) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度控制范围最高值 := lib.To_float32(温度控制范围最高值_)
|
|
|
+
|
|
|
+ 第一次开门结束时间 := c.GetString("第一次开门结束时间") // v26nplogbwt1
|
|
|
+ if len(第一次开门结束时间) == 0 || 第一次开门结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 第一次开门结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 第一次开门结束时间_a, err := time.Parse("2006-01-02 15:04:05", 第一次开门结束时间)
|
|
|
+ 第一次开门结束时间_b := 第一次开门结束时间_a
|
|
|
+
|
|
|
+ for x := 0; x < 60; x++ {
|
|
|
+ 第一次开门结束时间_b = 第一次开门结束时间_a.Add(time.Minute * 60)
|
|
|
+
|
|
|
+ maps_Time_Min_Max_GROUP := Task.Read_TaskData_T_Min_Max_Time_Min_Max_ListGROUP(Task_r.T_task_id, 柜内所有测点, 第一次开门结束时间_a.Format("2006-01-02 15:04:05"), 第一次开门结束时间_b.Format("2006-01-02 15:04:05"))
|
|
|
+
|
|
|
+ // 判断拐点
|
|
|
+ if maps_Time_Min_Max_GROUP[0].T_max <= maps_Time_Min_Max_GROUP[1].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[1].T_max >= maps_Time_Min_Max_GROUP[2].T_max {
|
|
|
+
|
|
|
+ if maps_Time_Min_Max_GROUP[1].T_max > 温度控制范围最高值 {
|
|
|
+ // 情况1:开门有超标的情况:
|
|
|
+ // 柜内所有测点中任意一条数据出现超温度控制范围最高值后所有验证工具下降至温度控制范围最高值减0.5℃此时的时间
|
|
|
+ for _, group := range maps_Time_Min_Max_GROUP {
|
|
|
+ if group.T_max < 温度控制范围最高值-0.5 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: group.T_times})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 下降至温度控制范围最高值减0.5℃此时的时间 !"})
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ // 情况2:开门无超标的情况:
|
|
|
+ // 柜内所有测点中温度持续下降连续5分钟内,取第一条时间作为此时间点
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 柜内所有测点, maps_Time_Min_Max_GROUP[1].T_times, 第一次开门结束时间_a.Add(time.Minute*30).Format("2006-01-02 15:04:05"))
|
|
|
+
|
|
|
+ for i := 0; i < len(list)-6; i++ {
|
|
|
+ if maps_Time_Min_Max_GROUP[i].T_max <= maps_Time_Min_Max_GROUP[i+1].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+1].T_max >= maps_Time_Min_Max_GROUP[i+2].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+2].T_max >= maps_Time_Min_Max_GROUP[i+3].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+3].T_max >= maps_Time_Min_Max_GROUP[i+4].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+4].T_max >= maps_Time_Min_Max_GROUP[i+5].T_max {
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: maps_Time_Min_Max_GROUP[i].T_times})
|
|
|
+ return
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 温度持续下降连续5分钟 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ 第一次开门结束时间_a = 第一次开门结束时间_a.Add(time.Minute * 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到数据拐点 !"})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载第一次关门温度恢复时间() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 柜内所有测点 := c.GetString("柜内所有测点") // v26nplogbwt1
|
|
|
+ if len(柜内所有测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 柜内所有测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度控制范围最高值_ := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最高值_) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 温度控制范围最高值 := lib.To_float32(温度控制范围最高值_)
|
|
|
+
|
|
|
+ 第一次开门结束时间 := c.GetString("第一次开门结束时间") // v26nplogbwt1
|
|
|
+ if len(第一次开门结束时间) == 0 || 第一次开门结束时间 == "null" {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 第一次开门结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 第一次开门结束时间_a, err := time.Parse("2006-01-02 15:04:05", 第一次开门结束时间)
|
|
|
+ 第一次开门结束时间_b := 第一次开门结束时间_a
|
|
|
+
|
|
|
+ for x := 0; x < 60; x++ {
|
|
|
+ 第一次开门结束时间_b = 第一次开门结束时间_a.Add(time.Minute * 20)
|
|
|
+
|
|
|
+ maps_Time_Min_Max_GROUP := Task.Read_TaskData_T_Min_Max_Time_Min_Max_ListGROUP(Task_r.T_task_id, 柜内所有测点, 第一次开门结束时间_a.Format("2006-01-02 15:04:05"), 第一次开门结束时间_b.Format("2006-01-02 15:04:05"))
|
|
|
+
|
|
|
+ // 判断拐点
|
|
|
+ if maps_Time_Min_Max_GROUP[0].T_max <= maps_Time_Min_Max_GROUP[1].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[1].T_max >= maps_Time_Min_Max_GROUP[2].T_max {
|
|
|
+
|
|
|
+ if maps_Time_Min_Max_GROUP[1].T_max > 温度控制范围最高值 {
|
|
|
+ // 情况1:开门有超标的情况:
|
|
|
+ // 柜内所有测点中任意一条数据出现超温度控制范围最高值后所有验证工具下降至温度控制范围最高值减0.5℃此时的时间
|
|
|
+ for _, group := range maps_Time_Min_Max_GROUP {
|
|
|
+ if group.T_max < 温度控制范围最高值-0.5 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: group.T_times})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 下降至温度控制范围最高值减0.5℃此时的时间 !"})
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ // 情况2:开门无超标的情况:
|
|
|
+ // 柜内所有测点中温度持续下降连续5分钟内,取第一条时间作为此时间点
|
|
|
+ list := Task.Read_TaskData_ById_AVG(Task_r.T_task_id, 柜内所有测点, maps_Time_Min_Max_GROUP[1].T_times, 第一次开门结束时间_a.Add(time.Minute*30).Format("2006-01-02 15:04:05"))
|
|
|
+
|
|
|
+ for i := 0; i < len(list)-6; i++ {
|
|
|
+ if maps_Time_Min_Max_GROUP[i].T_max <= maps_Time_Min_Max_GROUP[i+1].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+1].T_max >= maps_Time_Min_Max_GROUP[i+2].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+2].T_max >= maps_Time_Min_Max_GROUP[i+3].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+3].T_max >= maps_Time_Min_Max_GROUP[i+4].T_max &&
|
|
|
+ maps_Time_Min_Max_GROUP[i+4].T_max >= maps_Time_Min_Max_GROUP[i+5].T_max {
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: maps_Time_Min_Max_GROUP[i].T_times})
|
|
|
+ return
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到 温度持续下降连续5分钟 !"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ 第一次开门结束时间_a = 第一次开门结束时间_a.Add(time.Minute * 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "没找到数据拐点 !"})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A满载开门最长需要多少分钟恢复() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 恢复时间_ := c.GetString("满载第一次关门温度恢复时间") // v26nplogbwt1
|
|
|
+ 恢复时间, err := time.Parse("2006-01-02 15:04:05", 恢复时间_)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 满载第一次关门温度恢复时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 结束时间_ := c.GetString("第一次开门结束时间") // v26nplogbwt1
|
|
|
+ 结束时间, err := time.Parse("2006-01-02 15:04:05", 结束时间_)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 第一次开门结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: lib.To_string((恢复时间.Unix() - 结束时间.Unix()) / 60)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A空载开门最长需要多少分钟恢复() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 恢复时间_ := c.GetString("空载第一次关门温度恢复时间") // v26nplogbwt1
|
|
|
+ 恢复时间, err := time.Parse("2006-01-02 15:04:05", 恢复时间_)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 空载第一次关门温度恢复时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 结束时间_ := c.GetString("第一次开门结束时间") // v26nplogbwt1
|
|
|
+ 结束时间, err := time.Parse("2006-01-02 15:04:05", 结束时间_)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 第一次开门结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: lib.To_string((恢复时间.Unix() - 结束时间.Unix()) / 60)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A冷藏库作业口外部环境分割线最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 作业口外部测点 := c.GetString("作业口外部测点") // v26nplogbwt1
|
|
|
+ if len(作业口外部测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 作业口外部测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ minT, _ := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 作业口外部测点, "", 现场测试开始时间, 现场测试结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(minT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A冷藏库作业口外部环境分割线最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 作业口外部测点 := c.GetString("作业口外部测点") // v26nplogbwt1
|
|
|
+ if len(作业口外部测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 作业口外部测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ _, maxT := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 作业口外部测点, "", 现场测试开始时间, 现场测试结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(maxT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A冷藏库外部环境测点最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冷藏库外部环境测点 := c.GetString("冷藏库外部环境测点") // v26nplogbwt1
|
|
|
+ if len(冷藏库外部环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冷藏库外部环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ _, maxT := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 冷藏库外部环境测点, "", 现场测试开始时间, 现场测试结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(maxT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+func (c *TaskDataController) A冷藏库外部环境测点最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ Task_r, err := Task.Read_Task(T_task_id)
|
|
|
+ if err != nil {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取任务信息失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 冷藏库外部环境测点 := c.GetString("冷藏库外部环境测点") // v26nplogbwt1
|
|
|
+ if len(冷藏库外部环境测点) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 冷藏库外部环境测点 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ 现场测试开始时间 := c.GetString("现场测试开始时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试开始时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 现场测试结束时间 := c.GetString("现场测试结束时间") // v26nplogbwt1
|
|
|
+ if len(现场测试开始时间) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 现场测试结束时间 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ minT, _ := Task.Read_TaskData_T_Min_Max(Task_r.T_task_id, 冷藏库外部环境测点, "", 现场测试开始时间, 现场测试结束时间)
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: fmt.Sprintf("%.1f", math.Ceil(float64(minT*10))/10)})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A冷藏库内部最低温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 温度控制范围最小值 := c.GetString("温度控制范围最小值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最小值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最小值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 温度控制范围最小值})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|
|
|
+
|
|
|
+func (c *TaskDataController) A冷藏库内部最高温() {
|
|
|
+
|
|
|
+ T_task_id := c.GetString("T_task_id") // v26nplogbwt1
|
|
|
+ println("T_task_id:", T_task_id)
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Content-Type", "text/event-stream")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Cache-Control", "no-cache")
|
|
|
+ c.Ctx.ResponseWriter.Header().Set("Connection", "keep-alive")
|
|
|
+
|
|
|
+ 温度控制范围最高值 := c.GetString("温度控制范围最高值") // v26nplogbwt1
|
|
|
+ if len(温度控制范围最高值) == 0 {
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 2, Msg: "获取 温度控制范围最高值 失败!"})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ lib.SseWriteJSON(c.Ctx.ResponseWriter, lib.JSONSSE{State: 1, Msg: 温度控制范围最高值})
|
|
|
+
|
|
|
+ // Close the connection
|
|
|
+ c.Ctx.ResponseWriter.WriteHeader(http.StatusOK)
|
|
|
+}
|