Commit 95edfb59 authored by 郝彦辉's avatar 郝彦辉

百行每天的重新报送优化成定时任务4

parent ef3b1124
......@@ -64,7 +64,7 @@ public class RoutineWorkTask {
@Async
@Scheduled(cron = "0 10 18 * * ?")
@Scheduled(cron = "0 30 18 * * ?")
public void downloadLog() {
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_1)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_1, 10, TimeUnit.SECONDS);
......@@ -77,6 +77,9 @@ public class RoutineWorkTask {
//String beforeDatenyr = LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE);
String newDatenyr = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
newDatenyr = newDatenyr.replace("-", "");
newDatenyr = "20200311";
log.info("下载(众信利民助贷)百行反馈日志开始>>>>>>>>, newTime: {} , newDatenyr: {} ", LocalDateTime.now(), newDatenyr);
//指定只有172.21.10.8服务器
//String downloadUrl = "http://172.21.10.8:9021/manualtool/send/baihang?key=b5140fb2-2c85-4b5a-abcf-3e97528014db";
......@@ -93,14 +96,13 @@ public class RoutineWorkTask {
String isProduct = "true";
String errorCode = "D3_035,";//以后发现其他错误code,可以追加
log.info("下载(众信利民助贷)百行反馈日志开始, newTime: {} , newDatenyr: {} ", LocalDateTime.now(), newDatenyr);
try {
Stopwatch stopwatch1 = Stopwatch.createStarted();
Map<String, String> resultMap = manualToolService.sendBaiHangData(p1, p2, p3, p4, p5, secretKey, isSend, errorCode, isProduct, sendIncludeType);
log.info("处理结束, result: {} , 耗时: {} ", JSONObject.toJSONString(resultMap), stopwatch1.stop().elapsed(TimeUnit.MILLISECONDS));
if (resultMap != null) {
String success = resultMap.get("success");
String alarm = resultMap.get("alarm");
......@@ -109,9 +111,10 @@ public class RoutineWorkTask {
if (StringUtils.isNotEmpty(alarm)) {
dingTalk.talk("Info", "下载&处理" + newDatenyr + "(众信利民助贷)百行反馈日志结束", success);
Thread.sleep(500);
dingTalk.talk_ToUser("下载(众信利民助贷)百行反馈主日志文件不存在", "下载" + newDatenyr + "反馈主日志文件不存在,反馈日志主文件不存在,请注意确认!");
log.info("下载(众信利民助贷)百行反馈日志结束, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
log.info("下载(众信利民助贷)百行反馈日志结束<<<<<<<<, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
return;
} else {
dingTalk.talk("Info", "下载&处理 (" + newDatenyr + "(众信利民助贷)百行反馈日志结束", success + "————10分钟后将会自动重新报送,若有问题请及时停止!");
......@@ -131,13 +134,13 @@ public class RoutineWorkTask {
setRedisValStr(ZXLM_D3_INTERFACE_SEND);
}
log.info("下载(众信利民助贷)百行反馈日志结束, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
log.info("下载(众信利民助贷)百行反馈日志结束<<<<<<<<, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
return;
}
}
}
} catch (Exception e) {
log.error("下载(众信利民助贷)百行反馈日志异常, newDatenyr: {} ", newDatenyr, e);
log.error("下载(众信利民助贷)百行反馈日志异常<<<<<<<<, newDatenyr: {} ", newDatenyr, e);
dingTalk.talk("Error", "报送服务内部异常", "(" + newDatenyr + ") 异常信息:" + e.toString());
dingTalk.talk_ToUser("数据报送异常", "报送服务内部异常,请尽快手动处理!");
return;
......@@ -145,14 +148,14 @@ public class RoutineWorkTask {
dingTalk.talk_ToUser("下载(众信利民助贷)百行反馈日志未知异常", "下载 (" + newDatenyr + ") 反馈日志失败,请尽快手动处理!");
log.info("下载(众信利民助贷)百行反馈日志结束, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
log.info("下载(众信利民助贷)百行反馈日志结束<<<<<<<<, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
}
}
@Async
@Scheduled(cron = "0 20 18 * * ?")
@Scheduled(cron = "0 40 18 * * ?")
public void sendBaoSong() {
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_2)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_2, 10, TimeUnit.SECONDS);
......@@ -163,13 +166,14 @@ public class RoutineWorkTask {
//yyyy-MM-dd
String newDatenyr = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
newDatenyr = newDatenyr.replace("-", "");
newDatenyr = "20200311";
//指定只有172.21.10.8服务器 172.21.10.8:9021
//String send_A1_url = "http://172.21.10.8:9021/zhudai/re_send/manual/buquan/mainApplySend?key=b5140fb2-2c85-4b5a-abcf-3e97528014db";
//String send_D2_url = "http://172.21.10.8:9021/zhudai/re_send/manual/buquan/mainLoanInfoSend?key=b5140fb2-2c85-4b5a-abcf-3e97528014db";
//String send_D3_url = "http://172.21.10.8:9021/zhudai/re_send/manual/buquan/mainRepaymentLoanInfo?key=b5140fb2-2c85-4b5a-abcf-3e97528014db";
log.info("众信利民助贷-百行重新报送开始, newTime: {} , newDatenyr: {} ", LocalDateTime.now(), newDatenyr);
log.info("众信利民助贷-百行重新报送开始>>>>>>>>, newTime: {} , newDatenyr: {} ", LocalDateTime.now(), newDatenyr);
if (getRedisValStr(ZXLM_A1_INTERFACE_SEND)) {
try {
......@@ -193,7 +197,7 @@ public class RoutineWorkTask {
redisTemplate.delete(ZXLM_D2_INTERFACE_SEND);
String result = baiHangZhuDaiService.sendHandLoaInfoReportToBaiHang2(true, null, null);
;
log.info("众信利民助贷-百行重新报送D2结束, newTime: {} , newDatenyr: {} , result: {} ", LocalDateTime.now(), newDatenyr, result);
dingTalk.talk("Info", "众信利民助贷-重新报送 D2 结束", "(" + newDatenyr + ")" + result);
......@@ -223,7 +227,7 @@ public class RoutineWorkTask {
}
}
log.info("众信利民助贷-百行重新报送结束, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
log.info("众信利民助贷-百行重新报送结束<<<<<<<<, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
}
}
......
......@@ -428,7 +428,7 @@ public class ManualToolService implements CommonSuperService {
ArrayList<String> fileNameList = new ArrayList<>();
String logPath = base_path + "/" +p5;
try{
getAllFileName("D:\\JavaTeam\\test", fileNameList);
getAllFileName(logPath, fileNameList);
}catch (Exception e){
log.error("获取报送日志文件夹下文件异常, path: {} ", e);
}
......@@ -436,6 +436,7 @@ public class ManualToolService implements CommonSuperService {
boolean have_logFile = false;
if(fileNameList!=null && fileNameList.size()>0){
for (String name : fileNameList) {
log.info("目录: {} 下的文件包括: {}", logPath, name);
if(StringUtils.isNotEmpty(name) && name.endsWith(".log")
&& !name.endsWith("_logicerror.log") && !name.endsWith("_inputerror.log")){
have_logFile = true;
......
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