|
|
@@ -554,12 +554,12 @@ public class LabSubjectManagerService {
|
|
|
// return createSubControllerVO(labSubjects, true, true, true, true, true);
|
|
|
}
|
|
|
|
|
|
- public LabSubjectControllerVO querySubById(Long id, Integer type) {
|
|
|
+ public LabSubjectControllerVO querySubById(Long id, Integer type,Long[] typeCollection) {
|
|
|
LabSubject subject = new LabSubject();
|
|
|
subject.setId(id);
|
|
|
List<LabSubjectVO> labSubjects = subjectService.selectLabSubjectListAuthByPc(subject);
|
|
|
- List<LabSubjectControllerVO> list = createSubControllerVO2(labSubjects, true, true, true, true, true);
|
|
|
- if(list.size() > 0){
|
|
|
+ List<LabSubjectControllerVO> list = createSubControllerVO2(labSubjects,typeCollection, true, true, true, true, true);
|
|
|
+ if(list !=null && list.size() > 0){
|
|
|
LabSubjectControllerVO subjectControllerVO = list.get(0);
|
|
|
subjectControllerVO.setSafeUserNameAdminPhone(labSubjectMapper.queryUserNameBySafeUserInfo(subjectControllerVO.getSafeUserId()));
|
|
|
subjectControllerVO.setSafeUserName(labSubjectMapper.queryUserNameBySafeUserId(subjectControllerVO.getSafeUserId()));
|
|
|
@@ -1211,7 +1211,7 @@ public class LabSubjectManagerService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Deprecated
|
|
|
- private List<LabSubjectControllerVO> createSubControllerVO2(List<? extends LabSubject> labSubjects, boolean flag, boolean iflabSubClassVOS, boolean iflabHardwares, boolean iflabSensors, boolean ifFunction) {
|
|
|
+ private List<LabSubjectControllerVO> createSubControllerVO2(List<? extends LabSubject> labSubjects,Long[] typeCollection, boolean flag, boolean iflabSubClassVOS, boolean iflabHardwares, boolean iflabSensors, boolean ifFunction) {
|
|
|
List<LabSubjectControllerVO> list = null;
|
|
|
if (CollUtil.isNotEmpty(labSubjects)) {
|
|
|
Long[] longs = labSubjects.stream().map(a -> a.getId()).toArray(Long[]::new);
|
|
|
@@ -1223,7 +1223,11 @@ public class LabSubjectManagerService {
|
|
|
List<LabHardware> labHardwares = null;
|
|
|
if (iflabHardwares) {
|
|
|
//1.可控设备
|
|
|
- labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
+ //labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
+ LabHardware hardware = new LabHardware();
|
|
|
+ hardware.setSubIds(longs);
|
|
|
+ hardware.setTypeCollection(typeCollection);
|
|
|
+ labHardwares = hardwareMapper.selectLabHardwareByParameter(hardware);
|
|
|
}
|
|
|
List<LabSensor> labSensors = null;
|
|
|
boolean flagUpdate = false;
|
|
|
@@ -1347,9 +1351,13 @@ public class LabSubjectManagerService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Async("labExecutor")
|
|
|
- public CompletableFuture<Integer> queryHardwares(Map<Long, SubDiyVO> subDiyVOMap, Long... longs) {
|
|
|
+ public CompletableFuture<Integer> queryHardwares(Long[] typeCollection,Map<Long, SubDiyVO> subDiyVOMap, Long... longs) {
|
|
|
int re = 0;
|
|
|
- List<LabHardware> labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
+ //List<LabHardware> labHardwares = hardwareMapper.selectLabHardwareBySubIds(longs);
|
|
|
+ LabHardware lhd = new LabHardware();
|
|
|
+ lhd.setSubIds(longs);
|
|
|
+ lhd.setTypeCollection(typeCollection);
|
|
|
+ List<LabHardware> labHardwares = hardwareMapper.selectLabHardwareByParameter(lhd);
|
|
|
//传感器和可控设备都转为vo数据,并映射为map表
|
|
|
Map<Long, List<HardwareCVO>> mapHardwareCVO = Optional.ofNullable(labHardwares).orElse(new ArrayList<>(0)).stream().map(a -> {
|
|
|
HardwareCVO hardware = getHardwareCVO(a);
|