Compare commits
5 Commits
b38d3bad1b
...
2025-12
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b0feb1320 | |||
| e92326c55d | |||
| 7abbfd500b | |||
| 77360ef468 | |||
| 56d88939c4 |
@@ -11,7 +11,6 @@ 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.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.csdevice.constant.DataParam;
|
import com.njcn.csdevice.constant.DataParam;
|
||||||
import com.njcn.csdevice.controller.project.EngineeringController;
|
|
||||||
import com.njcn.csdevice.enums.LineBaseEnum;
|
import com.njcn.csdevice.enums.LineBaseEnum;
|
||||||
import com.njcn.csdevice.mapper.*;
|
import com.njcn.csdevice.mapper.*;
|
||||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||||
@@ -210,7 +209,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
List<CsLedgerVO> ledger;
|
List<CsLedgerVO> ledger;
|
||||||
String role = RequestUtil.getUserRole();
|
String role = RequestUtil.getUserRole();
|
||||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
if (roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())) {
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
ledger = allList.stream()
|
ledger = allList.stream()
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -414,7 +413,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
|||||||
List<CsLedgerVO> ledger;
|
List<CsLedgerVO> ledger;
|
||||||
String role = RequestUtil.getUserRole();
|
String role = RequestUtil.getUserRole();
|
||||||
List<String> roles = JSONArray.parseArray(role, String.class);
|
List<String> roles = JSONArray.parseArray(role, String.class);
|
||||||
if (roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode())) {
|
if(roles.contains(AppRoleEnum.ROOT.getCode()) || roles.contains(AppRoleEnum.OPERATION_MANAGER.getCode()) || roles.contains(AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
ledger = allList.stream()
|
ledger = allList.stream()
|
||||||
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
.filter(item -> Objects.equals(item.getLevel(), 2) && Objects.equals(item.getPid(), "0"))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if(Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
|
if(Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER_8000.getCode())){
|
||||||
csDeviceUserPOQueryWrapper.clear();
|
csDeviceUserPOQueryWrapper.clear();
|
||||||
csEngineeringUserPOQueryWrapper.clear();
|
csEngineeringUserPOQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
@@ -94,7 +94,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// ||Objects.equals(role,"bxs_user")
|
// ||Objects.equals(role,"bxs_user")
|
||||||
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()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode()) ){
|
||||||
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
List<CsEngineeringPO> csEngineeringPOS = csEngineeringMapper.selectList(null);
|
||||||
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
collect =csEngineeringPOS.stream().filter(temp->Objects.equals(temp.getStatus(),"1")).map(CsEngineeringPO::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if(
|
if(
|
||||||
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode())){
|
Objects.equals(role,AppRoleEnum.APP_VIP_USER.getCode()) || Objects.equals(role,AppRoleEnum.REGULAR_USER_8000.getCode())){
|
||||||
csDeviceUserPOQueryWrapper.clear();
|
csDeviceUserPOQueryWrapper.clear();
|
||||||
csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> {
|
csDeviceUserPOQueryWrapper.eq("status","1").and(wq -> {
|
||||||
wq.eq("primary_user_id", userIndex)
|
wq.eq("primary_user_id", userIndex)
|
||||||
@@ -198,7 +198,7 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
// ||Objects.equals(role,"bxs_user")
|
// ||Objects.equals(role,"bxs_user")
|
||||||
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()) || Objects.equals(role,AppRoleEnum.REGULAR_USER.getCode())){
|
||||||
csLedgerQueryWrapper.clear();
|
csLedgerQueryWrapper.clear();
|
||||||
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
csLedgerQueryWrapper.eq("level",2).eq("state",1);
|
||||||
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
|
|||||||
@@ -146,6 +146,16 @@
|
|||||||
<build>
|
<build>
|
||||||
<finalName>csHarmonicBoot</finalName>
|
<finalName>csHarmonicBoot</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<nonFilteredFileExtensions>
|
||||||
|
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
|
||||||
|
</nonFilteredFileExtensions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
|||||||
@@ -165,7 +165,6 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
}
|
}
|
||||||
String clDid = influxDbParamUtil.getClDidByLineId(item.getLineId());
|
String clDid = influxDbParamUtil.getClDidByLineId(item.getLineId());
|
||||||
//基础信息
|
//基础信息
|
||||||
System.out.println(item.getLineId());
|
|
||||||
CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],targetName,clDid);
|
CsRtDataVO vo = getLineRtData(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],targetName,clDid);
|
||||||
//设备状态信息
|
//设备状态信息
|
||||||
CsEquipmentDeliveryPO po = equipmentFeignClient.getDevByLineId(item.getLineId()).getData();
|
CsEquipmentDeliveryPO po = equipmentFeignClient.getDevByLineId(item.getLineId()).getData();
|
||||||
@@ -215,7 +214,7 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
String s = tempUid.get(tempUid.size() - 1);
|
String s = tempUid.get(tempUid.size() - 1);
|
||||||
String[] tempTable = s.replace("$", "").split("#");
|
String[] tempTable = s.replace("$", "").split("#");
|
||||||
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2].toUpperCase(),temp,item.getUnit().get(i)));
|
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"M":tempTable[1],tempTable[2],temp,item.getUnit().get(i)));
|
||||||
// result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%"));
|
// result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,13 +272,6 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
*/
|
*/
|
||||||
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target, String cldId) {
|
public CsRtDataVO getLineRtData(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target, String cldId) {
|
||||||
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
||||||
log.info("---------------------------------------------------------------------------------------------------------------");
|
|
||||||
log.info(lineId);
|
|
||||||
log.info(tableName);
|
|
||||||
log.info(columnName);
|
|
||||||
log.info(phasic);
|
|
||||||
log.info(dataType);
|
|
||||||
log.info(cldId);
|
|
||||||
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,cldId);
|
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,cldId);
|
||||||
if(Objects.isNull(statisticalDataDTO)){
|
if(Objects.isNull(statisticalDataDTO)){
|
||||||
statisticalDataDTO = new StatisticalDataDTO();
|
statisticalDataDTO = new StatisticalDataDTO();
|
||||||
@@ -311,7 +303,8 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
*/
|
*/
|
||||||
public CsRtDataVO getLineRtDataNew(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
|
public CsRtDataVO getLineRtDataNew(String id,String lineId, String tableName, String columnName, String phasic, String dataType, String target,String uint) {
|
||||||
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
CsRtDataVO csRtDataVO = new CsRtDataVO();
|
||||||
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,null);
|
String clDid = influxDbParamUtil.getClDidByLineId(lineId);
|
||||||
|
StatisticalDataDTO statisticalDataDTO = commonService.getLineRtData(lineId,tableName,columnName,phasic,dataType,clDid);
|
||||||
if(Objects.isNull(statisticalDataDTO)){
|
if(Objects.isNull(statisticalDataDTO)){
|
||||||
statisticalDataDTO = new StatisticalDataDTO();
|
statisticalDataDTO = new StatisticalDataDTO();
|
||||||
statisticalDataDTO.setLineId(lineId);
|
statisticalDataDTO.setLineId(lineId);
|
||||||
|
|||||||
Reference in New Issue
Block a user