Commit a48ef023 authored by 史志龙's avatar 史志龙

前6个更新--shizhilong

parent c27e0ff7
......@@ -3,7 +3,6 @@
<mapper namespace="org.jeecg.modules.checkData.mapper.CorrugationRecordMapper">
<select id="queryPageList" resultType="org.jeecg.modules.checkData.vo.CorrugationRecordVO">
SELECT
t1.id,
t2.id recordsMasterCheckId,
t2.ek_code,
t2.work_code,
......@@ -21,9 +20,9 @@
t2.end_mileage,
t2.remark
FROM
t_ek_corrugation_record t1
LEFT JOIN t_ek_records_master_check t2 ON t1.records_master_check_id = t2.id and t2.del_flag = '0'
WHERE t1.del_flag = '0'
t_ek_records_master_check t2
WHERE t2.del_flag = '0'
AND t2.type = '4'
<if test="dto.ekCode != null and dto.ekCode != ''">
AND t2.ek_code like concat('%',#{dto.ekCode},'%')
</if>
......@@ -41,6 +40,6 @@
t1.*
FROM
t_ek_corrugation_record t1
where t1.id = #{id}
where t1.records_master_check_id = #{id}
</select>
</mapper>
......@@ -4,7 +4,6 @@
<select id="queryPageList" resultType="org.jeecg.modules.checkData.vo.RailWearRecordVO">
SELECT
t1.id,
t2.id recordsMasterCheckId,
t2.ek_code,
t2.work_code,
......@@ -22,9 +21,9 @@
t2.end_mileage,
t2.remark
FROM
t_ek_rail_wear_record t1
LEFT JOIN t_ek_records_master_check t2 ON t1.records_master_check_id = t2.id and t2.del_flag = '0'
WHERE t1.del_flag = '0'
t_ek_records_master_check t2
WHERE t2.del_flag = '0'
AND t2.type = '2'
<if test="dto.ekCode != null and dto.ekCode != ''">
AND t2.ek_code like concat('%',#{dto.ekCode},'%')
</if>
......@@ -41,6 +40,6 @@
t1.*
FROM
t_ek_rail_wear_record t1
where t1.id = #{id}
where t1.records_master_check_id = #{id}
</select>
</mapper>
......@@ -50,5 +50,5 @@ public class RailWearRecordDetailVO {
@ApiModelProperty("换轨计划")
@TableField("damage_plan")
private Integer damagePlan;
private String damagePlan;
}
......@@ -107,6 +107,7 @@ public class AnalysisAlgorithm {
// 1.1 获取分析基础数据
AnalysisBatch analysisBatch = analysisBatchService.getById(analysisBatchId);
//查询该批次所需要分析得采集信息批次
List<AnalysisBatchCheckDataMap> analysisBatchCheckDataMapList = analysisBatchCheckDataMapService.lambdaQuery().eq(AnalysisBatchCheckDataMap::getAnalysisBatchId, analysisBatchId).list();
......@@ -114,7 +115,7 @@ public class AnalysisAlgorithm {
List<Map<String, Object>> unitDeviceList = analysisAlgorithmMapper.getUnitDevice(analysisBatch.getLightRailId(), analysisBatch.getLineAliasId(), analysisBatch.getStartingMileage(), analysisBatch.getEndMileage());
// 1.3 关联关系
// 1.3 关联关系-封装1-钢轨,2-曲线,3-竖曲线,4-道岔得单位编号
for (Map<String, Object> unitDevice : unitDeviceList) {
unitDeviceTable.put(unitDevice.get("unitCode").toString(), unitDevice);
}
......@@ -124,7 +125,7 @@ public class AnalysisAlgorithm {
for (AnalysisBatchCheckDataMap checkDataMap : analysisBatchCheckDataMapList) {
// 检查数据类型 1-人工静态检查 2-轨检仪静态检查 3-轨检车检查 4-添乘仪检查
if (1 == checkDataMap.getEkType()) {
//分析批次数据、需要分析得检查批次、1-钢轨,2-曲线,3-竖曲线,4-道岔
labourCheckDataAnalysis(analysisBatch, checkDataMap, unitDeviceList);
} else if (2 == checkDataMap.getEkType()) {
......@@ -2105,7 +2106,7 @@ public class AnalysisAlgorithm {
}
/**
* 人工检查数据分析
* 人工检查数据分析->分析批次数据、需要分析得检查批次、1-钢轨,2-曲线,3-竖曲线,4-道岔
*/
public void labourCheckDataAnalysis(AnalysisBatch analysisBatch, AnalysisBatchCheckDataMap
checkDataMap, List<Map<String, Object>> unitDeviceList) {
......@@ -2118,11 +2119,13 @@ public class AnalysisAlgorithm {
// 2.循环遍历单元设备中心里程落在检查项目【开始-结束】这个区间视为这个区间的单元设备数
for (Map<String, Object> unitDevice : unitDeviceList) {
//获取基础数据得中心里程
BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage"));
// 循环遍历检查项目比较【开始-结束】来映射关联关系
for (MovementCourse checkItem : checkItemList) {
// 这里可能出现开始时间比结束时间大的情况
//获取待分析数据得检查起始里程
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage();
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage();
if (checkItemStartingMileage.compareTo(checkItemEndMileage) > 0) {
......@@ -2132,28 +2135,38 @@ public class AnalysisAlgorithm {
// 2.2.1 命中检查项目
if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) {
//获取其中一段得检查里程信息
List<MovementCourseInfo> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId());
// 1 处理3个格子映射问题
//将这段检查里程信息按轨号进行分组拿到轨号1,2,3
Map<String, List<MovementCourseInfo>> trackCodeMap = movementCourseInfos.stream().collect(Collectors.groupingBy(MovementCourseInfo::getTrackCode));
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).sorted().mapToObj(String::valueOf).collect(Collectors.toList());
//当前开始里程
BigDecimal currentStartMileage = checkItemStartingMileage;
//当前结束里程=检测开始里程+平均值
BigDecimal currentEndEndMileage = checkItemStartingMileage.add(averageDec);
// 2.循环来命中格子
for (String trackCode : trackCodes) {
if (currentStartMileage.compareTo(centerMileage) <= 0 && currentEndEndMileage.compareTo(centerMileage) > 0) {
//获取某个轨号对应得检查里程信息
List<MovementCourseInfo> labourCheckList = trackCodeMap.get(trackCode);
//动静态分析-分析批次-单元设备超限
List<AnalysisBatchUnitDeviceTransfinite> transfiniteList = new ArrayList<>();
//动静态分析-人工检查数据分析批次映射
List<AnalysisLabourCheckDataUnitDeviceMap> labourCheckDataUnitDeviceMapList = new ArrayList<>();
// 循环处理测点数据
for (MovementCourseInfo movementCourseInfo : labourCheckList) {
// 保存数据
// 保存数据(当前轨号对应得开始结束里程)
movementCourseInfo.setCurrentStartMileage(currentStartMileage);
movementCourseInfo.setCurrentEndEndMileage(currentEndEndMileage);
//当前轨号对应得检查里程信息(测点、轨距、水平、三角坑等)、设备类型信息、当前检查里程信息
MovementCheckDataUnitDeviceMap map = this.labourCheckDeviceMapSave(movementCourseInfo, unitDevice, checkItem);
map.setCheckDetailStartingMileage(currentStartMileage);
map.setCheckDetailEndMileage(currentEndEndMileage);
......@@ -2845,9 +2858,9 @@ public class AnalysisAlgorithm {
/**
* 人工检查设备映射
*
* @param movementCourseInfo
* @param unitDevice
* @param checkItem
* @param movementCourseInfo 当前轨号对应得检查里程信息(测点、轨距、水平、三角坑等)
* @param unitDevice 设备类型信息
* @param checkItem 当前检查里程信息
* @return
*/
private MovementCheckDataUnitDeviceMap labourCheckDeviceMapSave(MovementCourseInfo movementCourseInfo, Map<String, Object> unitDevice, MovementCourse checkItem) {
......
......@@ -30,9 +30,13 @@ public class CheckBatchDTO {
@ApiModelProperty("终点里程")
private BigDecimal endMileage;
@ApiModelProperty("检查日期")
@ApiModelProperty("检查日期开始日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date checkTime;
private Date startTime;
@ApiModelProperty("检查日期截止日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
@ApiModelProperty("备注")
private String remark;
......
......@@ -32,11 +32,11 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId}
</if>
<if test="dto.checkTime != null">
AND t1.check_time >= #{dto.checkTime}
<if test="dto.startTime != null">
AND t1.check_time >= #{dto.startTime}
</if>
<if test="dto.checkTime != null">
AND t1.check_time <![CDATA[ <= ]]> #{dto.checkTime}
<if test="dto.endTime != null">
AND t1.check_time <![CDATA[ <= ]]> #{dto.endTime}
</if>
</select>
<select id="listRecord" resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO">
......
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