Просмотр исходного кода

2023-11-10 删除注释,修改优化代码。

chaiyunlong лет назад: 2
Родитель
Сommit
0499548428

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabPhotoNoteServiceImpl.java

@@ -133,7 +133,7 @@ public class LabPhotoNoteServiceImpl implements ILabPhotoNoteService {
         LabSubject subjectPo = labSubjectMapper.selectLabSubjectById(labPhotoNote.getSubjectId());
         List<LabSecurityApplyVO> applist = new ArrayList<>();
         if(subjectPo!=null){
-            StringBuffer usersStr = new StringBuffer();
+            StringBuilder usersStr = new StringBuilder();
             if(subjectPo.getAdminId()!=null){
                 usersStr.append(subjectPo.getAdminId()+",");
             }

+ 3 - 6
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanAbnormalGroupServiceImpl.java

@@ -80,7 +80,7 @@ public class LabRiskPlanAbnormalGroupServiceImpl implements ILabRiskPlanAbnormal
             LabRiskPlanAbnormalLog labRiskPlanAbnormalLog = new LabRiskPlanAbnormalLog();
             labRiskPlanAbnormalLog.setGroupId(a.getId());
             List<LabRiskPlanAbnormalLog> abnormalLogList = labRiskPlanAbnormalLogMapper.selectLabRiskPlanAbnormalLogOrderByList(labRiskPlanAbnormalLog);
-            StringBuffer sensorStr = new StringBuffer();
+            StringBuilder sensorStr = new StringBuilder();
             Optional.ofNullable(abnormalLogList).orElseGet(Collections::emptyList).stream().filter(b->b.getRiskStatus()==1).forEach(b->{
                 JSONArray sensorList = JSONObject.parseArray(b.getSensorJson());
                 for(int x=0;x<sensorList.size();x++){
@@ -91,11 +91,8 @@ public class LabRiskPlanAbnormalGroupServiceImpl implements ILabRiskPlanAbnormal
                     }else{
                         sensorStr.append(jsonObj.getString("describe")+":"+jsonObj.getString("value"));
                     }
-//                    sensorStr.append(jsonObj.get("describe")+":"+jsonObj.get("value")+""+jsonObj.get("unit")==null?"":jsonObj.get("unit")+"  ");
-                    if(StringUtils.isNotNull(jsonObj.getString("funNum")) && (jsonObj.getString("funNum")).equals("huoyan")){
-                        if(!a.getClosePlan()){
-                            a.setClosePlan(true);
-                        }
+                    if(StringUtils.isNotNull(jsonObj.getString("funNum")) && (jsonObj.getString("funNum")).equals("huoyan") && !a.getClosePlan()){
+                        a.setClosePlan(true);
                     }
                 }
             });

+ 0 - 19
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabRiskPlanAbnormalLogServiceImpl.java

@@ -7,7 +7,6 @@ import com.zd.common.core.annotation.DataScope;
 import com.zd.common.core.redis.RedisService;
 import com.zd.common.core.utils.DateUtils;
 import com.zd.common.core.utils.SecurityUtils;
-import com.zd.laboratory.api.entity.SensorFunctionStatus;
 import com.zd.laboratory.config.HardwareFunctionStatusConfig;
 import com.zd.laboratory.domain.*;
 import com.zd.laboratory.domain.vo.LabRiskPlanAbnormalLogVO;
@@ -249,23 +248,6 @@ public class LabRiskPlanAbnormalLogServiceImpl implements ILabRiskPlanAbnormalLo
         result.put("sevenDays", dataMap);
 
         /** ----------------------- 30天数据,暂时不要--------------------------- */
-        /*dataMap = new HashMap<>();
-
-        // 风险数
-        params.put("type", 2);
-        maps = labRiskPlanAbnormalLogMapper.queryRiskTrend(params);
-        dataMap.put("risks", maps);
-
-        // 故障数
-        maps = labAbnormalMapper.queryFailures(params);
-        dataMap.put("failures", maps);
-
-        // 隐患数
-        maps = labPhotoNoteMapper.selectDangers(params);
-        dataMap.put("dangers", maps);
-
-        // 近30天数据
-        result.put("oneMonth", dataMap);*/
         return result;
     }
 
@@ -330,7 +312,6 @@ public class LabRiskPlanAbnormalLogServiceImpl implements ILabRiskPlanAbnormalLo
                         if(subDiy.size()>0){
                             appVo.setSubDiyVo(subDiy.get(0));
                         }
-//                        appVo.setSubDiyVo(Optional.ofNullable(subDiy).filter(p->p.size()>0).orElseGet(Collections::emptyList).get(0));
                         appVo.setTodayHappenCount(todayHappenCount);
                         longAdder.add(todayHappenCount);
                         //加入实验室信息