Commit 27ead316 authored by hkl's avatar hkl

feat:1.首页代码提交

parent 88028080
......@@ -7,6 +7,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.jeecg.modules.homePage.dto.DiseaseDTO;
import org.jeecg.modules.homePage.vo.DiseaseVO;
import org.jeecg.modules.homePage.vo.ToDoDetailVO;
......
......@@ -154,9 +154,9 @@
t2.transfinite_type diseaseTypeName,
t2.transfinite_grade overrunLevel,
t2.transfinite_grade_name,
t2.allow_value peakValue,
IFNULL(t2.allow_value,'') peakValue,
t2.measure_point_value longitude,
t2.measure_point_value - t2.allow_value dataDifference
t2.ek_type
FROM
(
SELECT
......@@ -184,7 +184,6 @@
t1.analysis_batch_id = #{analysisBatchCode}
) analysis
LEFT JOIN t_dsa_analysis_batch_unit_device_transfinite t2 ON t2.analysis_batch_unit_device_id = analysis.id
WHERE
1 = 1
AND analysis.unit_score_level = 3
......
......@@ -8,6 +8,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.jeecg.modules.homePage.dto.DiseaseDTO;
import org.jeecg.modules.homePage.vo.DiseaseVO;
import org.jeecg.modules.homePage.vo.ToDoDetailVO;
......@@ -42,6 +43,7 @@ public interface IAnalysisBatchService extends IService<AnalysisBatch> {
/**
* 病害列表
*
* @param analysisBatchCode
* @return
*/
......
......@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.dynamicStaticAnalysis.util.StrUtil;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.jeecg.modules.homePage.dto.DiseaseDTO;
import org.jeecg.modules.homePage.vo.DiseaseVO;
import org.jeecg.modules.homePage.vo.ToDoDetailVO;
import org.jeecg.modules.utils.BeanCopyUtil;
......
......@@ -5,22 +5,23 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Set;
@Data
@ApiModel(value = "DiseaseDTO对象", description = "首页-病害DTO")
public class DiseaseDTO {
@ApiModelProperty("超限类型")
private List<String> overType;
@ApiModelProperty("超限类型 1-人工检查数据 2-轨检仪检查数据")
private Set<Integer> overType;
@ApiModelProperty("轨检车超限")
private List<String> overCard;
@ApiModelProperty("轨检车超限 1-1级超限 2-2级超限 3-3级超限 4-4级超限")
private Set<Integer> overCard;
@ApiModelProperty("水加")
private List<String> h;
private Set<Integer> h;
@ApiModelProperty("垂加")
private List<String> v;
private Set<Integer> v;
}
package org.jeecg.modules.homePage.face.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.models.auth.In;
import org.jeecg.modules.checkData.service.IMovementRecordsMasterService;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchService;
......@@ -14,8 +17,10 @@ import org.jeecg.modules.subwayNetwork.vo.SectionStationNode;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class HomePageFaceImpl implements HomePageFace {
......@@ -69,6 +74,7 @@ public class HomePageFaceImpl implements HomePageFace {
.last("limit 1")
.one();
List<DiseaseVO> records = analysisBatchService.diseaseList(one.getId());
for (DiseaseVO record : records) {
record.setLineAliasId(one.getLineAliasId());
......@@ -78,31 +84,74 @@ public class HomePageFaceImpl implements HomePageFace {
record.setLineAliasCode("XDK");
}
}
//
// // 病害里程,取分
// List<DiseaseVO> records = new ArrayList<>();
//
// DiseaseVO vo = new DiseaseVO();
// vo.setId("1682308697792339970");
// vo.setLineAliasCode("SDK");
// vo.setMileage("21556");
// vo.setOverrunType("左轨向");
// vo.setOverrunLevel("1");
// vo.setLongitude("2");
// vo.setPeakValue("-10.44");
// vo.setDataDifference("-0.44");
// records.add(vo);
//
// DiseaseVO vo2 = new DiseaseVO();
// vo2.setId("1682308697792339970");
// vo2.setLineAliasCode("SDK");
// vo2.setMileage("21556");
// vo2.setOverrunType("左轨向");
// vo2.setOverrunLevel("1");
// vo2.setLongitude("2");
// vo2.setPeakValue("-10.44");
// vo2.setDataDifference("-0.44");
// records.add(vo2);
if (ObjectUtil.isNotEmpty(records)) {
records = conditionalFilter(records, dto);
}
// 单独处理管理数据差字段
for (DiseaseVO record : records) {
// 峰值是否全是数字
String dataDifference;
if (record.getPeakValue().matches("\\d+(\\.\\d+)?")) {
BigDecimal peakValue = Convert.toBigDecimal(record.getPeakValue());
BigDecimal longitude = Convert.toBigDecimal(record.getLongitude());
BigDecimal difference = peakValue.subtract(longitude);
dataDifference = difference.toString();
} else {
dataDifference = record.getLongitude();
}
record.setDataDifference(dataDifference);
}
return records;
}
/**
* 条件过滤
*
* @param records
* @param dto
*/
private List<DiseaseVO> conditionalFilter(List<DiseaseVO> records, DiseaseDTO dto) {
Set<Integer> overTypeSet = dto.getOverType();
overTypeSet.add(3);// 3-轨检车检查
overTypeSet.add(4);// 4-添乘仪检查
// 1. 过滤检查类型
if (ObjectUtil.isNotEmpty(records)) {
records = records.stream()
.filter(v -> overTypeSet.contains(v.getEkType()))
.collect(Collectors.toList());
}
// 轨检车超限
Set<Integer> overCardSet = dto.getOverCard();
// 2.过滤轨检车相关数据
if (ObjectUtil.isNotEmpty(records)) {
records = records.stream().filter(v -> v.getEkType() != 3 || overCardSet.contains(v.getOverrunLevel()))
.collect(Collectors.toList());
}
// 添乘仪-水平超限
Set<Integer> hSet = dto.getH();
if (ObjectUtil.isNotEmpty(records)) {
records = records.stream()
.filter(v -> v.getEkType() != 4 || (v.getDiseaseTypeName().equals("水平超限") && hSet.contains(v.getOverrunLevel())))
.collect(Collectors.toList());
}
// 添乘仪-垂直超限
Set<Integer> vSet = dto.getV();
if (ObjectUtil.isNotEmpty(records)) {
records = records.stream()
.filter(v -> v.getEkType() != 4 || (v.getDiseaseTypeName().equals("垂直超限") && vSet.contains(v.getOverrunLevel())))
.collect(Collectors.toList());
}
return records;
}
......
......@@ -23,9 +23,9 @@ public class DiseaseVO {
private String overrunType;
@ApiModelProperty("超限等级")
private String overrunLevel;
private Integer overrunLevel;
@ApiModelProperty("长度")
@ApiModelProperty("测点值")
private String longitude;
@ApiModelProperty("峰值")
......@@ -39,4 +39,7 @@ public class DiseaseVO {
@ApiModelProperty("病害类型名称")
private String diseaseTypeName;
@ApiModelProperty("检查类型 检查数据类型 1-人工静态检查 2-轨检仪静态检查 3-轨检车检查 4-添乘仪检查")
private Integer ekType;
}
......@@ -45,7 +45,8 @@
t.section_starting_mileage startMileage,
TRUNCATE((t.section_end_mileage + t.section_starting_mileage) / 2, 3) centerMileage,
t.section_end_mileage endMileage,
true isLeaf
true isLeaf,
0 isStation
FROM t_sn_subway_section t
LEFT JOIN t_sn_light_rail t2 ON t.light_rail_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t.line_alias_id = t3.id
......
......@@ -44,7 +44,8 @@
t1.starting_mileage startMileage,
t1.center_mileage centerMileage,
t1.end_mileage endMileage,
true isLeaf
true isLeaf,
1 isStation
FROM t_sn_train_station t1
LEFT JOIN t_sn_light_rail t3 on t1.light_rail_id = t3.id
LEFT JOIN t_sn_line_alias t4 ON t1.line_alias_id = t4.id
......
......@@ -41,6 +41,9 @@ public class SectionStationNode {
@ApiModelProperty(value = "是否是叶子节点")
private Boolean isLeaf;
@ApiModelProperty(value = "是否车站 1-是 0-否")
private Integer isStation = 0;
@ApiModelProperty(value = "孩子节点")
private List<SectionStationNode> children;
......
server:
port: 8080
port: 8081
tomcat:
max-swallow-size: -1
error:
......@@ -131,7 +131,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://47.94.207.62:3306/hzsomms?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
url: jdbc:mysql://47.94.207.62:3306/hzgw_test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username: root
password: superAdmin&321
driver-class-name: com.mysql.jdbc.Driver
......
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