|
@@ -115,8 +115,6 @@ public class LabSubjectManagerService {
|
|
|
/**
|
|
/**
|
|
|
* 最低危险等级
|
|
* 最低危险等级
|
|
|
*/
|
|
*/
|
|
|
-// @Autowired
|
|
|
|
|
-// private LabSubClassVO getNONELabSubClassVO;
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FunctionMapperUtil functionMapperUtil;
|
|
private FunctionMapperUtil functionMapperUtil;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -189,10 +187,6 @@ public class LabSubjectManagerService {
|
|
|
|
|
|
|
|
logger.info("预案调用硬件,硬件id={},硬件名称={},硬件指令={}",labHardware.getId(), JSON.toJSONString(labHardware.getName()),JSON.toJSONString(command));
|
|
logger.info("预案调用硬件,硬件id={},硬件名称={},硬件指令={}",labHardware.getId(), JSON.toJSONString(labHardware.getName()),JSON.toJSONString(command));
|
|
|
return ResultData.success(riskControl(labHardware.getId(), command));
|
|
return ResultData.success(riskControl(labHardware.getId(), command));
|
|
|
-
|
|
|
|
|
- //老继电器调用方法
|
|
|
|
|
-// return controlService.execution(labHardware, functionStatus);
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void test(Long id){
|
|
public void test(Long id){
|
|
@@ -313,9 +307,6 @@ public class LabSubjectManagerService {
|
|
|
alarmUpMap.put("handlingUserId",SecurityUtils.getUserId()+"");
|
|
alarmUpMap.put("handlingUserId",SecurityUtils.getUserId()+"");
|
|
|
alarmUpMap.put("handlingContent","关闭智能声光报警");
|
|
alarmUpMap.put("handlingContent","关闭智能声光报警");
|
|
|
remoteChemicalAlarmService.updateStatus(alarmUpMap);
|
|
remoteChemicalAlarmService.updateStatus(alarmUpMap);
|
|
|
-// if(!updateAlarm.getData()){
|
|
|
|
|
-// logger.error("智能声光报警日志处理失败,报警设备编号:"+labHardwareVO.getHardwareNum());
|
|
|
|
|
-// }
|
|
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -487,8 +478,6 @@ public class LabSubjectManagerService {
|
|
|
//设置负责人
|
|
//设置负责人
|
|
|
subSimpleVO.setAdminName(subject.getAdminName());
|
|
subSimpleVO.setAdminName(subject.getAdminName());
|
|
|
subSimpleVO.setAdminPhone(subject.getAdminPhone());
|
|
subSimpleVO.setAdminPhone(subject.getAdminPhone());
|
|
|
- //获取危险等级
|
|
|
|
|
- //LabSubClassVO subclassVo = getSubClassVO(subject);
|
|
|
|
|
|
|
|
|
|
//设置危险等级名称
|
|
//设置危险等级名称
|
|
|
subSimpleVO.setDangerName(subject.getTypeName());
|
|
subSimpleVO.setDangerName(subject.getTypeName());
|
|
@@ -503,8 +492,6 @@ public class LabSubjectManagerService {
|
|
|
.map(SubAddrr::addrrPlus)
|
|
.map(SubAddrr::addrrPlus)
|
|
|
.orElseGet(() -> StrUtil.EMPTY));
|
|
.orElseGet(() -> StrUtil.EMPTY));
|
|
|
//设置安全联系信息
|
|
//设置安全联系信息
|
|
|
-// subSimpleVO.setSafeUserPhone(subject.getSafeUserPhone());
|
|
|
|
|
-// subSimpleVO.setSafeUserName(subject.getSafeUserName());
|
|
|
|
|
subSimpleVO.setAdminUserDesc(subject.getAdminName()+" "+subject.getAdminPhone());
|
|
subSimpleVO.setAdminUserDesc(subject.getAdminName()+" "+subject.getAdminPhone());
|
|
|
subSimpleVO.setSafeUserDesc(labSubjectMapper.queryUserNameBySafeUserByOnepc(subject.getSafeUserId()));
|
|
subSimpleVO.setSafeUserDesc(labSubjectMapper.queryUserNameBySafeUserByOnepc(subject.getSafeUserId()));
|
|
|
subSimpleVO.setSafeUserName(labSubjectMapper.queryUserNameBySafeUserId(subject.getSafeUserId()));
|
|
subSimpleVO.setSafeUserName(labSubjectMapper.queryUserNameBySafeUserId(subject.getSafeUserId()));
|
|
@@ -562,11 +549,6 @@ public class LabSubjectManagerService {
|
|
|
|
|
|
|
|
public LabSubClassVO getSubClassVO(Long id) {
|
|
public LabSubClassVO getSubClassVO(Long id) {
|
|
|
List<LabSubClassVO> labSubClassVOS = subjectService.querySubClassesByIds(id);
|
|
List<LabSubClassVO> labSubClassVOS = subjectService.querySubClassesByIds(id);
|
|
|
-// LabSubClassVO subclassVo = Optional.ofNullable(labSubClassVOS)
|
|
|
|
|
-// .filter(a -> a.size() > 0)
|
|
|
|
|
-// .map(a -> a.get(0))
|
|
|
|
|
-// .orElse(getNONELabSubClassVO);
|
|
|
|
|
-// return subclassVo;
|
|
|
|
|
if (labSubClassVOS.size() > 0) {
|
|
if (labSubClassVOS.size() > 0) {
|
|
|
return labSubClassVOS.get(0);
|
|
return labSubClassVOS.get(0);
|
|
|
}
|
|
}
|
|
@@ -641,13 +623,10 @@ public class LabSubjectManagerService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
-
|
|
|
|
|
|
|
+ logger.error("异常信息:",e);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 2.5 页面改变,接口加分页,并拆成两部分
|
|
// 2.5 页面改变,接口加分页,并拆成两部分
|
|
|
return labSubjects;
|
|
return labSubjects;
|
|
|
-
|
|
|
|
|
-// return createSubControllerVO(labSubjects, true, true, true, true, true);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public LabSubjectControllerVO querySubById(Long id, Integer type,Long[] typeCollection) {
|
|
public LabSubjectControllerVO querySubById(Long id, Integer type,Long[] typeCollection) {
|
|
@@ -822,7 +801,6 @@ public class LabSubjectManagerService {
|
|
|
LabSubject subject = new LabSubject();
|
|
LabSubject subject = new LabSubject();
|
|
|
subject.setAdminId(SecurityUtils.getUserId());
|
|
subject.setAdminId(SecurityUtils.getUserId());
|
|
|
//不展示禁用数据
|
|
//不展示禁用数据
|
|
|
-// subject.setIsDel(false);
|
|
|
|
|
List<LabSubjectVO> labSubjects = labSubjectMapper.selectLabSubjectVOList(subject);
|
|
List<LabSubjectVO> labSubjects = labSubjectMapper.selectLabSubjectVOList(subject);
|
|
|
return createSubControllerVO(labSubjects, false, true, true, false, true);
|
|
return createSubControllerVO(labSubjects, false, true, true, false, true);
|
|
|
}
|
|
}
|
|
@@ -863,9 +841,7 @@ public class LabSubjectManagerService {
|
|
|
public List<SensorFunctionStatus> querySenseNewFunctionBySubId(Long subjectId) {
|
|
public List<SensorFunctionStatus> querySenseNewFunctionBySubId(Long subjectId) {
|
|
|
List<LabSensor> labSensors = sensorMapper.selectSensorBySubIds(subjectId);
|
|
List<LabSensor> labSensors = sensorMapper.selectSensorBySubIds(subjectId);
|
|
|
updateLabHardwareFunctionStatuses(subjectId);
|
|
updateLabHardwareFunctionStatuses(subjectId);
|
|
|
-
|
|
|
|
|
return getSensorFunctionStatuses(labSensors, true);
|
|
return getSensorFunctionStatuses(labSensors, true);
|
|
|
-// return getSensorNewFunctionStatuses(labSensors, subjectId);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1379,7 +1355,6 @@ public class LabSubjectManagerService {
|
|
|
List<LabHardware> labHardwares = null;
|
|
List<LabHardware> labHardwares = null;
|
|
|
if (iflabHardwares) {
|
|
if (iflabHardwares) {
|
|
|
//1.可控设备
|
|
//1.可控设备
|
|
|
- //labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
|
|
LabHardware hardware = new LabHardware();
|
|
LabHardware hardware = new LabHardware();
|
|
|
hardware.setSubIds(longs);
|
|
hardware.setSubIds(longs);
|
|
|
hardware.setTypeCollection(typeCollection);
|
|
hardware.setTypeCollection(typeCollection);
|
|
@@ -1407,7 +1382,6 @@ public class LabSubjectManagerService {
|
|
|
if (flag) {
|
|
if (flag) {
|
|
|
// 实验权限覆盖后面做(已完成)
|
|
// 实验权限覆盖后面做(已完成)
|
|
|
LabSubject subject = new LabSubject();
|
|
LabSubject subject = new LabSubject();
|
|
|
-// subject.setAdminId(SecurityUtils.getUserIdEx());
|
|
|
|
|
//获取我的实验室
|
|
//获取我的实验室
|
|
|
labSubjectsDataScope = subjectService.selectLabSubjectListDataScope(subject);
|
|
labSubjectsDataScope = subjectService.selectLabSubjectListDataScope(subject);
|
|
|
}
|
|
}
|
|
@@ -1505,7 +1479,6 @@ public class LabSubjectManagerService {
|
|
|
@Async("labExecutor")
|
|
@Async("labExecutor")
|
|
|
public CompletableFuture<Integer> queryHardwares(Long[] typeCollection,Map<Long, SubDiyVO> subDiyVOMap, Long... longs) {
|
|
public CompletableFuture<Integer> queryHardwares(Long[] typeCollection,Map<Long, SubDiyVO> subDiyVOMap, Long... longs) {
|
|
|
int re = 0;
|
|
int re = 0;
|
|
|
- //List<LabHardware> labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
|
|
LabHardware lhd = new LabHardware();
|
|
LabHardware lhd = new LabHardware();
|
|
|
lhd.setSubIds(longs);
|
|
lhd.setSubIds(longs);
|
|
|
lhd.setTypeCollection(typeCollection);
|
|
lhd.setTypeCollection(typeCollection);
|
|
@@ -1592,7 +1565,6 @@ public class LabSubjectManagerService {
|
|
|
|
|
|
|
|
private LabSubClassVO getLabSubClassVO(LabSubClassVO subClassVO) {
|
|
private LabSubClassVO getLabSubClassVO(LabSubClassVO subClassVO) {
|
|
|
return subClassVO;
|
|
return subClassVO;
|
|
|
- //return Optional.ofNullable(subClassVO).orElseGet(() -> this.getNONELabSubClassVO);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1606,8 +1578,6 @@ public class LabSubjectManagerService {
|
|
|
senseValVO.setSubId(a.getSubjectId());
|
|
senseValVO.setSubId(a.getSubjectId());
|
|
|
senseValVO.setHardwareName(a.getName());
|
|
senseValVO.setHardwareName(a.getName());
|
|
|
senseValVO.setSenseType(a.getType());
|
|
senseValVO.setSenseType(a.getType());
|
|
|
- // 这里需要考虑设备唯一码从哪里来
|
|
|
|
|
-// senseValVO.setHardwareNUM();
|
|
|
|
|
return senseValVO;
|
|
return senseValVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1619,7 +1589,6 @@ public class LabSubjectManagerService {
|
|
|
*/
|
|
*/
|
|
|
public HardwareCVO getHardwareCVO(LabHardware a) {
|
|
public HardwareCVO getHardwareCVO(LabHardware a) {
|
|
|
// 这里需要考虑设备唯一码从哪里来
|
|
// 这里需要考虑设备唯一码从哪里来
|
|
|
- // hardware.setHardwareNUM();
|
|
|
|
|
HardwareCVO hardware = new HardwareCVO();
|
|
HardwareCVO hardware = new HardwareCVO();
|
|
|
hardware.setId(a.getId().toString());
|
|
hardware.setId(a.getId().toString());
|
|
|
hardware.setHardwareName(a.getName());
|
|
hardware.setHardwareName(a.getName());
|