查询统计核素方法新增标识判断是否已经存储过当前日期

查询统计核素方法返回内容移除全日期数据
This commit is contained in:
qiaoqinzheng 2024-01-24 18:06:02 +08:00
parent e3e8a52344
commit 8c5f85b499

View File

@ -885,8 +885,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
return result;
}
String endTime = DateUtils.formatDate(endDate, "yyyy-MM-dd") + " 23:59:59";
List<String> allDayTime = DateUtils.getAllDayTime(DateUtils.formatDate(startDate, "yyyy-MM-dd"), DateUtils.formatDate(endDate, "yyyy-MM-dd"));
resultMap.put("AllDayTime", allDayTime);
List<String> allDayTime = DateUtils.getAllDay(DateUtils.formatDate(startDate, "yyyy-MM-dd"), DateUtils.formatDate(endDate, "yyyy-MM-dd"));
//判断查询的核素内容是否为空
List<String> nuclideNameList = new LinkedList<>();
if (nuclideNames != null && nuclideNames.length > 0) {
@ -1172,6 +1171,8 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
for (int i=0; i< allDateTime.size(); i++) {
//根据下标获取日期时间
String dayTime = allDateTime.get(i);
//新增标识判断是否包含 可能存在一天有多条数据的情况
boolean isHave = false;
//遍历查询结果数组
for (int j=0; j< nuclideStatisticsMap.size(); j++) {
//根据下标获取核素查询结果
@ -1180,8 +1181,8 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
Object collectStart = nuclideStatistics.get("COLLECT_START");
//采集开始时间转为字符串
String collectStartStr = collectStart.toString();
//截取采集开始时间的年月日小时
collectStartStr = collectStartStr.substring(0, collectStartStr.indexOf(StringPool.COLON)) + ":00:00";
//截取采集开始时间的年月日
collectStartStr = collectStartStr.substring(0, 10);
//如果采集时间包含当前日期 则正常的读取数据并存入数组
if (dayTime.equals(collectStartStr)) {
collectStartList.add(collectStart.toString());
@ -1240,11 +1241,11 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl<GardsSampleDataWe
}
}
}
break;
isHave = true;
} else { //如果采集时间不包含当前日期 各数组填补null
//如果全数组遍历后都没有 就填充空数据
if (j == nuclideStatisticsMap.size()-1) {
collectStartList.add(dayTime);
if (j == nuclideStatisticsMap.size()-1 && !isHave) {
collectStartList.add(dayTime+" 00:00:00");
quantityList.add(null);
acqLiveSecList.add(null);
//判断系统类型决定读取核素的信息