Commit 18b0e84c authored by hkl's avatar hkl

feat:1.代码提交

parent e3032981
......@@ -73,10 +73,6 @@
<properties>
<package.environment>hkl</package.environment>
</properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 测试环境 -->
......@@ -93,6 +89,10 @@
<properties>
<package.environment>pressure</package.environment>
</properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 生成环境环境-->
......
......@@ -95,6 +95,9 @@ public class AnalysisAlgorithm {
@Resource
private IAnalysisTqiReportCheckUnitDeviceMapService analysisTqiReportCheckUnitDeviceMapService;
@Resource
private IConfigTqiLimitService configTqiLimitService;
@Transactional
public void analysis(String analysisBatchId) {
Map<String, Map<String, Object>> unitDeviceTable = new LinkedHashMap<>();
......@@ -530,41 +533,46 @@ public class AnalysisAlgorithm {
JSONArray dispatchingList = JSONArray.parseArray(analysisBatch.getDispatching());
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 4) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
String reasonLabel = String.valueOf(dispatching.get("reasonLabel"));
if ("add_instrument_1".equals(reasonValue)) {
reasonLabelAddInstrumentOver1 = reasonLabel;
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWorkAddInstrumentOver1 = 1;
reasonLabelAddInstrumentOver1 = reasonLabel;
} else {
isWorkAddInstrumentOver1 = 0;
}
}
if ("add_instrument_2".equals(reasonValue)) {
reasonLabelAddInstrumentOver2 = reasonLabel;
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWorkAddInstrumentOver2 = 2;
reasonLabelAddInstrumentOver2 = reasonLabel;
isWorkAddInstrumentOver2 = 1;
} else {
isWorkAddInstrumentOver2 = 0;
}
}
if ("add_instrument_3".equals(reasonValue)) {
reasonLabelAddInstrumentOver3 = reasonLabel;
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWorkAddInstrumentOver3 = 3;
reasonLabelAddInstrumentOver3 = reasonLabel;
isWorkAddInstrumentOver3 = 1;
} else {
isWorkAddInstrumentOver3 = 0;
}
}
if ("add_instrument_4".equals(reasonValue)) {
reasonLabelAddInstrumentOver4 = reasonLabel;
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWorkAddInstrumentOver4 = 4;
reasonLabelAddInstrumentOver4 = reasonLabel;
isWorkAddInstrumentOver4 = 1;
} else {
isWorkAddInstrumentOver4 = 0;
}
......@@ -659,7 +667,7 @@ public class AnalysisAlgorithm {
zontalSpeedTransfinite.setEkType(4);
zontalSpeedTransfinite.setEkItemId(additiveInfo.getId());
zontalSpeedTransfinite.setMeasurePointValue(additiveInfo.getVerticalSpeed().toString());
zontalSpeedTransfinite.setDiseaseMileage(additiveInfo.getPointMileage());
zontalSpeedTransfinite.setDiseaseMileage(pointMileage);
addInstrumentTransfiniteList.add(zontalSpeedTransfinite);
}
......@@ -688,7 +696,7 @@ public class AnalysisAlgorithm {
verticalSpeedTransfinite.setEkType(4);
verticalSpeedTransfinite.setEkItemId(additiveInfo.getId());
verticalSpeedTransfinite.setMeasurePointValue(additiveInfo.getVerticalSpeed().toString());
verticalSpeedTransfinite.setDiseaseMileage(additiveInfo.getPointMileage());
verticalSpeedTransfinite.setDiseaseMileage(pointMileage);
addInstrumentTransfiniteList.add(verticalSpeedTransfinite);
}
......@@ -811,6 +819,7 @@ public class AnalysisAlgorithm {
additiveInfoUnitMap.setUnitStartMileage(Convert.toBigDecimal(unitDevice.get("startMileage")));
additiveInfoUnitMap.setUnitCenterMileage(Convert.toBigDecimal(unitDevice.get("centerMileage")));
additiveInfoUnitMap.setUnitEndMileage(Convert.toBigDecimal(unitDevice.get("endMileage")));
additiveInfoUnitMap.setMovementAdditiveInfoId(additiveInfo.getId());
additiveInfoUnitMap.setPointMileage(additiveInfo.getPointMileage().multiply(new BigDecimal("1000")));
additiveInfoUnitMap.setZontalSpeed(additiveInfo.getZontalSpeed());
additiveInfoUnitMap.setZontalSpeedLevel(additiveInfo.getZontalSpeedLevel());
......@@ -854,7 +863,11 @@ public class AnalysisAlgorithm {
// 1.6 获取轨检车TQI阀值
// config
List<ConfigTqiLimit> configTqiLimits = configTqiLimitService.lambdaQuery()
.eq(ConfigTqiLimit::getSpeedMax, analysisBatch.getSpeedMax())
.eq(ConfigTqiLimit::getSpeedMin, analysisBatch.getSpeedMin())
.orderByAsc(ConfigTqiLimit::getOverStandardType)
.list();
// 2.根据分析批次的里程查询出映射单元
......@@ -1044,7 +1057,6 @@ public class AnalysisAlgorithm {
for (MovementTqiReport tqiReport : tqiReports) {
// 如果命中处理测点映射关系
if (tqiReport.getStartMileage().compareTo(centerMileage) <= 0 && tqiReport.getEndMileage().compareTo(centerMileage) > 0) {
MovementTqiReportUnitDeviceMap movementTqiReportUnitDeviceMap = new MovementTqiReportUnitDeviceMap();
movementTqiReportUnitDeviceMap.setId(UUIDGenerator.generate());
movementTqiReportUnitDeviceMap.setCheckId(checkDataMap.getEkId());
......@@ -1170,13 +1182,11 @@ public class AnalysisAlgorithm {
scoreList.add(tqiScore);
// 判断tqi是否超限
// 超标≤10% | 15 ≤ TQI < 16.5(0 < V ≤ 80)
// if(tqiReport.getTqiComeUpon())
// // 轨检车超限等级
// AnalysisBatchUnitDeviceTransfinite tqiTransfinite = this.createRailVehicleCheckTqiTransfinite(dispatchingList, tqiReport);
// railVehicleTransfiniteList.add(tqiTransfinite);
// System.out.printf(analysisBatch.getDispatching());
// tqi 超限等级
AnalysisBatchUnitDeviceTransfinite tqiTransfinite = this.createRailVehicleCheckTqiTransfinite(dispatchingList, tqiReport, configTqiLimits);
if (ObjectUtil.isNotEmpty(tqiTransfinite)) {
railVehicleTransfiniteList.add(tqiTransfinite);
}
// 只映射一个tqi区间,映射到了就直接结束区间循环
break;
......@@ -1206,7 +1216,74 @@ public class AnalysisAlgorithm {
}
private AnalysisTqiReportCheckUnitDeviceMap tqiReportCheckUnitDeviceMapSave(AnalysisBatchCheckDataMap checkDataMap, Map<String, Object> unitDevice, MovementTqiReport tqiReport) {
private AnalysisBatchUnitDeviceTransfinite createRailVehicleCheckTqiTransfinite(JSONArray dispatchingList, MovementTqiReport tqiReport, List<ConfigTqiLimit> configTqiLimits) {
// 先判断是否超限
Integer transfiniteGrade = null;
ConfigTqiLimit currentTqiLimit = null;
for (ConfigTqiLimit tqiLimit : configTqiLimits) {
// 1.获取tqi数值
BigDecimal tqiComeUpon = Convert.toBigDecimal(tqiReport.getTqiComeUpon());
if (tqiLimit.getTqiMin().compareTo(tqiComeUpon) <= 0 && tqiLimit.getTqiMax().compareTo(tqiComeUpon) >= 0) {
transfiniteGrade = tqiLimit.getOverStandardType();
currentTqiLimit = tqiLimit;
break;
}
}
// 如果没有读取到相应得配置表示不
if (transfiniteGrade == null) {
return null;
}
int isWork = 1;
String reasonLabel = "";
String railVehicleTqiOverGrade = "rail_vehicle_tqi_" + transfiniteGrade;
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 3) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
if (reasonValue.equals(railVehicleTqiOverGrade)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
reasonLabel = dispatching.get("reasonLabel").toString();
if (isWorkTemp) {
isWork = 1;
} else {
isWork = 0;
}
break;
}
}
// 人工的病害里程:这个格子的(起点里程 + 终点里程)/2
BigDecimal diseaseMileage = tqiReport.getStartMileage().add(tqiReport.getEndMileage()).divide(new BigDecimal("2"), 3, BigDecimal.ROUND_HALF_UP);
AnalysisBatchUnitDeviceTransfinite transfinite = new AnalysisBatchUnitDeviceTransfinite();
transfinite.setId(UUIDGenerator.generate());
transfinite.setTransfiniteGrade(transfiniteGrade);
transfinite.setTransfiniteType("Tqi超限");
String allowValue = currentTqiLimit.getTqiMin() + "< tqi <" + currentTqiLimit.getTqiMax();
transfinite.setAllowValue(allowValue);
transfinite.setEkId(tqiReport.getMovementMasterId());
transfinite.setEkType(3);
transfinite.setEkItemId(tqiReport.getId());
transfinite.setMeasurePointValue(tqiReport.getTqiComeUpon());
transfinite.setIsWork(isWork);
transfinite.setDiseaseMileage(diseaseMileage);
transfinite.setTransfiniteGradeName(reasonLabel);
return transfinite;
}
private AnalysisTqiReportCheckUnitDeviceMap tqiReportCheckUnitDeviceMapSave(AnalysisBatchCheckDataMap
checkDataMap, Map<String, Object> unitDevice, MovementTqiReport tqiReport) {
AnalysisTqiReportCheckUnitDeviceMap record = new AnalysisTqiReportCheckUnitDeviceMap();
record.setId(UUIDGenerator.generate());
record.setCheckId(checkDataMap.getEkId());
......@@ -1237,7 +1314,9 @@ public class AnalysisAlgorithm {
return record;
}
private AnalysisOverReportCheckUnitDeviceMap analysisOverReportCheckUnitDeviceMapSave(Map<String, Object> unitDevice, AnalysisBatchCheckDataMap checkDataMap, MovementOverReport movementOverReport) {
private AnalysisOverReportCheckUnitDeviceMap analysisOverReportCheckUnitDeviceMapSave
(Map<String, Object> unitDevice, AnalysisBatchCheckDataMap checkDataMap, MovementOverReport
movementOverReport) {
AnalysisOverReportCheckUnitDeviceMap record = new AnalysisOverReportCheckUnitDeviceMap();
record.setId(UUIDGenerator.generate());
record.setUnitId(Convert.toStr(unitDevice.get("id")));
......@@ -1295,7 +1374,9 @@ public class AnalysisAlgorithm {
/**
* 创建轨检车测点得分
*/
private AnalysisBatchUnitDevicePointScore createRailVehicleCheckTransfinitePointScore(AnalysisBatch analysisBatch, List<MovementOverReport> currentUnitDeviceOverReportList, String overrunType, BigDecimal weightValue) {
private AnalysisBatchUnitDevicePointScore createRailVehicleCheckTransfinitePointScore(AnalysisBatch
analysisBatch, List<MovementOverReport> currentUnitDeviceOverReportList, String overrunType, BigDecimal
weightValue) {
if (ObjectUtil.isEmpty(currentUnitDeviceOverReportList)) {
return null;
}
......@@ -1360,15 +1441,19 @@ public class AnalysisAlgorithm {
boolean isDisplay = false;
int isWork = 1;
String reasonLabel = null;
String reasonLabel = "";
Integer transfiniteGrade = Convert.toInt(movementOverReport.getOverrunLevel());
String railVehicleOverGrade = "rail_vehicle_over_" + transfiniteGrade;
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 3) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
if (reasonValue.equals(railVehicleOverGrade)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
reasonLabel = String.valueOf(dispatching.get("reasonLabel"));
reasonLabel = dispatching.get("reasonLabel").toString();
if (isWorkTemp) {
isWork = 1;
} else {
......@@ -1405,7 +1490,8 @@ public class AnalysisAlgorithm {
/**
* 轨检仪检查数据分析
*/
private void railDeviceCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap checkDataMap, List<Map<String, Object>> unitDeviceList) {
private void railDeviceCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap
checkDataMap, List<Map<String, Object>> unitDeviceList) {
List<MovementCheckDataUnitDeviceMap> movementCheckDataUnitDeviceMaps = new ArrayList<>();
......@@ -1483,10 +1569,16 @@ public class AnalysisAlgorithm {
railDeviceCheckDataUnitDeviceMapList.add(railDeviceCheckDataUnitDeviceMap);
AnalysisBatchUnitDeviceTransfinite transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo);
if (transfinite != null) {
transfiniteList.add(transfinite);
// AnalysisBatchUnitDeviceTransfinite transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo);
// if (transfinite != null) {
// transfiniteList.add(transfinite);
// }
List<AnalysisBatchUnitDeviceTransfinite> innerTransfiniteList = this.railDeviceCheckTransfiniteList(analysisBatch, movementCourseInfo);
if (ObjectUtil.isNotEmpty(innerTransfiniteList)) {
transfiniteList.addAll(innerTransfiniteList);
}
}
// 计算得分
......@@ -1513,7 +1605,144 @@ public class AnalysisAlgorithm {
// movementCheckDataUnitDeviceMapService.saveBatch(movementCheckDataUnitDeviceMaps);
}
private AnalysisRailDeviceCheckDataUnitDeviceMap railDeviceCheckDataUnitDeviceMapSave(RailInspectionEquipmentItemDetail movementCourseInfo, Map<String, Object> unitDevice, RailInspectionEquipmentItem checkItem) {
private List<AnalysisBatchUnitDeviceTransfinite> railDeviceCheckTransfiniteList(AnalysisBatch analysisBatch, RailInspectionEquipmentItemDetail movementCourseInfo) {
// 超限配置
JSONObject allowValue = JSONObject.parseObject(analysisBatch.getAllowValue());
BigDecimal bigTrackGauge = Convert.toBigDecimal(allowValue.get("bigTrackGauge")); // 大轨距
BigDecimal smallTrackGauge = Convert.toBigDecimal(allowValue.get("smallTrackGauge")); // 小轨距
BigDecimal allowLevel = Convert.toBigDecimal(allowValue.get("level")); // 水平
BigDecimal allowTriangularPit = Convert.toBigDecimal(allowValue.get("triangularPit")); // 三角坑
// 是否派工配置
Integer isWork = 1;
String reasonLabel = "轨检仪检查数据-超限";
JSONArray dispatchingList = JSONArray.parseArray(analysisBatch.getDispatching());
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 1) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
if ("static_limit".equals(reasonValue)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWork = 1;
} else {
isWork = 0;
}
}
}
// 轨仪器的病害里程:这个格子的(起点里程 + 终点里程)/2
BigDecimal diseaseMileage = movementCourseInfo.getCurrentStartMileage().add(movementCourseInfo.getCurrentEndEndMileage()).divide(new BigDecimal("2"), 3, BigDecimal.ROUND_HALF_UP);
String allowValueSave = "";
String measurePointValue = "";
String transfiniteType = "";
List<AnalysisBatchUnitDeviceTransfinite> transfiniteList = new ArrayList<>();
// 轨距
BigDecimal trackGauge = Convert.toBigDecimal(movementCourseInfo.getTrackGauge());
if (ObjectUtil.isNotEmpty(trackGauge)) {
if (trackGauge.compareTo(bigTrackGauge) > 0) {
allowValueSave = bigTrackGauge.toString();
measurePointValue = trackGauge.toString();
transfiniteType = "大轨距";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getRailInspectionEquipmentId());
record.setEkType(2);
record.setEkItemId(movementCourseInfo.getRailInspectionEquipmentItemId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
} else if (trackGauge.compareTo(smallTrackGauge) < 0) {
allowValueSave = smallTrackGauge.toString();
measurePointValue = trackGauge.toString();
transfiniteType = "小轨距";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getRailInspectionEquipmentId());
record.setEkType(2);
record.setEkItemId(movementCourseInfo.getRailInspectionEquipmentItemId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
// 水平
BigDecimal level = Convert.toBigDecimal(movementCourseInfo.getLevel());
if (ObjectUtil.isNotEmpty(level)) {
if (level.compareTo(allowLevel) > 0) {
allowValueSave = allowLevel.toString();
measurePointValue = level.toString();
transfiniteType = "水平";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getRailInspectionEquipmentId());
record.setEkType(2);
record.setEkItemId(movementCourseInfo.getRailInspectionEquipmentItemId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
//三角坑
BigDecimal triangularPit = Convert.toBigDecimal(movementCourseInfo.getTriangularPit());
if (ObjectUtil.isNotEmpty(triangularPit)) {
if (triangularPit.compareTo(allowTriangularPit) > 0) {
allowValueSave = allowTriangularPit.toString();
measurePointValue = triangularPit.toString();
transfiniteType = "三角坑";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getRailInspectionEquipmentId());
record.setEkType(2);
record.setEkItemId(movementCourseInfo.getRailInspectionEquipmentItemId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
return transfiniteList;
}
private AnalysisRailDeviceCheckDataUnitDeviceMap railDeviceCheckDataUnitDeviceMapSave
(RailInspectionEquipmentItemDetail
movementCourseInfo, Map<String, Object> unitDevice, RailInspectionEquipmentItem checkItem) {
AnalysisRailDeviceCheckDataUnitDeviceMap record = new AnalysisRailDeviceCheckDataUnitDeviceMap();
record.setId(UUIDGenerator.generate());
record.setUnitId(Convert.toStr(unitDevice.get("id")));
......@@ -1543,7 +1772,8 @@ public class AnalysisAlgorithm {
/**
* 轨检仪检查数据分数
*/
private void railDeviceCheckScore(AnalysisBatch analysisBatch, List<RailInspectionEquipmentItemDetail> railDeviceCheckList, Map<String, Object> unitDevice) {
private void railDeviceCheckScore(AnalysisBatch
analysisBatch, List<RailInspectionEquipmentItemDetail> railDeviceCheckList, Map<String, Object> unitDevice) {
Integer analysisType = analysisBatch.getAnalysisType();
BigDecimal finalTrackGauge = null;
......@@ -1736,24 +1966,26 @@ public class AnalysisAlgorithm {
/**
* 轨检仪检查数据超限
*/
private AnalysisBatchUnitDeviceTransfinite railDeviceCheckTransfinite(AnalysisBatch analysisBatch, RailInspectionEquipmentItemDetail movementCourseInfo) {
private AnalysisBatchUnitDeviceTransfinite railDeviceCheckTransfinite(AnalysisBatch
analysisBatch, RailInspectionEquipmentItemDetail movementCourseInfo) {
// 超限配置
JSONObject allowValue = JSONObject.parseObject(analysisBatch.getAllowValue());
Integer bigTrackGauge = Convert.toInt(allowValue.get("bigTrackGauge")); // 大轨距
Integer smallTrackGauge = Convert.toInt(allowValue.get("smallTrackGauge")); // 小轨距
Integer allowLevel = Convert.toInt(allowValue.get("level")); // 水平
Integer allowTriangularPit = Convert.toInt(allowValue.get("triangularPit")); // 三角坑
Integer allowHeight = Convert.toInt(allowValue.get("height")); // 高低
Integer allowDirection = Convert.toInt(allowValue.get("direction")); // 轨向
// 是否派工配置
Integer isWork = 1;
String reasonLabel = "";
String reasonLabel = "轨检仪检查数据-超限";
JSONArray dispatchingList = JSONArray.parseArray(analysisBatch.getDispatching());
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 1) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
reasonLabel = String.valueOf(dispatching.get("reasonLabel"));
if ("static_limit".equals(reasonValue)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
......@@ -1837,7 +2069,8 @@ public class AnalysisAlgorithm {
/**
* 轨检仪检查
*/
private MovementCheckDataUnitDeviceMap railDeviceCheckDeviceMapSave(RailInspectionEquipmentItemDetail movementCourseInfo, Map<String, Object> unitDevice, RailInspectionEquipmentItem checkItem) {
private MovementCheckDataUnitDeviceMap railDeviceCheckDeviceMapSave(RailInspectionEquipmentItemDetail
movementCourseInfo, Map<String, Object> unitDevice, RailInspectionEquipmentItem checkItem) {
MovementCheckDataUnitDeviceMap movementCheckDataUnitDeviceMap = new MovementCheckDataUnitDeviceMap();
movementCheckDataUnitDeviceMap.setId(UUIDGenerator.generate());
movementCheckDataUnitDeviceMap.setCheckType(2);// 2-轨检仪静态检查
......@@ -1867,8 +2100,9 @@ public class AnalysisAlgorithm {
/**
* 人工检查数据分析
*/
public void labourCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap checkDataMap, List<Map<String, Object>> unitDeviceList) {
List<MovementCheckDataUnitDeviceMap> movementCheckDataUnitDeviceMaps = new ArrayList<>();
public void labourCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap
checkDataMap, List<Map<String, Object>> unitDeviceList) {
// List<MovementCheckDataUnitDeviceMap> movementCheckDataUnitDeviceMaps = new ArrayList<>();
// 1 获取人工检查数据
List<MovementCourse> checkItemList = movementCourseService.lambdaQuery().eq(MovementCourse::getMovementMasterId, checkDataMap.getEkId()).list();
List<MovementCourseInfo> checkItemItemDetailList = movementCourseInfoService.lambdaQuery().eq(MovementCourseInfo::getMovementMasterId, checkDataMap.getEkId()).list();
......@@ -1923,10 +2157,15 @@ public class AnalysisAlgorithm {
// 计算超限:如果为null则计算,否则和单元绑定
AnalysisBatchUnitDeviceTransfinite transfinite = this.labourCheckTransfinite(analysisBatch, movementCourseInfo);
// 如果超限不为空则添加进去
if (null != transfinite) {
transfiniteList.add(transfinite);
// AnalysisBatchUnitDeviceTransfinite transfinite = this.labourCheckTransfinite(analysisBatch, movementCourseInfo);
// // 如果超限不为空则添加进去
// if (null != transfinite) {
// transfiniteList.add(transfinite);
// }
List<AnalysisBatchUnitDeviceTransfinite> innerTransfiniteList = this.labourCheckTransfiniteList(analysisBatch, movementCourseInfo);
if (ObjectUtil.isNotEmpty(innerTransfiniteList)) {
transfiniteList.addAll(innerTransfiniteList);
}
}
// 计算得分
......@@ -1953,7 +2192,193 @@ public class AnalysisAlgorithm {
// }
}
private AnalysisLabourCheckDataUnitDeviceMap labourCheckDataUnitDeviceMapSave(MovementCourseInfo movementCourseInfo, Map<String, Object> unitDevice, MovementCourse checkItem) {
private List<AnalysisBatchUnitDeviceTransfinite> labourCheckTransfiniteList(AnalysisBatch analysisBatch, MovementCourseInfo movementCourseInfo) {
// 超限配置
JSONObject allowValue = JSONObject.parseObject(analysisBatch.getAllowValue());
BigDecimal bigTrackGauge = Convert.toBigDecimal(allowValue.get("bigTrackGauge")); // 大轨距
BigDecimal smallTrackGauge = Convert.toBigDecimal(allowValue.get("smallTrackGauge")); // 小轨距
BigDecimal allowLevel = Convert.toBigDecimal(allowValue.get("level")); // 水平
BigDecimal allowTriangularPit = Convert.toBigDecimal(allowValue.get("triangularPit")); // 三角坑
BigDecimal allowHeight = Convert.toBigDecimal(allowValue.get("height")); // 高低
BigDecimal allowDirection = Convert.toBigDecimal(allowValue.get("direction")); // 轨向
// 是否派工配置
Integer isWork = 1;
String reasonLabel = "人工检查数据超限-超限";
JSONArray dispatchingList = JSONArray.parseArray(analysisBatch.getDispatching());
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 1) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
if ("static_limit".equals(reasonValue)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
isWork = 1;
} else {
isWork = 0;
}
break;
}
}
// 人工的病害里程:这个格子的(起点里程 + 终点里程)/2
BigDecimal diseaseMileage = movementCourseInfo.getCurrentStartMileage().add(movementCourseInfo.getCurrentEndEndMileage()).divide(new BigDecimal("2"), 3, BigDecimal.ROUND_HALF_UP);
List<AnalysisBatchUnitDeviceTransfinite> transfiniteList = new ArrayList<>();
String allowValueSave = "";
String measurePointValue = "";
String transfiniteType = "";
// 轨距
BigDecimal trackGauge = Convert.toBigDecimal(movementCourseInfo.getTrackGauge());
if (ObjectUtil.isNotEmpty(trackGauge)) {
if (trackGauge.compareTo(bigTrackGauge) > 0) {
allowValueSave = bigTrackGauge.toString();
measurePointValue = trackGauge.toString();
transfiniteType = "大轨距";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
} else if (trackGauge.compareTo(smallTrackGauge) < 0) {
allowValueSave = smallTrackGauge.toString();
measurePointValue = trackGauge.toString();
transfiniteType = "小轨距";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
// 水平
BigDecimal level = Convert.toBigDecimal(movementCourseInfo.getLevel());
if (ObjectUtil.isNotEmpty(level)) {
if (level.compareTo(allowLevel) > 0) {
allowValueSave = allowLevel.toString();
measurePointValue = level.toString();
transfiniteType = "水平";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
//三角坑
BigDecimal triangularPit = Convert.toBigDecimal(movementCourseInfo.getTriangularPit());
if (ObjectUtil.isNotEmpty(triangularPit)) {
if (triangularPit.compareTo(allowTriangularPit) > 0) {
allowValueSave = allowTriangularPit.toString();
measurePointValue = triangularPit.toString();
transfiniteType = "三角坑";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
// 高低
BigDecimal height = Convert.toBigDecimal(movementCourseInfo.getHeight());
if (ObjectUtil.isNotEmpty(height)) {
if (height.compareTo(allowHeight) > 0) {
allowValueSave = allowHeight.toString();
measurePointValue = height.toString();
transfiniteType = "高低";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
// 轨向
BigDecimal direction = Convert.toBigDecimal(movementCourseInfo.getDirection());
if (ObjectUtil.isNotEmpty(direction)) {
if (direction.compareTo(allowDirection) > 0) {
allowValueSave = allowDirection.toString();
measurePointValue = direction.toString();
transfiniteType = "轨向";
AnalysisBatchUnitDeviceTransfinite record = new AnalysisBatchUnitDeviceTransfinite();
record.setId(UUIDGenerator.generate());
record.setTransfiniteGrade(1);
record.setTransfiniteGradeName(reasonLabel);
record.setTransfiniteType(transfiniteType);
record.setAllowValue(allowValueSave);
record.setEkId(movementCourseInfo.getMovementMasterId());
record.setEkType(1);
record.setEkItemId(movementCourseInfo.getMovementCourseId());
record.setMeasurePointValue(measurePointValue);
record.setIsWork(isWork);
record.setDiseaseMileage(diseaseMileage);
transfiniteList.add(record);
}
}
return transfiniteList;
}
private AnalysisLabourCheckDataUnitDeviceMap labourCheckDataUnitDeviceMapSave(MovementCourseInfo
movementCourseInfo, Map<String, Object> unitDevice, MovementCourse checkItem) {
AnalysisLabourCheckDataUnitDeviceMap record = new AnalysisLabourCheckDataUnitDeviceMap();
record.setId(UUIDGenerator.generate());
record.setUnitId(Convert.toStr(unitDevice.get("id")));
......@@ -1987,7 +2412,8 @@ public class AnalysisAlgorithm {
/**
* 人工分数
*/
private void labourCheckScore(AnalysisBatch analysisBatch, List<MovementCourseInfo> labourCheckList, Map<String, Object> unitDevice) {
private void labourCheckScore(AnalysisBatch
analysisBatch, List<MovementCourseInfo> labourCheckList, Map<String, Object> unitDevice) {
Integer analysisType = analysisBatch.getAnalysisType();
BigDecimal finalTrackGauge = null;
......@@ -2301,12 +2727,15 @@ public class AnalysisAlgorithm {
// 是否派工配置
Integer isWork = 1;
String reasonLabel = "";
String reasonLabel = "人工检查数据超限-超限";
JSONArray dispatchingList = JSONArray.parseArray(analysisBatch.getDispatching());
for (Object obj : dispatchingList) {
JSONObject dispatching = (JSONObject) obj;
Integer type = Convert.toInt(dispatching.get("type"));
if (type != 1) {
continue;
}
String reasonValue = String.valueOf(dispatching.get("reasonValue"));
reasonLabel = String.valueOf(dispatching.get("reasonLabel"));
if ("static_limit".equals(reasonValue)) {
Boolean isWorkTemp = Boolean.valueOf(dispatching.get("isWork").toString());
if (isWorkTemp) {
......
......@@ -63,6 +63,10 @@ public class AnalysisAdditiveCheckUnitDeviceMap implements Serializable {
@TableField("movement_master_id")
private String movementMasterId;
@ApiModelProperty("动静态几何尺寸数据主表主键-》外键")
@TableField("movement_additive_info_id")
private String movementAdditiveInfoId;
@ApiModelProperty("设备单元id")
@TableField("unit_id")
private String unitId;
......
......@@ -131,7 +131,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://47.94.207.62:3306/hzgw3?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
url: jdbc:mysql://47.94.207.62:3306/hzsomms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username: root
password: superAdmin&321
driver-class-name: com.mysql.jdbc.Driver
......
......@@ -307,4 +307,4 @@ third-app:
client-id: ??
# appSecret
client-secret: ??
agent-id: ??
\ No newline at end of file
agent-id: ??
......@@ -69,9 +69,9 @@
<!-- 日志输出级别 -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<!-- <appender-ref ref="FILE" />-->
<!-- <appender-ref ref="HTML" />-->
<!-- <appender-ref ref="FILE_HTML" />-->
<appender-ref ref="FILE" />
<appender-ref ref="HTML" />
<appender-ref ref="FILE_HTML" />
</root>
</configuration>
\ No newline at end of file
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment