电实时数据修改

新增手动抄表页面
更换电实时数据文件
1.3.5
zhouhy 10 months ago
parent 75b050a100
commit cf928c4b21

@ -144,7 +144,7 @@ public class RecordDnbInstantController extends BaseController {
@Log(title = "电实时数据", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(RecordDnbInstant recordDnbInstant)
public AjaxResult addSave(@RequestBody RecordDnbInstant recordDnbInstant)
{
return toAjax(recordDnbInstantService.insertRecordDnbInstant(recordDnbInstant));
}

@ -85,6 +85,7 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
public RecordDnbInstantDataVo selectRecordDnbInstantList(RecordDnbInstant recordDnbInstant) {
RecordDnbInstantDataVo recordDnbInstantDataVo = new RecordDnbInstantDataVo();
try {
Integer pageNum = Integer.valueOf((String) recordDnbInstant.getParams().get("pageNum"));
Integer pageSize = Integer.valueOf((String) recordDnbInstant.getParams().get("pageSize"));
Integer offset = (pageNum - 1) * pageSize;
@ -95,6 +96,15 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
String stratTime = (String) recordDnbInstant.getParams().get("beginTime");
String endTime = (String) recordDnbInstant.getParams().get("endTime");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//todo 因为手动补录采集时间默认为空,且手动补录页面初始化需要展示出所有的历史数据
if (stratTime==null){
//开始事件设置的足够远,确保可以查询到所有数据
stratTime ="2023-01-01 00:00:00";
}
if (endTime==null){
//结束事件设置为当前时间
endTime = sdf.format(new Date(System.currentTimeMillis()));
}
Date dateStrat = sdf.parse(stratTime);
Date dateEnd = sdf.parse(endTime);
@ -125,21 +135,44 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
recordDnbInstant1.setObjid(Long.valueOf(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITOROBJID))));
recordDnbInstant1.setMonitorId(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORID)));
recordDnbInstant1.setMonitorName(String.valueOf(data.get(TdEngineConstants.ST_TAG_EMS_MONITORNAME)));
recordDnbInstant1.setVA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagea")))));
recordDnbInstant1.setVB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatageb")))));
recordDnbInstant1.setVC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagec")))));
recordDnbInstant1.setIA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currenta")))));
recordDnbInstant1.setIB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentb")))));
recordDnbInstant1.setIC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentc")))));
recordDnbInstant1.setGlys(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("glys")))));
recordDnbInstant1.setZxyg(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("zxyg")))));
recordDnbInstant1.setActivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("activepower")))));
recordDnbInstant1.setReactivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("reactivepower")))));
if (data.get("volatagea")!=null ){
recordDnbInstant1.setVA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagea")))));
}
if (data.get("volatageb")!=null ){
recordDnbInstant1.setVB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatageb")))));
}
if (data.get("volatagec")!=null ){
recordDnbInstant1.setVC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("volatagec")))));
}
if (data.get("currenta")!=null ){
recordDnbInstant1.setIA(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currenta")))));
}
if (data.get("currentb")!=null ){
recordDnbInstant1.setIB(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentb")))));
}
if (data.get("currentc")!=null ){
recordDnbInstant1.setIC(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("currentc")))));
}
if (data.get("glys")!=null ){
recordDnbInstant1.setGlys(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("glys")))));
}
if (data.get("zxyg")!=null ){
recordDnbInstant1.setZxyg(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("zxyg")))));
}
if (data.get("activepower")!=null ){
recordDnbInstant1.setActivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("activepower")))));
}
if (data.get("reactivepower")!=null ){
recordDnbInstant1.setReactivePower(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("reactivepower")))));
}
//调整时间格式
String substring = String.valueOf(data.get("ts")).replaceAll("T", " ").substring(0, 19);
recordDnbInstant1.setCollectTime(sdf.parse(substring));
// recordDnbInstant.setConsumption(BigDecimal.valueOf(Double.valueOf(String.valueOf(data.get("consumption")))));
recordDnbInstant1.setCollectType(Long.valueOf(String.valueOf(data.get("collecttype"))));
if (data.get("reactivepower")!=null ){
recordDnbInstant1.setCollectType(Long.valueOf(String.valueOf(data.get("collecttype"))));
}
records.add(recordDnbInstant1);
}
recordDnbInstantDataVo.setCount(tdReturnDataVo.getCount());
@ -172,9 +205,49 @@ public class RecordDnbInstantServiceImpl implements IRecordDnbInstantService {
}
}
}*/
recordDnbInstant.setRecordTime(new Date());
recordDnbInstant.setCollectType(0L);
return recordDnbInstantMapper.insertRecordDnbInstant(recordDnbInstant);
BaseMonitorInfo baseMonitorInfo = new BaseMonitorInfo();
baseMonitorInfo.setMonitorId(recordDnbInstant.getMonitorId());
List<BaseMonitorInfo> baseMonitorInfos = baseMonitorInfoService.selectBaseMonitorInfoList(baseMonitorInfo);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date collectTime = recordDnbInstant.getCollectTime();
TdTableVo tdTableVo = new TdTableVo();
tdTableVo.setDatabaseName("db_hwmes");
tdTableVo.setSuperTableName("st_electricity");
tdTableVo.setTableName("t_e_"+baseMonitorInfos.get(0).getObjid());
List<TdField> fields = new ArrayList<TdField>();
List<TdField> field2s = new ArrayList<TdField>();
TdField field = new TdField();
TdField field2 = new TdField();
TdField field3 = new TdField();
TdField field4 = new TdField();
field.setFieldName(TdEngineConstants.ST_TAG_EMS_BUILDID);
field.setFieldValue(baseMonitorInfos.get(0).getBuildId());
field2.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITORNAME);
field2.setFieldValue(baseMonitorInfos.get(0).getMonitorName());
field3.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITOROBJID);
field3.setFieldValue(baseMonitorInfos.get(0).getObjid());
field4.setFieldName(TdEngineConstants.ST_TAG_EMS_MONITORID);
field4.setFieldValue(baseMonitorInfos.get(0).getMonitorId());
fields.add(field);
fields.add(field2);
fields.add(field3);
fields.add(field4);
tdTableVo.setTagsFieldValues(fields);
TdField field5 = new TdField();
TdField field6 = new TdField();
field5.setFieldName(TdEngineConstants.DEFAULT_FIRST_FIELD_NAME);
field5.setFieldValue(sdf.format(collectTime));
field6.setFieldName("zxyg");
field6.setFieldValue(recordDnbInstant.getZxyg());
field2s.add(field5);
field2s.add(field6);
tdTableVo.setSchemaFields(field2s);
R<?> r = remoteTdEngineService.insertTable(tdTableVo, SecurityConstants.INNER);
// recordDnbInstant.setRecordTime(new Date());
// recordDnbInstant.setCollectType(0L);
// return recordDnbInstantMapper.insertRecordDnbInstant(recordDnbInstant);
return 1;
}
/**

@ -8,6 +8,8 @@ import com.hw.common.core.web.page.TableDataInfo;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.ems.record.domain.RecordDnbInstant;
import com.hw.ems.record.domain.vo.RecordDnbInstantDataVo;
import com.hw.ems.report.domain.ReportPointDnb;
import com.hw.ems.report.domain.ReportPointDnbDTO;
import com.hw.ems.report.service.IReportPointDnbService;
@ -52,6 +54,19 @@ public class ReportPointDnbController extends BaseController {
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("record:dnbInstant:list")
@GetMapping("/lists")
@ResponseBody
public TableDataInfo lists(ReportPointDnb reportPointDnb)
{
startPage();
List<ReportPointDnb> list = reportPointDnbService.selectReportPointDnbList(reportPointDnb);
return getDataTable(list);
}
/**
* List

@ -11,6 +11,13 @@ export function listUser(data) {
contentType:'application/x-www-form-urlencoded',
})
}
export function listUsers(data) {
return request({
url: '/ems/report/pointDnb/lists',
method: 'get',
data: data,
})
}
//日月年列表查询接口
export function listUser2(data) {
return request({

@ -150,11 +150,19 @@
v-if="columns[1].visible"
:show-overflow-tooltip="true"
/>
<!-- <el-table-column-->
<!-- label="计量设备位置"-->
<!-- align="center"-->
<!-- key="monitorSubset"-->
<!-- prop="monitorSubset"-->
<!-- v-if="columns[2].visible"-->
<!-- :show-overflow-tooltip="true"-->
<!-- />-->
<el-table-column
label="计量设备位置"
align="center"
key="monitorSubset"
prop="monitorSubset"
key="address"
prop="address"
v-if="columns[2].visible"
:show-overflow-tooltip="true"
/>
@ -208,6 +216,7 @@
<script>
import {
listUser,
listUsers,
treeDat,
dnbCountingData,
listUser2,
@ -449,7 +458,7 @@ export default {
this.queryParams.params.endCollectTime = this.dateRangetwo;
console.log("this.datatimeone", this.queryParams);
if (this.queryParams.dateType === "hour") {
listUser(this.queryParams).then((response) => {
listUsers(this.queryParams).then((response) => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;

@ -192,7 +192,7 @@
<!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="formadd" :model="formadd" :rules="rules" label-width="80px">
<el-form ref="formadd" :model="formadd" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="计量设备名称" prop="nickName">
@ -307,6 +307,8 @@ export default {
components: { Treeselect },
data() {
return {
pageNum:"",
pageSize: "",
//
loading: true,
//
@ -375,9 +377,9 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
orderByColumn: "collectTime",
// orderByColumn: "collectTime",
collectType: 0,
isAsc: "desc",
// isAsc: "desc",
monitorSubset: "",
params: {
beginCollectTime: "",
@ -444,6 +446,10 @@ export default {
this.loading = true;
this.queryParams.params.beginCollectTime = this.dateRangeone;
this.queryParams.params.endCollectTime = this.dateRangetwo;
this.queryParams.params.beginTime = this.dateRangeone;
this.queryParams.params.endTime = this.dateRangetwo;
this.queryParams.params.pageNum = this.queryParams.pageNum;
this.queryParams.params.pageSize = this.queryParams.pageSize;
listUser(this.queryParams).then((response) => {
this.userList = response.rows;
this.total = response.total;

Loading…
Cancel
Save