Commit 77847dff by zt

修改

parent 7ebac7b6
......@@ -20,6 +20,7 @@ public class DbSoundsMonitorTask {
private static final Logger log = LoggerFactory.getLogger(DbSoundsMonitorTask.class);
public static void main(String[] args) throws Exception {
if (args == null || args.length == 0){
//本地启动是可以。到了服务器变成了java.io.FileNotFoundException: file:/data/smsAndEmailTest/task-3.0-SNAPSHOT.jar!/global.properties (No such file or directory)
......@@ -51,5 +52,6 @@ public class DbSoundsMonitorTask {
//发送邮件和短信
SoundMonitorService.sendEmailAndSms(aicc,aicp,resultCode,mobile);
}
}
......@@ -83,4 +83,12 @@ public interface SoundsMaxIdDao {
* @param blackIp
*/
void deleteBlackIp(@Param("blackIp") String blackIp);
/**
* 根据时间查询通话记录
*
* @param updateTime
* @return
*/
SoundInfo getInfoByUpdateTime(@Param("updateTime") String updateTime);
}
......@@ -12,6 +12,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.io.Reader;
......@@ -70,6 +71,11 @@ public class SoundMonitorService {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime ldt = LocalDateTime.parse(updateTime,df);
if (DateUtils.until(ldt) > Long.parseLong(interval)){
//2019年10月5日14:38:07 zt
SoundInfo soundInfo = soundsMaxIdDao.getInfoByUpdateTime(updateTime);
if(soundInfo != null){
log.info("更新时间与最新时间间隔大于20分钟,有通话记录start_time:{}",soundInfo.getBeginTime());
}else {
log.info("更新时间异常,与最新时间间隔大于20分钟,updateTime:{}", updateTime);
focSmsEmailRecord.setDescription("更新时间异常,与最新时间间隔大于20分钟,updateTime为" + updateTime);
focSmsEmailRecord.setMonitorState((short)1);
......@@ -77,8 +83,10 @@ public class SoundMonitorService {
session.commit();
return true;
}
}
List<SoundInfo> list = soundsMaxIdDao.getInfo(updateTime);
if (list == null && list.size() < 1){
if (CollectionUtils.isEmpty(list)){
log.info("查询不到记录" );
focSmsEmailRecord.setDescription("查询不到记录");
focSmsEmailRecord.setMonitorState((short)0);
......
......@@ -6,6 +6,12 @@
SELECT id,update_date FROM foc_soundmax_id order by id desc limit 1
</select>
<select id="getInfoByUpdateTime" resultType="com.foc.entity.SoundInfo">
select start_time as beginTime
from foc_sound_records
where start_time &gt;=#{updateTime} or end_time &gt;=#{updateTime}
</select>
<select id="getInfo" resultType="com.foc.entity.SoundInfo">
SELECT
create_phone AS callNo,
......
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