Commit 6c121853 authored by hkl's avatar hkl

feat: 1.轨检仪器bug修改

parent 6ca0da31
......@@ -51,11 +51,11 @@ public class RailInspectionEquipmentItem implements Serializable {
@TableField("rail_inspection_equipment_id")
private String railInspectionEquipmentId;
@ApiModelProperty("检查起始里程(m)")
@ApiModelProperty("检查起始里程(km)")
@TableField("course_starting_mileage")
private BigDecimal courseStartingMileage;
@ApiModelProperty("检查终点里程(m)")
@ApiModelProperty("检查终点里程(km)")
@TableField("course_end_mileage")
private BigDecimal courseEndMileage;
......
......@@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
......@@ -93,6 +94,8 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
int skipRow = analysisItemDetail(i, titleHeader, item.getId(), rowRecords, itemDetails);
i = i + skipRow;
} else {
i++;
}
}
......@@ -127,9 +130,12 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
private int analysisItemDetail(int rows, String titleHeader, String itemId, List<List<Object>> rowRecords, List<RailInspectionEquipmentItemDetail> itemDetails) {
// 解析检查项目:3行:跳过2行不解析
// 解析检查项目:1行:跳过2行不解析
List<Object> checkItems = rowRecords.get(rows + 2);
// 解析规矩轨距:1行
// 解析测点:1行
List<Object> measurePoints = rowRecords.get(rows + 3);
// 解析轨距:1行
List<Object> trackGauges = rowRecords.get(rows + 4);
// 解析水平 :1行
List<Object> levels = rowRecords.get(rows + 5);
......@@ -139,37 +145,36 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
List<Object> others = rowRecords.get(rows + 7);
int measurePoint = 1;
int sort = 1;
for (int i = 2; i < 32; i++) {
if (measurePoint % 8 == 0) {
measurePoint = 1;
i = i + 2;
// 测点:测点8和9不保留
Integer measurePoint = Convert.toInt(measurePoints.get(i));
if (measurePoint == 8 || measurePoint == 9) {
continue;
} else {
measurePoint++;
}
RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail();
itemDetail.setId(UUIDGenerator.generate());
itemDetail.setRailInspectionEquipmentItemId(itemId);
// 检查项目
String checkItem = checkItems.get(i).toString();
itemDetail.setCheckItem(checkItem);
//轨距
// 轨距
String trackGauge = trackGauges.get(i).toString();
itemDetail.setTrackGauge(trackGauge);
//水平
// 水平
String level = levels.get(i).toString();
itemDetail.setLevel(level);
//三角坑
// 三角坑
String triangularPit = triangularPits.get(i).toString();
itemDetail.setTriangularPit(triangularPit);
//解析轨向、高低及其它
String other = others.get(i).toString();
itemDetail.setOther(other);
// 测点
itemDetail.setMeasurePoint(measurePoint);
// 测点值向后偏移一个
itemDetail.setMeasurePoint(measurePoint + 1);
itemDetail.setInfoSort(sort++);
itemDetails.add(itemDetail);
......@@ -200,6 +205,11 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
@Override
public void saveRecord(RailInspectionEquipmentItem record) {
// 中心里程 = (开始里程+结束里程) / 2
BigDecimal startMileage = record.getCourseStartingMileage();
BigDecimal endMileage = record.getCourseEndMileage();
BigDecimal avgMileage = endMileage.subtract(startMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
// 保存item表
record.setId(UUIDGenerator.generate());
......@@ -208,23 +218,28 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
// 初始化明细表
String checkItem = "检查项目:";
List<RailInspectionEquipmentItemDetail> itemDetails = new ArrayList<>();
int measurePoint = 1;
int measurePoint = 0;
int sort = 1;
for (int i = 2; i < 32; i++) {
if (measurePoint % 8 == 0) {
measurePoint = 1;
i = i + 2;
continue;
} else {
if (measurePoint == 8) {
measurePoint++;
continue;
}
if (measurePoint == 9) {
measurePoint = 0;
startMileage = startMileage.add(avgMileage);
continue;
}
measurePoint++;
RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail();
itemDetail.setId(UUIDGenerator.generate());
itemDetail.setRailInspectionEquipmentId(record.getRailInspectionEquipmentId());
itemDetail.setRailInspectionEquipmentItemId(record.getId());
// 检查项目
itemDetail.setCheckItem("");
itemDetail.setCheckItem(checkItem + startMileage.add(avgMileage));
//轨距
itemDetail.setTrackGauge("");
//水平
......@@ -235,12 +250,7 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
itemDetail.setOther("");
// 测点
itemDetail.setMeasurePoint(measurePoint - 1);
if (measurePoint % 10 == 0) {
measurePoint = 1;
} else {
measurePoint++;
}
itemDetail.setMeasurePoint(measurePoint);
itemDetail.setInfoSort(sort++);
itemDetails.add(itemDetail);
}
......
......@@ -20,15 +20,13 @@ import org.jeecg.modules.checkData.equipmentCheckData.service.IMovementOverRepor
import org.jeecg.modules.dynamicStaticAnalysis.entity.*;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisAlgorithmMapper;
import org.jeecg.modules.dynamicStaticAnalysis.service.*;
import org.jeecg.modules.dynamicStaticAnalysis.util.StrUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -74,24 +72,35 @@ public class AnalysisAlgorithm {
.eq(AnalysisBatchCheckDataMap::getAnalysisBatchId, analysisBatchId)
.list();
// 1.2 按公里数正序排序所有1-钢轨,2-曲线,3-竖曲线,4-道岔
List<Map<String, Object>> unitDeviceList = analysisAlgorithmMapper.getUnitDevice(analysisBatch.getLightRailId(), analysisBatch.getLineAliasId());
List<Map<String, Object>> unitDeviceList = analysisAlgorithmMapper.getUnitDevice(
analysisBatch.getLightRailId(),
analysisBatch.getLineAliasId(),
analysisBatch.getStartingMileage(),
analysisBatch.getEndMileage());
// 1.3 关联关系
for (Map<String, Object> unitDevice : unitDeviceList) {
unitDeviceTable.put(unitDevice.get("unitCode").toString(), unitDevice);
}
// 1.3 获取检查数据
// 1.4 循环分析检查项目
for (AnalysisBatchCheckDataMap checkDataMap : analysisBatchCheckDataMapList) {
// 检查数据类型 1-人工静态检查 2-轨检仪静态检查 3-轨检车检查 4-添乘仪检查
if (1 == checkDataMap.getEkType()) {
labourCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList, unitDeviceTable);
labourCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList);
} else if (2 == checkDataMap.getEkType()) {
railDeviceCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList, unitDeviceTable);
railDeviceCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList);
} else if (3 == checkDataMap.getEkType()) {
railVehicleCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList, unitDeviceTable);
railVehicleCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList);
} else {
......@@ -100,6 +109,22 @@ public class AnalysisAlgorithm {
// 3.保存算法结果
if (ObjectUtil.isNotEmpty(unitDeviceTable)) {
// 删除超限
analysisBatchUnitDeviceTransfiniteService.lambdaUpdate()
.eq(AnalysisBatchUnitDeviceTransfinite::getAnalysisBatchId, analysisBatch.getId())
.remove();
// 删除得分
analysisBatchUnitDevicePointScoreService.lambdaUpdate()
.eq(AnalysisBatchUnitDevicePointScore::getAnalysisBatchId, analysisBatch.getId())
.remove();
// 删除分析关联设备id
analysisBatchUnitDeviceService.lambdaUpdate()
.eq(AnalysisBatchUnitDevice::getAnalysisBatchId, analysisBatchId)
.remove();
// 3.1 保存分析批次-单元设备
List<AnalysisBatchUnitDevice> analysisBatchUnitDevices = new ArrayList<>();
for (Map.Entry<String, Map<String, Object>> entry : unitDeviceTable.entrySet()) {
Map<String, Object> unitDevice = entry.getValue();
......@@ -122,6 +147,7 @@ public class AnalysisAlgorithm {
} else {
analysisBatchUnitDevice.setLabourCheck(0);
}
BigDecimal labourCheckScore = (BigDecimal) unitDevice.get("labourCheckScore");
// -1代表未评分
if (labourCheckScore == null) {
......@@ -145,7 +171,7 @@ public class AnalysisAlgorithm {
// 保存超限
Object transfiniteData = unitDevice.get("transfinite");
Object transfiniteData = unitDevice.get("labourCheckTransfinite");
if (ObjectUtil.isNotEmpty(transfiniteData)) {
AnalysisBatchUnitDeviceTransfinite transfinite = (AnalysisBatchUnitDeviceTransfinite) transfiniteData;
transfinite.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId());
......@@ -155,7 +181,6 @@ public class AnalysisAlgorithm {
transfinite.setUnitCode(analysisBatchUnitDevice.getUnitCode());
transfinite.setUnitType(analysisBatchUnitDevice.getUnitType());
transfinite.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
analysisBatchUnitDeviceTransfiniteService.lambdaUpdate().eq(AnalysisBatchUnitDeviceTransfinite::getAnalysisBatchUnitDeviceId, analysisBatchUnitDevice.getId()).remove();
analysisBatchUnitDeviceTransfiniteService.save(transfinite);
}
......@@ -171,23 +196,24 @@ public class AnalysisAlgorithm {
score.setUnitType(analysisBatchUnitDevice.getUnitType());
score.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
}
analysisBatchUnitDevicePointScoreService.lambdaUpdate().eq(AnalysisBatchUnitDevicePointScore::getAnalysisBatchUnitDeviceId, analysisBatchUnitDevice.getId()).remove();
analysisBatchUnitDevicePointScoreService.saveBatch(scoreList);
}
}
analysisBatchUnitDeviceService.lambdaUpdate().eq(AnalysisBatchUnitDevice::getAnalysisBatchId, analysisBatchId).remove();
analysisBatchUnitDeviceService.saveBatch(analysisBatchUnitDevices);
}
// 分析完成
analysisBatchService.lambdaUpdate().set(AnalysisBatch::getAnalysisStatus, 99)
.eq(AnalysisBatch::getId, analysisBatchId)
.update();
}
/**
* 轨检车检查数据解析
*/
private void railVehicleCheckDataAnalysis(AnalysisBatch analysisBatch,
AnalysisBatchCheckDataMap checkDataMap,
List<Map<String, Object>> unitDeviceList,
Map<String, Map<String, Object>> unitDeviceTable) {
List<Map<String, Object>> unitDeviceList) {
// 1.获取轨检车检查超限
List<MovementOverReport> movementOverReports = movementOverReportService
.lambdaQuery()
......@@ -215,9 +241,6 @@ public class AnalysisAlgorithm {
break;
}
}
unitDeviceTable.putIfAbsent(unitDevice.get("unitCode").toString(), unitDevice); // 放入命中分析-单元表中
}
}
......@@ -227,12 +250,12 @@ public class AnalysisAlgorithm {
/**
* 轨检仪检查数据分析
*/
private void railDeviceCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap checkDataMap,
List<Map<String, Object>> unitDeviceList,
Map<String, Map<String, Object>> unitDeviceTable) {
private void railDeviceCheckDataAnalysis(AnalysisBatch analysisBatch,
AnalysisBatchCheckDataMap checkDataMap,
List<Map<String, Object>> unitDeviceList) {
List<MovementCheckDataUnitDeviceMap> movementCheckDataUnitDeviceMaps = new ArrayList<>();
// 1 获取轨检仪静态检查
List<RailInspectionEquipmentItem> checkItemList = railInspectionEquipmentItemService.lambdaQuery()
.eq(RailInspectionEquipmentItem::getRailInspectionEquipmentId, checkDataMap.getEkId())
......@@ -247,9 +270,11 @@ public class AnalysisAlgorithm {
// 2 循环遍历检查项目比较【开始-结束】来映射关联关系
for (RailInspectionEquipmentItem checkItem : checkItemList) {
// 2.1 这里可能出现开始时间比结束时间大的情况
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage();
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage();
// 2.1 这里可能出现开始时间比结束时间大的情况,轨检仪数据还要乘1000
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage().multiply(new BigDecimal("1000"));
checkItem.setCourseStartingMileage(checkItemStartingMileage);
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage().multiply(new BigDecimal("1000"));
checkItem.setCourseEndMileage(checkItemEndMileage);
if (checkItemStartingMileage.compareTo(checkItemEndMileage) > 0) {
checkItemStartingMileage = checkItem.getCourseEndMileage();
checkItemEndMileage = checkItem.getCourseStartingMileage();
......@@ -257,31 +282,24 @@ public class AnalysisAlgorithm {
// 2.2 单元设备中心里程落在检查项目【开始-结束】这个区间视为这个区间的单元设备
for (Map<String, Object> unitDevice : unitDeviceList) {
BigDecimal startMileage = Convert.toBigDecimal(unitDevice.get("startMileage"));
BigDecimal endMileage = Convert.toBigDecimal(unitDevice.get("endMileage"));
BigDecimal centerMileage = startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
unitDevice.put("centerMileage", centerMileage);
BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage"));
// 2.2.1 命中检查项目
if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) {
List<RailInspectionEquipmentItemDetail> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId());
for (RailInspectionEquipmentItemDetail info : movementCourseInfos) {
String checkItemKey = info.getCheckItem();
BigDecimal bigDecimal = new BigDecimal(checkItemKey);
BigDecimal multiply = bigDecimal.multiply(new BigDecimal("1000"));
info.setCheckItem(String.valueOf(multiply.intValue()));
}
if (ObjectUtil.isNotEmpty(movementCourseInfos)) {
// 1 处理3个格子映射问题
// 按照检查项目聚合
Map<String, List<RailInspectionEquipmentItemDetail>> trackCodeMap = movementCourseInfos.stream()
.collect(Collectors.groupingBy(RailInspectionEquipmentItemDetail::getCheckItem));
.collect(Collectors.groupingBy(
// 处理一下“标示里程:20.100” 中文字符
record -> StrUtil.extractTextToNumber(record.getCheckItem()).toString()
));
int size = trackCodeMap.size();
BigDecimal averageDec = checkItemEndMileage.subtract(checkItemStartingMileage).divide(new BigDecimal(size), 3, RoundingMode.HALF_UP);
List<String> trackCodes = trackCodeMap.keySet().stream()
.mapToInt(Integer::valueOf)
.map(BigDecimal::new)
.sorted()
.mapToObj(String::valueOf)
.map(BigDecimal::toString)
.collect(Collectors.toList());
BigDecimal currentStartMileage = checkItemStartingMileage;
BigDecimal currentEndEndMileage = checkItemStartingMileage.add(averageDec);
......@@ -297,9 +315,7 @@ public class AnalysisAlgorithm {
// 循环处理测点数据
for (RailInspectionEquipmentItemDetail movementCourseInfo : railDeviceCheckList) {
// 保存数据
movementCourseInfo.setCurrentStartMileage(currentStartMileage);
movementCourseInfo.setCurrentEndEndMileage(currentEndEndMileage);
// 保存检查数据-单元关联关系
MovementCheckDataUnitDeviceMap map = this.railDeviceCheckDeviceMapSave(movementCourseInfo, unitDevice, checkItem);
movementCheckDataUnitDeviceMaps.add(map);
......@@ -313,8 +329,6 @@ public class AnalysisAlgorithm {
// 计算得分
this.railDeviceCheckScore(analysisBatch, railDeviceCheckList, unitDevice);
unitDeviceTable.putIfAbsent(unitDevice.get("unitCode").toString(), unitDevice); // 放入命中分析-单元表中
}
currentStartMileage = currentEndEndMileage;
currentEndEndMileage = currentEndEndMileage.add(averageDec);
......@@ -330,7 +344,12 @@ public class AnalysisAlgorithm {
movementCheckDataUnitDeviceMapService.saveBatch(movementCheckDataUnitDeviceMaps);
}
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();
Integer finalTrackGauge = null;
......@@ -523,7 +542,11 @@ public class AnalysisAlgorithm {
unitDevice.put("railDeviceCheckScoreList", scoreList);
}
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")); // 大轨距
......@@ -613,12 +636,13 @@ public class AnalysisAlgorithm {
}
}
private MovementCheckDataUnitDeviceMap railDeviceCheckDeviceMapSave(RailInspectionEquipmentItemDetail movementCourseInfo, Map<String, Object> unitDevice, RailInspectionEquipmentItem checkItem) {
BigDecimal startMileage = Convert.toBigDecimal(unitDevice.get("startMileage"));
BigDecimal endMileage = Convert.toBigDecimal(unitDevice.get("endMileage"));
BigDecimal centerMileage = startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
/**
* 轨检仪检查
*/
private MovementCheckDataUnitDeviceMap railDeviceCheckDeviceMapSave(RailInspectionEquipmentItemDetail movementCourseInfo,
Map<String, Object> unitDevice,
RailInspectionEquipmentItem checkItem) {
MovementCheckDataUnitDeviceMap movementCheckDataUnitDeviceMap = new MovementCheckDataUnitDeviceMap();
movementCheckDataUnitDeviceMap.setId(UUIDGenerator.generate());
movementCheckDataUnitDeviceMap.setCheckType(2);// 2-轨检仪静态检查
......@@ -626,9 +650,9 @@ public class AnalysisAlgorithm {
movementCheckDataUnitDeviceMap.setUnitCode(Convert.toStr(unitDevice.get("unitCode")));
movementCheckDataUnitDeviceMap.setUnitType(Convert.toInt(unitDevice.get("type")));
movementCheckDataUnitDeviceMap.setUnitTypeName(Convert.toStr(unitDevice.get("typeName")));
movementCheckDataUnitDeviceMap.setUnitStartingMileage(startMileage);
movementCheckDataUnitDeviceMap.setUnitCenterMileage(centerMileage);
movementCheckDataUnitDeviceMap.setUnitEndMileage(endMileage);
movementCheckDataUnitDeviceMap.setUnitStartingMileage(Convert.toBigDecimal(unitDevice.get("startMileage")));
movementCheckDataUnitDeviceMap.setUnitCenterMileage(Convert.toBigDecimal(unitDevice.get("centerMileage")));
movementCheckDataUnitDeviceMap.setUnitEndMileage(Convert.toBigDecimal(unitDevice.get("endMileage")));
movementCheckDataUnitDeviceMap.setCheckId(checkItem.getRailInspectionEquipmentId());
movementCheckDataUnitDeviceMap.setCheckItemId(checkItem.getRailInspectionEquipmentId());
movementCheckDataUnitDeviceMap.setCheckItemStartingMileage(checkItem.getCourseStartingMileage());
......@@ -647,15 +671,13 @@ public class AnalysisAlgorithm {
/**
* 人工检查数据分析
*
* @param checkDataMap
*/
public void labourCheckDataAnalysis(AnalysisBatch analysisBatch,
AnalysisBatchCheckDataMap checkDataMap,
List<Map<String, Object>> unitDeviceList,
Map<String, Map<String, Object>> unitDeviceTable) {
List<Map<String, Object>> unitDeviceList) {
List<MovementCheckDataUnitDeviceMap> movementCheckDataUnitDeviceMaps = new ArrayList<>();
// 1 获取人工检查数据
List<MovementCourse> checkItemList = movementCourseService.lambdaQuery()
.eq(MovementCourse::getMovementMasterId, checkDataMap.getEkId())
......@@ -669,7 +691,6 @@ public class AnalysisAlgorithm {
// 2 循环遍历检查项目比较【开始-结束】来映射关联关系
for (MovementCourse checkItem : checkItemList) {
// 2.1 这里可能出现开始时间比结束时间大的情况
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage();
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage();
......@@ -680,10 +701,7 @@ public class AnalysisAlgorithm {
// 2.2 单元设备中心里程落在检查项目【开始-结束】这个区间视为这个区间的单元设备
for (Map<String, Object> unitDevice : unitDeviceList) {
BigDecimal startMileage = Convert.toBigDecimal(unitDevice.get("startMileage"));
BigDecimal endMileage = Convert.toBigDecimal(unitDevice.get("endMileage"));
BigDecimal centerMileage = startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
unitDevice.put("centerMileage", centerMileage);
BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage"));
// 2.2.1 命中检查项目
if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) {
......@@ -728,8 +746,6 @@ public class AnalysisAlgorithm {
// 计算得分
this.labourCheckScore(analysisBatch, labourCheckList, unitDevice);
unitDeviceTable.putIfAbsent(unitDevice.get("unitCode").toString(), unitDevice); // 放入命中分析-单元表中
}
currentStartMileage = currentEndEndMileage;
currentEndEndMileage = currentEndEndMileage.add(averageDec);
......@@ -752,10 +768,6 @@ public class AnalysisAlgorithm {
/**
* 人工分数
*
* @param analysisBatch
* @param labourCheckList
* @param unitDevice
*/
private void labourCheckScore(AnalysisBatch analysisBatch,
List<MovementCourseInfo> labourCheckList,
......
package org.jeecg.modules.dynamicStaticAnalysis.mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
......@@ -19,5 +20,8 @@ public interface AnalysisAlgorithmMapper {
* @param lightRailId 线路id
* @param lineAliasId 线别id
*/
List<Map<String,Object>> getUnitDevice(String lightRailId, String lineAliasId);
List<Map<String, Object>> getUnitDevice(String lightRailId,
String lineAliasId,
BigDecimal startMileage,
BigDecimal endMileage);
}
......@@ -69,6 +69,14 @@
WHERE t1.line_alias_id = #{lineAliasId}
AND t2.light_rail_id = #{lightRailId}
) t
<where>
<if test="startMileage != null">
AND t.centerMileage >= #{startMileage}
</if>
<if test="endMileage != null">
AND t.centerMileage <![CDATA[ <= ]]> #{endMileage}
</if>
</where>
ORDER BY t.startMileage
</select>
</mapper>
......@@ -18,7 +18,7 @@
t1.unit_device_code,
t1.unit_type,
t1.unit_type_name,
t1.unit_starting_mileage,
t1.unit_start_mileage unit_starting_mileage,
t1.unit_center_mileage,
t1.unit_end_mileage,
t1.unit_score,
......
package org.jeecg.modules.dynamicStaticAnalysis.util;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -30,4 +31,27 @@ public class StrUtil {
return speedLevel;
}
/**
* 提取文字成数字并去掉末尾多余的0
*
* @param text
* @return
*/
public static BigDecimal extractTextToNumber(String text) {
String regex = "(-\\|+)?\\d+(\\.\\d+)?";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(text);
BigDecimal result = null;
while (matcher.find()) {
String group = matcher.group();
if (null != group && !group.isEmpty()) {
result = new BigDecimal(group);
break;
}
}
return result;
}
}
......@@ -99,12 +99,15 @@
WHERE t1.line_alias_id = #{dto.lineAliasId}
AND t2.light_rail_id = #{dto.lightRailId}
) t
<where>
<if test="dto.startMileage != null">
AND t.centerMileage >= #{dto.startMileage}
</if>
<if test="dto.endMileage != null">
AND t.centerMileage <![CDATA[ <= ]]> #{dto.endMileage}
</if>
</where>
ORDER BY t.startMileage
</select>
</mapper>
......@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMapper;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceTransfiniteMapper;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO;
import org.jeecg.modules.maintenanceWork.dto.*;
import org.jeecg.modules.maintenanceWork.entity.WorkBatch;
import org.jeecg.modules.maintenanceWork.entity.WorkBatchDetail;
......@@ -39,6 +41,8 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
@Resource
private AnalysisBatchUnitDeviceMapper analysisBatchUnitDeviceMapper;
@Resource
private AnalysisBatchUnitDeviceTransfiniteMapper transfiniteMapper;
@Override
public Page<WorkBatchVO> listRecord(Page<WorkBatchVO> pageData, WorkBatchDTO dto) {
......@@ -46,6 +50,10 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
for (WorkBatchVO record : pageRecords.getRecords()) {
List<WorkBatchDetailVO> detailList = workBatchDetailMapper.queryListByWorkBatchId(record.getId());
// for (WorkBatchDetailVO workBatchDetailVO : detailList) {
// List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = transfiniteMapper.getTransfiniteList(record.getId());
// workBatchDetailVO.setTransfiniteList(transfiniteList);
// }
record.setDetailList(detailList);
}
......
......@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO;
/**
* <p>
......@@ -68,4 +71,8 @@ public class WorkBatchDetailVO {
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("超限")
private List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = new ArrayList<>();
}
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