|
|
@ -68,32 +68,32 @@ public class QichachaConfig { |
|
|
|
//每周日凌晨1点执行
|
|
|
|
@Scheduled(cron = "0 0 1 ? * 1") |
|
|
|
public void enterpriseRiskInquiry(){ |
|
|
|
String currDay = DateUtil.format(DateUtil.offsetDay(new Date(), -1), "yyyy-MM-dd"); |
|
|
|
List<EnterpriseInformation> list = enterpriseInformationService.enterpriseInformationList(); |
|
|
|
for (EnterpriseInformation enterpriseInformation : list) { |
|
|
|
String paramStr = "searchKey=" + enterpriseInformation.getEnterpriseName(); |
|
|
|
String status = ""; |
|
|
|
try { |
|
|
|
HttpHead reqHeader = new HttpHead(); |
|
|
|
String[] autherHeader = RandomAuthentHeader(); |
|
|
|
reqHeader.setHeader("Token", autherHeader[0]); |
|
|
|
reqHeader.setHeader("Timespan", autherHeader[1]); |
|
|
|
final String reqUri = URL.concat("?key=").concat(APPkey).concat("&").concat(paramStr); |
|
|
|
String tokenJson = httpGet(reqUri, reqHeader.getAllHeaders()); |
|
|
|
System.out.println(String.format("==========================>this is response:{%s}", tokenJson)); |
|
|
|
status = FormartJson(tokenJson, "Status"); |
|
|
|
System.out.println(String.format("==========================>Status:{%s}", status)); |
|
|
|
BusinessRiskDateDto businessRiskDate = new BusinessRiskDateDto(); |
|
|
|
businessRiskDate.setExecutionTime(currDay); |
|
|
|
businessRiskDate.setBusinessName(enterpriseInformation.getEnterpriseName()); |
|
|
|
//// TODO: 2023/6/7
|
|
|
|
// businessRiskData.setBuSid(businessRiskDate.getSid());
|
|
|
|
// businessRiskDate.setDataList();
|
|
|
|
businessRiskDateService.save(businessRiskDate); |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
// String currDay = DateUtil.format(DateUtil.offsetDay(new Date(), -1), "yyyy-MM-dd");
|
|
|
|
// List<EnterpriseInformation> list = enterpriseInformationService.enterpriseInformationList();
|
|
|
|
// for (EnterpriseInformation enterpriseInformation : list) {
|
|
|
|
// String paramStr = "searchKey=" + enterpriseInformation.getEnterpriseName();
|
|
|
|
// String status = "";
|
|
|
|
// try {
|
|
|
|
// HttpHead reqHeader = new HttpHead();
|
|
|
|
// String[] autherHeader = RandomAuthentHeader();
|
|
|
|
// reqHeader.setHeader("Token", autherHeader[0]);
|
|
|
|
// reqHeader.setHeader("Timespan", autherHeader[1]);
|
|
|
|
// final String reqUri = URL.concat("?key=").concat(APPkey).concat("&").concat(paramStr);
|
|
|
|
// String tokenJson = httpGet(reqUri, reqHeader.getAllHeaders());
|
|
|
|
// System.out.println(String.format("==========================>this is response:{%s}", tokenJson));
|
|
|
|
// status = FormartJson(tokenJson, "Status");
|
|
|
|
// System.out.println(String.format("==========================>Status:{%s}", status));
|
|
|
|
// BusinessRiskDateDto businessRiskDate = new BusinessRiskDateDto();
|
|
|
|
// businessRiskDate.setExecutionTime(currDay);
|
|
|
|
// businessRiskDate.setBusinessName(enterpriseInformation.getEnterpriseName());
|
|
|
|
// //// TODO: 2023/6/7
|
|
|
|
//// businessRiskData.setBuSid(businessRiskDate.getSid());
|
|
|
|
//// businessRiskDate.setDataList();
|
|
|
|
// businessRiskDateService.save(businessRiskDate);
|
|
|
|
// }catch (Exception e){
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
|