|
|
|
|
@ -58,6 +58,39 @@ public class HighDangerController { |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.currentdir}") |
|
|
|
|
private String CURRENT_DIR; // 文件存放的目录
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
新增隐患排查(测试用) |
|
|
|
|
*/ |
|
|
|
|
@Transactional |
|
|
|
|
@GetMapping("/insertDangerTest") |
|
|
|
|
public ServerResponse<?> insertDanger(@RequestParam String name){ |
|
|
|
|
|
|
|
|
|
HighDangerBase highDangerBase = new HighDangerBase(); |
|
|
|
|
HighDangerRoad highDangerRoad = new HighDangerRoad(); |
|
|
|
|
|
|
|
|
|
UUID uuid = UUID.fromString(UUID.randomUUID().toString()); |
|
|
|
|
String nid = uuid.toString().replaceAll("-", ""); |
|
|
|
|
String businessId = "ZZ" + highDangerService.random12(); |
|
|
|
|
|
|
|
|
|
// base主键
|
|
|
|
|
highDangerBase.setNid(nid); |
|
|
|
|
// 隐患id
|
|
|
|
|
highDangerBase.setBusinessId(businessId); |
|
|
|
|
// 隐患名称
|
|
|
|
|
highDangerBase.setName(name); |
|
|
|
|
|
|
|
|
|
// 道路NID
|
|
|
|
|
highDangerRoad.setNid(nid); |
|
|
|
|
// 隐患主键
|
|
|
|
|
highDangerRoad.setBusinessId(businessId); |
|
|
|
|
|
|
|
|
|
// 分别插入两张表
|
|
|
|
|
highDangerService.insertDanger(highDangerBase); |
|
|
|
|
highDangerService.insertDangerRoad(highDangerRoad); |
|
|
|
|
return ServerResponse.ok(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
查询各个状态的数据情况 |
|
|
|
|
*/ |
|
|
|
|
@ -416,12 +449,14 @@ public class HighDangerController { |
|
|
|
|
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId); |
|
|
|
|
roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid()); |
|
|
|
|
|
|
|
|
|
if (roadInfo.getCoordinate() == null) { |
|
|
|
|
return ServerResponse.ok("无对应路口信息", null); |
|
|
|
|
SectionVO sectionByCode = highDangerMapper.getSectionByCode(roadInfo.getSectionCode()); |
|
|
|
|
|
|
|
|
|
if (sectionByCode.getPosition() == null) { |
|
|
|
|
return ServerResponse.ok("路段点位为空", null); |
|
|
|
|
} |
|
|
|
|
LinkedList<Map<String, Double>> coordinateMapTemporary = new LinkedList<>(); |
|
|
|
|
|
|
|
|
|
String[] split = roadInfo.getCoordinate().split(","); |
|
|
|
|
String[] split = sectionByCode.getPosition().split(","); |
|
|
|
|
for (int i = 0; i < split.length; i += 2) { |
|
|
|
|
//CoordinateConverter coordinateConverter = new CoordinateConverter();
|
|
|
|
|
Map<String, Double> pointMap = new LinkedHashMap<>(); |
|
|
|
|
@ -441,6 +476,7 @@ public class HighDangerController { |
|
|
|
|
pointMap.put("latitude", aMap.getLatitude()); |
|
|
|
|
coordinateMapTemporary.add(pointMap); |
|
|
|
|
} |
|
|
|
|
roadInfo.setAddress(sectionByCode.getSectionName()); |
|
|
|
|
roadInfo.setCoordinateList(coordinateMapTemporary); |
|
|
|
|
|
|
|
|
|
Date nowDate = new Date(); |
|
|
|
|
@ -603,11 +639,12 @@ public class HighDangerController { |
|
|
|
|
public ServerResponse<?> getSectionInfo(@RequestParam String businessId, HttpServletRequest request) { |
|
|
|
|
log.info("/getSectionInfo(获取基础数据(第一页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId); |
|
|
|
|
|
|
|
|
|
ThtSectionInfoDTO sectionInfo = highDangerMapper.getSectionInfo(businessId); |
|
|
|
|
List<ThtSectionInfoDTO> sectionInfo = highDangerMapper.getSectionInfo(businessId); |
|
|
|
|
ThtSectionInfoDTO thtSectionInfoDTO = sectionInfo.get(0); |
|
|
|
|
|
|
|
|
|
log.info("/getSectionInfo(获取基础数据(第一页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionInfo); |
|
|
|
|
if (sectionInfo != null) { |
|
|
|
|
return ServerResponse.ok(sectionInfo); |
|
|
|
|
return ServerResponse.ok(thtSectionInfoDTO); |
|
|
|
|
} else { |
|
|
|
|
return ServerResponse.ok("无基本信息内容", null); |
|
|
|
|
} |
|
|
|
|
@ -738,7 +775,8 @@ public class HighDangerController { |
|
|
|
|
// 保存轄區和街道
|
|
|
|
|
highDangerMapper.updateSectionCommunity(manualInvestigation.getBusinessId(),manualInvestigation.getXqcode(),manualInvestigation.getJdcode()); |
|
|
|
|
|
|
|
|
|
ThtSectionInfoDTO sectionInfo = highDangerMapper.getSectionInfo(manualInvestigation.getBusinessId()); |
|
|
|
|
List<ThtSectionInfoDTO> sectionInfos = highDangerMapper.getSectionInfo(manualInvestigation.getBusinessId()); |
|
|
|
|
ThtSectionInfoDTO sectionInfo = sectionInfos.get(0); |
|
|
|
|
if (sectionInfo != null) { |
|
|
|
|
// 更新基础数据(步骤1)
|
|
|
|
|
highDangerMapper.updateSectionInfo(manualInvestigation); |
|
|
|
|
@ -896,6 +934,15 @@ public class HighDangerController { |
|
|
|
|
return ServerResponse.ok("状态修改成功,状态为:" + pcType, pcType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@GetMapping("/getRoadTypes") |
|
|
|
|
public ServerResponse<?> getRoadType(){ |
|
|
|
|
|
|
|
|
|
List<EnumRoadType> roadTypes = highDangerService.getRoadTypes(); |
|
|
|
|
return ServerResponse.ok(roadTypes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 图片上传接口
|
|
|
|
|
/*@PostMapping("/uploadImage") |
|
|
|
|
public ServerResponse<?> uploadImage(@RequestBody MultipartFile multipartFile) throws IOException { |
|
|
|
|
|