|
|
|
|
@ -14,6 +14,7 @@ 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; |
|
|
|
|
@ -84,11 +85,15 @@ public class HighDangerController { |
|
|
|
|
highDangerBase.setBusinessId(businessId); |
|
|
|
|
// 隐患名称
|
|
|
|
|
highDangerBase.setName(name); |
|
|
|
|
// 操作用户
|
|
|
|
|
highDangerBase.setOperator("admin1"); |
|
|
|
|
|
|
|
|
|
// 道路NID
|
|
|
|
|
highDangerRoad.setNid(nid); |
|
|
|
|
// 隐患主键
|
|
|
|
|
highDangerRoad.setBusinessId(businessId); |
|
|
|
|
// 绑定路段
|
|
|
|
|
highDangerRoad.setSectionCode("14FIV0ARI5010484"); |
|
|
|
|
|
|
|
|
|
// 分别插入两张表
|
|
|
|
|
highDangerService.insertDanger(highDangerBase); |
|
|
|
|
@ -169,7 +174,7 @@ public class HighDangerController { |
|
|
|
|
diffHours = Math.abs(diffHours); |
|
|
|
|
|
|
|
|
|
int comparison = nowDate.compareTo(pcEndTime); |
|
|
|
|
if (comparison < 0) { // 超期
|
|
|
|
|
if (comparison < 0) { // 超期逻辑
|
|
|
|
|
if (diffHours < 1) { |
|
|
|
|
base.setDeadlineStatus("超期不足一小时"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
@ -177,17 +182,17 @@ public class HighDangerController { |
|
|
|
|
} |
|
|
|
|
if(diffDays == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
continue; |
|
|
|
|
}else if(remainingHours == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + diffDays + "天"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
base.setDeadline(diffDays); |
|
|
|
|
base.setDeadlineStatus("超期" + diffDays + "天" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
} else if (comparison > 0 && diffDays <= 3) { // 临期
|
|
|
|
|
} else if (comparison > 0 && diffDays <= 3) { // 临期逻辑
|
|
|
|
|
if (diffHours < 1) { |
|
|
|
|
base.setDeadlineStatus("临期不足一小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
@ -210,6 +215,7 @@ public class HighDangerController { |
|
|
|
|
base.setDeadlineStatus("正常"); |
|
|
|
|
base.setDeadlineType("3"); |
|
|
|
|
} |
|
|
|
|
// 排查开始时间判断
|
|
|
|
|
} else if(pcStartTime != null){ |
|
|
|
|
// 无排查结束时间,根据开始时间判断
|
|
|
|
|
long diff = nowDate.getTime() - pcStartTime.getTime(); |
|
|
|
|
@ -235,11 +241,11 @@ public class HighDangerController { |
|
|
|
|
} |
|
|
|
|
if(diffDays == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + remainingHours + "小时"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
continue; |
|
|
|
|
}else if(remainingHours == 0){ |
|
|
|
|
base.setDeadlineStatus("超期" + diffDays + "天"); |
|
|
|
|
base.setDeadlineType("2"); |
|
|
|
|
base.setDeadlineType("1"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
base.setDeadline(diffDays); |
|
|
|
|
@ -707,8 +713,20 @@ 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); |
|
|
|
|
ThtSectionInfoDTO thtSectionInfoDTO = sectionInfo.get(0); |
|
|
|
|
// 用户数据查询是否为空
|
|
|
|
|
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); |
|
|
|
|
|