|
|
@@ -5,7 +5,6 @@ import cn.hutool.json.JSONObject;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.zd.algorithm.api.camera.feign.RemoteCameraService;
|
|
|
import com.zd.algorithm.api.speaker.entity.ParamVo;
|
|
|
@@ -1492,39 +1491,18 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<LabRiskPlan> queryRiskPlanList(Page<LabRiskPlan> page, RiskPlanVo riskPlan) {
|
|
|
+ public List<LabRiskPlanDTO> queryRiskPlanList(RiskPlanVo riskPlan) {
|
|
|
//预案列表
|
|
|
- Page<LabRiskPlan> labRiskPlans = labRiskPlanMapper.queryRiskPlanList(new Page<>(riskPlan.getPageNum(), riskPlan.getPageSize()), riskPlan);
|
|
|
- //根据预案查询分级信息
|
|
|
-// for (LabRiskPlan labRiskPlan : labRiskPlans.getRecords()) {
|
|
|
-// List<LabRiskPlanLevel> labRiskPlanLevels = labRiskPlanLevelService.queryRiskPlanLevelList(labRiskPlan.getId());
|
|
|
-// labRiskPlan.setLabRiskPlanLevels(labRiskPlanLevels);
|
|
|
-//
|
|
|
-// //根据预案查询出绑定实验室
|
|
|
-// List<LabSubjectVO> labSubjectVos = labRiskPlanjoinsubMapper.selectLabRiskPlanjoinsubByRiskPlanId(labRiskPlan.getId());
|
|
|
-// //根据实验室id和预案id查询当前预案和实验室下绑定的传感器和危险源
|
|
|
-// List<RiskPlanSubjectRelationVo> riskPlanSubjectRelationVoList = new ArrayList<>();
|
|
|
-// for (LabSubjectVO labSubjectVO : labSubjectVos) {
|
|
|
-// RiskPlanSubjectRelationVo riskPlanSubjectRelationVo = new RiskPlanSubjectRelationVo();
|
|
|
-// List<LabSensorHazardRelation> labSensorHazardRelations = labSensorHazardRelationService.getSensorHazardList(labRiskPlan.getId(),labSubjectVO.getId());
|
|
|
-// riskPlanSubjectRelationVo.setSubjectId(labSubjectVO.getId());
|
|
|
-// riskPlanSubjectRelationVo.setLabSensorHazardRelations(labSensorHazardRelations);
|
|
|
-// riskPlanSubjectRelationVoList.add(riskPlanSubjectRelationVo);
|
|
|
-// }
|
|
|
-// labRiskPlan.setRiskPlanSubjectRelationVoList(riskPlanSubjectRelationVoList);
|
|
|
-// }
|
|
|
- return labRiskPlans;
|
|
|
+ List<LabRiskPlanDTO> list = labRiskPlanMapper.queryRiskPlanList(riskPlan);
|
|
|
+ return list;
|
|
|
}
|
|
|
-
|
|
|
@Override
|
|
|
- public Page<LabSubjectVO> getLabRiskPlanJoinSubInfo(LabRiskPlanSubVo labRiskPlanSubVo) {
|
|
|
+ public List<LabSubjectVO> getLabRiskPlanJoinSubInfo(LabRiskPlanSubVo labRiskPlanSubVo) {
|
|
|
//通过传感器字符串和预案id查询相关实验室列表
|
|
|
- Page<LabSubjectVO> labSubjectVOS = labRiskPlanMapper.selectRelationSubList(new Page<LabSubjectVO>(labRiskPlanSubVo.getPageNum(), labRiskPlanSubVo.getPageSize()), labRiskPlanSubVo);
|
|
|
-// String types = getSensorTypesByRiskPlanId(labRiskPlanSubVo.getRiskPlanId());
|
|
|
+ List<LabSubjectVO> labSubjectVOS = labRiskPlanMapper.selectRelationSubList(labRiskPlanSubVo);
|
|
|
List<Integer> collect = labRiskPlanMapper.selectSensorType(labRiskPlanSubVo.getRiskPlanId());
|
|
|
-// List<Long> collect = Arrays.stream(StrUtil.splitToLong(types, ",")).boxed().collect(Collectors.toList());
|
|
|
if (null != labRiskPlanSubVo.getRiskPlanId()) {
|
|
|
- for (LabSubjectVO labSubjectVO : labSubjectVOS.getRecords()) {
|
|
|
+ for (LabSubjectVO labSubjectVO : labSubjectVOS) {
|
|
|
List<LabSensorHazardRelation> labSensorHazardRelations = labSensorHazardRelationService.getSensorHazardList(labRiskPlanSubVo.getRiskPlanId(), labSubjectVO.getId());
|
|
|
List<Integer> list = labSensorService.getSensorTypesBySubId(labSubjectVO.getId());
|
|
|
if (isListEqual(collect, list)) {
|
|
|
@@ -1540,13 +1518,11 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Page<LabSubjectVO> getLabRiskPlanNoJoinSub(LabRiskPlanSubVo labRiskPlanSubVo) {
|
|
|
-// String typeIds = getSensorTypesByRiskPlanId(labRiskPlanSubVo.getRiskPlanId());
|
|
|
-// labRiskPlanSubVo.setTypes(typeIds);
|
|
|
+ public List<LabSubjectVO> getLabRiskPlanNoJoinSub(LabRiskPlanSubVo labRiskPlanSubVo) {
|
|
|
labRiskPlanSubVo.setUserId(tokenService.getLoginUser().getUserid());
|
|
|
- Page<LabSubjectVO> labSubjectVOS = labRiskPlanMapper.getLabRiskPlanNoJoinSub(new Page<LabSubjectVO>(labRiskPlanSubVo.getPageNum(), labRiskPlanSubVo.getPageSize()), labRiskPlanSubVo);
|
|
|
- if (labSubjectVOS.getRecords().size() > 0) {
|
|
|
- for (LabSubjectVO labSubjectVO : labSubjectVOS.getRecords()) {
|
|
|
+ List<LabSubjectVO> labSubjectVOS = labRiskPlanMapper.getLabRiskPlanNoJoinSub(labRiskPlanSubVo);
|
|
|
+ if (labSubjectVOS.size() > 0) {
|
|
|
+ for (LabSubjectVO labSubjectVO : labSubjectVOS) {
|
|
|
List<LabSensor> sensorListBySubId = labSensorService.getSensorListBySubId(labSubjectVO.getId());
|
|
|
List<LabHazardSubVO> labHazardSubVOS = labHazardSubjectRelationService.queryHazardSubListVO(labSubjectVO.getId());
|
|
|
labSubjectVO.setLabSensorList(sensorListBySubId);
|