排查状态保存(人工&智能)

master
Zangzhipeng 2 years ago
parent 75143fe591
commit 0f3602737b
  1. 7
      hiatmp-hidden-danger-server/src/main/java/com/hisense/hiatmp/server_api/controller/AuthController.java
  2. 286
      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/HighDangerMapper.java
  4. 24
      hiatmp-hidden-danger-server/src/main/resources/sql-mapper/HighDangerMapper.xml
  5. 4
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/HighDangerBase.java
  6. 1
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ImportDangerDTO.java
  7. 4
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtDangerItems.java
  8. 6
      hiatmp-model/src/main/java/com/hisense/hiatmp/model/common/ThtHiddenDataCollectConfigExtra.java

@ -39,11 +39,10 @@ public class AuthController {
// 密码加密
String encrypt = authService.encrypt(operator.getCuserpwd()+ operator.getNuserid());
if (operatorById.getNuserid().equals(operator.getNuserid()) && operatorById.getCuserpwd().equals(encrypt)) {
authMap.put("nuserid", operator.getNuserid());
authMap.put("department", operatorById.getCdepartmentid());
// authMap.put("nuserid", operator.getNuserid());
// authMap.put("department", operatorById.getCdepartmentid());
// String token = JwtUtil.createToken(operatorById);
return ServerResponse.ok("登录成功",authMap);
return ServerResponse.ok("登录成功",operator.getNuserid());
}
}else{
return ServerResponse.error("用户不存在");

@ -39,13 +39,13 @@ public class HighDangerController {
查询各个状态的数据情况
*/
@GetMapping("/getHighDangerStatusNum")
public ServerResponse<?> getHighStatusNum(@RequestParam String nuserid, HttpServletRequest request){
public ServerResponse<?> getHighStatusNum(@RequestParam String nuserid, HttpServletRequest request) {
log.info("/getHighDangerStatusNum(查询各个状态的数据情况)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), nuserid);
String cdepartmentid = null;
Operator operatorById = operatorMapper.getOperatorById(nuserid);
if(operatorById != null){
if (operatorById != null) {
cdepartmentid = operatorById.getCdepartmentid();
}else{
} else {
return ServerResponse.error("未找到当前用户");
}
@ -64,21 +64,21 @@ public class HighDangerController {
@RequestParam(defaultValue = "10") Integer pageSize,
@RequestParam(defaultValue = "") String search,
HttpServletRequest request
){
log.info("/getHigDangerDealt(查询首页各个状态的数据列表)接口被调用,调用ip: {}, 入参:{},{},{},{}", request.getRemoteAddr(), highDangerBaseVO,pageNum,pageSize,search);
) {
log.info("/getHigDangerDealt(查询首页各个状态的数据列表)接口被调用,调用ip: {}, 入参:{},{},{},{}", request.getRemoteAddr(), highDangerBaseVO, pageNum, pageSize, search);
String cdepartmentid = null;
// 获取当前操作的对象,用于查找对应的部门
Operator operatorById = operatorMapper.getOperatorById(highDangerBaseVO.getNuserid());
if(operatorById != null){
if (operatorById != null) {
cdepartmentid = operatorById.getCdepartmentid();
}else{
} else {
return ServerResponse.error("未找到当前用户");
}
//Page<HighDangerBase> page = new Page<>(pageNum, pageSize);
PageHelper.startPage(pageNum, pageSize);
// 将要查询的状态和部门id查询数据库,获得隐患排查表
List<HighDangerBase> statusCounts = highDangerMapper.getHigDangerDealt(highDangerBaseVO.getStatus(),cdepartmentid,search);
List<HighDangerBase> statusCounts = highDangerMapper.getHigDangerDealt(highDangerBaseVO.getStatus(), cdepartmentid, search);
// 待办
/*if("20".equals(highDangerBaseVO.getStatus())){
@ -89,7 +89,7 @@ public class HighDangerController {
for (HighDangerBase base : statusCounts) {
Date nowDate = new Date();
Date pcEndTime = base.getPcEndTime();
if(pcEndTime != null){
if (pcEndTime != null) {
long diff = nowDate.getTime() - pcEndTime.getTime();
// 时间差,天数
long diffDays = diff / (24 * 60 * 60 * 1000);
@ -104,8 +104,8 @@ public class HighDangerController {
diffHours = Math.abs(diffHours);
int comparison = nowDate.compareTo(pcEndTime);
if(comparison < 0) { // 超期
if(diffHours < 1){
if (comparison < 0) { // 超期
if (diffHours < 1) {
base.setDeadlineStatus("超期不足一小时");
base.setDeadlineType("1");
continue;
@ -113,8 +113,8 @@ public class HighDangerController {
base.setDeadline(diffDays);
base.setDeadlineStatus("超期" + diffDays + "天" + remainingHours + "小时");
base.setDeadlineType("1");
} else if(comparison > 0 && diffDays <= 3) { // 临期
if(diffHours < 1){
} else if (comparison > 0 && diffDays <= 3) { // 临期
if (diffHours < 1) {
base.setDeadlineStatus("临期不足一小时");
base.setDeadlineType("2");
continue;
@ -127,7 +127,7 @@ public class HighDangerController {
base.setDeadlineStatus("正常");
base.setDeadlineType("3");
}
}else{
} else {
base.setDeadlineStatus("无排查结束时间");
base.setDeadlineType("3");
}
@ -141,28 +141,28 @@ public class HighDangerController {
// 查询临期 & 超期任务
@PostMapping("/getHigDangerDying")
public ServerResponse<?> getHighDying(@RequestBody HighDangerBaseVO highDangerBaseVO){
public ServerResponse<?> getHighDying(@RequestBody HighDangerBaseVO highDangerBaseVO) {
String departmentId = null;
// 查询当前登录用户的部门
Operator operatorById = operatorMapper.getOperatorById(highDangerBaseVO.getNuserid());
if(operatorById != null){
departmentId = operatorById.getCdepartmentid();
}else{
if (operatorById != null) {
departmentId = operatorById.getCdepartmentid();
} else {
return ServerResponse.error("未找到当前用户");
}
// 查询该部门的指定状态的任务
List<HighDangerBase> statusCounts = highDangerMapper.getHigDangerDying(highDangerBaseVO.getStatus(),departmentId);
if(statusCounts != null){
List<HighDangerBase> statusCounts = highDangerMapper.getHigDangerDying(highDangerBaseVO.getStatus(), departmentId);
if (statusCounts != null) {
return ServerResponse.ok(statusCounts);
}else{
} else {
return ServerResponse.error("未查询到任务");
}
}
// 查询指定任务详情任务
@GetMapping("/getHigDangerDetail")
public ServerResponse<?> getHighDetail(@RequestParam String businessId){
public ServerResponse<?> getHighDetail(@RequestParam String businessId) {
HighDangerBase highDangerBase = highDangerMapper.getHigDangerDetail(businessId);
@ -173,12 +173,12 @@ public class HighDangerController {
* 模糊查询隐患排查项
*/
@GetMapping("/getHigDangerSearch")
public ServerResponse<?> getHighSearch(@RequestParam String search){
public ServerResponse<?> getHighSearch(@RequestParam String search) {
List<HighDangerBase> highDangerBase = highDangerMapper.getHigDangerSearch("%" + search + "%");
if(highDangerBase != null){
if (highDangerBase != null) {
return ServerResponse.ok(highDangerBase);
}else{
} else {
return ServerResponse.error("未查询到隐患排查项");
}
}
@ -199,15 +199,15 @@ public class HighDangerController {
@RequestParam(defaultValue = "10") Long pageSize,
@RequestParam(defaultValue = "") String search,
HttpServletRequest request
){
) {
log.info("/getNearRoadInfo(获取最近道路)接口被调用,调用ip: {}, 入参:{},{},{}", request.getRemoteAddr(), point, pageNum, pageSize);
//获取三公里内的坐标
double[] rectangle = CoordinateUtils.getRectangleCoordinates(point.getY(),point.getX(),3);
double[] rectangle = CoordinateUtils.getRectangleCoordinates(point.getY(), point.getX(), 3);
// DecimalFormat df = new DecimalFormat("#.##");
// 获取全部路段数据
BigDecimal d = new BigDecimal(point.getX()).setScale(1,BigDecimal.ROUND_DOWN);
BigDecimal d = new BigDecimal(point.getX()).setScale(1, BigDecimal.ROUND_DOWN);
SectionVO sectionVO = new SectionVO();
sectionVO.setPosition(String.valueOf(d));
sectionVO.setSearch(search);
@ -218,27 +218,27 @@ public class HighDangerController {
Point Dpoint = new Point();
// 遍历所有路段
for(SectionVO dto : allRoadInfo){
for (SectionVO dto : allRoadInfo) {
HashMap<String, Object> pointMapSection = new HashMap<>();
// Map<String,Object> map = new HashMap<>();
LinkedList<Map<String, Double>> pointList = new LinkedList<>();
// 临时存储最短距离
//Double minDistance = null;
if(dto.getPosition() == null){
if (dto.getPosition() == null) {
continue;
}
// 将单条路段的坐标点依次取出进行对比
String[] split = dto.getPosition().split(",");
Double minDistance = null;
for(int i = 0; i < split.length; i += 2) {
for (int i = 0; i < split.length; i += 2) {
float x = Float.parseFloat(split[i]);
float y = Float.parseFloat(split[i + 1]);
Map<String,Double> pointMap = new LinkedHashMap<>();
Map<String, Double> pointMap = new LinkedHashMap<>();
CoordinateConverter.AMap aMap = CoordinateConverter.transform(x, y);
pointMap.put("longitude", aMap.getLongitude());
@ -246,7 +246,7 @@ public class HighDangerController {
pointList.add(pointMap);
if (!(x >= rectangle[0] && x <= rectangle[2] && y >= rectangle[1] && y <= rectangle[3])){
if (!(x >= rectangle[0] && x <= rectangle[2] && y >= rectangle[1] && y <= rectangle[3])) {
continue;
}
@ -254,11 +254,11 @@ public class HighDangerController {
Dpoint.setY(y);
// 计算两点间的距离
Double pointDistance = highDangerService.getPointDistance(Dpoint, point);
if(minDistance == null){
if (minDistance == null) {
minDistance = pointDistance;
continue;
}else{
if(pointDistance < minDistance){
} else {
if (pointDistance < minDistance) {
minDistance = pointDistance;
}
}
@ -268,13 +268,13 @@ public class HighDangerController {
// float y = Float.parseFloat(split[1]);
//for(int i = 0; i < split.length; i += 2){
//float x = Float.parseFloat(split[i]);
//float y = Float.parseFloat(split[i + 1]);
//float x = Float.parseFloat(split[i]);
//float y = Float.parseFloat(split[i + 1]);
// Dpoint.setX(x);
// Dpoint.setY(y);
// 计算两点间的距离
// 计算两点间的距离
// Double pointDistance = highDangerService.getPointDistance(Dpoint, point);
// 最短距离为空,初次存入第一个值
// 最短距离为空,初次存入第一个值
/*if(minDistance == null){
minDistance = pointDistance;
continue;
@ -293,12 +293,13 @@ public class HighDangerController {
// pointList.add(pointMap);
// }
if(minDistance == null){
continue;
if (minDistance == null) {
continue;
}
pointMapSection.put("distance", (int) Math.ceil(minDistance));
pointMapSection.put("name",dto.getSectionName());
pointMapSection.put("name", dto.getSectionName());
pointMapSection.put("position", pointList);
pointMapSection.put("sectionCode",dto.getSectionCode());
pointMapSection.put("type", "1");
combinedMap.add(pointMapSection);
@ -318,10 +319,10 @@ public class HighDangerController {
List<CrossingDTO> allCrossing = highDangerMapper.getAllCrossing(crossingDTO);
// List<CrossingDTO> allCrossing = highDangerMapper.getAllCrossing(crossingDTO);
// 遍历集合,将所有坐标点与当前坐标比较
for(CrossingDTO cross : allCrossing){
for (CrossingDTO cross : allCrossing) {
HashMap<String, Object> pointMapCrossing = new HashMap<>();
// Map<String,Object> map = new HashMap<>();
Map<String,Double> pointMap = new HashMap<>();
Map<String, Double> pointMap = new HashMap<>();
LinkedList<Map<String, Double>> pointList = new LinkedList<>();
float x = cross.getLongitude();
@ -339,6 +340,7 @@ public class HighDangerController {
pointList.add(pointMap);
pointMapCrossing.put("distance", (int) Math.ceil(pointDistance));
pointMapCrossing.put("position", pointList);
pointMapCrossing.put("sectionCode",cross.getCrossingCode());
pointMapCrossing.put("type", "2");
// map.put(pointDistance, cross.getLongitude() + "," + cross.getLatitude());
pointMapCrossing.put("name", cross.getCrossingName());
@ -357,7 +359,7 @@ public class HighDangerController {
});
// hashMap.put("businessId",combinedMap);
hashMap.put("params",combinedMap);
hashMap.put("params", combinedMap);
log.info("/getNearRoadInfo(获取最近道路)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), combinedMap);
@ -367,22 +369,22 @@ public class HighDangerController {
// 查询当前排查所在路段
@GetMapping("/getDangerRoad")
public ServerResponse<?> getDangerRoad(@RequestParam String businessId, HttpServletRequest request){
public ServerResponse<?> getDangerRoad(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getDangerRoad(查询当前排查所在路段)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(businessId);
roadInfo.setDeptId(operatorMapper.getOperatorById(roadInfo.getOperator()).getCdepartmentid());
if(roadInfo.getCoordinate() == null){
return ServerResponse.ok("无对应路口信息",null);
if (roadInfo.getCoordinate() == null) {
return ServerResponse.ok("无对应路口信息", null);
}
LinkedList<Map<String, Double>> coordinateMapTemporary = new LinkedList<>();
String[] split = roadInfo.getCoordinate().split(",");
for(int i = 0; i < split.length; i+=2){
for (int i = 0; i < split.length; i += 2) {
//CoordinateConverter coordinateConverter = new CoordinateConverter();
Map<String,Double> pointMap = new LinkedHashMap<>();
Map<String, Double> pointMap = new LinkedHashMap<>();
float lon = Float.parseFloat(split[i]);
float lat = Float.parseFloat(split[i + 1]);
@ -403,18 +405,18 @@ public class HighDangerController {
Date nowDate = new Date();
Date pcEndTime = roadInfo.getPcEndTime();
if(pcEndTime != null){
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) { // 超期
if (comparison < 0) { // 超期
roadInfo.setDeadline(diffDays);
roadInfo.setDeadlineStatus("超期" + diffDays + "天");
roadInfo.setDeadlineType("1");
} else if(comparison > 0 && diffDays <= 3) { // 临期
} else if (comparison > 0 && diffDays <= 3) { // 临期
roadInfo.setDeadline(diffDays);
roadInfo.setDeadlineStatus("临期" + diffDays + "天");
roadInfo.setDeadlineType("2");
@ -423,16 +425,16 @@ public class HighDangerController {
roadInfo.setDeadlineStatus("正常");
roadInfo.setDeadlineType("3");
}
}else{
} else {
roadInfo.setDeadlineStatus("无排查结束时间");
roadInfo.setDeadlineType("3");
}
log.info("/getDangerRoad(查询当前排查所在路段)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), roadInfo);
if(roadInfo != null){
if (roadInfo != null) {
return ServerResponse.ok(roadInfo);
}else {
} else {
return ServerResponse.error("无对应路口信息");
}
@ -440,32 +442,33 @@ public class HighDangerController {
// 查询重点排查选项
@GetMapping("/getImportDangers")
public ServerResponse<?> getImportDangers(HttpServletRequest request){
public ServerResponse<?> getImportDangers(HttpServletRequest request) {
log.info("/getImportDangers(查询重点排查选项)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),"无");
log.info("/getImportDangers(查询重点排查选项)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), "无");
List<ImportDangerDTO> importDanger = highDangerMapper.getImportDanger();
for (ImportDangerDTO importDangerDTO : importDanger){
for (ImportDangerDTO importDangerDTO : importDanger) {
List<ThtDangerItems> importDangerItems = highDangerMapper.getImportDangerItems(importDangerDTO.getNid());
importDangerDTO.setDangerItems(importDangerItems);
}
log.info("/getImportDangers(查询重点排查选项)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), importDanger);
if(importDanger != null){
if (importDanger != null) {
return ServerResponse.ok(importDanger);
}else {
} else {
return ServerResponse.error("无对应路口信息");
}
}
// 新增路段 & 路口
@PostMapping("/saveSectionOrCrossing")
public ServerResponse<?> saveRoad(@RequestBody SectionOrCrossAdd sectionOrCrossAdd, HttpServletRequest request){
public ServerResponse<?> saveRoad(@RequestBody SectionOrCrossAdd sectionOrCrossAdd, HttpServletRequest request) {
log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),sectionOrCrossAdd);
log.info("/saveSectionOrCrossing(新增路段 & 路口)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sectionOrCrossAdd);
if(highDangerMapper.isRoadExist(sectionOrCrossAdd.getBusinessId()) == 0){
HighDangerRoad roadInfo = highDangerMapper.getRoadInfo(sectionOrCrossAdd.getBusinessId());
if (roadInfo != null) {
UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", "");
highDangerMapper.insertRoad(uuidString,sectionOrCrossAdd.getBusinessId());
highDangerMapper.insertRoad(uuidString, sectionOrCrossAdd.getBusinessId());
}
// 随机生成一个16位的数作为路段id
// Random random = new Random();
@ -475,23 +478,24 @@ public class HighDangerController {
// sectionVO.setSectionCode(String.valueOf(sectionCode));
// sectionVO.setRoadCode(String.valueOf(roadCode));
log.info("/saveSectionOrCrossing(新增路段 & 路口)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionOrCrossAdd);
if("1".equals(sectionOrCrossAdd.getAddType())){
if ("1".equals(sectionOrCrossAdd.getAddType())) {
// 插入路段表
int i = highDangerMapper.saveSection(sectionOrCrossAdd);
if(i > 0){
return ServerResponse.ok("道路新增成功");
if (i > 0) {
assert roadInfo != null;
return ServerResponse.ok("道路新增成功","2079028191469929");
} else {
return ServerResponse.error("道路新增失败");
}
}
else if("2".equals(sectionOrCrossAdd.getAddType())){
} else if ("2".equals(sectionOrCrossAdd.getAddType())) {
int i = highDangerMapper.saveCrossing(sectionOrCrossAdd);
if(i > 0){
return ServerResponse.ok("道路新增成功");
if (i > 0) {
assert roadInfo != null;
return ServerResponse.ok("道路新增成功","2079028191469929");
} else {
return ServerResponse.error("道路新增失败");
}
}else{
} else {
return ServerResponse.error("新增类型错误");
}
@ -529,73 +533,73 @@ public class HighDangerController {
// 重点排查二级页面信息
@GetMapping("/getImportDangerInfo")
public ServerResponse<?> getImportDangerInfo(@RequestParam String sid, HttpServletRequest request){
public ServerResponse<?> getImportDangerInfo(@RequestParam String sid, HttpServletRequest request) {
log.info("/getImportDangerInfo(排查第三页--重点排查新增标签详情数据(默认数据-无用户数据后调用))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),sid);
log.info("/getImportDangerInfo(排查第三页--重点排查新增标签详情数据(默认数据-无用户数据后调用))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), sid);
List<ImportDangerInfoDTO> importDangerInfo = highDangerMapper.getImportDangerInfo(sid);
log.info("/getImportDangerInfo(排查第三页--重点排查新增标签详情数据(默认数据-无用户数据后调用))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), importDangerInfo);
if(importDangerInfo != null){
if (importDangerInfo != null) {
return ServerResponse.ok(importDangerInfo);
}else {
} else {
return ServerResponse.error("获取二级页面信息失败");
}
}
// 排查审批
@PostMapping("/approval")
public ServerResponse<?> approval(@RequestParam String businessId){
public ServerResponse<?> approval(@RequestParam String businessId) {
String approvalId = highDangerMapper.setApproval(businessId);
if(approvalId != null){
if (approvalId != null) {
return ServerResponse.ok(approvalId);
}else {
} else {
return ServerResponse.error("审批失败");
}
}
// 获取基础数据(第一页)
@GetMapping("/getSectionInfo")
public ServerResponse<?> getSectionInfo(@RequestParam String businessId, HttpServletRequest request){
log.info("/getSectionInfo(获取基础数据(第一页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),businessId);
public ServerResponse<?> getSectionInfo(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getSectionInfo(获取基础数据(第一页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
ThtSectionInfoDTO sectionInfo = highDangerMapper.getSectionInfo(businessId);
log.info("/getSectionInfo(获取基础数据(第一页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionInfo);
if(sectionInfo != null){
if (sectionInfo != null) {
return ServerResponse.ok(sectionInfo);
}else {
return ServerResponse.ok("无基本信息内容",null);
} else {
return ServerResponse.ok("无基本信息内容", null);
}
}
// 获取统计数据(第二页)
@GetMapping("/getSectionTraffic")
public ServerResponse<?> getSectionTraffic(@RequestParam String businessId, HttpServletRequest request){
public ServerResponse<?> getSectionTraffic(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getSectionTraffic(获取统计数据(第二页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),businessId);
log.info("/getSectionTraffic(获取统计数据(第二页))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
ThtSectionTrafficDTO sectionTraffic = highDangerMapper.getSectionTraffic(businessId);
log.info("/getSectionTraffic(获取统计数据(第二页))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), sectionTraffic);
if(sectionTraffic != null){
if (sectionTraffic != null) {
return ServerResponse.ok(sectionTraffic);
}else {
return ServerResponse.ok("无基本信息内容",null);
} else {
return ServerResponse.ok("无基本信息内容", null);
}
}
// 获取存在隐患的存在问题,多级列表
@GetMapping("/getDangerItems")
public ServerResponse<?> getDangerItems(HttpServletRequest request){
log.info("/getDangerItems(排查第三页--存在隐患的存在问题(三级列表查询))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),"无");
public ServerResponse<?> getDangerItems(HttpServletRequest request) {
log.info("/getDangerItems(排查第三页--存在隐患的存在问题(三级列表查询))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), "无");
List<ThtDangerItems> thtDangerItems = highDangerService.listWithTree();
log.info("/getDangerItems(排查第三页--存在隐患的存在问题(三级列表查询))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), thtDangerItems);
if(thtDangerItems != null){
if (thtDangerItems != null) {
return ServerResponse.ok(thtDangerItems);
}else {
} else {
return ServerResponse.error("无存在问题数据");
}
}
@ -604,12 +608,31 @@ public class HighDangerController {
排查第三页--重点排查项标签用户数据回显
*/
@GetMapping("/getImportDangerDisplay")
public ServerResponse<?> getImportDangerDisplay(@RequestParam String businessId, HttpServletRequest request){
log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),businessId);
List<ImportDangerDTO> item = highDangerMapper.getImportDangerDisplayItem(businessId);
public ServerResponse<?> getImportDangerDisplay(@RequestParam String businessId, HttpServletRequest request) {
log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
LinkedList<String> checkedList = new LinkedList<>();
List<ImportDangerDTO> item = highDangerMapper.getImportDangerDisplayItem(businessId);
List<ThtHiddenDataCollectConfigExtra> importDangerList = highDangerMapper.getImportDangerDisplay(businessId, null);
for (ThtHiddenDataCollectConfigExtra importDanger : importDangerList) {
checkedList.add(importDanger.getDangerId());
}
for (ImportDangerDTO importDangerDTO : item) {
List<ThtDangerItems> importDangerItemsValue = new LinkedList<>();
List<ThtDangerItems> importDangerItems = highDangerMapper.getImportDangerItems(importDangerDTO.getNid());
for (ThtDangerItems items : importDangerItems) {
if (checkedList.contains(items.getId())) {
items.setChecked("1");
}
// assert importDangerItemsValue != null;
importDangerItemsValue.add(items);
}
importDangerDTO.setDangerItems(importDangerItemsValue);
}
log.info("/getImportDangerDisplay(排查第三页--重点排查项标签)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), item);
if(item != null){
if (item != null) {
return ServerResponse.ok(item);
} else {
return ServerResponse.error("无存在问题数据");
@ -622,11 +645,11 @@ public class HighDangerController {
@GetMapping("/getImportDangerDisplayDetail")
public ServerResponse<?> getImportDangerDisplayDetail(@RequestParam String businessId,
@RequestParam String dangerId,
HttpServletRequest request){
log.info("/getImportDangerDisplayDetail(排查第三页--重点排查新增标签详情数据)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),businessId);
List<ThtHiddenDataCollectConfigExtra> importDangerList = highDangerMapper.getImportDangerDisplay(businessId,dangerId);
HttpServletRequest request) {
log.info("/getImportDangerDisplayDetail(排查第三页--重点排查新增标签详情数据)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
List<ThtHiddenDataCollectConfigExtra> importDangerList = highDangerMapper.getImportDangerDisplay(businessId, dangerId);
log.info("/getImportDangerDisplayDetail(排查第三页--重点排查新增标签详情数据)接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), importDangerList);
if(importDangerList != null){
if (importDangerList != null) {
return ServerResponse.ok(importDangerList);
} else {
return ServerResponse.error("无存在问题数据");
@ -639,14 +662,14 @@ public class HighDangerController {
@GetMapping("/getUserHiddenDangerList")
public ServerResponse<?> getUserHiddenDangerList(@RequestParam String businessId,
@RequestParam String pcType,
@RequestParam String hdTerm,
@RequestParam(defaultValue = "") String hdTerm,
HttpServletRequest request
){
) {
log.info("/getUserHiddenDangerList(排查第三页--存在隐患列表(用户数据回显))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),businessId);
log.info("/getUserHiddenDangerList(排查第三页--存在隐患列表(用户数据回显))接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), businessId);
List<HiddenDangerDTO> userHiddenDangerList = highDangerMapper.getUserHiddenDangerList(businessId,pcType,hdTerm);
for(HiddenDangerDTO hiddenDangerDTO : userHiddenDangerList){
List<HiddenDangerDTO> userHiddenDangerList = highDangerMapper.getUserHiddenDangerList(businessId, pcType, hdTerm);
for (HiddenDangerDTO hiddenDangerDTO : userHiddenDangerList) {
String dangerItems = highDangerMapper.getDangerProblem(hiddenDangerDTO.getBigCategory()) + "/" +
highDangerMapper.getDangerProblem(hiddenDangerDTO.getSmallCategory()) + "/" +
highDangerMapper.getDangerProblem(hiddenDangerDTO.getHdTerm());
@ -654,9 +677,9 @@ public class HighDangerController {
}
log.info("/getUserHiddenDangerList(排查第三页--存在隐患列表(用户数据回显))接口返回, 客户端ip: {}, 返回数据:{}", request.getRemoteAddr(), userHiddenDangerList);
if(userHiddenDangerList != null){
if (userHiddenDangerList != null) {
return ServerResponse.ok(userHiddenDangerList);
}else{
} else {
return ServerResponse.error("当前隐患排查中无存在隐患信息");
}
}
@ -664,17 +687,17 @@ public class HighDangerController {
// 保存 & 暂存人工排查
@Transactional
@PostMapping("/saveManualInvestigation")
public ServerResponse<?> saveManualInvestigation(@RequestBody ManualInvestigation manualInvestigation,HttpServletRequest request){
public ServerResponse<?> saveManualInvestigation(@RequestBody ManualInvestigation manualInvestigation, HttpServletRequest request) {
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(),manualInvestigation);
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口被调用,调用ip: {}, 入参:{}", request.getRemoteAddr(), manualInvestigation);
Date lastModDate = new Date();
manualInvestigation.setLastModeDate(lastModDate);
ThtSectionInfoDTO sectionInfo = highDangerMapper.getSectionInfo(manualInvestigation.getBusinessId());
if(sectionInfo != null){
if (sectionInfo != null) {
// 更新基础数据(步骤1)
highDangerMapper.updateSectionInfo(manualInvestigation);
}else{
} else {
// 保存基础数据(步骤1)
highDangerMapper.insertSectionInfo(manualInvestigation);
}
@ -682,10 +705,10 @@ public class HighDangerController {
// 判断数据库是否存在统计数据
ThtSectionTrafficDTO sectionTraffic = highDangerMapper.getSectionTraffic(manualInvestigation.getBusinessId());
if(sectionTraffic != null){
if (sectionTraffic != null) {
// 更新统计数据(步骤2)
highDangerMapper.updateSectionTraffic(manualInvestigation);
}else{
} else {
// 保存统计数据(步骤2)
highDangerMapper.insertSectionTraffic(manualInvestigation);
}
@ -697,7 +720,7 @@ public class HighDangerController {
// 先删除二级页面数据
highDangerMapper.deleteThtHiddenDataCollectConfigExtra(manualInvestigation.getBusinessId());
for(ThtHiddenDataCollectConfigExtra extra : manualInvestigation.getExtraConfigs()){
for (ThtHiddenDataCollectConfigExtra extra : manualInvestigation.getExtraConfigs()) {
extra.setPcCount(pcCount);
extra.setBusinessId(manualInvestigation.getBusinessId());
highDangerMapper.saveThtHiddenDataCollectConfigExtra(extra);
@ -705,7 +728,7 @@ public class HighDangerController {
// 隐患排查表--如果存在该记录则更新
highDangerMapper.deleteRoadInfo(manualInvestigation.getBusinessId());
for(HiddenDangerDTO details : manualInvestigation.getDescribe()){
for (HiddenDangerDTO details : manualInvestigation.getDescribe()) {
// 随机生成UUID
UUID uuid = UUID.randomUUID();
String uuidString = uuid.toString().replace("-", "");
@ -761,19 +784,34 @@ public class HighDangerController {
// 暂存数据
if(manualInvestigation.getTemporary() == Boolean.FALSE){
if (manualInvestigation.getTemporary() == Boolean.FALSE) {
// highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "99");
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(),"数据已暂存", manualInvestigation);
return ServerResponse.ok("数据已暂存",manualInvestigation);
}else{
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(),"数据已保存", manualInvestigation);
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已暂存", manualInvestigation);
return ServerResponse.ok("数据已暂存", manualInvestigation);
} else {
log.info("/saveManualInvestigation(保存 & 暂存人工排查)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已保存", manualInvestigation);
highDangerMapper.updateTemporary(manualInvestigation.getBusinessId(), "20");
return ServerResponse.ok("数据已保存",manualInvestigation);
return ServerResponse.ok("数据已保存", manualInvestigation);
}
// return ServerResponse.ok(manualInvestigation);
}
// 智能排查 & 人工排查保存状态
@GetMapping("/HighDangerSaveStatus")
public ServerResponse<?> HighDangerSaveStatus(
@RequestParam String businessId,
@RequestParam String pcType,
HttpServletRequest request
) {
log.info("/HighDangerSaveStatus(智能排查 & 人工排查状态)接口被调用, 调用ip: {}, 入参: businessId={}, pcType={}", request.getRemoteAddr(), businessId, pcType);
// 保存排查类型
highDangerMapper.HighDangerSaveStatus(businessId, pcType);
log.info("/HighDangerSaveStatus(智能排查 & 人工排查状态)接口返回, 客户端ip: {}, 返回数据:{},{}", request.getRemoteAddr(), "数据已保存");
return ServerResponse.ok("状态修改成功,状态为:" + pcType, pcType);
}
// 图片上传接口
/*@PostMapping("/uploadImage")
public ServerResponse<?> uploadImage(@RequestBody MultipartFile multipartFile) throws IOException {

@ -87,5 +87,7 @@ public interface HighDangerMapper extends BaseMapper<HighDangerBase>{
String getDangerProblem(String id);
void HighDangerSaveStatus(@Param("businessId") String businessId,@Param("pcType") String pcType);
}

@ -114,7 +114,7 @@
</select>
<select id="getHigDangerDealt" resultType="com.hisense.hiatmp.model.common.HighDangerBase">
SELECT *
SELECT hdb.*,hdr.pc_type
FROM tht_hidden_danger_base hdb
LEFT JOIN tht_hidden_danger_road hdr ON hdb.business_id = hdr.business_id
AND hdb.pc_count = hdr.pc_count
@ -224,7 +224,7 @@
</select>
<select id="isRoadExist" resultType="int">
SELECT count(1)
SELECT DISTINCT *
from tht_hidden_danger_road
where business_id = #{businessId}
</select>
@ -234,7 +234,7 @@
</insert>
<select id="getImportDanger" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO">
SELECT *
SELECT DISTINCT *
from tht_hidden_scenes;
</select>
@ -296,7 +296,7 @@
</select>
<select id="getDangerItems" resultType="com.hisense.hiatmp.model.common.ThtDangerItems">
SELECT *
SELECT DISTINCT *
FROM tht_danger_items
</select>
@ -402,7 +402,11 @@
</insert>
<select id="getImportDangerDisplay" resultType="com.hisense.hiatmp.model.common.ThtHiddenDataCollectConfigExtra">
select * from tht_hidden_data_collect_config_extra where business_id = #{businessId} and danger_id = #{dangerId}
select * from tht_hidden_data_collect_config_extra where business_id = #{businessId}
<if test="dangerId != null">
and danger_id = #{dangerId}
</if>
</select>
<select id="getImportDangerDisplayItem" resultType="com.hisense.hiatmp.model.common.ImportDangerDTO">
@ -428,14 +432,14 @@
business_id = #{businessId}
and
pc_type = #{pcType}
<if test="hdTerm != null">
<if test="hdTerm != null and hdTerm != ''">
AND hd_term = #{hdTerm}
</if>
</select>
<select id="getDangerProblem" resultType="String">
SELECT
SELECT DISTINCT
itemname
FROM
tht_danger_items
@ -443,5 +447,11 @@
id = #{id}
</select>
<update id="HighDangerSaveStatus">
update tht_hidden_danger_road
set pc_type = #{pcType}
where business_id = #{businessId}
</update>
</mapper>

@ -65,6 +65,8 @@ public class HighDangerBase implements Serializable {
*/
private String operator;
private String deptId;
/**
* insert_time
*/
@ -131,6 +133,8 @@ public class HighDangerBase implements Serializable {
*/
private String pcCount;
private String pcType;
/**
* split_id
*/

@ -15,6 +15,7 @@ public class ImportDangerDTO implements Serializable {
private String name;
private String measure;
private String description;
// private List<String> checked;
List<ThtDangerItems> dangerItems;

@ -22,8 +22,10 @@ public class ThtDangerItems implements Serializable {
private String nlevel;
private String checked;
@TableField(exist = false)
@JsonIgnore
// @JsonIgnore
private List<ThtDangerItems> children;

@ -44,5 +44,11 @@ public class ThtHiddenDataCollectConfigExtra implements Serializable {
private String dangerId;
// // 重点排查-存在隐患
// private String hdTerm;
// private String hdDesc;
// private String hdPic;
// private String hdInfo;
public ThtHiddenDataCollectConfigExtra() {}
}
Loading…
Cancel
Save