Browse Source

修复:智能诊断页面查询增加用户权限

zhongwei
ty 4 months ago
parent
commit
5a3c04d294
  1. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

16
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -14,10 +14,14 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -40,6 +44,8 @@ import java.util.Map;
public class FdpListTableDataServiceImpl implements IFdpListTableDataService { public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Resource @Resource
private IStationClient stationClient; private IStationClient stationClient;
@Resource
private ISysClient sysClient;
@Value("${url.getNeoFaultPropertyList}") @Value("${url.getNeoFaultPropertyList}")
private String getNeoFaultPropertyList; private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}") @Value("${url.getNeoFaultTableData}")
@ -57,17 +63,19 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
List<StationEntity> list = new ArrayList<>(); List<StationEntity> list = new ArrayList<>();
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() { R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
}); });
StationEntity condition = new StationEntity();
R<List<StationEntity>> stationR = stationClient.list(condition);
if (!stationR.isSuccess()||CollectionUtil.isEmpty(stationR.getData())){
return R.data(list);
}
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) { if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
R<List<StationEntity>> listAll = stationClient.getListAll();
if (listAll.isSuccess() && ObjectUtil.isNotEmpty(listAll.getData())) {
for (String s : res.getData()) { for (String s : res.getData()) {
for (StationEntity station : listAll.getData()) { for (StationEntity station : stationR.getData()) {
if (station.getCode().equals(s)) { if (station.getCode().equals(s)) {
list.add(station); list.add(station);
} }
} }
} }
}
} }
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms"); log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list); return R.data(list);

Loading…
Cancel
Save