Browse Source

形变告警开发

master
lijiuwei 8 months ago
parent
commit
0b4b8233ba
6 changed files with 45 additions and 21 deletions
  1. +23
    -3
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/domain/ResultAnalysis.java
  2. +8
    -18
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java
  3. +2
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java
  4. +2
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java
  5. +4
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  6. +6
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 23
- 3
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/domain/ResultAnalysis.java View File

@ -370,17 +370,37 @@ public class ResultAnalysis extends BaseEntity {
this.setResultType("0");
defaultDesc = "异常";
}
} else if (algType.equals("infrared")) {
} else if (algType.equals("infrared") ||
algType.equals("infra_1800") ||
algType.equals("infra_yu3") ||
algType.equals("infra_camera") ||
algType.equals("infra_camera_reverse") ||
algType.equals("xb")) {
String device = "";
if(algType.equals("infrared")) {
device = "红外";
} else if(algType.equals("infra_1800")) {
device = "红外1800";
} else if(algType.equals("infra_yu3")) {
device = "无人机红外";
} else if(algType.equals("infra_camera")) {
device = "摄像头红外";
} else if(algType.equals("infra_camera_reverse")) {
device = "摄像头红外灰度反算";
} else if(algType.equals("xb")) {
device = "形变";
}
if (algValue.isAlarm(value)) {
this.setResStatus("1");
this.setPointStatus("1");
this.setResultType("1");
defaultDesc = "正常";
defaultDesc = device + "正常";
} else {
this.setResStatus("0");
this.setPointStatus("2");
this.setResultType("0");
defaultDesc = "温度告警";
defaultDesc = device + "告警";
}
} else if (algType.equals("isolator")) {
if (value.equals("3")) {


+ 8
- 18
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java View File

@ -99,7 +99,7 @@ public class AnalysisServiceImpl implements IAnalysisService {
boolean bDefect = analyseResPoint.isDefect(); // code=2000代表初筛结果返回正常value=1代表有缺陷
log.info("picAnalyseRetNotify FILTER bDefect={}, algorithmType={}", bDefect, analyseResPoint.getType());
analyseResult.reloadReq(analyseRequest);
analyseResult.reloadReq(analyseRequest);//只有一个,analyseReq.getObjectList().get(0)
/*
*大致两种情况1. 算法是表计(meter); 2. 算法不是表计(meter)
* 1. 算法不是表计(meter)
@ -139,7 +139,7 @@ public class AnalysisServiceImpl implements IAnalysisService {
try {
analysis(analyseResult);
} catch (Exception e) {
e.printStackTrace();
log.error("error", e);
}
//doAlgorithmAnalysis(analyseResult);
//calculateProcess(analyseResult);
@ -366,7 +366,7 @@ public class AnalysisServiceImpl implements IAnalysisService {
}
}
} catch (Exception e) {
e.printStackTrace();
log.error("error", e);
}
}
@ -670,7 +670,7 @@ public class AnalysisServiceImpl implements IAnalysisService {
try {
resultAnalysisService.insertResultAnalysis(resultAnalysis);
} catch (Exception e) {
e.printStackTrace();
log.error("error", e);
}
}
@ -740,19 +740,9 @@ public class AnalysisServiceImpl implements IAnalysisService {
}
private AlgValue selectAlgMap(String devId, String type) {
Map<String, String> map = this.resultAnalysisService.selectPointInfoById(devId);
String alarmThreshold = map.get(AnalyseConstants.ANALYSE_ALARM_THRESHOLD);
if (alarmThreshold != null) {
JSONArray thresholdList = JSONArray.parseArray(alarmThreshold);
for (int i = 0; i < thresholdList.size(); ++i) {
JSONObject threshold = thresholdList.getJSONObject(i);
log.info("selectAlgMap type: {}, threshold: {}", type, threshold);
if (StringUtils.isNotEmpty(type) && type.equals(threshold.getString(AnalyseConstants.ANALYSE_CODE))) {
return new AlgValue(threshold.getString(AnalyseConstants.ANALYSE_UPPER_VALUE), threshold.getString(AnalyseConstants.ANALYSE_LOWER_VALUE));
}
}
}
return new AlgValue();
log.info("selectAlgMap patrolPointId: {}", devId);
Map<String, String> thresholdMap = patrolResultService.selectPatrolPresetParam(devId);
log.info("selectAlgMap thresholdMap: {}", JSONObject.toJSONString(thresholdMap));
return new AlgValue(thresholdMap.get("alarm_max_temp"), thresholdMap.get("alarm_min_temp"));
}
}

+ 2
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java View File

@ -50,6 +50,8 @@ public interface PatrolResultMapper {
List<PatrolPresetPosModule> selectAlgorithmTypeList(String key);
Map<String, String> selectPatrolPresetParam(String pointId);
Map<String, String> selectThresholdByPointId(String pointId);
Map<String, String> selectAlgTypeDataType(String key);


+ 2
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java View File

@ -41,6 +41,8 @@ public interface IPatrolResultService {
List<PatrolPresetPosModule> selectAlgorithmTypeList(String key);
Map<String, String> selectPatrolPresetParam(String pointId);
Map<String, String> selectThresholdByPointId(String pointId);
Map<String, String> selectAlgTypeDataType(String key);


+ 4
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -134,6 +134,10 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
return patrolResultMapper.selectAlgorithmTypeList(lineId);
}
public Map<String, String> selectPatrolPresetParam(String lineId) {
return patrolResultMapper.selectPatrolPresetParam(lineId);
}
public Map<String, String> selectThresholdByPointId(String lineId) {
return patrolResultMapper.selectThresholdByPointId(lineId);
}


+ 6
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -496,6 +496,12 @@
where a.patrol_point_id = #{lineId}
and a.alg_subtype_code is not null
</select>
<select id="selectPatrolPresetParam" parameterType="String" resultMap="java.util.Map">
SELECT a.alarm_min_temp, a.alarm_max_temp
FROM patrol_preset_param a, patrol_preset_pos b
WHERE a.preset_pos_id = b.preset_pos_id AND b.patrol_point_id = #{lineId}
limit 1
</select>
<select id="selectAlgorithmType" parameterType="String" resultType="java.util.Map">
select b.alg_subtype_code, c.alg_name, a.alg_subtype_ids
from basedata_patrolpoint a


Loading…
Cancel
Save