fix: 改造标准预警模块定时执行的逻辑
This commit is contained in:
@@ -69,45 +69,45 @@ public class ProcessTimer {
|
||||
public void urging() {
|
||||
if(isNotScheduled){
|
||||
log.info("=================================自动催办定时任务启动=====================================");
|
||||
List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
|
||||
if (null != busProcessNames && 0 < busProcessNames.size()) {
|
||||
for (BusProcessName busProcessName : busProcessNames) {
|
||||
String type = busProcessName.getPrcType();
|
||||
Integer typeInt = 99;
|
||||
if (StringUtils.isNotEmpty(type)) {
|
||||
typeInt = Integer.valueOf(type);
|
||||
}
|
||||
type = chooseType(typeInt, type);
|
||||
|
||||
UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
||||
String[] array = userEO.getEmail().split(",");
|
||||
String overTime = busProcessName.getOverTime();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date dateTime = null;
|
||||
Integer num = 3;
|
||||
try {
|
||||
dateTime = simpleDateFormat.parse(overTime);
|
||||
Date now = new Date();
|
||||
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
} catch (ParseException e) {
|
||||
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
|
||||
try {
|
||||
dateTime = simpleDateFormat1.parse(overTime);
|
||||
Date now = new Date();
|
||||
long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
} catch (ParseException e1) {
|
||||
e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
|
||||
" ——来自 全球标准法规管理系统";
|
||||
String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
||||
mailUtil.sendMsgFeign(array, title, msg);
|
||||
}
|
||||
}
|
||||
// List<BusProcessName> busProcessNames = workFlowFeignClient.queryBusProcessNameForEnd(null);
|
||||
// if (null != busProcessNames && 0 < busProcessNames.size()) {
|
||||
// for (BusProcessName busProcessName : busProcessNames) {
|
||||
// String type = busProcessName.getPrcType();
|
||||
// Integer typeInt = 99;
|
||||
// if (StringUtils.isNotEmpty(type)) {
|
||||
// typeInt = Integer.valueOf(type);
|
||||
// }
|
||||
// type = chooseType(typeInt, type);
|
||||
//
|
||||
// UserEO userEO = userEOService.selectByPrimaryKey(busProcessName.getCreatUserName());
|
||||
// String[] array = userEO.getEmail().split(",");
|
||||
// String overTime = busProcessName.getOverTime();
|
||||
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// Date dateTime = null;
|
||||
// Integer num = 3;
|
||||
// try {
|
||||
// dateTime = simpleDateFormat.parse(overTime);
|
||||
// Date now = new Date();
|
||||
// long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
// num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
// } catch (ParseException e) {
|
||||
// SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'");
|
||||
// try {
|
||||
// dateTime = simpleDateFormat1.parse(overTime);
|
||||
// Date now = new Date();
|
||||
// long daysBetween = (dateTime.getTime() - now.getTime() + 1000000) / (60 * 60 * 24 * 1000);
|
||||
// num = Integer.valueOf(String.valueOf(daysBetween));
|
||||
// } catch (ParseException e1) {
|
||||
// e.getMessage();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// String msg = "您好,[" + busProcessName.getPrcNum() + "]-[" + busProcessName.getPrcName() + "] 您有待办任务未及时办理,距离截至日期还有[" + String.valueOf(num) + "]天 请及时办理,请登录全球标准法规管理系统 ( http://39.98.140.126:10005/#/login ) 办理:链接 ( http://39.98.140.126:10005/#/processCenter?tabsName=ProcessCenter ) 。\n" +
|
||||
// " ——来自 全球标准法规管理系统";
|
||||
// String title = "GSRM——【待办任务】[" + type + "] 您有未完成的待办任务";
|
||||
// mailUtil.sendMsgFeign(array, title, msg);
|
||||
// }
|
||||
// }
|
||||
log.info("=================================自动催办定时任务结束=====================================");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user