|
@@ -67,6 +67,8 @@ func (this *MonthReportsController) List() {
|
|
|
if DeviceItemContainint(ChannelItem_Power, channelmodel.DataItem) {
|
|
if DeviceItemContainint(ChannelItem_Power, channelmodel.DataItem) {
|
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", code, begin, end, timearea)
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", code, begin, end, timearea)
|
|
|
fmt.Println("--------queryCommand---------", queryCommand)
|
|
fmt.Println("--------queryCommand---------", queryCommand)
|
|
|
|
|
+ } else if DeviceItemContainint(ChannelItem_HaveLiquidLevel, channelmodel.DataItem) {
|
|
|
|
|
+ queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc,MEDIAN(liquidlevel) as liquidlevel from %v where time > %vs and time < %vs group by time(%v) fill(none)", code, begin, end, timearea)
|
|
|
}
|
|
}
|
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), channelmodel.DataItem, showcols, result, []TriggerHourData{})
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), channelmodel.DataItem, showcols, result, []TriggerHourData{})
|
|
@@ -143,6 +145,8 @@ func (this *MonthReportsController) GetExcel() {
|
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
|
|
+ } else if DeviceItemContainint(ChannelItem_HaveLiquidLevel, v.DataItem) {
|
|
|
|
|
+ queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc,MEDIAN(liquidlevel) as liquidlevel from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
}
|
|
}
|
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
@@ -179,6 +183,8 @@ func (this *MonthReportsController) GetExcel() {
|
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement ,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement ,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
|
|
+ } else if DeviceItemContainint(ChannelItem_HaveLiquidLevel, v.DataItem) {
|
|
|
|
|
+ queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(liquidlevel) as liquidlevel from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
}
|
|
}
|
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, i), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
@@ -270,6 +276,8 @@ func (this *MonthReportsController) GetPDF() {
|
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand := fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
if DeviceItemContainint(ChannelItem_Power, v.DataItem) {
|
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3 ,MEDIAN(tvoc) as tvoc ,MEDIAN(electricalsupply) as electricalsupply,MEDIAN(electricalpower) as electricalpower from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
|
|
+ } else if DeviceItemContainint(ChannelItem_HaveLiquidLevel, v.DataItem) {
|
|
|
|
|
+ queryCommand = fmt.Sprintf("select MEDIAN(temperature) as temperature,MEDIAN(humidity) as humidity,MEDIAN(voltage) as voltage,MEDIAN(rssi) as rssi,MEDIAN(o2) as o2,MEDIAN(co2) as co2 ,MEDIAN(ots) as ots,MEDIAN(displacement) as displacement,MEDIAN(h2o) as h2o ,MEDIAN(so2) as so2,MEDIAN(windspeed) as windspeed ,MEDIAN(pressure) as pressure,MEDIAN(clo2) as clo2,MEDIAN(c2h4) as c2h4,MEDIAN(c2h2) as c2h2,MEDIAN(cl2) as cl2,MEDIAN(o3) as o3,MEDIAN(tvoc) as tvoc,MEDIAN(liquidlevel) as liquidlevel from %v where time > %vs and time < %vs group by time(%v) fill(none)", v.Code, begin, end, timearea)
|
|
|
}
|
|
}
|
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
result := client.QueryLabSop(queryCommand, data)
|
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, j), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
reportdata := GetReportData(utils.TimeFormat(t1.AddDate(0, 0, j), "2006-1-2"), v.DataItem, showcols, result, []TriggerHourData{})
|
|
@@ -512,7 +520,7 @@ func (this *MonthReportsController) MaxReport() {
|
|
|
for k, v := range channel1 {
|
|
for k, v := range channel1 {
|
|
|
if v.Code != "" {
|
|
if v.Code != "" {
|
|
|
|
|
|
|
|
- queryGroupCommand := fmt.Sprintf("select max(temperature),min(temperature),max(humidity),min(humidity),max(o2),min(o2),max(co2),min(co2),max(ots),min(ots),max(displacement),min(displacement),max(h2o),min(h2o),max(so2),min(so2),max(electricalpower),min(electricalpower),max(electricalsupply),min(electricalsupply) from %v where time > %vs and time < %vs group by time(1d,16h) fill(none) ", v.Code, t1.Unix()-1, t2.Unix()+1)
|
|
|
|
|
|
|
+ queryGroupCommand := fmt.Sprintf("select max(temperature),min(temperature),max(humidity),min(humidity),max(o2),min(o2),max(co2),min(co2),max(ots),min(ots),max(displacement),min(displacement),max(h2o),min(h2o),max(so2),min(so2),max(electricalpower),min(electricalpower),max(electricalsupply),min(electricalsupply),max(liquidlevel),min(liquidlevel) from %v where time > %vs and time < %vs group by time(1d,16h) fill(none) ", v.Code, t1.Unix()-1, t2.Unix()+1)
|
|
|
datagroup, _ := client.QueryOneResultByCommand(queryGroupCommand)
|
|
datagroup, _ := client.QueryOneResultByCommand(queryGroupCommand)
|
|
|
var datas [][]interface{}
|
|
var datas [][]interface{}
|
|
|
if datagroup != nil && len(datagroup) > 0 {
|
|
if datagroup != nil && len(datagroup) > 0 {
|
|
@@ -540,7 +548,7 @@ func (this *MonthReportsController) MaxReport() {
|
|
|
_, channel := svc.GetChannelsList(-1, 8, where, uidstr)
|
|
_, channel := svc.GetChannelsList(-1, 8, where, uidstr)
|
|
|
for k, v := range channel {
|
|
for k, v := range channel {
|
|
|
if v.Code != "" {
|
|
if v.Code != "" {
|
|
|
- queryGroupCommand := fmt.Sprintf("select max(temperature),min(temperature),max(humidity),min(humidity),max(o2),min(o2),max(co2),min(co2),max(ots),min(ots),max(displacement),min(displacement),max(h2o),min(h2o),max(so2),min(so2),max(electricalpower),min(electricalpower),max(electricalsupply),min(electricalsupply) from %v where time > %vs and time < %vs group by time(1d,16h) fill(none) ", v.Code, t1.Unix()-1, t2.Unix()+1)
|
|
|
|
|
|
|
+ queryGroupCommand := fmt.Sprintf("select max(temperature),min(temperature),max(humidity),min(humidity),max(o2),min(o2),max(co2),min(co2),max(ots),min(ots),max(displacement),min(displacement),max(h2o),min(h2o),max(so2),min(so2),max(electricalpower),min(electricalpower),max(electricalsupply),min(electricalsupply),max(liquidlevel),min(liquidlevel) from %v where time > %vs and time < %vs group by time(1d,16h) fill(none) ", v.Code, t1.Unix()-1, t2.Unix()+1)
|
|
|
datagroup, _ := client.QueryOneResultByCommand(queryGroupCommand)
|
|
datagroup, _ := client.QueryOneResultByCommand(queryGroupCommand)
|
|
|
var datas [][]interface{}
|
|
var datas [][]interface{}
|
|
|
if datagroup != nil && len(datagroup) > 0 {
|
|
if datagroup != nil && len(datagroup) > 0 {
|
|
@@ -656,10 +664,14 @@ func (this *MonthReportsController) GroupSaveXlsx(name, code, timestr string, da
|
|
|
cell = rowhead.AddCell()
|
|
cell = rowhead.AddCell()
|
|
|
cell.Value = "电量V"
|
|
cell.Value = "电量V"
|
|
|
}
|
|
}
|
|
|
|
|
+ if DeviceItemContainint(ChannelItem_HaveLiquidLevel, dataitem) {
|
|
|
|
|
+ cell = rowhead.AddCell()
|
|
|
|
|
+ cell.Value = "液位mm"
|
|
|
|
|
+ }
|
|
|
if report != nil && len(report) > 0 && report[0] != nil && len(report[0]) > 0 {
|
|
if report != nil && len(report) > 0 && report[0] != nil && len(report[0]) > 0 {
|
|
|
for _, v := range report {
|
|
for _, v := range report {
|
|
|
var valuef0, valuef1, valuef2, valuef3, valuef4, valuef5,
|
|
var valuef0, valuef1, valuef2, valuef3, valuef4, valuef5,
|
|
|
- valuef6, valuef7, valuef8 float64
|
|
|
|
|
|
|
+ valuef6, valuef7, valuef8, valuef9, valuef10 float64
|
|
|
var valuei0, valuei1, valuei2, valuei3 int64
|
|
var valuei0, valuei1, valuei2, valuei3 int64
|
|
|
valuef0, _ = v[0].(json.Number).Float64()
|
|
valuef0, _ = v[0].(json.Number).Float64()
|
|
|
vint := int64(valuef0)
|
|
vint := int64(valuef0)
|
|
@@ -701,6 +713,10 @@ func (this *MonthReportsController) GroupSaveXlsx(name, code, timestr string, da
|
|
|
valuei2, _ = v[11].(json.Number).Int64()
|
|
valuei2, _ = v[11].(json.Number).Int64()
|
|
|
valuei3, _ = v[12].(json.Number).Int64()
|
|
valuei3, _ = v[12].(json.Number).Int64()
|
|
|
}
|
|
}
|
|
|
|
|
+ if DeviceItemContainint(ChannelItem_HaveLiquidLevel, dataitem) {
|
|
|
|
|
+ valuef9, _ = v[20].(json.Number).Float64()
|
|
|
|
|
+ valuef10, _ = v[21].(json.Number).Float64()
|
|
|
|
|
+ }
|
|
|
row := sheet.AddRow()
|
|
row := sheet.AddRow()
|
|
|
cell = row.AddCell()
|
|
cell = row.AddCell()
|
|
|
cell.Value = time.Unix(vint, 0).Format("2006-01-02")
|
|
cell.Value = time.Unix(vint, 0).Format("2006-01-02")
|
|
@@ -745,6 +761,10 @@ func (this *MonthReportsController) GroupSaveXlsx(name, code, timestr string, da
|
|
|
cell = row.AddCell()
|
|
cell = row.AddCell()
|
|
|
cell.Value = utils.ToStr(valuei2)
|
|
cell.Value = utils.ToStr(valuei2)
|
|
|
}
|
|
}
|
|
|
|
|
+ if DeviceItemContainint(ChannelItem_HaveLiquidLevel, dataitem) {
|
|
|
|
|
+ cell = row.AddCell()
|
|
|
|
|
+ cell.Value = utils.ToStr(valuef9)
|
|
|
|
|
+ }
|
|
|
row = sheet.AddRow()
|
|
row = sheet.AddRow()
|
|
|
cell = row.AddCell()
|
|
cell = row.AddCell()
|
|
|
cell.Value = ""
|
|
cell.Value = ""
|
|
@@ -788,6 +808,10 @@ func (this *MonthReportsController) GroupSaveXlsx(name, code, timestr string, da
|
|
|
cell = row.AddCell()
|
|
cell = row.AddCell()
|
|
|
cell.Value = utils.ToStr(valuei3)
|
|
cell.Value = utils.ToStr(valuei3)
|
|
|
}
|
|
}
|
|
|
|
|
+ if DeviceItemContainint(ChannelItem_HaveLiquidLevel, dataitem) {
|
|
|
|
|
+ cell = row.AddCell()
|
|
|
|
|
+ cell.Value = utils.ToStr(valuef10)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|