Commit 14ccfb80 authored by hkl's avatar hkl

feat:1.统计分析-钢轨伤损数量统计

parent 15347069
......@@ -6,6 +6,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.statisticAnalysis.service.StatisticAnalysisService;
import org.jeecg.modules.statisticAnalysis.vo.DynamicGeometryVO;
import org.jeecg.modules.statisticAnalysis.vo.RailWearVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -31,4 +32,14 @@ public class StatisticAnalysisController {
return Result.OK(voList);
}
@AutoLog(value = "统计分析-钢轨伤损数量统计")
@ApiOperation(value = "统计分析-钢轨伤损数量统计", notes = "统计分析-钢轨伤损数量统计")
@GetMapping(value = "/railWear")
public Result<List<RailWearVO>> railWear(String startMonth, String endMonth) {
List<RailWearVO> voList = statisticAnalysisService.railWear(startMonth, endMonth);
return Result.OK(voList);
}
}
package org.jeecg.modules.statisticAnalysis.mapper;
import org.jeecg.modules.statisticAnalysis.vo.RailWearVO;
import java.util.List;
import java.util.Map;
......@@ -17,4 +19,15 @@ public interface StatisticAnalysisMapper {
* checkNum = 当月检查次数
*/
List<Map<String, Object>> getDynamicGeometry(String year);
/**
* @param startMonth
* @param endMonth
* @return map
* lightRailName = 线路名称
* damageType = 伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)
* damageDegree = 伤损程度(1-轻伤,2-轻伤有发展,3-重伤)
* checkNum = 检查次数
*/
List<RailWearVO> getRailWear(String startMonth, String endMonth);
}
......@@ -26,4 +26,15 @@
t.check_month
ORDER BY t.check_month ASC
</select>
<select id="getRailWear" resultType="org.jeecg.modules.statisticAnalysis.vo.RailWearVO">
SELECT t1.damage_type AS damageType,
t1.damage_degree AS damageDegree,
t2.light_rail_name AS lightRailName,
COUNT(1) AS checkNum
FROM t_ek_rail_wear_record t1
INNER JOIN t_ek_records_master_check t2 ON t1.records_master_check_id = t2.id
GROUP BY t2.light_rail_name,
t1.damage_type,
t1.damage_degree
</select>
</mapper>
package org.jeecg.modules.statisticAnalysis.service;
import org.jeecg.modules.statisticAnalysis.vo.DynamicGeometryVO;
import org.jeecg.modules.statisticAnalysis.vo.RailWearVO;
import java.util.List;
......@@ -12,4 +13,11 @@ public interface StatisticAnalysisService {
* @return
*/
List<DynamicGeometryVO> dynamicGeometry(String year);
/**
* 统计分析-钢轨伤损数量统计
*
* @return
*/
List<RailWearVO> railWear(String startMonth, String endMonth);
}
package org.jeecg.modules.statisticAnalysis.service.impl;
import cn.hutool.core.convert.Convert;
import io.swagger.annotations.ApiModelProperty;
import org.jeecg.modules.statisticAnalysis.mapper.StatisticAnalysisMapper;
import org.jeecg.modules.statisticAnalysis.service.StatisticAnalysisService;
import org.jeecg.modules.statisticAnalysis.vo.DynamicGeometryVO;
import org.jeecg.modules.statisticAnalysis.vo.RailWearVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -69,4 +69,72 @@ public class StatisticAnalysisServiceImpl implements StatisticAnalysisService {
return volist;
}
@Override
public List<RailWearVO> railWear(String startMonth, String endMonth) {
List<RailWearVO> records = statisticAnalysisMapper.getRailWear(startMonth, endMonth);
for (RailWearVO record : records) {
String label = getDamageTypeName(record.getDamageType()) + "-" + getDamageDegree(record.getDamageDegree());
record.setLabel(label);
}
return records;
}
/**
* 伤损程度(1-轻伤,2-轻伤有发展,3-重伤)
*/
public static String getDamageDegree(Integer damageDegree) {
String resultStr = "";
switch (damageDegree) {
case 1:
resultStr = "轻伤";
break;
case 2:
resultStr = "轻伤有发展";
break;
case 3:
resultStr = "重伤";
break;
default:
resultStr = "其他";
}
return resultStr;
}
/**
* 伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)
*
* @param damageType
* @return
*/
public static String getDamageTypeName(Integer damageType) {
String resultStr = "";
switch (damageType) {
case 1:
resultStr = "鱼鳞纹";
break;
case 2:
resultStr = "剥落掉块";
break;
case 3:
resultStr = "表面疲劳裂纹";
break;
case 4:
resultStr = "轨底掉块";
break;
case 5:
resultStr = "灼伤";
break;
case 6:
resultStr = "核伤";
break;
case 7:
resultStr = "焊缝";
break;
default:
resultStr = "其他";
}
return resultStr;
}
}
......@@ -17,9 +17,6 @@ public class DynamicGeometryVO {
@ApiModelProperty("检查数据12月个数据")
private List<CheckData> checkDataList;
@ApiModelProperty("检查数据列表")
private BigDecimal[] deductAveSumArray;
@Data
@ApiModel(value = "DynamicGeometryVO$CheckData对象", description = "统计分析-线网动态几何尺寸扣分走势图-检查数据")
public static class CheckData {
......
package org.jeecg.modules.statisticAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ApiModel(value = "RailWearVO对象", description = "统计分析-钢轨探伤记录")
public class RailWearVO {
@ApiModelProperty("线路名称")
private String lightRailName;
@ApiModelProperty("伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)")
private Integer damageType;
@ApiModelProperty("伤损程度(1-轻伤,2-轻伤有发展,3-重伤)")
private Integer damageDegree;
@ApiModelProperty("检查次数")
private Integer checkNum;
@ApiModelProperty("标签")
private String label;
}
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