新增排查内容修改

master
Zangzhipeng 1 year ago
parent 20fe694cb2
commit c7019936c8
  1. 7
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/ConfigController.java
  2. 225
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/HighDangerController.java
  3. 2
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/mapper/ConfigMapper.java
  4. 15
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/mapper/HighDangerMapper.java
  5. 12
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/HighDangerService.java
  6. 2
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/IConfigService.java
  7. 6
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/impl/ConfigServiceImpl.java
  8. 9
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/service/impl/HighDangerBaseServiceImpl.java
  9. 16
      hiatmp-hidden-danger-server/src/main/resources/application.yml
  10. 20
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/ConfigMapper.xml
  11. 22
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/HighDangerMapper.xml
  12. 15
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/DTO/HiddenDangerVO.java
  13. 4
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/DTO/SectionDTO.java
  14. 37
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ManualInvestigation.java
  15. 2
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtSectionInfoDTO.java
  16. 22
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/VO/BasicInfoVO.java
  17. 9
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/VO/CrossingVO.java
  18. 20
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/VO/SectionVO.java
  19. 5
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/dmr/LineInfo.java
  20. BIN
      hiatmp-model/target/classes/com/hisense/hiatmp/model/common/Operator.class
  21. BIN
      hiatmp-model/target/classes/com/hisense/hiatmp/model/dmr/LineInfo.class

@ -64,11 +64,12 @@ public class ConfigController extends HiatmpController {
基础信息预留展示接口
*/
@GetMapping("/getDangerBaseData")
public ServerResponse<?> getBaseData(@RequestParam String sectionCode,
@RequestParam String businessId){
public ServerResponse<?> getBaseData(@RequestParam(defaultValue = "") String sectionCode,
@RequestParam(defaultValue = "") String crossingCode,
@RequestParam(defaultValue = "") String businessId){
log.info("/getDangerBaseData(排查第一页默认数据回显)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),sectionCode);
// 查询默认数据
LineInfo dangerBaseData = configService.getDangerBaseData(sectionCode,businessId);
List<LineInfo> dangerBaseData = configService.getDangerBaseData(sectionCode,crossingCode,businessId);
/*List<EnumRoadType> roadTypes = highDangerMapper.getRoadTypes();
if(dangerBaseData.getSectionType() != null){

@ -3,10 +3,13 @@ package com.hisense.hiatmp.server_api.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hisense.hiatmp.model.common.*;
import com.hisense.hiatmp.model.common.DTO.HiddenDangerVO;
import com.hisense.hiatmp.model.common.DTO.SectionDTO;
import com.hisense.hiatmp.model.common.VO.BasicInfoVO;
import com.hisense.hiatmp.model.common.VO.SectionVO;
import com.hisense.hiatmp.server_api.mapper.ConfigureMapper;
import com.hisense.hiatmp.server_api.mapper.HighDangerMapper;
import com.hisense.hiatmp.server_api.mapper.OperatorMapper;
import com.hisense.hiatmp.model.common.DangerProblem;
import com.hisense.hiatmp.server_api.model.StreetCommunity;
import com.hisense.hiatmp.server_api.service.HighDangerService;
import com.hisense.hiatmp.model.dmr.Point;
@ -14,7 +17,6 @@ import com.hisense.hiatmp.server_api.service.ThtApproveService;
import com.hisense.hiatmp.server_api.service.ThtAttachsService;
import com.hisense.hiatmp.server_api.utils.CoordinateConverter;
import com.hisense.hiatmp.server_api.utils.CoordinateUtils;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -22,15 +24,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.Duration;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Slf4j
@RestController
@ -72,8 +69,8 @@ public class HighDangerController {
新增隐患排查测试用
*/
@Transactional
@GetMapping("/insertDangerTest")
public ServerResponse<?> insertDanger(@RequestParam String name) {
@PostMapping("/insertHiddenDanger")
public ServerResponse<?> insertDanger(@RequestBody HiddenDangerVO hiddenDangerVO) {
HighDangerBase highDangerBase = new HighDangerBase();
HighDangerRoad highDangerRoad = new HighDangerRoad();
@ -87,7 +84,7 @@ public class HighDangerController {
// 隐患id
highDangerBase.setBusinessId(businessId);
// 隐患名称
highDangerBase.setName(name);
highDangerBase.setName(hiddenDangerVO.getName());
// 操作用户
highDangerBase.setOperator("admin1");
@ -457,7 +454,6 @@ public class HighDangerController {
@RequestParam(defaultValue = "10") Long pageSize,
HttpServletRequest request
) {
log.info("/getNearRoadInfo(获取最近道路)接口被调用,调用ip: {}, 入参:{},{},{}", request.getRemoteAddr(), point, pageNum, pageSize);
//获取三公里内的坐标
double[] rectangle = CoordinateUtils.getRectangleCoordinates(point.getY(), point.getX(), 3);
@ -465,17 +461,17 @@ public class HighDangerController {
// DecimalFormat df = new DecimalFormat("#.##");
// 获取全部路段数据
BigDecimal d = new BigDecimal(point.getX()).setScale(1, BigDecimal.ROUND_DOWN);
SectionVO sectionVO = new SectionVO();
sectionVO.setPosition(String.valueOf(d));
sectionVO.setSearch(point.getSearch());
List<SectionVO> allRoadInfo = highDangerMapper.getAllSection(sectionVO);
SectionDTO sectionDTO = new SectionDTO();
sectionDTO.setPosition(String.valueOf(d));
sectionDTO.setSearch(point.getSearch());
List<SectionDTO> allRoadInfo = highDangerMapper.getAllSection(sectionDTO);
// List<SectionVO> allRoadInfo = highDangerMapper.getAllSection(sectionVO);
List<HashMap<String, Object>> combinedMap = new LinkedList<>();
HashMap<String, Object> hashMap = new HashMap<>();
Point Dpoint = new Point();
// 遍历所有路段
for (SectionVO dto : allRoadInfo) {
for (SectionDTO dto : allRoadInfo) {
HashMap<String, Object> pointMapSection = new HashMap<>();
// Map<String,Object> map = new HashMap<>();
@ -624,6 +620,17 @@ public class HighDangerController {
return ServerResponse.ok(combinedMap);
}
/*
根据路口查询上下游路段信息
*/
@GetMapping("/getSectionByCrossing")
public ServerResponse<?> getSectionByCrossing(@RequestParam String crossingCode){
List<SectionVO> sectionByCrossing = highDangerService.getSectionByCrossing(crossingCode);
return ServerResponse.ok(sectionByCrossing);
}
// 查询当前排查所在路段
@GetMapping("/getDangerRoad")
public ServerResponse<?> getDangerRoad(@RequestParam String businessId, HttpServletRequest request) {
@ -633,7 +640,7 @@ public class HighDangerController {
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId);
roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid());
SectionVO sectionByCode = highDangerMapper.getSectionByCode(roadInfo.getSectionCode());
SectionDTO sectionByCode = highDangerMapper.getSectionByCode(roadInfo.getSectionCode());
if (sectionByCode.getPosition() == null) {
return ServerResponse.ok("路段点位为空", null);
@ -663,32 +670,32 @@ public class HighDangerController {
roadInfo.setAddress(sectionByCode.getSectionName());
roadInfo.setCoordinateList(coordinateMapTemporary);
Date nowDate = new Date();
Date pcEndTime = roadInfo.getPcEndTime();
if (pcEndTime != null) {
long diff = nowDate.getTime() - pcEndTime.getTime();
// 时间差
long diffDays = diff / (24 * 60 * 60 * 1000);
diffDays = Math.abs(diffDays);
int comparison = nowDate.compareTo(pcEndTime);
if (comparison < 0) { // 超期
roadInfo.setDeadline(diffDays);
roadInfo.setDeadlineStatus("超期" + diffDays + "天");
roadInfo.setDeadlineType("1");
} else if (comparison > 0 && diffDays <= 3) { // 临期
roadInfo.setDeadline(diffDays);
roadInfo.setDeadlineStatus("临期" + diffDays + "天");
roadInfo.setDeadlineType("2");
} else { // 正常
roadInfo.setDeadline(diffDays);
roadInfo.setDeadlineStatus("正常");
roadInfo.setDeadlineType("3");
}
} else {
roadInfo.setDeadlineStatus("无排查结束时间");
roadInfo.setDeadlineType("3");
}
// Date nowDate = new Date();
// Date pcEndTime = roadInfo.getPcEndTime();
// if (pcEndTime != null) {
// long diff = nowDate.getTime() - pcEndTime.getTime();
// // 时间差
// long diffDays = diff / (24 * 60 * 60 * 1000);
// diffDays = Math.abs(diffDays);
//
// int comparison = nowDate.compareTo(pcEndTime);
// if (comparison < 0) { // 超期
// roadInfo.setDeadline(diffDays);
// roadInfo.setDeadlineStatus("超期" + diffDays + "天");
// roadInfo.setDeadlineType("1");
// } else if (comparison > 0 && diffDays <= 3) { // 临期
// roadInfo.setDeadline(diffDays);
// roadInfo.setDeadlineStatus("临期" + diffDays + "天");
// roadInfo.setDeadlineType("2");
// } else { // 正常
// roadInfo.setDeadline(diffDays);
// roadInfo.setDeadlineStatus("正常");
// roadInfo.setDeadlineType("3");
// }
// } else {
// roadInfo.setDeadlineStatus("无排查结束时间");
// roadInfo.setDeadlineType("3");
// }
log.info("/getDangerRoad(查询当前排查所在路段)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), roadInfo);
@ -823,36 +830,33 @@ public class HighDangerController {
public ServerResponse<?> getSectionInfo(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getSectionInfo(获取基础数据(第一页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
ThtSectionInfoDTO thtSectionInfoDTO;
// 用户数据查询,如果没有该用户数据则新增
List<ThtSectionInfoDTO> sectionInfo = highDangerMapper.getSectionInfo(businessId);
// 用户数据查询是否为空
if (sectionInfo.isEmpty()) {
ManualInvestigation manualInvestigation = new ManualInvestigation();
manualInvestigation.setBusinessId(businessId);
highDangerMapper.insertSectionInfo(manualInvestigation);
List<ThtSectionInfoDTO> section = highDangerMapper.getSectionInfo(businessId);
thtSectionInfoDTO = section.get(0);
} else {
thtSectionInfoDTO = sectionInfo.get(0);
}
// 是否该排查有绑定的辖区街道信息,有则展示
List<StreetCommunity> communityByRoad = highDangerMapper.getCommunityByRoad(businessId);
if (communityByRoad == null || communityByRoad.isEmpty()) {
log.info("/getSectionInfo(获取基础数据(第一页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionInfo);
return ServerResponse.ok(thtSectionInfoDTO);
// if (sectionInfo.isEmpty()) {
// ManualInvestigation manualInvestigation = new ManualInvestigation();
// manualInvestigation.setBusinessId(businessId);
// highDangerMapper.insertSectionInfo(manualInvestigation);
// List<ThtSectionInfoDTO> section = highDangerMapper.getSectionInfo(businessId);
// thtSectionInfoDTO = section.get(0);
// } else {
for(ThtSectionInfoDTO sectionInfoDTO : sectionInfo){
// thtSectionInfoDTO = sectionInfo.get(0);
// 是否该排查有绑定的辖区街道信息,有则展示
List<StreetCommunity> communityByRoad = highDangerMapper.getCommunityByRoad(businessId);
if (communityByRoad != null && !communityByRoad.isEmpty()) {
StreetCommunity streetCommunity = communityByRoad.get(0);
sectionInfoDTO.setXqcode(streetCommunity.getXqcode());
sectionInfoDTO.setXqname(streetCommunity.getXqname());
sectionInfoDTO.setJdcode(streetCommunity.getJdcode());
sectionInfoDTO.setJdname(streetCommunity.getJdname());
// log.info("/getSectionInfo(获取基础数据(第一页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionInfo);
// return ServerResponse.ok(sectionInfoDTO);
}
}
StreetCommunity streetCommunity = communityByRoad.get(0);
thtSectionInfoDTO.setXqcode(streetCommunity.getXqcode());
thtSectionInfoDTO.setXqname(streetCommunity.getXqname());
thtSectionInfoDTO.setJdcode(streetCommunity.getJdcode());
thtSectionInfoDTO.setJdname(streetCommunity.getJdname());
log.info("/getSectionInfo(获取基础数据(第一页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionInfo);
if (sectionInfo != null) {
return ServerResponse.ok(thtSectionInfoDTO);
return ServerResponse.ok(sectionInfo);
} else {
return ServerResponse.ok("无基本信息内容", null);
}
@ -980,22 +984,61 @@ public class HighDangerController {
Date lastModDate = new Date();
manualInvestigation.setLastModeDate(lastModDate);
String hidden_businessId = manualInvestigation.getBusinessId();
// 新增排查
if(manualInvestigation.getTemporary() == 2){
HighDangerBase highDangerBase = new HighDangerBase();
HighDangerRoad highDangerRoad = new HighDangerRoad();
UUID uuid = UUID.fromString(UUID.randomUUID().toString());
String nid = uuid.toString().replaceAll("-", "");
hidden_businessId = "ZZ" + highDangerService.random12();
// base主键
highDangerBase.setNid(nid);
// 隐患id
highDangerBase.setBusinessId(hidden_businessId);
// 隐患名称
highDangerBase.setName(manualInvestigation.getName());
// 操作用户
highDangerBase.setOperator(manualInvestigation.getOperator());
// 道路NID
highDangerRoad.setNid(nid);
// 隐患主键
highDangerRoad.setBusinessId(hidden_businessId);
// 绑定路段
highDangerRoad.setSectionCode(manualInvestigation.getSectionCode());
// 分别插入两张表
highDangerService.insertDanger(highDangerBase);
highDangerService.insertDangerRoad(highDangerRoad);
}
manualInvestigation.setBusinessId(hidden_businessId);
// 保存辖区和街道
highDangerMapper.updateSectionCommunity(manualInvestigation.getBusinessId(), manualInvestigation.getXqcode(), manualInvestigation.getJdcode());
highDangerMapper.updateSectionCommunity(hidden_businessId, manualInvestigation.getXqcode(), manualInvestigation.getJdcode());
// 第一页:基础数据
List<ThtSectionInfoDTO> sectionInfos = highDangerMapper.getSectionInfo(manualInvestigation.getBusinessId());
ThtSectionInfoDTO sectionInfo = sectionInfos.get(0);
if (sectionInfo != null) {
List<ThtSectionInfoDTO> sectionInfos = highDangerMapper.getSectionInfo(hidden_businessId);
if (!sectionInfos.isEmpty()) {
// 更新基础数据(步骤1)
highDangerMapper.updateSectionInfo(manualInvestigation);
for(BasicInfoVO basicInfoVO : manualInvestigation.getBasicInfo()){
basicInfoVO.setBusinessId(hidden_businessId);
highDangerMapper.updateSectionInfo(basicInfoVO);
}
} else {
// 保存基础数据(步骤1)
highDangerMapper.insertSectionInfo(manualInvestigation);
for(BasicInfoVO basicInfoVO : manualInvestigation.getBasicInfo()){
basicInfoVO.setBusinessId(hidden_businessId);
highDangerMapper.insertSectionInfo(basicInfoVO);
}
}
// 判断数据库是否存在统计数据
ThtSectionTrafficDTO sectionTraffic = highDangerMapper.getSectionTraffic(manualInvestigation.getBusinessId());
ThtSectionTrafficDTO sectionTraffic = highDangerMapper.getSectionTraffic(hidden_businessId);
if (sectionTraffic != null) {
// 更新统计数据(步骤2)
@ -1005,27 +1048,28 @@ public class HighDangerController {
highDangerMapper.insertSectionTraffic(manualInvestigation);
}
HighDangerBase higDangerDetail = highDangerMapper.getHigDangerDetail(manualInvestigation.getBusinessId());
// 查询base表的pcCount值
HighDangerBase higDangerDetail = highDangerMapper.getHigDangerDetail(hidden_businessId);
String pcCount = higDangerDetail.getPcCount();
manualInvestigation.setPcCount(pcCount);
// 先删除二级页面数据
highDangerMapper.deleteThtHiddenDataCollectConfigExtra(manualInvestigation.getBusinessId());
highDangerMapper.deleteThtHiddenDataCollectConfigExtra(hidden_businessId);
for (ThtHiddenDataCollectConfigExtra extra : manualInvestigation.getExtraConfigs()) {
extra.setPcCount(pcCount);
extra.setBusinessId(manualInvestigation.getBusinessId());
extra.setBusinessId(hidden_businessId);
highDangerMapper.saveThtHiddenDataCollectConfigExtra(extra);
}
Date date = new Date();
// 隐患排查表--如果存在该记录则更新
highDangerMapper.deleteRoadInfo(manualInvestigation.getBusinessId());
highDangerMapper.deleteRoadInfo(hidden_businessId);
for (HiddenDangerDTO details : manualInvestigation.getDescribe()) {
// 随机生成UUID
UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", "");
details.setNid(uuidString);
details.setBusinessId(manualInvestigation.getBusinessId());
details.setBusinessId(hidden_businessId);
details.setPcCount(manualInvestigation.getPcCount());
ThtDangerItems dangerItemsById = highDangerMapper.getDangerItemsById(details.getHdTerm());
@ -1038,7 +1082,7 @@ public class HighDangerController {
highDangerMapper.saveDangerExtra(details);
//提交的时候保存附件
if (manualInvestigation.getTemporary() == Boolean.TRUE
if (manualInvestigation.getTemporary() == 1
&& StringUtils.isNotEmpty(details.getHdPic())) {
String hdPicArr[] = details.getHdPic().split(",");
for (String s : hdPicArr) {
@ -1052,7 +1096,7 @@ public class HighDangerController {
thtAttachs.setUploadTime(date);
thtAttachs.setInfoId(details.getNid());
thtAttachs.setAttachName(accachName);
thtAttachs.setBusinessId(manualInvestigation.getBusinessId());
thtAttachs.setBusinessId(hidden_businessId);
thtAttachs.setPcCount(pcCount);
thtAttachs.setLastModDate(date);
thtAttachsService.saveAttachs(thtAttachs);
@ -1105,24 +1149,24 @@ public class HighDangerController {
// manualInvestigation.setKeySet(keys.toString());
// 暂存数据
if (manualInvestigation.getTemporary() == Boolean.FALSE) {
if (manualInvestigation.getTemporary() == 0) {
// highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "99");
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已暂存", manualInvestigation);
return ServerResponse.ok("数据已暂存", manualInvestigation);
} else {
} else if(manualInvestigation.getTemporary() == 1){
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已保存", manualInvestigation);
highDangerMapper.updateTemporary(manualInvestigation.getBusinessId());
highDangerMapper.updateTemporary(hidden_businessId);
//隐患项不为空时,修改tht_hidden_danger_road
String hdFlag = "0";
if (CollectionUtils.isNotEmpty(manualInvestigation.getDescribe())) {
hdFlag = "1";
}
highDangerMapper.updateDangerRoad(hdFlag, manualInvestigation.getBusinessId(), pcCount, manualInvestigation.getOperator());
highDangerMapper.updateDangerRoad(hdFlag, hidden_businessId, pcCount, manualInvestigation.getOperator());
ThtApprove thtAApprove = new ThtApprove();
UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", "");
thtAApprove.setNid(uuidString);
thtAApprove.setBusinessId(manualInvestigation.getBusinessId());
thtAApprove.setBusinessId(hidden_businessId);
thtAApprove.setOperator(manualInvestigation.getLastModeUser());
thtAApprove.setStatus("10");
thtAApprove.setOperateTime(date);
@ -1131,8 +1175,13 @@ public class HighDangerController {
thtApproveService.save(thtAApprove);
return ServerResponse.ok("数据已保存", manualInvestigation);
}
// return ServerResponse.ok(manualInvestigation);
// 新增
else if(manualInvestigation.getTemporary() == 2){
return ServerResponse.ok("数据已新增", manualInvestigation);
}
else {
return ServerResponse.error("无保存标识");
}
}
// 智能排查 & 人工排查保存状态

@ -19,5 +19,5 @@ public interface ConfigMapper {
List<StreetCommunity> getStreetCommunityByXq(String xqcode);
LineInfo getDangerBaseData(@Param("sectionCode") String sectionCode, @Param("businessId") String businessId);
List<LineInfo> getDangerBaseData(@Param("sectionCode") String sectionCode,@Param("crossingCode") String crossingCode, @Param("businessId") String businessId);
}

@ -1,8 +1,9 @@
package com.hisense.hiatmp.server_api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.hiatmp.model.common.*;
import com.hisense.hiatmp.model.common.DangerProblem;
import com.hisense.hiatmp.model.common.DTO.SectionDTO;
import com.hisense.hiatmp.model.common.VO.BasicInfoVO;
import com.hisense.hiatmp.model.common.VO.SectionVO;
import com.hisense.hiatmp.server_api.model.StreetCommunity;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;
@ -29,10 +30,12 @@ public interface HighDangerMapper{
List<HighDangerBase> getHigDangerSearch(String search);
List<SectionVO> getAllSection(@Param("sectionVO") SectionVO sectionVO);
List<SectionDTO> getAllSection(@Param("sectionVO") SectionDTO sectionDTO);
List<CrossingDTO> getAllCrossing(CrossingDTO crossingDTO);
List<SectionVO> getSectionByCrossing(String crossingCode);
HighDangerRoad getRoadInfo(String businessId);
List<ImportDangerDTO> getImportDanger();
@ -58,9 +61,9 @@ public interface HighDangerMapper{
ThtSectionTrafficDTO getSectionTraffic(String businessId);
void insertSectionInfo(ManualInvestigation sectionInfo);
void insertSectionInfo(BasicInfoVO basicInfoVO);
void updateSectionInfo(ManualInvestigation sectionInfo);
void updateSectionInfo(BasicInfoVO basicInfoVO);
void insertSectionTraffic(ManualInvestigation sectionTraffic);
@ -105,7 +108,7 @@ public interface HighDangerMapper{
List<EnumRoadType> getEnumValues(Integer enumType);
SectionVO getSectionByCode(String sectionCode);
SectionDTO getSectionByCode(String sectionCode);
List<StreetCommunity> getCommunityByRoad(String businessId);
}

@ -1,17 +1,13 @@
package com.hisense.hiatmp.server_api.service;
import com.hisense.hiatmp.model.common.EnumRoadType;
import com.hisense.hiatmp.model.common.HighDangerBase;
import com.hisense.hiatmp.model.common.HighDangerRoad;
import com.hisense.hiatmp.model.common.ThtDangerItems;
import com.hisense.hiatmp.model.common.*;
import com.hisense.hiatmp.model.common.DTO.SectionDTO;
import com.hisense.hiatmp.model.common.VO.SectionVO;
import com.hisense.hiatmp.model.dmr.Point;
import com.hisense.hiatmp.server_api.utils.CoordinateConverter;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -40,6 +36,8 @@ public interface HighDangerService {
List<EnumRoadType> getEnumValues(Integer enumType);
List<SectionVO> getSectionByCrossing(String crossingCode);
// 随机生成12位数字
String random12();
}

@ -17,5 +17,5 @@ public interface IConfigService {
List<StreetCommunity> getStreetCommunityByXq(String xqcode);
LineInfo getDangerBaseData(String sectionCode, String businessId);
List<LineInfo> getDangerBaseData(String sectionCode,String crossingCode, String businessId);
}

@ -37,10 +37,8 @@ public List<StreetCommunity> getStreetCommunityByXq(String xqcode) {
}
@Override
public LineInfo getDangerBaseData(String sectionCode,String businessId) {
public List<LineInfo> getDangerBaseData(String sectionCode,String crossingCode, String businessId) {
return configMapper.getDangerBaseData(sectionCode,businessId);
return configMapper.getDangerBaseData(sectionCode,crossingCode,businessId);
}
}

@ -3,6 +3,7 @@ package com.hisense.hiatmp.server_api.service.impl;
import com.hisense.hiatmp.model.common.EnumRoadType;
import com.hisense.hiatmp.model.common.HighDangerBase;
import com.hisense.hiatmp.model.common.HighDangerRoad;
import com.hisense.hiatmp.model.common.VO.SectionVO;
import com.hisense.hiatmp.server_api.mapper.HighDangerMapper;
import com.hisense.hiatmp.server_api.service.HighDangerService;
import com.hisense.hiatmp.model.common.ThtDangerItems;
@ -360,6 +361,14 @@ public class HighDangerBaseServiceImpl implements HighDangerService {
return highDangerMapper.getEnumValues(enumType);
}
/*
根据路口id查找上下游路段
*/
@Override
public List<SectionVO> getSectionByCrossing(String crossingCode) {
return highDangerMapper.getSectionByCrossing(crossingCode);
}
public String random12(){
Random random = new Random();
StringBuilder sb = new StringBuilder();

@ -11,10 +11,18 @@ spring:
multipart:
max-file-size: 100MB
max-request-size: 200MB
# cloud:
# nacos:
# discovery:
# server-addr: 10.16.3.178:8848
cloud:
nacos:
discovery:
server-addr: 49.235.207.167:8848 #质量部131服务器Nacos服务注册中心地址
namespace: d0216010-7812-4765-a97c-fb0b4cf5cba6
config:
server-addr: 49.235.207.167:8848 #Nacos作为配置中心地址
file-extension: yaml #指定yaml格式的配置
group: DEFAULT_GROUP
namespace: d0216010-7812-4765-a97c-fb0b4cf5cba6
bootstrap:
enabled: true
#server-addr: localhost:8848
#6.1管控平台数据库地址、账号、密码,根据项目现场进行修改
datasource:

@ -31,8 +31,22 @@
</select>
<select id="getDangerBaseData" resultType="com.hisense.hiatmp.model.dmr.LineInfo">
select bs.*,thdr.belong_xq as xqcode,thdr.xzjd as jdcode from bis_section bs
LEFT JOIN tht_hidden_danger_road thdr on thdr.business_id = #{businessId}
where bs.section_code = #{sectionCode};
select
bs.*,thdr.belong_xq as xqcode,thdr.xzjd as jdcode
from
bis_section bs
LEFT JOIN tht_hidden_danger_road thdr on thdr.business_id = #{businessId}
<if test="crossingCode != null and crossingCode != ''">
LEFT JOIN bis_crossing bc on bs.up_crossing_code = #{crossingCode}
OR bs.down_crossing_code = #{crossingCode}
</if>
where
1 = 1
<if test="sectionCode != null and sectionCode != ''">
AND bs.section_code = #{sectionCode}
</if>
<if test="crossingCode != null and crossingCode != ''">
AND bc.crossing_code = #{crossingCode}
</if>
</select>
</mapper>

@ -336,8 +336,8 @@
WHERE hdb.name like #{search}
</select>
<select id="getAllSection" parameterType="com.hisense.hiatmp.model.common.SectionVO"
resultType="com.hisense.hiatmp.model.common.SectionVO">
<select id="getAllSection" parameterType="com.hisense.hiatmp.model.common.DTO.SectionDTO"
resultType="com.hisense.hiatmp.model.common.DTO.SectionDTO">
SELECT
section_code,
section_name,
@ -379,6 +379,17 @@
</if>
</select>
<select id="getSectionByCrossing" resultType="com.hisense.hiatmp.model.common.VO.SectionVO">
SELECT
*
FROM
bis_section
WHERE
up_crossing_code = #{crossingCode}
or
down_crossing_code = #{crossingCode}
</select>
<select id="getRoadInfo" resultType="com.hisense.hiatmp.model.common.HighDangerRoad">
SELECT DISTINCT thdb.*, thdr.address, thdr.section_code, thdr.if_cross, thdr.coordinate
@ -503,8 +514,8 @@
#{sideProtec},
#{centerSeparate},
#{designSpeed},
#{limitSpeed})
RETURNING #{businessId};
#{limitSpeed},
#{sectionCode});
</insert>
@ -519,6 +530,7 @@
"DESIGN_SPEED" = #{designSpeed},
"LIMIT_SPEED" = #{limitSpeed}
where "BUSINESS_ID" = #{businessId}
and "SECTION_CODE" = #{sectionCode}
</update>
<insert id="insertSectionTraffic">
@ -675,7 +687,7 @@
order by dispindex,enumname
</select>
<select id="getSectionByCode" resultType="com.hisense.hiatmp.model.common.SectionVO">
<select id="getSectionByCode" resultType="com.hisense.hiatmp.model.common.DTO.SectionDTO">
select *
from bis_section
where section_code = #{sectionCode}

@ -0,0 +1,15 @@
package com.hisense.hiatmp.model.common.DTO;
import lombok.Data;
@Data
public class HiddenDangerVO {
String name;
// 道路/路口ID
String sectionCode;
// 道路/路口标识 1 道路 2 路口
String ifCross;
}

@ -1,11 +1,11 @@
package com.hisense.hiatmp.model.common;
package com.hisense.hiatmp.model.common.DTO;
import lombok.Data;
import java.io.Serializable;
@Data
public class SectionVO implements Serializable {
public class SectionDTO implements Serializable {
private static final long serialVersionUID = 1L;

@ -1,5 +1,6 @@
package com.hisense.hiatmp.model.common;
import com.hisense.hiatmp.model.common.VO.BasicInfoVO;
import lombok.Data;
import java.io.Serializable;
@ -16,23 +17,25 @@ public class ManualInvestigation implements Serializable {
// 用户
String operator;
// 第一页,基本信息
String businessId;
// 轄區code
String xqcode;
// 街道code
String jdcode;
String roadType;
String roadWidth;
String laneCount;
String roadStructure;
String sideProtec;
String centerSeparate;
String designSpeed;
String limitSpeed;
// 第一页,基本信息
List<BasicInfoVO> basicInfo;
private String sectionCode;
// 隐患名称
private String name;
private String xqcode;
private String jdcode;
// String xqcode;
// String jdcode;
// String roadType;
// String roadWidth;
// String laneCount;
// String roadStructure;
// String sideProtec;
// String centerSeparate;
// String designSpeed;
// String limitSpeed;
// 第二页,统计信息
String passingTrend;
@ -52,7 +55,7 @@ public class ManualInvestigation implements Serializable {
String pcCount;
List<HiddenDangerDTO> describe;
// 暂存标识 0暂存 1提交
Boolean temporary;
// 暂存标识 0暂存 1提交 2 新增
Integer temporary;
}

@ -27,6 +27,8 @@ public class ThtSectionInfoDTO implements Serializable {
*/
private String businessId;
private String sectionCode;
/**
* ROAD_TYPE
*/

@ -0,0 +1,22 @@
package com.hisense.hiatmp.model.common.VO;
import lombok.Data;
import java.io.Serializable;
@Data
public class BasicInfoVO implements Serializable {
private static final long serialVersionUID = 1L;
private String businessId;
private String sectionCode;
private String roadType;
private String roadWidth;
private String laneCount;
private String roadStructure;
private String sideProtec;
private String centerSeparate;
private String designSpeed;
private String limitSpeed;
}

@ -0,0 +1,9 @@
package com.hisense.hiatmp.model.common.VO;
public class CrossingVO {
String crossingCode;
String crossingName;
}

@ -0,0 +1,20 @@
package com.hisense.hiatmp.model.common.VO;
import lombok.Data;
import java.io.Serializable;
@Data
public class SectionVO implements Serializable {
private static final long serialVersionUID = 1L;
private String sectionCode;
// private String roadCode;
private String sectionName;
private Float width;
private Float length;
private String sectionType;
private String laneNum;
private String speed;
}

@ -4,6 +4,11 @@ import java.util.List;
@Data
public class LineInfo {
// 道路名称
private String sectionName;
// 道路id
private String sectionCode;
//
private String lineId;
// 道路类型
private String sectionType;

Loading…
Cancel
Save