1.无线bug修改
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
package com.njcn.csdevice.controller.ledger;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.PqsDeviceUnitMapper;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2023/4/26 10:00
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/commTerminal")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Api(tags = "通用台账查询")
|
||||
public class CommTerminalController extends BaseController {
|
||||
|
||||
private final PqsDeviceUnitMapper pqsDeviceUnitMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过监测点获取监测点数据单位
|
||||
* @author cdf
|
||||
* @date 2023/9/21
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/lineUnitDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||
public HttpResult<PqsDeviceUnit> lineUnitDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("lineUnitDetail");
|
||||
|
||||
PqsDeviceUnit pqsDeviceUnit = pqsDeviceUnitMapper.selectById(lineId);
|
||||
if(Objects.isNull(pqsDeviceUnit)){
|
||||
pqsDeviceUnit = new PqsDeviceUnit();
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqsDeviceUnit, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,15 +5,19 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.OverlimitMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.utils.COverlimitUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
@@ -36,6 +40,8 @@ public class CslineController extends BaseController {
|
||||
|
||||
private final CsLinePOService csLinePOService;
|
||||
|
||||
private final OverlimitMapper overlimitMapper;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryLineById")
|
||||
@ApiOperation("监测点查询通过id获取")
|
||||
@@ -70,9 +76,16 @@ public class CslineController extends BaseController {
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("批量新增监测点")
|
||||
@ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public HttpResult<String> addLineList(@RequestBody List<CsLinePO> list){
|
||||
String methodDescribe = getMethodDescribe("addLineList");
|
||||
csLinePOService.saveBatch(list);
|
||||
for(CsLinePO csLinePO: list){
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(csLinePO.getVolGrade().floatValue(),10f,10f,10f,0,1);
|
||||
overlimit.setId(csLinePO.getLineId());
|
||||
overlimitMapper.deleteById(csLinePO.getLineId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/8/21
|
||||
*/
|
||||
public interface PqsDeviceUnitMapper extends BaseMapper<PqsDeviceUnit> {
|
||||
}
|
||||
@@ -346,7 +346,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
for (CsDataSet item : dataSet) {
|
||||
DeviceManagerVO.DataSetVO dataSetVO = new DeviceManagerVO.DataSetVO();
|
||||
dataSetVO.setId(item.getId());
|
||||
dataSetVO.setName(item.getAnotherName());
|
||||
dataSetVO.setName("准实时数据");
|
||||
dataSetVO.setType("rt");
|
||||
dataSetList.add(dataSetVO);
|
||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||
@@ -354,7 +354,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
//历史数据tab
|
||||
DeviceManagerVO.DataSetVO dataSetVo2 = new DeviceManagerVO.DataSetVO();
|
||||
dataSetVo2.setId(item.getId());
|
||||
dataSetVo2.setName("历史" + item.getAnotherName());
|
||||
dataSetVo2.setName("历史统计数据");
|
||||
dataSetVo2.setType("history");
|
||||
dataSetList.add(dataSetVo2);
|
||||
deviceManagerVo.setDataLevel(item.getDataLevel());
|
||||
@@ -363,19 +363,19 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
//趋势数据tab
|
||||
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
|
||||
dataSetVo3.setId(item.getId());
|
||||
dataSetVo3.setName(item.getAnotherName() + "趋势数据");
|
||||
dataSetVo3.setName("历史趋势数据");
|
||||
dataSetVo3.setType("trenddata");
|
||||
dataSetList.add(dataSetVo3);
|
||||
//实时数据tab
|
||||
DeviceManagerVO.DataSetVO dataSetVo4 = new DeviceManagerVO.DataSetVO();
|
||||
dataSetVo4.setId(item.getId());
|
||||
dataSetVo4.setName(item.getAnotherName() + "实时数据");
|
||||
dataSetVo4.setName("实时数据");
|
||||
dataSetVo4.setType("realtimedata");
|
||||
dataSetList.add(dataSetVo4);
|
||||
//暂态事件tab
|
||||
DeviceManagerVO.DataSetVO dataSetVo5 = new DeviceManagerVO.DataSetVO();
|
||||
dataSetVo5.setId(item.getId());
|
||||
dataSetVo5.setName(item.getAnotherName() + "暂态事件");
|
||||
dataSetVo5.setName("暂态事件");
|
||||
dataSetVo5.setType("event");
|
||||
dataSetList.add(dataSetVo5);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -293,11 +295,9 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
List<ThdDataVO> result = new ArrayList();
|
||||
List<CsEquipmentDeliveryDTO> data1 = equipmentFeignClient.queryDeviceById(Stream.of(commonStatisticalQueryParam.getDevId()).collect(Collectors.toList())).getData();
|
||||
List<CsLinePO> finalCsLinePOList = csLineFeignClient.queryLineById(Arrays.asList(commonStatisticalQueryParam.getLineId())).getData();
|
||||
if(commonStatisticalQueryParam.getList() != null && commonStatisticalQueryParam.getList().size() > 0){
|
||||
if(CollectionUtil.isNotEmpty(commonStatisticalQueryParam.getList())){
|
||||
for (CommonStatisticalQueryParam param : commonStatisticalQueryParam.getList()){
|
||||
if(param.getStatisticalId() == null){
|
||||
continue;
|
||||
}
|
||||
|
||||
List<EleEpdPqd> eleEpdPqds = csStatisticalSetFeignClient.queryStatisticalSelect(param.getStatisticalId()).getData();
|
||||
eleEpdPqds.forEach(epdPqd->{
|
||||
List<CommonQueryParam> commonQueryParams = finalCsLinePOList.stream().map(temp -> {
|
||||
@@ -306,15 +306,19 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
||||
commonQueryParam.setTableName(influxDbParamUtil.getTableNameByClassId(epdPqd.getClassId()));
|
||||
commonQueryParam.setColumnName(epdPqd.getName()+ (param.getFrequency() == null ? "":"_"+param.getFrequency()));
|
||||
commonQueryParam.setPhasic(epdPqd.getPhase());
|
||||
|
||||
commonQueryParam.setStartTime(DateUtil.format(DateUtil.beginOfMonth(new Date()), DatePattern.NORM_DATETIME_PATTERN));
|
||||
commonQueryParam.setEndTime(DateUtil.format(DateUtil.date(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
//commonQueryParam.setStartTime(commonStatisticalQueryParam.getStartTime());
|
||||
|
||||
//commonQueryParam.setEndTime(commonStatisticalQueryParam.getEndTime());
|
||||
commonQueryParam.setDataType(commonStatisticalQueryParam.getValueType());
|
||||
commonQueryParam.setProcess(data1.get(0).getProcess()+"");
|
||||
commonQueryParam.setClDid(influxDbParamUtil.getClDidByLineId(temp.getLineId()));
|
||||
return commonQueryParam;
|
||||
}).collect(Collectors.toList());
|
||||
//List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
||||
List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtDataByTime(commonQueryParams);
|
||||
//List<StatisticalDataDTO> deviceRtData = commonService.getDeviceRtData(commonQueryParams);
|
||||
List<ThdDataVO> collect1 = deviceRtData.stream().map(temp -> {
|
||||
ThdDataVO vo = new ThdDataVO();
|
||||
vo.setLineId(temp.getLineId());
|
||||
|
||||
@@ -110,7 +110,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
c.setPid(portable.getId());
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(c.getId());
|
||||
c.setComFlag(csEquipmentDeliveryPO.getRunStatus());
|
||||
c.setChildren(wlRecordMapper.getAllLine(c.getId()));
|
||||
List<CsLedgerVO> csLedgerVOList = wlRecordMapper.getAllLine(c.getId());
|
||||
csLedgerVOList.forEach(item->item.setComFlag(c.getComFlag()));
|
||||
c.setChildren(csLedgerVOList);
|
||||
for(CsLedgerVO cs : c.getChildren()){
|
||||
cs.setPid(c.getId());
|
||||
cs.setLevel(3);
|
||||
|
||||
Reference in New Issue
Block a user