Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 3 months ago
parent
commit
58c0969baa
  1. 17
      zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java
  2. 7
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

17
zc-business/src/main/java/com/zc/business/service/impl/DcSdhsEventServiceImpl.java

@ -957,10 +957,12 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
} else if (dcSdhsEventQuery.getType().equals("1")) {
// 将查询开始时间和结束时间转换为 LocalDateTime
LocalDateTime queryStart = dcSdhsEventQuery.getStartTime().toInstant().atZone(zoneId).toLocalDateTime();
// 获取该月的最后一天
LocalDateTime endOfMonth = dcSdhsEventQuery.getEndTime().toInstant().atZone(zoneId).toLocalDateTime();
/* // 获取该月的最后一天
LocalDate lastDayOfMonth = queryStart.toLocalDate().with(TemporalAdjusters.lastDayOfMonth());
// 构建该月的最后一刻(23:59:59)
LocalDateTime endOfMonth = LocalDateTime.of(lastDayOfMonth, LocalTime.MAX);
LocalDateTime endOfMonth = LocalDateTime.of(lastDayOfMonth, LocalTime.MAX);*/
List<DcSdhsEvent> filteredEvents = getDcSdhsEvents(dcSdhsEventQuery, cacheList, zoneId, queryStart, endOfMonth);
// 定义日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd");
@ -990,7 +992,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
// 获取该年的最后一天
LocalDate lastDayOfYear = queryStart.toLocalDate().with(TemporalAdjusters.lastDayOfYear());
// 构建该年的最后一刻(23:59:59)
LocalDateTime endOfYear = LocalDateTime.of(lastDayOfYear, LocalTime.MAX);
// LocalDateTime endOfYear = LocalDateTime.of(lastDayOfYear, LocalTime.MAX);
LocalDateTime endOfYear = dcSdhsEventQuery.getEndTime().toInstant().atZone(zoneId).toLocalDateTime();
List<DcSdhsEvent> filteredEvents = getDcSdhsEvents(dcSdhsEventQuery, cacheList, zoneId, queryStart, endOfYear);
// 定义日期格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MM");
@ -1004,7 +1007,8 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
);
// 确保所有月份都出现在结果中
LocalDate queryEnd = endOfYear.toLocalDate().plusMonths(1); // 确保包含结束月份
// 目标年的年末之后的一个月
LocalDate queryEnd = endOfYear.toLocalDate().plusMonths(0); // 确保包含结束月份
LocalDate currentMonth = queryStart.toLocalDate();
while (currentMonth.isBefore(queryEnd)) {
String monthString = currentMonth.format(formatter);
@ -1073,20 +1077,17 @@ public class DcSdhsEventServiceImpl implements IDcSdhsEventService {
Map<String, Long> lastYearData = accidentTimeAnalysis(dcSdhsEventQuery1);
String type = dcSdhsEventQuery.getType();
int rows = 0;
int rows = currentYearData.size()+1;
String stingType = "";
String name = "";
if (type.equals("2")) {
rows = 25;
stingType = "点";
name = "wordTemplate/accidentTimeAnalysis.docx";
} else if (type.equals("1")) {
rows = 32;
stingType = "日";
name = "wordTemplate/accidentTimeDayAnalysis.docx";
} else {
rows = 13;
stingType = "月";
name = "wordTemplate/accidentTimeMonthAnalysis.docx";

7
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -1126,8 +1126,10 @@ public class DcWarningServiceImpl implements IDcWarningService {
*/
@Override
public String getRadarIncidentVideo(String id) throws Exception {
String msg = "";
HashMap<String, Object> stringObjectHashMap = dcWarningMapper.selectDcWarningById(id);
if (!stringObjectHashMap.isEmpty()) {
// 时间
String givenTime = (String) stringObjectHashMap.get("warningTime");
@ -1164,8 +1166,11 @@ public class DcWarningServiceImpl implements IDcWarningService {
JsonNode data = objectMapper.readTree(jsonObject.get("data").toString());
// 使用 textValue() 方法获取纯字符串
String fileUrl = data.get("fileUrl").textValue();
return fileUrl;
return fileUrl;
}else {
return "";
}
}

Loading…
Cancel
Save