Merge remote-tracking branch 'origin/master'

This commit is contained in:
wr
2023-11-03 16:47:37 +08:00
15 changed files with 131 additions and 57 deletions

View File

@@ -56,10 +56,10 @@ public class DevCountVO {
@ApiModelProperty(value = "稳态件数") @ApiModelProperty(value = "稳态件数")
private Integer currentHarmonicCount; private Integer currentHarmonicCount;
@ApiModelProperty(value = "项目数") @ApiModelProperty(value = "当前项目数")
private Integer currentProjectCount; private Integer currentProjectCount;
@ApiModelProperty(value = "项目") @ApiModelProperty(value = "反馈")
private Integer feedBackCount; private Integer feedBackCount;

View File

@@ -67,11 +67,15 @@ public class EquipmentDeliveryController extends BaseController {
@DeviceLog(operateType = DeviceOperate.ADD) @DeviceLog(operateType = DeviceOperate.ADD)
public HttpResult<Boolean> addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){ public HttpResult<Boolean> addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){
String methodDescribe = getMethodDescribe("addEquipmentDelivery"); String methodDescribe = getMethodDescribe("addEquipmentDelivery");
Boolean flag = csEquipmentDeliveryService.save (csEquipmentDeliveryAddParm); Boolean flag = csEquipmentDeliveryService.save(csEquipmentDeliveryAddParm);
if (flag){ if (flag){
//查询mqtt用户名和密码是否存在
boolean result = mqttUserService.findMqttUser(csEquipmentDeliveryAddParm.getNdid());
if (result){
//初始化装置mqtt连接信息(使用sha256加密) //初始化装置mqtt连接信息(使用sha256加密)
mqttUserService.insertMqttUser(csEquipmentDeliveryAddParm.getNdid()); mqttUserService.insertMqttUser(csEquipmentDeliveryAddParm.getNdid());
} }
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
} }

View File

@@ -96,9 +96,9 @@
from from
cs_equipment_delivery t0 cs_equipment_delivery t0
left join left join
cs_dev_model_relation t1 on t0.id = t1.dev_id cs_dev_model_relation t1 on t0.id = t1.dev_id and t1.status = 1
left join left join
cs_dev_model t2 on t1.model_id = t2.id cs_dev_model t2 on t1.model_id = t2.id and t2.status = 1
left join cs_data_set t3 on t3.pid = t2.id left join cs_data_set t3 on t3.pid = t2.id
left join cs_data_array t4 on t3.id = t4.pid left join cs_data_array t4 on t3.id = t4.pid
where where

View File

@@ -13,6 +13,13 @@ import com.njcn.csdevice.pojo.po.MqttUser;
*/ */
public interface IMqttUserService extends IService<MqttUser> { public interface IMqttUserService extends IService<MqttUser> {
/**
* 查询新增的mqtt用户名和密码是否存在
* @param userName 用户名
* @return boolean
*/
boolean findMqttUser(String userName);
/** /**
* 根据密码生成mqtt连接信息 * 根据密码生成mqtt连接信息
* @param password * @param password

View File

@@ -57,9 +57,10 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
/*治理侧监测点*/ /*治理侧监测点*/
CsLinePO csLinePO = collect1.get(0); CsLinePO csLinePO = collect1.get(0);
CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one(); CsDevCapacityPO one = this.lambdaQuery().eq(CsDevCapacityPO::getLineId, csLinePO.getLineId()).eq(CsDevCapacityPO::getCldid, 0).one();
Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING)); // Optional.ofNullable(one).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.DATA_MISSING));
if(Objects.isNull(one)){
return 0.0;
}
return Double.valueOf(df.format(one.getCapacity()*0.1)); return Double.valueOf(df.format(one.getCapacity()*0.1));
} }
} }

View File

@@ -302,7 +302,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
CsEquipmentDeliveryPO temp = csEquipmentDeliveryMapper.selectById(eid); CsEquipmentDeliveryPO temp = csEquipmentDeliveryMapper.selectById(eid);
mqttUserService.deleteUser(temp.getNdid()); mqttUserService.deleteUser(temp.getNdid());
List<CsLedger> list1 = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, eid).list(); List<CsLedger> list1 = iCsLedgerService.lambdaQuery().eq(CsLedger::getPid, eid).list();
if(!com.alibaba.nacos.client.naming.utils.CollectionUtils.isEmpty(list1)){ if(!CollectionUtils.isEmpty(list1)){
List<String> collect = list1.stream().map(CsLedger::getId).collect(Collectors.toList()); List<String> collect = list1.stream().map(CsLedger::getId).collect(Collectors.toList());
LambdaQueryWrapper<CsLinePO> csLinePOLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CsLinePO> csLinePOLambdaQueryWrapper = new LambdaQueryWrapper<>();
csLinePOLambdaQueryWrapper.in(CsLinePO::getLineId,collect); csLinePOLambdaQueryWrapper.in(CsLinePO::getLineId,collect);

View File

@@ -125,10 +125,10 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override @Override
// @Transactional(rollbackFor = {Exception.class}, propagation = Propagation.REQUIRED) // @Transactional(rollbackFor = {Exception.class}, propagation = Propagation.REQUIRED)
public Boolean AuditEquipmentDelivery(String id) { public Boolean AuditEquipmentDelivery(String id) {
UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper(); //物理删除
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
wrapper.eq ("id", id); wrapper.eq ("id", id);
wrapper.set ("run_status", "0"); boolean update = this.remove (wrapper);
boolean update = this.update (wrapper);
//删除deviceuser表里的设备游客数据设备,删除监测点相关数据 //删除deviceuser表里的设备游客数据设备,删除监测点相关数据
List<CsLedger> list = csLedgerService.lambdaQuery().eq(CsLedger::getPid, id).list(); List<CsLedger> list = csLedgerService.lambdaQuery().eq(CsLedger::getPid, id).list();
if(!CollectionUtils.isEmpty(list)){ if(!CollectionUtils.isEmpty(list)){
@@ -153,9 +153,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>(); QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
queryWrap.eq("device_id",id); queryWrap.eq("device_id",id);
csTouristDataPOService.getBaseMapper().delete(queryWrap); csTouristDataPOService.getBaseMapper().delete(queryWrap);
/*后续徐那边做处理*/
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id); // CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.getBaseMapper().selectById(id);
mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid()); // mqttUserService.deleteUser(csEquipmentDeliveryPO.getNdid());
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update(); csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
@@ -496,8 +496,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
public void testCompletion(String deviceId,Integer type,String remark) { public void testCompletion(String deviceId,Integer type,String remark) {
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one(); CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId). this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
set(CsEquipmentDeliveryPO::getStatus,1). // set(CsEquipmentDeliveryPO::getStatus,1).
set(CsEquipmentDeliveryPO::getRunStatus,1). // set(CsEquipmentDeliveryPO::getRunStatus,2).
set(CsEquipmentDeliveryPO::getProcess,type+1).update(); set(CsEquipmentDeliveryPO::getProcess,type+1).update();
this.delete(deviceId); this.delete(deviceId);
List<CsEquipmentProcessPO> list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()). List<CsEquipmentProcessPO> list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()).
@@ -516,8 +516,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one(); CsEquipmentDeliveryPO one = this.lambdaQuery().eq(CsEquipmentDeliveryPO::getId, deviceId).one();
this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId). this.lambdaUpdate().eq(CsEquipmentDeliveryPO::getId,deviceId).
set(CsEquipmentDeliveryPO::getStatus,1). // set(CsEquipmentDeliveryPO::getStatus,1).
set(CsEquipmentDeliveryPO::getRunStatus,1). // set(CsEquipmentDeliveryPO::getRunStatus,1).
set(CsEquipmentDeliveryPO::getProcess,type).update(); set(CsEquipmentDeliveryPO::getProcess,type).update();
this.delete(deviceId); this.delete(deviceId);
List<CsEquipmentProcessPO> list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()). List<CsEquipmentProcessPO> list = csEquipmentProcessPOService.lambdaQuery().eq(CsEquipmentProcessPO::getDevId, one.getNdid()).

View File

@@ -5,17 +5,11 @@ import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.csdevice.enums.LineBaseEnum; import com.njcn.csdevice.enums.LineBaseEnum;
import com.njcn.csdevice.mapper.AppProjectMapper; import com.njcn.csdevice.mapper.*;
import com.njcn.csdevice.mapper.AppTopologyDiagramMapper;
import com.njcn.csdevice.mapper.CsEngineeringMapper;
import com.njcn.csdevice.mapper.CsLedgerMapper;
import com.njcn.csdevice.pojo.dto.DevDetailDTO; import com.njcn.csdevice.pojo.dto.DevDetailDTO;
import com.njcn.csdevice.pojo.dto.LineParamDTO; import com.njcn.csdevice.pojo.dto.LineParamDTO;
import com.njcn.csdevice.pojo.param.CsLedgerParam; import com.njcn.csdevice.pojo.param.CsLedgerParam;
import com.njcn.csdevice.pojo.po.AppProjectPO; import com.njcn.csdevice.pojo.po.*;
import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO;
import com.njcn.csdevice.pojo.po.CsEngineeringPO;
import com.njcn.csdevice.pojo.po.CsLedger;
import com.njcn.csdevice.pojo.vo.CsLedgerVO; import com.njcn.csdevice.pojo.vo.CsLedgerVO;
import com.njcn.csdevice.service.CsLinePOService; import com.njcn.csdevice.service.CsLinePOService;
import com.njcn.csdevice.service.ICsEngineeringUserService; import com.njcn.csdevice.service.ICsEngineeringUserService;
@@ -57,6 +51,9 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
private final FileStorageUtil fileStorageUtil; private final FileStorageUtil fileStorageUtil;
private final RoleEngineerDevService roleEngineerDevService; private final RoleEngineerDevService roleEngineerDevService;
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
@Override @Override
public List<CsLedgerVO> getLedgerTree() { public List<CsLedgerVO> getLedgerTree() {
@@ -92,7 +89,15 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
// } // }
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
// List<CsLedgerVO> deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); // List<CsLedgerVO> deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).
map(
temp->{
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId());
temp.setComFlag(csEquipmentDeliveryPO.getRunStatus());
return temp;
}
).
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
List<CsLedgerVO> lineList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List<CsLedgerVO> lineList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
// List<String> collect = lineList.stream().map(CsLedgerVO::getId).collect(Collectors.toList()); // List<String> collect = lineList.stream().map(CsLedgerVO::getId).collect(Collectors.toList());
@@ -125,7 +130,15 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
// } // }
List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List<CsLedgerVO> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
// List<CsLedgerVO> deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); // List<CsLedgerVO> deviceList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList()); List<CsLedgerVO> deviceList = allList.stream().filter(item -> device.contains(item.getId())).
map(
temp->{
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(temp.getId());
temp.setComFlag(csEquipmentDeliveryPO.getRunStatus());
return temp;
}
).
sorted(Comparator.comparing(CsLedgerVO::getSort)).collect(Collectors.toList());
projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList))); projectList.forEach(pro -> pro.setChildren(getChildren(pro, deviceList)));
engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList))); engineeringList.forEach(eng -> eng.setChildren(getChildren(eng, projectList)));

View File

@@ -9,6 +9,7 @@ import com.njcn.csdevice.pojo.po.MqttUser;
import com.njcn.csdevice.service.IMqttUserService; import com.njcn.csdevice.service.IMqttUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.Random; import java.util.Random;
/** /**
@@ -23,6 +24,12 @@ import java.util.Random;
@DS("mqtt") @DS("mqtt")
public class MqttUserServiceImpl extends ServiceImpl<MqttUserMapper, MqttUser> implements IMqttUserService { public class MqttUserServiceImpl extends ServiceImpl<MqttUserMapper, MqttUser> implements IMqttUserService {
@Override
public boolean findMqttUser(String userName) {
MqttUser mqttUser = this.lambdaQuery().eq(MqttUser::getUsername,userName).one();
return Objects.isNull(mqttUser);
}
@Override @Override
public void insertMqttUser(String password) { public void insertMqttUser(String password) {
Random r = new Random(); Random r = new Random();

View File

@@ -99,7 +99,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
}else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){ }else if(Objects.equals(role,AppRoleEnum.ROOT.getCode())||Objects.equals(role,AppRoleEnum.OPERATION_MANAGER.getCode())){
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null); List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
collect =csEngineeringPOS.stream().map(CsEngineeringPO::getId).collect(Collectors.toList()); collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
} }
return collect; return collect;

View File

@@ -1,9 +1,12 @@
package com.njcn.csharmonic.pojo.vo; package com.njcn.csharmonic.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.common.utils.serializer.InstantDateSerializer;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@@ -15,9 +18,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
public class ThdDataVO { public class ThdDataVO {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @JsonSerialize(using = InstantDateSerializer.class)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Instant time;
private LocalDateTime time;
private String lineId; private String lineId;
private String position; private String position;
private String lineName; private String lineName;

View File

@@ -81,11 +81,11 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
if( Objects.equals(role, AppRoleEnum.APP_VIP_USER.getCode())&&Objects.equals(csEventUserQueryParam.getType(),"3")){ if( Objects.equals(role, AppRoleEnum.APP_VIP_USER.getCode())&&Objects.equals(csEventUserQueryParam.getType(),"3")){
csEventUserQueryParam.setLevel("3"); csEventUserQueryParam.setLevel("3");
} }
if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){ // if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){
csEventUserQueryParam.setUserId(null); // csEventUserQueryParam.setUserId(null);
flag = Boolean.FALSE; // flag = Boolean.FALSE;
//
} // }
// if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())&&Objects.equals(csEventUserQueryParam.getType(),"0")){ // if(CollectionUtil.isEmpty(csEventUserQueryParam.getTarget())&&Objects.equals(csEventUserQueryParam.getType(),"0")){
// /*获取所有暂态事件类型*/ // /*获取所有暂态事件类型*/
// List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData(); // List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.APP_EVENT.getCode()).getData();
@@ -227,10 +227,10 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
if( Objects.equals(role, AppRoleEnum.APP_VIP_USER.getCode())&&Objects.equals(csEventUserQueryPage.getType(),"3")){ if( Objects.equals(role, AppRoleEnum.APP_VIP_USER.getCode())&&Objects.equals(csEventUserQueryPage.getType(),"3")){
csEventUserQueryPage.setLevel("3"); csEventUserQueryPage.setLevel("3");
} }
if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){ // if( Objects.equals(role, AppRoleEnum.OPERATION_MANAGER.getCode())||Objects.equals(role, AppRoleEnum.ROOT.getCode())){
csEventUserQueryPage.setUserId(null); // csEventUserQueryPage.setUserId(null);
flag = Boolean.FALSE; // flag = Boolean.FALSE;
} // }
List<String> deviceId = new ArrayList<>(); List<String> deviceId = new ArrayList<>();
List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData(); List<CsLedgerVO> data = csLedgerFeignClient.getDeviceTree().getData();

View File

@@ -64,7 +64,7 @@ public class DeviceDataTrendServiceImpl implements DeviceDataTrendService {
vo.setLineId(statisticalDataDTO.getLineId()); vo.setLineId(statisticalDataDTO.getLineId());
vo.setPhase(statisticalDataDTO.getPhaseType()); vo.setPhase(statisticalDataDTO.getPhaseType());
vo.setTime(statisticalDataDTO.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); vo.setTime(statisticalDataDTO.getTime());
vo.setStatMethod(statisticalDataDTO.getValueType()); vo.setStatMethod(statisticalDataDTO.getValueType());
vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.UP).doubleValue()); vo.setStatisticalData(BigDecimal.valueOf(statisticalDataDTO.getValue()).setScale(4, RoundingMode.UP).doubleValue());
vo.setStatisticalIndex(temp.getDataId()); vo.setStatisticalIndex(temp.getDataId());

View File

@@ -80,7 +80,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO(); ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO); BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(statisticalName); thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position); thdDataVO.setPosition(position);
Double statisticalValue = 0.00; Double statisticalValue = 0.00;
@@ -106,7 +106,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO(); ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO); BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName()); thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position); thdDataVO.setPosition(position);
Double statisticalValue = 0.00; Double statisticalValue = 0.00;
@@ -133,7 +133,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO(); ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO); BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(statisticalName); thdDataVO.setStatisticalName(statisticalName);
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position); thdDataVO.setPosition(position);
Double statisticalValue = 0.00; Double statisticalValue = 0.00;
@@ -158,7 +158,7 @@ public class StableDataServiceImpl implements StableDataService {
ThdDataVO thdDataVO = new ThdDataVO(); ThdDataVO thdDataVO = new ThdDataVO();
BeanUtils.copyProperties(temp,thdDataVO); BeanUtils.copyProperties(temp,thdDataVO);
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName()); thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); thdDataVO.setTime(temp.getTime());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
thdDataVO.setPosition(position); thdDataVO.setPosition(position);
Double statisticalValue = 0.00; Double statisticalValue = 0.00;
@@ -214,7 +214,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setPhase(phaseReflection(temp.getPhaseType())); vo.setPhase(phaseReflection(temp.getPhaseType()));
String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = finalCsLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
vo.setPosition(position); vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType()); vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(data.getId()); vo.setStatisticalIndex(data.getId());
@@ -265,7 +265,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setPhase(temp.getPhaseType()); vo.setPhase(temp.getPhaseType());
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition(); String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), vo.getLineId())).collect(Collectors.toList()).get(0).getPosition();
vo.setPosition(position); vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType()); vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(epdPqd.getId()); vo.setStatisticalIndex(epdPqd.getId());
@@ -325,7 +325,7 @@ public class StableDataServiceImpl implements StableDataService {
vo.setLineName(lineName); vo.setLineName(lineName);
vo.setPosition(position); vo.setPosition(position);
vo.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime()); vo.setTime(temp.getTime());
vo.setStatMethod(temp.getValueType()); vo.setStatMethod(temp.getValueType());
vo.setStatisticalData(Double.valueOf(df.format(temp.getValue()))); vo.setStatisticalData(Double.valueOf(df.format(temp.getValue())));
vo.setStatisticalIndex(epdPqd.getId()); vo.setStatisticalIndex(epdPqd.getId());

48
pom.xml
View File

@@ -28,8 +28,8 @@
<!--nacos的ip:port--> <!--nacos的ip:port-->
<nacos.url>${middle.server.url}:18848</nacos.url> <nacos.url>${middle.server.url}:18848</nacos.url>
<!--服务器发布内容为空--> <!--服务器发布内容为空-->
<nacos.namespace>415a1c87-33aa-47bd-8e25-13cc456c87ed</nacos.namespace> <nacos.namespace>eccf606c-4213-4ee1-846e-a265a50ae355</nacos.namespace>
<!-- <nacos.namespace>3eaa4bd1-bfb6-497b-aba2-47edda305427</nacos.namespace>--> <!-- <nacos.namespace>3eaa4bd1-bfb6-497b-aba2-47edda305427</nacos.namespace>-->
<!--sentinel:port--> <!--sentinel:port-->
<sentinel.url>${middle.server.url}:8080</sentinel.url> <sentinel.url>${middle.server.url}:8080</sentinel.url>
<!--网关地址主要用于配置swagger中认证token--> <!--网关地址主要用于配置swagger中认证token-->
@@ -85,7 +85,7 @@
<mqtt.version>1.2.7</mqtt.version> <mqtt.version>1.2.7</mqtt.version>
<easypoi.version>4.4.0</easypoi.version> <easypoi.version>4.4.0</easypoi.version>
<progressbar.version>0.5.3</progressbar.version> <progressbar.version>0.5.3</progressbar.version>
<okhttp.version>4.8.1</okhttp.version> <okhttp3.version>4.9.0</okhttp3.version>
<minio.version>8.2.1</minio.version> <minio.version>8.2.1</minio.version>
<spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version> <spring-cloud-huawei.version>1.7.0-Hoxton</spring-cloud-huawei.version>
</properties> </properties>
@@ -332,10 +332,50 @@
<artifactId>progressbar</artifactId> <artifactId>progressbar</artifactId>
<version>${progressbar.version}</version> <version>${progressbar.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okcurl</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency> <dependency>
<groupId>com.squareup.okhttp3</groupId> <groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>${okhttp.version}</version> <version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-dnsoverhttps</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-sse</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-testing-support</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-tls</artifactId>
<version>${okhttp3.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-urlconnection</artifactId>
<version>${okhttp3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.minio</groupId> <groupId>io.minio</groupId>