Ver código fonte

Merge remote-tracking branch 'origin/dbdx' into dbdx

xuxiaofei 2 anos atrás
pai
commit
f02ce76908

+ 0 - 9
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanLevelServiceImpl.java

@@ -44,13 +44,6 @@ public class LabRiskPlanLevelServiceImpl extends ServiceImpl<LabRiskPlanLevelMap
     @Override
     @Transactional
     public ResultData insertLabRiskPlanLevel(LabRiskPlanLevel labRiskPlanLevel) {
-//        long distinctNum = labRiskPlanLevels.stream().map(LabRiskPlanLevel::getRiskPlanLevel).distinct().count();
-//        if (distinctNum < labRiskPlanLevels.size()) {
-//            return ResultData.fail("预案分级不能重复 !");
-//        }
-//        LabRiskPlanLevel labRiskPlanLevel1 = labRiskPlanLevels.get(0);
-//        baseMapper.delete(new LambdaQueryWrapper<LabRiskPlanLevel>().eq(LabRiskPlanLevel::getRiskPlanId,labRiskPlanLevel1.getRiskPlanId()));
-//        baseMapper.batchInsert(labRiskPlanLevels);
 
         if (labRiskPlanLevel.getRiskPlanId() == null) {
             return ResultData.fail("预案id不能为空!");
@@ -138,10 +131,8 @@ public class LabRiskPlanLevelServiceImpl extends ServiceImpl<LabRiskPlanLevelMap
     public List<LabRiskPlanLevel> queryRiskPlanLevelList(Long id) {
         List<LabRiskPlanLevel> labRiskPlanLevels = baseMapper.selectList(new LambdaQueryWrapper<LabRiskPlanLevel>().eq(LabRiskPlanLevel::getRiskPlanId, id).orderByAsc(LabRiskPlanLevel::getRiskPlanLevel));
         for (LabRiskPlanLevel labRiskPlanLevel : labRiskPlanLevels) {
-//            List<LabRiskPlanSensorRelation> labRiskPlanSensorRelations = labRiskPlanSensorRelationService.list(new LambdaQueryWrapper<LabRiskPlanSensorRelation>().eq(LabRiskPlanSensorRelation::getRiskPlanLevelId, labRiskPlanLevel.getId()));
             List<LabRiskPlanSensorRelation> labRiskPlanSensorRelations = labRiskPlanSensorRelationService.selectSensorRelationListByLevelId(labRiskPlanLevel.getId());
             labRiskPlanLevel.setRiskPlanSensorList(labRiskPlanSensorRelations);
-//            List<LabRiskPlanHardwareRelation> labRiskPlanHardwareRelations = labRiskPlanHardwareRelationService.list(new LambdaQueryWrapper<LabRiskPlanHardwareRelation>().eq(LabRiskPlanHardwareRelation::getRiskPlanLevelId, labRiskPlanLevel.getId()));
             List<LabRiskPlanHardwareRelation> labRiskPlanHardwareRelations = labRiskPlanHardwareRelationService.selectHardwareRelationListByLevelId(labRiskPlanLevel.getId());
             labRiskPlanLevel.setRiskPlanHardwareList(labRiskPlanHardwareRelations);
         }

+ 2 - 24
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanServiceImpl.java

@@ -72,16 +72,10 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
     @Autowired
     private LabRiskPlanSensorRelationMapper labRiskPlanSensorRelationMapper;
     @Autowired
-    private ILabOperateHardwareService labOperateHardwareService;
-    @Autowired
     private LabRiskPlanAbnormalLogMapper labRiskPlanAbnormalLogMapper;
     @Autowired
-    private LabSubjectMapper labSubjectMapper;
-    @Autowired
     private LabRiskPlanAbnormalGroupMapper labRiskPlanAbnormalGroupMapper;
     @Autowired
-    private LabSensorMapper labSensorMapper;
-    @Autowired
     private SubMessageSendManager messageSendService;
     @Autowired
     private LabWarnPushMessageMapper labWarnPushMessageMapper;
@@ -118,8 +112,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
     @Lazy
     private LabRiskPlanLevelService labRiskPlanLevelService;
 
-    @Autowired
-    private ILabSubjectService labSubjectService;
 
     @Autowired
     private ILabSensorService labSensorService;
@@ -298,7 +290,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
      */
     @Override
     public Map<String, Object> getLabRiskPlanRepeat(LabRiskPlan labRiskPlan) {
-        SysUser user = tokenService.getLoginUser().getSysUser();
         //获取页面传感器列表
         List<LabRiskPlanSensorRelation> newRiskPlanSesorList = new ArrayList<>();
         List<LabRiskPlanSensorRelation> labRiskPlanSensorRelationList = labRiskPlan.getRiskPlanSensorList();
@@ -326,17 +317,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
                 }
             }
         });
-//        Optional.ofNullable(sensorRelationList).orElseGet(Collections::emptyList).stream()
-//                .forEach(a->Optional.ofNullable(labRiskPlanSensorRelationList)
-//                .orElseGet(Collections::emptyList).stream().forEach(b->{
-//                            if(a.getFunNum().equals(b.getFunNum())){
-//                                if(b.getMinMonitor().floatValue()>=a.getMinMonitor().floatValue() && b.getMinMonitor().floatValue()<=a.getMaxMonitor().floatValue()){
-//                                    newRiskPlanSesorList.add(a);
-//                                }else if(b.getMaxMonitor().floatValue()>=a.getMinMonitor().floatValue() && b.getMaxMonitor().floatValue()<=a.getMaxMonitor().floatValue()){
-//                                    newRiskPlanSesorList.add(a);
-//                                }
-//                            }
-//                        }));
         //根据预案id和实验室id查询当前用户是否有冲突的预案
         List<LabRiskPlanjoinsub> labRiskPlanjoinsubList = labRiskPlan.getLabRiskPlanjoinsubList();
         List<LabRiskPlanjoinsubVO> riskPlanjoinsubList = new ArrayList<>();
@@ -893,7 +873,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
             List<LabNoticeconfig> noticeconfigList = labNoticeconfigMapper.selectLabNoticeconfigList(new LabNoticeconfig());
             if (!noticeconfigList.isEmpty()) {
                 LabNoticeconfig labNoticeconfig = noticeconfigList.get(0);
-                StringBuffer radioStr = new StringBuffer();
+                StringBuilder radioStr = new StringBuilder();
                 radioStr.append(noticeconfigList.get(0).getRiskRadio());
                 labRiskPlanLevel.setMessage(labNoticeconfig.getRiskMessage());
                 labRiskPlanLevel.setVoicebroadcast(labNoticeconfig.getRiskVoice());
@@ -910,7 +890,7 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
         try {
             Map<SenseType, List<SensorFunctionStatus>> sensorFunctionStatusListMap = hardwareFunctionStatusConfig.getSensorFunctionStatusListMap();
             //处理预案下的传感器翻译
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             for (LabRiskPlanSensorRelation rps : labRiskPlanLevel.getRiskPlanSensorList()) {
                 //硬件社保统一传入的传感器设备列表
                 for (SensorFunctionStatus sensorFunc : subFunction.getFunctionStatuses()) {
@@ -1188,7 +1168,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
                     operateHardWareInfo(labRiskPlanLevel, labRiskPlanAbnormalGroup.getSubjectId(), labRiskPlanAbnormalLog.getGroupId(), riskPlanJson.toString());
                 } catch (Exception e) {
                     log.error("操作硬件设备异!{}",e);
-                } finally {
                 }
                 return groupId;
             } else {
@@ -1231,7 +1210,6 @@ public class LabRiskPlanServiceImpl extends ServiceImpl<LabRiskPlanMapper, LabRi
                             });
                         } catch (Exception e) {
                             log.error("操作硬件设备异常{}",e);
-                        } finally {
                         }
                         return groupId;
                     }