|
|
@@ -14,18 +14,19 @@ import com.zd.laboratory.domain.LabRiskPlanAbnormalGroup;
|
|
|
import com.zd.laboratory.domain.LabRiskPlanAbnormalLog;
|
|
|
import com.zd.laboratory.domain.vo.LabRiskPlanAbnormalGroupVO;
|
|
|
import com.zd.laboratory.mapper.LabHardwareMapper;
|
|
|
-import com.zd.laboratory.mapper.LabHardwareStateMapper;
|
|
|
import com.zd.laboratory.mapper.LabRiskPlanAbnormalGroupMapper;
|
|
|
import com.zd.laboratory.mapper.LabRiskPlanAbnormalLogMapper;
|
|
|
import com.zd.laboratory.service.ILabExitLineService;
|
|
|
import com.zd.laboratory.service.ILabRiskPlanAbnormalDescService;
|
|
|
import com.zd.laboratory.service.ILabRiskPlanAbnormalGroupService;
|
|
|
import com.zd.model.enums.HardwareTypeEnum;
|
|
|
+import com.zd.model.enums.SenseType;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -58,6 +59,9 @@ public class LabRiskPlanAbnormalGroupServiceImpl implements ILabRiskPlanAbnormal
|
|
|
@Autowired
|
|
|
private RedisService redisService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public HardwareFunctionStatusConfig hardwareFunctionStatusConfig;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
// @DataScope(deptAlias = "t")
|
|
|
@@ -107,11 +111,17 @@ public class LabRiskPlanAbnormalGroupServiceImpl implements ILabRiskPlanAbnormal
|
|
|
*/
|
|
|
@Override
|
|
|
public List<SensorFunctionStatus> queryWranFunNumBySubId(Long subId) {
|
|
|
- List<String> strings = labRiskPlanAbnormalGroupMapper.queryWranFunNumBySubId(subId);
|
|
|
-
|
|
|
- if(CollectionUtils.isEmpty(strings)){
|
|
|
+ List<Integer> sensorTypes = labRiskPlanAbnormalGroupMapper.queryWranFunNumBySubId(subId);
|
|
|
+ if(CollectionUtils.isEmpty(sensorTypes)){
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
+ List<String> strings = new ArrayList<>();
|
|
|
+ Map<SenseType, List<SensorFunctionStatus>> sensorFunctionStatusListMap = hardwareFunctionStatusConfig.getSensorFunctionStatusListMap();
|
|
|
+ for (Integer sensorType : sensorTypes) {
|
|
|
+ List<SensorFunctionStatus> sensorFunctionStatuses = sensorFunctionStatusListMap.get(SenseType.getByCode(sensorType));
|
|
|
+ String funNum = sensorFunctionStatuses.get(0).getFunNum();
|
|
|
+ strings.add(funNum);
|
|
|
+ }
|
|
|
logger.info("一体机预案异常类型:" + JSONUtil.toJsonStr(strings) + ", 实验室ID------" + subId);
|
|
|
List<SensorFunctionStatus> list = labSubjectManagerService.querySenseNewFunctionBySubId(subId);
|
|
|
logger.info("一体机预案实验室数据:" + JSONUtil.toJsonStr(list));
|