Commit f14ecbed authored by 郝彦辉's avatar 郝彦辉

百行反馈日志(正常今天反馈日志是昨天05:00报送的),但最近百行反馈日志一直延迟;-1代表向前推一天,既昨天

parent c5e77c3d
......@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
......@@ -62,6 +63,9 @@ public class RoutineWorkTask {
public static final String ZXLM_D2_INTERFACE_SEND = "ZXLM_D2_INTERFACE_SEND";
public static final String ZXLM_D3_INTERFACE_SEND = "ZXLM_D3_INTERFACE_SEND";
//百行反馈日志(今天反馈日志是昨天05:00报送的),但最近百行反馈日志一直延迟,-1代表向前推一天,既昨天
@Value("${baihang.backLog.delay.day}")
public String BACKLOG_DELAY_DAY;
@Async
@Scheduled(cron = "0 0 18 * * ?")
......@@ -73,10 +77,9 @@ public class RoutineWorkTask {
Stopwatch stopwatch = Stopwatch.createStarted();
//yyyy-MM-dd
//String beforeDatenyr = LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE);
String newDatenyr = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
newDatenyr = newDatenyr.replace("-", "");
//yyyyMMdd
//2020.03.19 本来今天查看今天的反馈日志(今天反馈日志是昨天05:00报送的),但最近百行反馈日志一直延迟1天
String newDatenyr = getNewDatenyr();
log.info("下载(众信利民助贷)百行反馈日志开始>>>>>>>>, newTime: {} , newDatenyr: {} ", LocalDateTime.now(), newDatenyr);
......@@ -109,11 +112,13 @@ public class RoutineWorkTask {
if (StringUtils.isNotEmpty(success)) {
if (StringUtils.isNotEmpty(isEmpty)) {
dingTalk.talk("Info", "下载&处理" + newDatenyr + "(ZXLM助贷)百行反馈日志结束", success);
//dingTalk.talk("Info", "下载&处理" + newDatenyr + "(ZXLM助贷)百行反馈日志结束", success);
if(StringUtils.isNotEmpty(alarm)){
Thread.sleep(500);
//Thread.sleep(500);
dingTalk.talk_ToUser("下载"+newDatenyr+"(ZXLM助贷)百行反馈主日志文件不存在", "下载反馈主日志文件不存在,请注意确认或和百行联系!");
}else{
dingTalk.talk("Info", "下载&处理" + newDatenyr + "(ZXLM助贷)百行反馈日志结束", success);
}
log.info("下载(众信利民助贷)百行反馈日志结束<<<<<<<<, newDatenyr: {}, 耗时: {} ", newDatenyr, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
......@@ -143,8 +148,8 @@ public class RoutineWorkTask {
}
} catch (Exception e) {
log.error("下载(众信利民助贷)百行反馈日志异常<<<<<<<<, newDatenyr: {} ", newDatenyr, e);
dingTalk.talk("Error", "下载&处理(ZXLM助贷)百行反馈日志系统异常", "(" + newDatenyr + ") 异常信息:" + e.toString());
dingTalk.talk_ToUser("下载&处理(ZXLM助贷)百行反馈日志系统异常", "日常处理ZXLM助贷反馈日志系统异常,请尽快手动处理!!!");
//dingTalk.talk("Error", "下载&处理(ZXLM助贷)百行反馈日志系统异常", "(" + newDatenyr + ") 异常信息:" + e.toString());
dingTalk.talk_ToUser("下载&处理(ZXLM助贷)百行反馈日志系统异常", "(" + newDatenyr + ") 日常处理ZXLM助贷反馈日志系统异常,请尽快手动处理!!!");
return;
}
......@@ -165,9 +170,8 @@ public class RoutineWorkTask {
if (StringUtils.isNotEmpty(ip) && (StringUtils.equalsAnyIgnoreCase(ip, "172.21.10.8", "172.17.0.122"))) {
Stopwatch stopwatch = Stopwatch.createStarted();
//yyyy-MM-dd
String newDatenyr = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
newDatenyr = newDatenyr.replace("-", "");
//yyyyMMdd
String newDatenyr = getNewDatenyr();
//指定只有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";
......@@ -284,5 +288,26 @@ public class RoutineWorkTask {
return null;
}
private String getNewDatenyr() {
int bakDay = 0;
if (StringUtils.isNotBlank(BACKLOG_DELAY_DAY)) {
try {
bakDay = Integer.parseInt(BACKLOG_DELAY_DAY);
} catch (Exception e) {
log.error("数字转换异常, BACKLOG_DELAY_DAY: {} ", BACKLOG_DELAY_DAY, e);
}
}
//yyyy-MM-dd
String newDatenyr = null;
if (bakDay != 0) {
newDatenyr = LocalDateTime.now().plusDays(bakDay).format(DateTimeFormatter.ISO_DATE);
} else {
newDatenyr = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
}
newDatenyr = newDatenyr.replace("-", "");
return newDatenyr;
}
}
......@@ -3487,6 +3487,44 @@ public class ManualToolService implements CommonSuperService {
return;
}
private static void buildSelectSql_hmd() {
//`name`,`phone_no`,`id_no`,`type`
List<String> oldD3ReqIdFileList = ReadOrWriteTxt.readTxtList("E:\\桌面_工作\\黑名单项目\\20200317\\参数.txt");
System.out.println("开始,list Size="+oldD3ReqIdFileList.size());
for(String str:oldD3ReqIdFileList){
//599e2b99de5c4959890e65f302b810c9,5c536844-7c11-41de-ad77-6dce26115a5f,BaiRongSpecialList_c,1003,2018-10-20 00:00:00
String[] arry = str.trim().split(",");
String black_list_new = "select * from black_list_new b where b.`name`='"+arry[0]+"' and b.phone_no='"+arry[1]+"' and b.id_no='"+arry[2]+"' and b.type='"+arry[3]+"' UNION ";
System.out.printf(black_list_new + "\n");
}
System.out.println("结束,list Size="+oldD3ReqIdFileList.size());
}
private static void buildSelectInsert_hmd() {
//name,phone_no,id_no,type
List<String> haveList = ReadOrWriteTxt.readTxtList("E:\\桌面_工作\\黑名单项目\\20200317\\have.txt");
System.out.println("开始,list Size="+haveList.size());
Map<String,String> map = new HashMap<>();
for(String str:haveList){
map.put(str.trim(), str.trim());
}
System.out.println("结束,map Size="+map.size());
List<String> allList = ReadOrWriteTxt.readTxtList("E:\\桌面_工作\\黑名单项目\\20200317\\all.txt");
for(String param : allList){
//手机号|姓名|身份证号|major_type|type|black_level|加入黑名单理由|uuid
String[] params = param.split("[|]");
String key = params[1]+","+params[0]+","+params[2]+","+params[4];
if(!map.containsKey(key)){
String sql = "INSERT INTO `black_list_new` (`uuid`, `name`, `phone_no`, `id_no`, `major_type`, `type`, `black_level`, `join_black_reason`) VALUES " +
" ('"+params[7]+"','"+params[1]+"','"+params[0]+"','"+params[2]+"','"+params[3]+"','"+params[4]+"','"+params[5]+"','"+params[6]+"'); ";
System.out.println(sql);
}
}
}
public static void main(String[] args) {
......@@ -3494,12 +3532,15 @@ public class ManualToolService implements CommonSuperService {
//d3_build_20200309();
//d3_build_20200309_ok();
ArrayList<String> fileNameList = new ArrayList<>();
/* ArrayList<String> fileNameList = new ArrayList<>();
getAllFileName("D:\\JavaTeam\\test", fileNameList);
for (String name: fileNameList) {
System.out.println(name);
}
}*/
// buildSelectSql_hmd();
buildSelectInsert_hmd();
}
......
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