Commit 9d0c00e8 authored by 赵建伟's avatar 赵建伟

update special monitor codes

parent 89a7e796
sudo mdir -p /data/log/dqmp sudo mkdir -p /data/log/dqmp
sudo chown -R apple:wheel /data/log/dqmp sudo chown -R apple:wheel /data/log/dqmp
\ No newline at end of file
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency> </dependency>
<!-- 集成mysql驱动 --> <!-- 集成mysql驱动 -->
<dependency> <dependency>
...@@ -75,7 +74,6 @@ ...@@ -75,7 +74,6 @@
<dependency> <dependency>
<groupId>net.sourceforge.nekohtml</groupId> <groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId> <artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency> </dependency>
<!-- 集成热部署插件 --> <!-- 集成热部署插件 -->
<dependency> <dependency>
......
...@@ -130,7 +130,6 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -130,7 +130,6 @@ public class DqRuleServiceImpl implements DqRuleService {
logger.error("Param is illegal! {}", dqRuleVo); logger.error("Param is illegal! {}", dqRuleVo);
return false; return false;
} }
dqRuleVo.setStartTime(DateUtils.getZeroTimeStrsMap().get(dqRuleVo.getStartTime()));
TblSqlMonitorSpecial tblSqlMonitorSpecial = BeanUtils.map(dqRuleVo, TblSqlMonitorSpecial.class); TblSqlMonitorSpecial tblSqlMonitorSpecial = BeanUtils.map(dqRuleVo, TblSqlMonitorSpecial.class);
tblSqlMonitorSpecial.setSqlContent(genSqlByTemplate(dqRuleVo)); tblSqlMonitorSpecial.setSqlContent(genSqlByTemplate(dqRuleVo));
tblSqlMonitorSpecial.setParentId(record.getId()); tblSqlMonitorSpecial.setParentId(record.getId());
...@@ -229,8 +228,6 @@ public class DqRuleServiceImpl implements DqRuleService { ...@@ -229,8 +228,6 @@ public class DqRuleServiceImpl implements DqRuleService {
.replaceAll("#tb_name", dqRuleVo.getTbName()).replaceAll("#indicator_type", indicatorType) .replaceAll("#tb_name", dqRuleVo.getTbName()).replaceAll("#indicator_type", indicatorType)
.replaceAll("#indicator_expre", indicatorMap.get(indicatorType)) .replaceAll("#indicator_expre", indicatorMap.get(indicatorType))
.replaceAll("#col_name", dqRuleVo.getColName()) .replaceAll("#col_name", dqRuleVo.getColName())
.replaceAll("#start_time", "'" + dqRuleVo.getStartTime() + "'")
.replaceAll("#end_time", "'" + DateUtils.getTodayZeroTimeStr() + "'")
.replaceAll("#check_db_name", dqRuleVo.getCheckDbName()) .replaceAll("#check_db_name", dqRuleVo.getCheckDbName())
.replaceAll("#check_tb_name", dqRuleVo.getCheckTbName()) .replaceAll("#check_tb_name", dqRuleVo.getCheckTbName())
.replaceAll("#check_col_name", dqRuleVo.getCheckColName()) .replaceAll("#check_col_name", dqRuleVo.getCheckColName())
......
...@@ -19,7 +19,6 @@ public class FormatServiceImpl implements FormatService { ...@@ -19,7 +19,6 @@ public class FormatServiceImpl implements FormatService {
Pattern p = Pattern.compile("\\s{1,}|\t|\r|\n"); Pattern p = Pattern.compile("\\s{1,}|\t|\r|\n");
Matcher m = p.matcher(str); Matcher m = p.matcher(str);
dest = m.replaceAll(" "); dest = m.replaceAll(" ");
} }
return dest; return dest;
} }
......
...@@ -109,8 +109,9 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -109,8 +109,9 @@ public class MonitorServiceImpl implements MonitorService {
String sql = tblCheckSql.getSqlContent(); String sql = tblCheckSql.getSqlContent();
Integer id = tblCheckSql.getId(); Integer id = tblCheckSql.getId();
Double threshold = tblCheckSql.getThreshold(); Double threshold = tblCheckSql.getThreshold();
String startTime = tblCheckSql.getStartTime();
int rs = 0; int rs = 0;
TblResultMonitorSpecial tblResultMonitorSpecial = getMonitorSpecialResult(sql); TblResultMonitorSpecial tblResultMonitorSpecial = getMonitorSpecialResult(sql,startTime);
if (tblResultMonitorSpecial == null) { if (tblResultMonitorSpecial == null) {
logger.error("Find result is empty!"); logger.error("Find result is empty!");
continue; continue;
...@@ -173,8 +174,10 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -173,8 +174,10 @@ public class MonitorServiceImpl implements MonitorService {
* @param sql * @param sql
* @return * @return
*/ */
private TblResultMonitorSpecial getMonitorSpecialResult(String sql) { private TblResultMonitorSpecial getMonitorSpecialResult(String sql,String startTime) {
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr())); sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()))
.replaceAll("#start_time", "'" + DateUtils.getZeroTimeStrsMap().get(startTime) + "'")
.replaceAll("#end_time", "'" + DateUtils.getTodayZeroTimeStr() + "'");
logger.info("Sql content : {}", sql); logger.info("Sql content : {}", sql);
TblResultMonitorSpecial tblResultMonitorSpecial = null; TblResultMonitorSpecial tblResultMonitorSpecial = null;
if (StringUtils.isBlank(sql)) { if (StringUtils.isBlank(sql)) {
......
spring: spring:
profiles: profiles:
active: dev active: prod
\ No newline at end of file \ No newline at end of file
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