Commit 1ba8c4d0 authored by 鲁鸿波's avatar 鲁鸿波

首页天气预警无数据bug修改

parent 4e237193
......@@ -7,8 +7,10 @@ import org.apache.commons.lang3.time.DateUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
......@@ -843,4 +845,14 @@ public class DateUtil {
return cn.hutool.core.date.DateUtil.toLocalDateTime(date);
}
public static String getTodayStartString() {
return LocalDate.now()
.atStartOfDay()
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
}
public static void main(String[] args) {
System.out.println(getTodayStartString());
}
}
......@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface WeatherDao extends SuperDao<WeatherDomain> {
List<WeatherWarnInfoVO> getInfoByList(@Param("list") List<String> codeList);
List<WeatherWarnInfoVO> getInfoByList(@Param("list") List<String> codeList,@Param("date")String date);
List<WeatherWarnInfoVO> getInfoByListTemp(@Param("list") List<String> codeList);
......
......@@ -9,6 +9,8 @@ import com.testor.biz.sys.org.model.domain.SysOrg;
import com.testor.biz.sys.org.service.SysOrgService;
import com.testor.biz.sys.user.model.domain.SysUser;
import com.testor.biz.sys.user.service.SysUserService;
import com.testor.common.core.utils.DateUtils;
import com.testor.common.util.DateUtil;
import com.testor.module.duty.model.dto.TSysDutyLogParam;
import com.testor.module.messageNotice.model.domain.TMsgNotice;
import com.testor.module.messageNotice.model.vo.MsgTemplateVO;
......@@ -70,7 +72,7 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
}
List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByList(cityCodeList);
List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByList(cityCodeList, DateUtil.getTodayStartString());
//临时修改,培训使用
//List<WeatherWarnInfoVO> warnInfoVOList = this.baseMapper.getInfoByListTemp(cityCodeList);
if (CollectionUtils.isEmpty(warnInfoVOList)) {
......@@ -108,7 +110,7 @@ public class WeatherServiceImpl extends SuperServiceImpl<WeatherDao, WeatherDoma
}
if (!CollectionUtils.isEmpty(codeList)) {
List<WeatherWarnInfoVO> list = this.baseMapper.getInfoByList(codeList);
List<WeatherWarnInfoVO> list = this.baseMapper.getInfoByList(codeList, DateUtil.getTodayStartString());
if (!CollectionUtils.isEmpty(list)) {
for (WeatherWarnInfoVO weatherWarnInfoVO : list) {
//根据编码查询预警内容
......
......@@ -7,7 +7,7 @@
select id, signal_type_code as code,record_time as warnTime,sender,signal_level_code as colorMsg,sender_area_code as
areaCode from t_weather_notice
<where>
TO_CHAR(record_time)=TO_CHAR(now())
TO_CHAR(record_time)>=#{date}
<if test="list != null and list.size()>0">
AND sender_area_code IN
<foreach item="item" index="index" collection="list" open="(" close=")" separator=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment