Commit 6dcd6cf2 authored by wujipeng's avatar wujipeng
Browse files

道路详情-增加字段

parent 56d4351f
...@@ -51,4 +51,22 @@ public class BasicEntity { ...@@ -51,4 +51,22 @@ public class BasicEntity {
@TableField(value = "rel_id") @TableField(value = "rel_id")
private String relId; private String relId;
/**
* 管径
*/
@TableField(value = "pipe_diameter")
private Double pipeDiameter;
/**
* 管道类型
*/
@TableField(value = "pipe_type")
private String pipeType;
/**
* 文件名
*/
@TableField(value = "file_name")
private String fileName;
} }
package com.example.pipelinenetwork.pojo.vo; package com.example.pipelinenetwork.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.example.pipelinenetwork.pojo.entity.RoadEntity; import com.example.pipelinenetwork.pojo.entity.RoadEntity;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*; import lombok.*;
import java.util.List; import java.util.List;
import java.util.Set;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
...@@ -68,4 +70,20 @@ public class RoadVO extends RoadEntity { ...@@ -68,4 +70,20 @@ public class RoadVO extends RoadEntity {
*/ */
private List<RoadVO> data; private List<RoadVO> data;
/**
* 管径
*/
private Double pipeDiameter;
/**
* 管道类型
*/
private Set<String> pipeType;
/**
* 文件名
*/
private String fileName;
} }
\ No newline at end of file
...@@ -16,20 +16,16 @@ import com.example.pipelinenetwork.service.DefectService; ...@@ -16,20 +16,16 @@ import com.example.pipelinenetwork.service.DefectService;
import com.example.pipelinenetwork.service.RepairService; import com.example.pipelinenetwork.service.RepairService;
import com.example.pipelinenetwork.service.RoadService; import com.example.pipelinenetwork.service.RoadService;
import com.example.pipelinenetwork.util.LinestringUtil; import com.example.pipelinenetwork.util.LinestringUtil;
import com.example.pipelinenetwork.util.NumberUtils;
import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
@Service @Service
public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> implements RoadService { public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> implements RoadService {
...@@ -94,10 +90,19 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme ...@@ -94,10 +90,19 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
int structuralDefect = 0; int structuralDefect = 0;
//功能性缺陷 //功能性缺陷
int functionalDefect = 0; int functionalDefect = 0;
//管径
double pipeDiameter = 0;
//管道类型
Set<String> pipeType = new HashSet<>();
//文件名
String fileName = "";
//列表 //列表
List<RoadVO> data = new ArrayList<>(); List<RoadVO> data = new ArrayList<>();
//获取relId //获取relId
List<BasicEntity> list = basicService.list(new LambdaQueryWrapper<BasicEntity>().eq(BasicEntity::getRoadName, roadDTO.getRoadName())); List<BasicEntity> list = basicService.list(new LambdaQueryWrapper<BasicEntity>().eq(BasicEntity::getRoadName, roadDTO.getRoadName()));
if(!list.isEmpty()){
fileName = list.get(0).getFileName();
}
List<String> relIds = new ArrayList<>(); List<String> relIds = new ArrayList<>();
for (BasicEntity basicEntity : list) { for (BasicEntity basicEntity : list) {
relIds.add(basicEntity.getRelId()); relIds.add(basicEntity.getRelId());
...@@ -107,6 +112,12 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme ...@@ -107,6 +112,12 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
if (basicEntity.getDetectionLength() != null) { if (basicEntity.getDetectionLength() != null) {
length += basicEntity.getDetectionLength(); length += basicEntity.getDetectionLength();
} }
if (basicEntity.getPipeDiameter() != null) {
pipeDiameter += basicEntity.getPipeDiameter();
}
if (basicEntity.getPipeType() != null) {
pipeType.add(basicEntity.getPipeType());
}
} }
if (relIds.isEmpty()) { if (relIds.isEmpty()) {
return Result.success(result); return Result.success(result);
...@@ -150,6 +161,9 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme ...@@ -150,6 +161,9 @@ public class RoadServiceImpl extends ServiceImpl<RoadMapper, RoadEntity> impleme
result.setLength(length); result.setLength(length);
result.setStructuralDefect(structuralDefect); result.setStructuralDefect(structuralDefect);
result.setFunctionalDefect(functionalDefect); result.setFunctionalDefect(functionalDefect);
result.setPipeDiameter(pipeDiameter);
result.setPipeType(pipeType);
result.setFileName(fileName);
result.setData(data); result.setData(data);
return Result.success(result); return Result.success(result);
} }
......
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