|
|
|
|
@ -3,9 +3,11 @@ 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.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; |
|
|
|
|
import com.hisense.hiatmp.server_api.service.ThtApproveService; |
|
|
|
|
@ -44,6 +46,9 @@ public class HighDangerController { |
|
|
|
|
@Autowired |
|
|
|
|
ThtApproveService thtApproveService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
ConfigureMapper configureMapper; |
|
|
|
|
|
|
|
|
|
@Value("${spring.ftp.username}") //用户名
|
|
|
|
|
private String userName; |
|
|
|
|
|
|
|
|
|
@ -131,6 +136,8 @@ public class HighDangerController { |
|
|
|
|
return ServerResponse.error("未找到当前用户"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int termTime = Integer.parseInt(configureMapper.getTermTime()); |
|
|
|
|
|
|
|
|
|
//Page<HighDangerBase> page = new Page<>(pageNum, pageSize);
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
// 将要查询的状态和部门id查询数据库,获得隐患排查表
|
|
|
|
|
@ -145,6 +152,8 @@ public class HighDangerController { |
|
|
|
|
for (HighDangerBase base : statusCounts) { |
|
|
|
|
Date nowDate = new Date(); |
|
|
|
|
Date pcEndTime = base.getPcEndTime(); |
|
|
|
|
Date pcStartTime = base.getPcStartTime(); |
|
|
|
|
|
|
|
|
|
if (pcEndTime != null) { |
|
|
|
|
long diff = nowDate.getTime() - pcEndTime.getTime(); |
|
|
|
|
// 时间差,天数
|
|
|
|
|
@ -201,8 +210,67 @@ public class HighDangerController { |
|
|
|
|
base.setDeadlineStatus("正常"); |
|
|
|
|
base.setDeadlineType("3"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
base.setDeadlineStatus("无排查结束时间"); |
|
|
|
|
} else if(pcStartTime != null){ |
|
|
|
|
// 无排查结束时间,根据开始时间判断
|
|
|
|
|
long diff = nowDate.getTime() - pcStartTime.getTime(); |
|
|
|
|
|
|
|
|
|
// 时间差,天数
|
|
|
|
|
long diffDays = diff / (24 * 60 * 60 * 1000); |
|
|
|
|
diffDays = Math.abs(diffDays); |
|
|
|
|
|
|
|
|
|
// 小时
|
|
|
|
|
long remainingHours = (diff % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000); |
|
|
|
|
remainingHours = Math.abs(remainingHours); |
|
|
|
|
|
|
|
|
|
// 判断不足一小时
|
|
|
|
|
long diffHours = diff / (60 * 60 * 1000); |
|
|
|
|
diffHours = Math.abs(diffHours); |
|
|
|
|
|
|
|
|
|
int comparison = nowDate.compareTo(pcStartTime); |
|
|
|
|
if (comparison < 0) { // 超期
|
|
|
|
|
if (diffHours < 1) { |
|
|
|
|
base.setDeadlineStatus("超期不足一小时"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if(diffDays == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
continue; |
|
|
|
|
}else if(remainingHours == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + diffDays + "天"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
base.setDeadline(diffDays); |
|
|
|
|
base.setDeadlineStatus("超期" + diffDays + "天" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
} else if (comparison > 0 && diffDays <= termTime) { // 临期
|
|
|
|
|
if (diffHours < 1) { |
|
|
|
|
base.setDeadlineStatus("临期不足一小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
base.setDeadline(diffDays); |
|
|
|
|
if (diffDays == 0) { |
|
|
|
|
base.setDeadlineStatus("临期" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
continue; |
|
|
|
|
} else if (remainingHours == 0) { |
|
|
|
|
base.setDeadlineStatus("临期" + diffDays + "天"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
base.setDeadlineStatus("临期" + diffDays + "天" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
}else{ |
|
|
|
|
base.setDeadlineStatus("正常"); |
|
|
|
|
base.setDeadlineType("3"); |
|
|
|
|
} |
|
|
|
|
// base.setDeadlineStatus("无排查结束时间");
|
|
|
|
|
// base.setDeadlineType("3");
|
|
|
|
|
}else{ |
|
|
|
|
base.setDeadlineStatus("无排查结束和开始时间"); |
|
|
|
|
base.setDeadlineType("3"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -642,6 +710,18 @@ public class HighDangerController { |
|
|
|
|
List<ThtSectionInfoDTO> sectionInfo = highDangerMapper.getSectionInfo(businessId); |
|
|
|
|
ThtSectionInfoDTO 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); |
|
|
|
|
} |
|
|
|
|
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); |
|
|
|
|
|