Commit e87d9c9d authored by hkl's avatar hkl

feat: 1.车站bug提交

parent 6c121853
...@@ -588,6 +588,8 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -588,6 +588,8 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
if (measurePoint % 8 == 0) { if (measurePoint % 8 == 0) {
measurePoint = 1; measurePoint = 1;
trackCode = String.valueOf(Integer.valueOf(trackCode) + 1); trackCode = String.valueOf(Integer.valueOf(trackCode) + 1);
} else {
measurePoint++;
} }
movementCourseInfos.add(movementCourseInfo); movementCourseInfos.add(movementCourseInfo);
} }
...@@ -784,7 +786,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -784,7 +786,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "轨检车详情查询") @AutoLog(value = "轨检车详情查询")
@ApiOperation(value = "轨检车详情查询", notes = "轨检车详情查询") @ApiOperation(value = "轨检车详情查询", notes = "轨检车详情查询")
@GetMapping(value = "/getTrackInfo") @GetMapping(value = "/getTrackInfo")
public Result<Map<String, Object>> getTrackInfo(@ApiParam(name = "动静态几何尺寸数据id") String id, @ApiParam(name = "查询类型") String type,@ApiParam(name = "轨检车->超限查询子类型") String overType) { public Result<Map<String, Object>> getTrackInfo(@ApiParam(name = "动静态几何尺寸数据id") String id, @ApiParam(name = "查询类型") String type, @ApiParam(name = "轨检车->超限查询子类型") String overType) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if ("1".equals(type)) { if ("1".equals(type)) {
//轨检车-》轨道动态几何尺寸容许值差管理值 //轨检车-》轨道动态几何尺寸容许值差管理值
...@@ -907,11 +909,11 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -907,11 +909,11 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
//处理200m区段轨道不平顺质量指数TQI管理标准(单位:mm)解析封装逻辑 //处理200m区段轨道不平顺质量指数TQI管理标准(单位:mm)解析封装逻辑
int dataOne = this.uploadMovementTqiStandardManager(movementTqiStandardManagerList, i, sort, realname, rowRecords, id); int dataOne = this.uploadMovementTqiStandardManager(movementTqiStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne; i = i + dataOne;
}else if (str.equals("TQI公里状态评定标准")) { } else if (str.equals("TQI公里状态评定标准")) {
//处理TQI公里状态评定标准解析封装逻辑 //处理TQI公里状态评定标准解析封装逻辑
int dataOne = this.uploadMovementTqiKilometerStandardManager(movementTqiKilometerStandardManagerList, i, sort, realname, rowRecords, id); int dataOne = this.uploadMovementTqiKilometerStandardManager(movementTqiKilometerStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne; i = i + dataOne;
}else if (str.equals("四级缺陷记录报告表") || str.equals("三级缺陷记录报告表") || str.equals("二级缺陷记录报告表") || str.equals("一级缺陷记录报告表")) { } else if (str.equals("四级缺陷记录报告表") || str.equals("三级缺陷记录报告表") || str.equals("二级缺陷记录报告表") || str.equals("一级缺陷记录报告表")) {
//处理超限记录报告解析封装逻辑 //处理超限记录报告解析封装逻辑
int dataOne = this.uploadMovementOverReport(movementOverReportList, i, sort, realname, rowRecords, id); int dataOne = this.uploadMovementOverReport(movementOverReportList, i, sort, realname, rowRecords, id);
i = i + dataOne; i = i + dataOne;
...@@ -992,7 +994,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -992,7 +994,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
* @param id 主表id * @param id 主表id
*/ */
public int uploadMovementTqiKilometerStandardManager(List<MovementTqiKilometerStandardManager> movementTqiStandardManagerList, int i, int sort, String realname, List<List<Object>> rowRecords, String id) { public int uploadMovementTqiKilometerStandardManager(List<MovementTqiKilometerStandardManager> movementTqiStandardManagerList, int i, int sort, String realname, List<List<Object>> rowRecords, String id) {
String regEx ="[^0-9 .]"; String regEx = "[^0-9 .]";
Pattern p = Pattern.compile(regEx); Pattern p = Pattern.compile(regEx);
int dataOne = 0; int dataOne = 0;
for (int j = i + 2; j < rowRecords.size(); j++) { for (int j = i + 2; j < rowRecords.size(); j++) {
...@@ -1061,6 +1063,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -1061,6 +1063,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
} }
return dataOne; return dataOne;
} }
/** /**
* @param movementTqiStandardManagerList 最终的200m区段轨道不平顺质量指数TQI管理标准(单位:mm)集合 * @param movementTqiStandardManagerList 最终的200m区段轨道不平顺质量指数TQI管理标准(单位:mm)集合
* @param i 当前行坐标 * @param i 当前行坐标
...@@ -1070,7 +1073,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -1070,7 +1073,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
* @param id 主表id * @param id 主表id
*/ */
public int uploadMovementTqiStandardManager(List<MovementTqiStandardManager> movementTqiStandardManagerList, int i, int sort, String realname, List<List<Object>> rowRecords, String id) { public int uploadMovementTqiStandardManager(List<MovementTqiStandardManager> movementTqiStandardManagerList, int i, int sort, String realname, List<List<Object>> rowRecords, String id) {
String regEx ="[^0-9 .]"; String regEx = "[^0-9 .]";
Pattern p = Pattern.compile(regEx); Pattern p = Pattern.compile(regEx);
int dataOne = 0; int dataOne = 0;
for (int j = i + 3; j < rowRecords.size(); j++) { for (int j = i + 3; j < rowRecords.size(); j++) {
...@@ -1323,7 +1326,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -1323,7 +1326,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
gaugeChange = rowRecords.get(j).get(98).toString().trim(); gaugeChange = rowRecords.get(j).get(98).toString().trim();
if (ObjectUtil.isNotEmpty(gaugeChange)) { if (ObjectUtil.isNotEmpty(gaugeChange)) {
model.setGaugeChange(gaugeChange); model.setGaugeChange(gaugeChange);
}else{ } else {
model.setGaugeChange(""); model.setGaugeChange("");
} }
//曲率变化率 //曲率变化率
...@@ -1331,7 +1334,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -1331,7 +1334,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
curvatureChange = rowRecords.get(j).get(111).toString().trim(); curvatureChange = rowRecords.get(j).get(111).toString().trim();
if (ObjectUtil.isNotEmpty(curvatureChange)) { if (ObjectUtil.isNotEmpty(curvatureChange)) {
model.setCurvatureChange(curvatureChange); model.setCurvatureChange(curvatureChange);
}else{ } else {
model.setCurvatureChange(""); model.setCurvatureChange("");
} }
//扣分标准 //扣分标准
...@@ -1339,7 +1342,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -1339,7 +1342,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
deductStandard = rowRecords.get(j).get(122).toString().trim(); deductStandard = rowRecords.get(j).get(122).toString().trim();
if (ObjectUtil.isNotEmpty(deductStandard)) { if (ObjectUtil.isNotEmpty(deductStandard)) {
model.setDeductStandard(deductStandard); model.setDeductStandard(deductStandard);
}else{ } else {
model.setDeductStandard(""); model.setDeductStandard("");
} }
movementDiferenceManagerList.add(model); movementDiferenceManagerList.add(model);
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert; ...@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetail; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetail;
...@@ -33,6 +34,7 @@ import java.util.stream.Collectors; ...@@ -33,6 +34,7 @@ import java.util.stream.Collectors;
* 分析算法 * 分析算法
*/ */
@Service @Service
@Slf4j
public class AnalysisAlgorithm { public class AnalysisAlgorithm {
@Resource @Resource
private AnalysisAlgorithmMapper analysisAlgorithmMapper; private AnalysisAlgorithmMapper analysisAlgorithmMapper;
...@@ -62,6 +64,8 @@ public class AnalysisAlgorithm { ...@@ -62,6 +64,8 @@ public class AnalysisAlgorithm {
private IConfigRailDeviceCheckService configRailDeviceCheckService; private IConfigRailDeviceCheckService configRailDeviceCheckService;
@Resource @Resource
private IMovementOverReportService movementOverReportService; private IMovementOverReportService movementOverReportService;
@Resource
private IConfigGradeLimitService iConfigGradeLimitService;
public void analysis(String analysisBatchId) { public void analysis(String analysisBatchId) {
Map<String, Map<String, Object>> unitDeviceTable = new TreeMap<>(); Map<String, Map<String, Object>> unitDeviceTable = new TreeMap<>();
...@@ -125,7 +129,15 @@ public class AnalysisAlgorithm { ...@@ -125,7 +129,15 @@ public class AnalysisAlgorithm {
// 3.1 保存分析批次-单元设备 // 3.1 保存分析批次-单元设备
List<ConfigGradeLimit> configGradeLimitList = iConfigGradeLimitService.lambdaQuery()
.eq(ConfigGradeLimit::getSpeedMax, analysisBatch.getSpeedMax())
.eq(ConfigGradeLimit::getSpeedMin, analysisBatch.getSpeedMin())
.eq(ConfigGradeLimit::getDelFlag, '0')
.list();
List<AnalysisBatchUnitDevice> analysisBatchUnitDevices = new ArrayList<>(); List<AnalysisBatchUnitDevice> analysisBatchUnitDevices = new ArrayList<>();
List<AnalysisBatchUnitDeviceTransfinite> transfiniteList = new ArrayList<>();
List<AnalysisBatchUnitDevicePointScore> scoreList = new ArrayList<>();
for (Map.Entry<String, Map<String, Object>> entry : unitDeviceTable.entrySet()) { for (Map.Entry<String, Map<String, Object>> entry : unitDeviceTable.entrySet()) {
Map<String, Object> unitDevice = entry.getValue(); Map<String, Object> unitDevice = entry.getValue();
AnalysisBatchUnitDevice analysisBatchUnitDevice = new AnalysisBatchUnitDevice(); AnalysisBatchUnitDevice analysisBatchUnitDevice = new AnalysisBatchUnitDevice();
...@@ -140,54 +152,80 @@ public class AnalysisAlgorithm { ...@@ -140,54 +152,80 @@ public class AnalysisAlgorithm {
analysisBatchUnitDevice.setUnitStartMileage(Convert.toBigDecimal(unitDevice.get("startMileage"))); analysisBatchUnitDevice.setUnitStartMileage(Convert.toBigDecimal(unitDevice.get("startMileage")));
analysisBatchUnitDevice.setUnitCenterMileage(Convert.toBigDecimal(unitDevice.get("centerMileage"))); analysisBatchUnitDevice.setUnitCenterMileage(Convert.toBigDecimal(unitDevice.get("centerMileage")));
analysisBatchUnitDevice.setUnitEndMileage(Convert.toBigDecimal(unitDevice.get("endMileage"))); analysisBatchUnitDevice.setUnitEndMileage(Convert.toBigDecimal(unitDevice.get("endMileage")));
Object labourCheckData = unitDevice.get("labourCheck"); analysisBatchUnitDevices.add(analysisBatchUnitDevice);
if (ObjectUtil.isNotEmpty(labourCheckData)) {
analysisBatchUnitDevice.setLabourCheck(1);
} else {
analysisBatchUnitDevice.setLabourCheck(0);
}
// 计算总得分
BigDecimal unitScore = null;
// 人工检查得分
BigDecimal labourCheckScore = (BigDecimal) unitDevice.get("labourCheckScore"); BigDecimal labourCheckScore = (BigDecimal) unitDevice.get("labourCheckScore");
// -1代表未评分
if (labourCheckScore == null) { if (labourCheckScore == null) {
analysisBatchUnitDevice.setLabourCheck(0);
analysisBatchUnitDevice.setLabourCheckScore(new BigDecimal("-1")); analysisBatchUnitDevice.setLabourCheckScore(new BigDecimal("-1"));
} else { } else {
analysisBatchUnitDevice.setLabourCheck(1);
analysisBatchUnitDevice.setLabourCheckScore(labourCheckScore); analysisBatchUnitDevice.setLabourCheckScore(labourCheckScore);
unitScore = labourCheckScore;
// 先写死
analysisBatchUnitDevice.setUnitScore(labourCheckScore);
analysisBatchUnitDevice.setUnitScoreLevel(3);
analysisBatchUnitDevice.setUnitScoreLevelStr("失格");
} }
Object railDeviceData = unitDevice.get("railDevice"); // 轨检仪检查得分
if (ObjectUtil.isNotEmpty(railDeviceData)) { BigDecimal railDeviceCheckScore = (BigDecimal) unitDevice.get("railDeviceCheckScore");
if (null == railDeviceCheckScore) {
analysisBatchUnitDevice.setRailDeviceCheck(0);
analysisBatchUnitDevice.setAddDeviceCheckScore(new BigDecimal("-1"));
} else {
analysisBatchUnitDevice.setRailDeviceCheck(1); analysisBatchUnitDevice.setRailDeviceCheck(1);
analysisBatchUnitDevice.setAddDeviceCheckScore(railDeviceCheckScore);
if (unitScore == null) {
unitScore = railDeviceCheckScore;
} else { } else {
analysisBatchUnitDevice.setRailDeviceCheck(0); unitScore = unitScore.add(railDeviceCheckScore);
}
} }
analysisBatchUnitDevices.add(analysisBatchUnitDevice);
// 计算总分
Integer unitScoreLevel = null;
String unitScoreLevelStr = "结果为空";
if (unitScore != null) {
for (ConfigGradeLimit configGradeLimit : configGradeLimitList) {
// 匹配单元设备类型
if (analysisBatchUnitDevice.getUnitType() == configGradeLimit.getDeviceType()) {
// 匹配等级
if (configGradeLimit.getGradeMin().compareTo(unitScore) <= 0 && configGradeLimit.getGradeMax().compareTo(unitScore) > 0) {
unitScoreLevel = configGradeLimit.getGradeLevel();
unitScoreLevelStr = configGradeLimit.getGradeLevelStr();
break;
}
// 保存超限 }
Object transfiniteData = unitDevice.get("labourCheckTransfinite"); }
if (ObjectUtil.isNotEmpty(transfiniteData)) { } else {
AnalysisBatchUnitDeviceTransfinite transfinite = (AnalysisBatchUnitDeviceTransfinite) transfiniteData; unitScore = new BigDecimal("-1");
transfinite.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId()); unitScoreLevelStr = "暂无数据记录";
transfinite.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId()); unitScoreLevel = 4;
transfinite.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode()); }
transfinite.setUnitId(analysisBatchUnitDevice.getUnitId()); // -1代表未评分
transfinite.setUnitCode(analysisBatchUnitDevice.getUnitCode()); analysisBatchUnitDevice.setUnitScore(unitScore);
transfinite.setUnitType(analysisBatchUnitDevice.getUnitType()); analysisBatchUnitDevice.setUnitScoreLevel(unitScoreLevel);
transfinite.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName()); analysisBatchUnitDevice.setUnitScoreLevelStr(unitScoreLevelStr);
analysisBatchUnitDeviceTransfiniteService.save(transfinite);
}
// 保存人工检查数据超限
// 保存人工计算得分 AnalysisBatchUnitDeviceTransfinite labourCheckTransfinite = (AnalysisBatchUnitDeviceTransfinite) unitDevice.get("labourCheckTransfinite");
List<AnalysisBatchUnitDevicePointScore> scoreList = (List<AnalysisBatchUnitDevicePointScore>) unitDevice.get("labourCheckScoreList"); if (ObjectUtil.isNotEmpty(labourCheckTransfinite)) {
if (ObjectUtil.isNotEmpty(scoreList)) { labourCheckTransfinite.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId());
for (AnalysisBatchUnitDevicePointScore score : scoreList) { labourCheckTransfinite.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId());
labourCheckTransfinite.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode());
labourCheckTransfinite.setUnitId(analysisBatchUnitDevice.getUnitId());
labourCheckTransfinite.setUnitCode(analysisBatchUnitDevice.getUnitCode());
labourCheckTransfinite.setUnitType(analysisBatchUnitDevice.getUnitType());
labourCheckTransfinite.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
transfiniteList.add(labourCheckTransfinite);
}
// 保存人工检查数据计算得分
List<AnalysisBatchUnitDevicePointScore> labourCheckScoreList = (List<AnalysisBatchUnitDevicePointScore>) unitDevice.get("labourCheckScoreList");
if (ObjectUtil.isNotEmpty(labourCheckScoreList)) {
for (AnalysisBatchUnitDevicePointScore score : labourCheckScoreList) {
score.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId()); score.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId());
score.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId()); score.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId());
score.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode()); score.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode());
...@@ -196,16 +234,51 @@ public class AnalysisAlgorithm { ...@@ -196,16 +234,51 @@ public class AnalysisAlgorithm {
score.setUnitType(analysisBatchUnitDevice.getUnitType()); score.setUnitType(analysisBatchUnitDevice.getUnitType());
score.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName()); score.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
} }
analysisBatchUnitDevicePointScoreService.saveBatch(scoreList); scoreList.addAll(labourCheckScoreList);
}
// 保存轨检仪检查数据超限
AnalysisBatchUnitDeviceTransfinite railDeviceTransfinite = (AnalysisBatchUnitDeviceTransfinite) unitDevice.get("railDeviceTransfinite");
if (ObjectUtil.isNotEmpty(railDeviceTransfinite)) {
railDeviceTransfinite.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId());
railDeviceTransfinite.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId());
railDeviceTransfinite.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode());
railDeviceTransfinite.setUnitId(analysisBatchUnitDevice.getUnitId());
railDeviceTransfinite.setUnitCode(analysisBatchUnitDevice.getUnitCode());
railDeviceTransfinite.setUnitType(analysisBatchUnitDevice.getUnitType());
railDeviceTransfinite.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
transfiniteList.add(railDeviceTransfinite);
}
// 保存轨检仪检检查数据计算得分
List<AnalysisBatchUnitDevicePointScore> railDeviceCheckScoreList = (List<AnalysisBatchUnitDevicePointScore>) unitDevice.get("railDeviceCheckScoreList");
if (ObjectUtil.isNotEmpty(railDeviceCheckScoreList)) {
for (AnalysisBatchUnitDevicePointScore score : railDeviceCheckScoreList) {
score.setAnalysisBatchUnitDeviceId(analysisBatchUnitDevice.getId());
score.setAnalysisBatchId(analysisBatchUnitDevice.getAnalysisBatchId());
score.setAnalysisBatchCode(analysisBatchUnitDevice.getAnalysisBatchCode());
score.setUnitId(analysisBatchUnitDevice.getUnitId());
score.setUnitCode(analysisBatchUnitDevice.getUnitCode());
score.setUnitType(analysisBatchUnitDevice.getUnitType());
score.setUnitTypeName(analysisBatchUnitDevice.getUnitTypeName());
} }
scoreList.addAll(railDeviceCheckScoreList);
}
} }
analysisBatchUnitDeviceService.saveBatch(analysisBatchUnitDevices); analysisBatchUnitDeviceService.saveBatch(analysisBatchUnitDevices);
analysisBatchUnitDeviceTransfiniteService.saveBatch(transfiniteList);
analysisBatchUnitDevicePointScoreService.saveBatch(scoreList);
} }
// 分析完成 // 分析完成
analysisBatchService.lambdaUpdate().set(AnalysisBatch::getAnalysisStatus, 99) analysisBatchService.lambdaUpdate().set(AnalysisBatch::getAnalysisStatus, 99)
.eq(AnalysisBatch::getId, analysisBatchId) .eq(AnalysisBatch::getId, analysisBatchId)
.update(); .update();
log.info("[分析完成]|线程id:【" + Thread.currentThread().getId() + "】=============分析批次ID:【" + analysisBatchId + "】");
} }
/** /**
...@@ -323,7 +396,7 @@ public class AnalysisAlgorithm { ...@@ -323,7 +396,7 @@ public class AnalysisAlgorithm {
if (null == transfinite) { if (null == transfinite) {
transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo); transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo);
} else { } else {
unitDevice.put("labourCheckTransfinite", transfinite); unitDevice.put("railDeviceTransfinite", transfinite);
} }
} }
......
...@@ -3,8 +3,11 @@ package org.jeecg.modules.dynamicStaticAnalysis.entity; ...@@ -3,8 +3,11 @@ package org.jeecg.modules.dynamicStaticAnalysis.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
...@@ -62,17 +65,21 @@ public class ConfigGradeLimit implements Serializable { ...@@ -62,17 +65,21 @@ public class ConfigGradeLimit implements Serializable {
@TableField("dict_label") @TableField("dict_label")
private String dictLabel; private String dictLabel;
@ApiModelProperty("评价等级 1-优良 2-合格 3-失格 ") @ApiModelProperty("评价等级 1-优良 2-合格 3-失格")
@TableField("grade_level") @TableField("grade_level")
private Integer gradeLevel; private Integer gradeLevel;
@ApiModelProperty("评价等级中文说明")
@TableField("grade_level_str")
private String gradeLevelStr;
@ApiModelProperty("最小评分") @ApiModelProperty("最小评分")
@TableField("grade_min") @TableField("grade_min")
private Integer gradeMin; private BigDecimal gradeMin;
@ApiModelProperty("最大评分") @ApiModelProperty("最大评分")
@TableField("grade_max") @TableField("grade_max")
private Integer gradeMax; private BigDecimal gradeMax;
@ApiModelProperty("设备类型 1-钢轨 2-道岔 3-曲线 4-竖曲线") @ApiModelProperty("设备类型 1-钢轨 2-道岔 3-曲线 4-竖曲线")
@TableField("device_type") @TableField("device_type")
......
...@@ -47,8 +47,33 @@ ...@@ -47,8 +47,33 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="dto.gradeJudgeList!=null and dto.gradeJudgeList.size()>0">
AND analysis.unit_score_level in
<foreach collection="dto.gradeJudgeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.unitTypeList!=null and dto.unitTypeList.size()>0">
AND analysis.unit_type in
<foreach collection="dto.unitTypeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="dto.isTransfinite != null"> <if test="dto.isTransfinite != null">
AND analysis.is_transfinite = 1 AND analysis.is_transfinite = 1
</if> </if>
<if test="dto.unitStartingMileage != null">
AND analysis.unit_starting_mileage >= #{dto.unitStartingMileage }
</if>
<if test="dto.unitEndMileage != null">
AND analysis.unit_end_mileage <![CDATA[ <= ]]> #{dto.unitEndMileage}
</if>
<if test="dto.unitCode != null and dto.unitCode != ''">
AND analysis.unit_code like concat('%',#{dto.unitCode},'%')
</if>
<if test="dto.unitDeviceCode != null and dto.unitDeviceCode != ''">
AND analysis.unit_device_code like concat('%',#{dto.unitDeviceCode},'%')
</if>
order by unit_starting_mileage
</select> </select>
</mapper> </mapper>
...@@ -2,14 +2,14 @@ package org.jeecg.modules.dynamicStaticAnalysis.service.impl; ...@@ -2,14 +2,14 @@ package org.jeecg.modules.dynamicStaticAnalysis.service.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.constant.DictConstant; import org.jeecg.modules.constant.DictConstant;
import org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigGradeLimit; import org.jeecg.modules.dynamicStaticAnalysis.entity.ConfigGradeLimit;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.ConfigGradeLimitMapper; import org.jeecg.modules.dynamicStaticAnalysis.mapper.ConfigGradeLimitMapper;
import org.jeecg.modules.dynamicStaticAnalysis.service.IConfigGradeLimitService; import org.jeecg.modules.dynamicStaticAnalysis.service.IConfigGradeLimitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.dynamicStaticAnalysis.util.StrUtil;
import org.jeecg.modules.system.entity.SysDict; import org.jeecg.modules.system.entity.SysDict;
import org.jeecg.modules.system.entity.SysDictItem; import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.mapper.SysDictItemMapper; import org.jeecg.modules.system.mapper.SysDictItemMapper;
...@@ -17,6 +17,7 @@ import org.jeecg.modules.system.mapper.SysDictMapper; ...@@ -17,6 +17,7 @@ import org.jeecg.modules.system.mapper.SysDictMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -73,15 +74,20 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap ...@@ -73,15 +74,20 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap
List<Integer> deviceTypeList = IntStream.range(1, 5).boxed().collect(Collectors.toList()); List<Integer> deviceTypeList = IntStream.range(1, 5).boxed().collect(Collectors.toList());
for (Integer deviceType : deviceTypeList) { for (Integer deviceType : deviceTypeList) {
for (SysDictItem sysDictItem : sysDictItems) { for (SysDictItem sysDictItem : sysDictItems) {
Integer[] speedLevels = StrUtil.getSpeedLevel(sysDictItem.getItemText());
// 优良 // 优良
ConfigGradeLimit a = new ConfigGradeLimit(); ConfigGradeLimit a = new ConfigGradeLimit();
a.setId(UUIDGenerator.generate()); a.setId(UUIDGenerator.generate());
a.setDictLabel(sysDictItem.getItemText()); a.setDictLabel(sysDictItem.getItemText());
a.setDictValue(sysDictItem.getItemValue()); a.setDictValue(sysDictItem.getItemValue());
a.setSpeedMin(speedLevels[0]);
a.setSpeedMax(speedLevels[1]);
a.setDeviceType(deviceType); a.setDeviceType(deviceType);
a.setGradeLevel(1); //1-优良 a.setGradeLevel(1); //1-优良
a.setGradeMin(0); a.setGradeLevelStr("优良");
a.setGradeMax(100); a.setGradeMin(new BigDecimal("0"));
a.setGradeMax(new BigDecimal("15"));
result.add(a); result.add(a);
// 合格 // 合格
...@@ -89,10 +95,13 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap ...@@ -89,10 +95,13 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap
b.setId(UUIDGenerator.generate()); b.setId(UUIDGenerator.generate());
b.setDictLabel(sysDictItem.getItemText()); b.setDictLabel(sysDictItem.getItemText());
b.setDictValue(sysDictItem.getItemValue()); b.setDictValue(sysDictItem.getItemValue());
b.setSpeedMin(speedLevels[0]);
b.setSpeedMax(speedLevels[1]);
b.setDeviceType(deviceType); b.setDeviceType(deviceType);
b.setGradeLevel(2); //2-合格 b.setGradeLevel(2); //2-合格
b.setGradeMin(100); b.setGradeLevelStr("合格");
b.setGradeMax(200); b.setGradeMin(new BigDecimal("15"));
b.setGradeMax(new BigDecimal("20"));
result.add(b); result.add(b);
// 失格 // 失格
...@@ -100,10 +109,13 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap ...@@ -100,10 +109,13 @@ public class ConfigGradeLimitServiceImpl extends ServiceImpl<ConfigGradeLimitMap
c.setId(UUIDGenerator.generate()); c.setId(UUIDGenerator.generate());
c.setDictLabel(sysDictItem.getItemText()); c.setDictLabel(sysDictItem.getItemText());
c.setDictValue(sysDictItem.getItemValue()); c.setDictValue(sysDictItem.getItemValue());
c.setSpeedMin(speedLevels[0]);
c.setSpeedMax(speedLevels[1]);
c.setDeviceType(deviceType); c.setDeviceType(deviceType);
c.setGradeLevel(3); //3-失格 c.setGradeLevel(3); //3-失格
c.setGradeMin(200); c.setGradeLevelStr("失格");
c.setGradeMax(99999); c.setGradeMin(new BigDecimal("20"));
c.setGradeMax(new BigDecimal("99999"));
result.add(c); result.add(c);
} }
......
...@@ -21,4 +21,8 @@ public class TrainStationQueryDTO { ...@@ -21,4 +21,8 @@ public class TrainStationQueryDTO {
@ApiModelProperty(value = "线别id") @ApiModelProperty(value = "线别id")
private String lineAliasId; private String lineAliasId;
@ApiModelProperty(value = "线路Id")
private String railLine;
} }
...@@ -22,15 +22,16 @@ ...@@ -22,15 +22,16 @@
t1.remark t1.remark
FROM t_sn_train_station t1 FROM t_sn_train_station t1
LEFT JOIN t_sn_light_rail t2 ON t1.light_rail_id = t2.id LEFT JOIN t_sn_light_rail t2 ON t1.light_rail_id = t2.id
<where> WHERE t2.status = 1
<if test="query.stationName !=null and query.stationName!=''"> <if test="query.stationName !=null and query.stationName!=''">
AND t1.station_name like concat('%',#{query.stationName},'%') AND t1.station_name like concat('%',#{query.stationName},'%')
</if> </if>
<if test="query.lineAliasId !=null and query.lineAliasId!=''"> <if test="query.lineAliasId !=null and query.lineAliasId!=''">
AND t1.line_alias_id = #{query.lineAliasId} AND t1.line_alias_id = #{query.lineAliasId}
</if> </if>
AND t2.status = 1 <if test="query.railLine !=null and query.railLine!=''">
</where> AND t1.light_rail_id = #{query.railLine}
</if>
</select> </select>
<select id="getTreeTrainStationList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode"> <select id="getTreeTrainStationList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
SELECT SELECT
......
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