Commit 293d715a authored by 赵建伟's avatar 赵建伟

update codes

parent 5f4fe16b
......@@ -16,27 +16,27 @@ public class DqScheduler {
@Autowired
private MonitorService monitorService;
@Scheduled(cron="0 */100 * * * ?")
@Scheduled(cron="0 10 15 * * ?")
private void uniqueCheckProcess(){
checkService.checkAndPersistSimpleResult(Constants.CHECK_UNIQUE);
}
@Scheduled(cron="10 */100 * * * ?")
@Scheduled(cron="0 20 15 * * ?")
private void unblankCheckProcess(){
checkService.checkAndPersistSimpleResult(Constants.CHECK_UNBLANK);
}
@Scheduled(cron="0 */100 * * * ?")
@Scheduled(cron="0 30 15 * * ?")
private void referCheckProcess(){
checkService.checkAndPersistMultipleResult(Constants.CHECK_REFER);
}
@Scheduled(cron="0 */100 * * * ?")
@Scheduled(cron="0 40 15 * * ?")
private void volatilityMonitorProcess(){
monitorService.monitorAndPersistVolatilityResult(Constants.MONITOR_PV);
}
@Scheduled(cron="0 */100 * * * ?")
@Scheduled(cron="0 50 15 * * ?")
private void specialMonitorProcess(){
monitorService.monitorAndPersistSpecialResult();
}
......
......@@ -72,7 +72,7 @@ public class CheckServiceImpl implements CheckService {
return;
}else {
Double uniqueRate = uniqueCheckResult.getUniqueRate();
if(uniqueRate <= threshold) {
if(null != uniqueRate && uniqueRate < threshold) {
mailService.sendSimpleMail(uniqueCheckResult.toString());
dingdingService.sendMsgToDingding(uniqueCheckResult.toString());
}
......@@ -86,7 +86,7 @@ public class CheckServiceImpl implements CheckService {
return;
}else {
Double unblankRate = tblResultCheckUnblank.getUnblankRate();
if(unblankRate <= threshold) {
if(null != unblankRate && unblankRate < threshold) {
mailService.sendSimpleMail(tblResultCheckUnblank.toString());
dingdingService.sendMsgToDingding(tblResultCheckUnblank.toString());
}
......@@ -125,7 +125,7 @@ public class CheckServiceImpl implements CheckService {
return;
}else {
Double matchedRate = referCheckResult.getMatchedRate();
if(matchedRate <= threshold) {
if(null != matchedRate && matchedRate < threshold) {
mailService.sendSimpleMail(referCheckResult.toString());
dingdingService.sendMsgToDingding(referCheckResult.toString());
}
......@@ -147,7 +147,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private TblResultCheckUnique getUniqueCheckResult(String sql) {
sql = sql.replaceAll("#partation_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
logger.info("Sql content : {}", sql);
TblResultCheckUnique tblResultCheckUnique = null;
if (StringUtils.isBlank(sql)) {
......@@ -183,7 +183,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private TblResultCheckUnblank getUnblankCheckResult(String sql) {
sql = sql.replaceAll("#partation_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
logger.info("Sql content : {}", sql);
TblResultCheckUnblank tblResultCheckUnblank = null;
if (StringUtils.isBlank(sql)) {
......@@ -219,7 +219,7 @@ public class CheckServiceImpl implements CheckService {
* @return
*/
private TblResultCheckRefer getReferCheckResult(String sql) {
sql = sql.replaceAll("#partation_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
logger.info("Sql content : {}", sql);
TblResultCheckRefer tblResultCheckRefer = null;
if (StringUtils.isBlank(sql)) {
......
......@@ -68,7 +68,7 @@ public class MonitorServiceImpl implements MonitorService {
return;
}else {
Long indicatorValue = tblResultMonitorVolatility.getIndicatorValue();
if(indicatorValue <= threshold) {
if(null != indicatorValue && indicatorValue < threshold) {
mailService.sendSimpleMail(tblResultMonitorVolatility.toString());
dingdingService.sendMsgToDingding(tblResultMonitorVolatility.toString());
}
......@@ -103,7 +103,7 @@ public class MonitorServiceImpl implements MonitorService {
return;
}else {
Long indicatorValue = tblResultMonitorSpecial.getIndicatorValue();
if(indicatorValue <= threshold) {
if(null != indicatorValue && indicatorValue < threshold) {
mailService.sendSimpleMail(tblResultMonitorSpecial.toString());
dingdingService.sendMsgToDingding(tblResultMonitorSpecial.toString());
}
......@@ -125,7 +125,7 @@ public class MonitorServiceImpl implements MonitorService {
* @return
*/
private TblResultMonitorVolatility getMonitorVolatilityResult(String sql, String indicatorType) {
sql = sql.replaceAll("#partation_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
logger.info("Sql content : {},indicatorType: {}", sql, indicatorType);
TblResultMonitorVolatility tblResultMonitorVolatility = null;
if (StringUtils.isBlank(sql) || StringUtils.isBlank(indicatorType)) {
......@@ -161,7 +161,7 @@ public class MonitorServiceImpl implements MonitorService {
* @return
*/
private TblResultMonitorSpecial getMonitorSpecialResult(String sql) {
sql = sql.replaceAll("#partation_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
sql = sql.replaceAll("#partition_date", String.format("'%s'", DateUtils.getYesterdayDateStr()));
logger.info("Sql content : {}", sql);
TblResultMonitorSpecial tblResultMonitorSpecial = null;
if (StringUtils.isBlank(sql)) {
......
......@@ -19,7 +19,7 @@ spring:
datasource:
#---mysql config---
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://152.136.57.57:3306/dqmp?useSSL=false
url: jdbc:mysql://172.18.44.3:3306/dqmp?useSSL=false
username: root
password: 5OqYM^zLwotJ3oSo
......
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