Commit 6c121853 authored by hkl's avatar hkl

feat: 1.轨检仪器bug修改

parent 6ca0da31
...@@ -51,11 +51,11 @@ public class RailInspectionEquipmentItem implements Serializable { ...@@ -51,11 +51,11 @@ public class RailInspectionEquipmentItem implements Serializable {
@TableField("rail_inspection_equipment_id") @TableField("rail_inspection_equipment_id")
private String railInspectionEquipmentId; private String railInspectionEquipmentId;
@ApiModelProperty("检查起始里程(m)") @ApiModelProperty("检查起始里程(km)")
@TableField("course_starting_mileage") @TableField("course_starting_mileage")
private BigDecimal courseStartingMileage; private BigDecimal courseStartingMileage;
@ApiModelProperty("检查终点里程(m)") @ApiModelProperty("检查终点里程(km)")
@TableField("course_end_mileage") @TableField("course_end_mileage")
private BigDecimal courseEndMileage; private BigDecimal courseEndMileage;
......
...@@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -93,6 +94,8 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -93,6 +94,8 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
int skipRow = analysisItemDetail(i, titleHeader, item.getId(), rowRecords, itemDetails); int skipRow = analysisItemDetail(i, titleHeader, item.getId(), rowRecords, itemDetails);
i = i + skipRow; i = i + skipRow;
} else {
i++;
} }
} }
...@@ -127,9 +130,12 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -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) { 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); List<Object> checkItems = rowRecords.get(rows + 2);
// 解析规矩轨距:1行 // 解析测点:1行
List<Object> measurePoints = rowRecords.get(rows + 3);
// 解析轨距:1行
List<Object> trackGauges = rowRecords.get(rows + 4); List<Object> trackGauges = rowRecords.get(rows + 4);
// 解析水平 :1行 // 解析水平 :1行
List<Object> levels = rowRecords.get(rows + 5); List<Object> levels = rowRecords.get(rows + 5);
...@@ -139,37 +145,36 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -139,37 +145,36 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
List<Object> others = rowRecords.get(rows + 7); List<Object> others = rowRecords.get(rows + 7);
int measurePoint = 1;
int sort = 1; int sort = 1;
for (int i = 2; i < 32; i++) { for (int i = 2; i < 32; i++) {
if (measurePoint % 8 == 0) { // 测点:测点8和9不保留
measurePoint = 1; Integer measurePoint = Convert.toInt(measurePoints.get(i));
i = i + 2; if (measurePoint == 8 || measurePoint == 9) {
continue; continue;
} else {
measurePoint++;
} }
RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail(); RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail();
itemDetail.setId(UUIDGenerator.generate()); itemDetail.setId(UUIDGenerator.generate());
itemDetail.setRailInspectionEquipmentItemId(itemId); itemDetail.setRailInspectionEquipmentItemId(itemId);
// 检查项目 // 检查项目
String checkItem = checkItems.get(i).toString(); String checkItem = checkItems.get(i).toString();
itemDetail.setCheckItem(checkItem); itemDetail.setCheckItem(checkItem);
//轨距 // 轨距
String trackGauge = trackGauges.get(i).toString(); String trackGauge = trackGauges.get(i).toString();
itemDetail.setTrackGauge(trackGauge); itemDetail.setTrackGauge(trackGauge);
//水平 // 水平
String level = levels.get(i).toString(); String level = levels.get(i).toString();
itemDetail.setLevel(level); itemDetail.setLevel(level);
//三角坑 // 三角坑
String triangularPit = triangularPits.get(i).toString(); String triangularPit = triangularPits.get(i).toString();
itemDetail.setTriangularPit(triangularPit); itemDetail.setTriangularPit(triangularPit);
//解析轨向、高低及其它 //解析轨向、高低及其它
String other = others.get(i).toString(); String other = others.get(i).toString();
itemDetail.setOther(other); itemDetail.setOther(other);
// 测点 // 测点值向后偏移一个
itemDetail.setMeasurePoint(measurePoint); itemDetail.setMeasurePoint(measurePoint + 1);
itemDetail.setInfoSort(sort++); itemDetail.setInfoSort(sort++);
itemDetails.add(itemDetail); itemDetails.add(itemDetail);
...@@ -200,6 +205,11 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -200,6 +205,11 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
@Override @Override
public void saveRecord(RailInspectionEquipmentItem record) { 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表 // 保存item表
record.setId(UUIDGenerator.generate()); record.setId(UUIDGenerator.generate());
...@@ -208,23 +218,28 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -208,23 +218,28 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
// 初始化明细表 // 初始化明细表
String checkItem = "检查项目:";
List<RailInspectionEquipmentItemDetail> itemDetails = new ArrayList<>(); List<RailInspectionEquipmentItemDetail> itemDetails = new ArrayList<>();
int measurePoint = 1; int measurePoint = 0;
int sort = 1; int sort = 1;
for (int i = 2; i < 32; i++) { for (int i = 2; i < 32; i++) {
if (measurePoint % 8 == 0) { if (measurePoint == 8) {
measurePoint = 1;
i = i + 2;
continue;
} else {
measurePoint++; measurePoint++;
continue;
}
if (measurePoint == 9) {
measurePoint = 0;
startMileage = startMileage.add(avgMileage);
continue;
} }
measurePoint++;
RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail(); RailInspectionEquipmentItemDetail itemDetail = new RailInspectionEquipmentItemDetail();
itemDetail.setId(UUIDGenerator.generate()); itemDetail.setId(UUIDGenerator.generate());
itemDetail.setRailInspectionEquipmentId(record.getRailInspectionEquipmentId()); itemDetail.setRailInspectionEquipmentId(record.getRailInspectionEquipmentId());
itemDetail.setRailInspectionEquipmentItemId(record.getId()); itemDetail.setRailInspectionEquipmentItemId(record.getId());
// 检查项目 // 检查项目
itemDetail.setCheckItem(""); itemDetail.setCheckItem(checkItem + startMileage.add(avgMileage));
//轨距 //轨距
itemDetail.setTrackGauge(""); itemDetail.setTrackGauge("");
//水平 //水平
...@@ -235,12 +250,7 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp ...@@ -235,12 +250,7 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
itemDetail.setOther(""); itemDetail.setOther("");
// 测点 // 测点
itemDetail.setMeasurePoint(measurePoint - 1); itemDetail.setMeasurePoint(measurePoint);
if (measurePoint % 10 == 0) {
measurePoint = 1;
} else {
measurePoint++;
}
itemDetail.setInfoSort(sort++); itemDetail.setInfoSort(sort++);
itemDetails.add(itemDetail); itemDetails.add(itemDetail);
} }
......
package org.jeecg.modules.dynamicStaticAnalysis.mapper; package org.jeecg.modules.dynamicStaticAnalysis.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -19,5 +20,8 @@ public interface AnalysisAlgorithmMapper { ...@@ -19,5 +20,8 @@ public interface AnalysisAlgorithmMapper {
* @param lightRailId 线路id * @param lightRailId 线路id
* @param lineAliasId 线别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 @@ ...@@ -69,6 +69,14 @@
WHERE t1.line_alias_id = #{lineAliasId} WHERE t1.line_alias_id = #{lineAliasId}
AND t2.light_rail_id = #{lightRailId} AND t2.light_rail_id = #{lightRailId}
) t ) 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 ORDER BY t.startMileage
</select> </select>
</mapper> </mapper>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
t1.unit_device_code, t1.unit_device_code,
t1.unit_type, t1.unit_type,
t1.unit_type_name, t1.unit_type_name,
t1.unit_starting_mileage, t1.unit_start_mileage unit_starting_mileage,
t1.unit_center_mileage, t1.unit_center_mileage,
t1.unit_end_mileage, t1.unit_end_mileage,
t1.unit_score, t1.unit_score,
......
package org.jeecg.modules.dynamicStaticAnalysis.util; package org.jeecg.modules.dynamicStaticAnalysis.util;
import java.math.BigDecimal;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -30,4 +31,27 @@ public class StrUtil { ...@@ -30,4 +31,27 @@ public class StrUtil {
return speedLevel; 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 @@ ...@@ -99,12 +99,15 @@
WHERE t1.line_alias_id = #{dto.lineAliasId} WHERE t1.line_alias_id = #{dto.lineAliasId}
AND t2.light_rail_id = #{dto.lightRailId} AND t2.light_rail_id = #{dto.lightRailId}
) t ) t
<if test="dto.startMileage != null"> <where>
AND t.centerMileage >= #{dto.startMileage} <if test="dto.startMileage != null">
</if> AND t.centerMileage >= #{dto.startMileage}
<if test="dto.endMileage != null"> </if>
AND t.centerMileage <![CDATA[ <= ]]> #{dto.endMileage} <if test="dto.endMileage != null">
</if> AND t.centerMileage <![CDATA[ <= ]]> #{dto.endMileage}
</if>
</where>
ORDER BY t.startMileage ORDER BY t.startMileage
</select> </select>
</mapper> </mapper>
...@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice; import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMapper; 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.dto.*;
import org.jeecg.modules.maintenanceWork.entity.WorkBatch; import org.jeecg.modules.maintenanceWork.entity.WorkBatch;
import org.jeecg.modules.maintenanceWork.entity.WorkBatchDetail; import org.jeecg.modules.maintenanceWork.entity.WorkBatchDetail;
...@@ -39,6 +41,8 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -39,6 +41,8 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
@Resource @Resource
private AnalysisBatchUnitDeviceMapper analysisBatchUnitDeviceMapper; private AnalysisBatchUnitDeviceMapper analysisBatchUnitDeviceMapper;
@Resource
private AnalysisBatchUnitDeviceTransfiniteMapper transfiniteMapper;
@Override @Override
public Page<WorkBatchVO> listRecord(Page<WorkBatchVO> pageData, WorkBatchDTO dto) { public Page<WorkBatchVO> listRecord(Page<WorkBatchVO> pageData, WorkBatchDTO dto) {
...@@ -46,6 +50,10 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -46,6 +50,10 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
for (WorkBatchVO record : pageRecords.getRecords()) { for (WorkBatchVO record : pageRecords.getRecords()) {
List<WorkBatchDetailVO> detailList = workBatchDetailMapper.queryListByWorkBatchId(record.getId()); List<WorkBatchDetailVO> detailList = workBatchDetailMapper.queryListByWorkBatchId(record.getId());
// for (WorkBatchDetailVO workBatchDetailVO : detailList) {
// List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = transfiniteMapper.getTransfiniteList(record.getId());
// workBatchDetailVO.setTransfiniteList(transfiniteList);
// }
record.setDetailList(detailList); record.setDetailList(detailList);
} }
......
...@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -6,13 +6,16 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO;
/** /**
* <p> * <p>
...@@ -68,4 +71,8 @@ public class WorkBatchDetailVO { ...@@ -68,4 +71,8 @@ public class WorkBatchDetailVO {
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; 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