|
|
|
@ -8,6 +8,7 @@ import com.hxjt.dataupload.utils.HttpUtils; |
|
|
|
import com.xxl.job.core.context.XxlJobHelper; |
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob; |
|
|
|
import org.apache.http.protocol.HTTP; |
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@ -27,11 +28,15 @@ public class FxgkcsJobHandler { |
|
|
|
|
|
|
|
@XxlJob(value = "FxgkcsJobHandler", init = "init", destroy = "destroy") |
|
|
|
public void execute(String param) { |
|
|
|
|
|
|
|
ArrayList<Fxgkcs> fxgkcs = fxfxdxService.getFxgkcss(); |
|
|
|
|
|
|
|
String jobParam = XxlJobHelper.getJobParam(); |
|
|
|
ArrayList<Fxgkcs> fxgkcs = new ArrayList<>(); |
|
|
|
if (jobParam.equals("全量")) { |
|
|
|
fxgkcs = fxfxdxService.getFxgkcss("N"); |
|
|
|
}else if(jobParam.equals("每日")){ |
|
|
|
fxgkcs = fxfxdxService.getFxgkcss("Y"); |
|
|
|
} |
|
|
|
for (int i = 0; i < fxgkcs.size(); i++) { |
|
|
|
|
|
|
|
System.out.println(i + 1); |
|
|
|
String company = fxgkcs.get(i).getQiyemingcheng(); |
|
|
|
String url = "https://www.ny-fxfk.com/space-ningyanghuagongchany/sapi/qpaas/tiga/dys/keyAuthentication/fengxianguankongqing/v1/fengxianguankongqing"; |
|
|
|
switch (company) { |
|
|
|
@ -42,16 +47,16 @@ public class FxgkcsJobHandler { |
|
|
|
try { |
|
|
|
post = HttpUtils.sendDataUpload(url, jsonObject, HTTP.UTF_8, "7CTkAyBoL26Jo7ZMNVmg0EA57A0791FD71AB"); |
|
|
|
//System.out.println("post:"+post.toString());
|
|
|
|
XxlJobHelper.log("执行日志:"+company+post.toString()); |
|
|
|
//XxlJobHelper.log("执行日志:" + company + post.toString());
|
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
XxlJobHelper.handleFail("任务执行失败"+e.getMessage()); |
|
|
|
XxlJobHelper.handleFail("任务执行失败" + e.getMessage()); |
|
|
|
} |
|
|
|
break; |
|
|
|
//System.out.println("post:"+post1.toString());
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|