6 changed files with 343 additions and 0 deletions
@ -0,0 +1,66 @@ |
|||
package com.hxjt.dataupload.jobhandler.doubleprevent; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.hxjt.dataupload.model.entity.doubleprevent.Fxgkcs; |
|||
import com.hxjt.dataupload.model.entity.doubleprevent.Fxsj; |
|||
import com.hxjt.dataupload.service.FxfxdxService; |
|||
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.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.io.IOException; |
|||
import java.util.ArrayList; |
|||
|
|||
|
|||
@Component |
|||
public class FxgkcsJobHandler { |
|||
|
|||
private Logger log = LoggerFactory.getLogger(FxgkcsJobHandler.class); |
|||
|
|||
@Autowired |
|||
FxfxdxService fxfxdxService; |
|||
|
|||
@XxlJob(value = "FxgkcsJobHandler", init = "init", destroy = "destroy") |
|||
public void execute(String param) { |
|||
|
|||
ArrayList<Fxgkcs> fxgkcs = fxfxdxService.getFxgkcss(); |
|||
|
|||
for (int i = 0; i < fxgkcs.size(); i++) { |
|||
|
|||
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) { |
|||
case "山东恒信高科能源有限公司": |
|||
case "恒信中碳氢能源科技(山东)有限公司": |
|||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(fxgkcs.get(i)); |
|||
String post = null; |
|||
try { |
|||
post = HttpUtils.sendDataUpload(url, jsonObject, HTTP.UTF_8, "7CTkAyBoL26Jo7ZMNVmg0EA57A0791FD71AB"); |
|||
//System.out.println("post:"+post.toString());
|
|||
XxlJobHelper.log("执行日志:"+company+post.toString()); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
XxlJobHelper.handleFail("任务执行失败"+e.getMessage()); |
|||
} |
|||
break; |
|||
//System.out.println("post:"+post1.toString());
|
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
private void init() { |
|||
log.info("init 方法调用成功"); |
|||
} |
|||
|
|||
private void destroy() { |
|||
log.info("destroy 方法调用成功"); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,204 @@ |
|||
package com.hxjt.dataupload.model.entity.doubleprevent; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public class Fxgkcs { |
|||
private String qiyemingcheng; |
|||
private String qiyebianma; |
|||
private String weixianhuaxuepindeng; |
|||
private String fengxianfenxiduixian; |
|||
private String fengxianfenxiduixia1; |
|||
private String qukuaimingcheng; |
|||
private String qukuaibianma; |
|||
private String fengxianshijianmingc; |
|||
private String fengxianshijianid; |
|||
private String xuhao; |
|||
private String guankongfangshi; |
|||
private String guankongcuoshineiron; |
|||
private String yinhuanpaichaneiron1; |
|||
private String guankongcuoshifenlei; |
|||
private String guankongcuoshifenle1; |
|||
private String guankongcuoshifenle2; |
|||
private String guankongzhuti; |
|||
private String jiluren; |
|||
private String jilushijian; |
|||
|
|||
public String getQiyemingcheng() { |
|||
return qiyemingcheng; |
|||
} |
|||
|
|||
public void setQiyemingcheng(String qiyemingcheng) { |
|||
this.qiyemingcheng = qiyemingcheng; |
|||
} |
|||
|
|||
public String getQiyebianma() { |
|||
return qiyebianma; |
|||
} |
|||
|
|||
public void setQiyebianma(String qiyebianma) { |
|||
this.qiyebianma = qiyebianma; |
|||
} |
|||
|
|||
public String getWeixianhuaxuepindeng() { |
|||
return weixianhuaxuepindeng; |
|||
} |
|||
|
|||
public void setWeixianhuaxuepindeng(String weixianhuaxuepindeng) { |
|||
this.weixianhuaxuepindeng = weixianhuaxuepindeng; |
|||
} |
|||
|
|||
public String getFengxianfenxiduixian() { |
|||
return fengxianfenxiduixian; |
|||
} |
|||
|
|||
public void setFengxianfenxiduixian(String fengxianfenxiduixian) { |
|||
this.fengxianfenxiduixian = fengxianfenxiduixian; |
|||
} |
|||
|
|||
public String getFengxianfenxiduixia1() { |
|||
return fengxianfenxiduixia1; |
|||
} |
|||
|
|||
public void setFengxianfenxiduixia1(String fengxianfenxiduixia1) { |
|||
this.fengxianfenxiduixia1 = fengxianfenxiduixia1; |
|||
} |
|||
|
|||
public String getQukuaimingcheng() { |
|||
return qukuaimingcheng; |
|||
} |
|||
|
|||
public void setQukuaimingcheng(String qukuaimingcheng) { |
|||
this.qukuaimingcheng = qukuaimingcheng; |
|||
} |
|||
|
|||
public String getQukuaibianma() { |
|||
return qukuaibianma; |
|||
} |
|||
|
|||
public void setQukuaibianma(String qukuaibianma) { |
|||
this.qukuaibianma = qukuaibianma; |
|||
} |
|||
|
|||
public String getFengxianshijianmingc() { |
|||
return fengxianshijianmingc; |
|||
} |
|||
|
|||
public void setFengxianshijianmingc(String fengxianshijianmingc) { |
|||
this.fengxianshijianmingc = fengxianshijianmingc; |
|||
} |
|||
|
|||
public String getFengxianshijianid() { |
|||
return fengxianshijianid; |
|||
} |
|||
|
|||
public void setFengxianshijianid(String fengxianshijianid) { |
|||
this.fengxianshijianid = fengxianshijianid; |
|||
} |
|||
|
|||
public String getXuhao() { |
|||
return xuhao; |
|||
} |
|||
|
|||
public void setXuhao(String xuhao) { |
|||
this.xuhao = xuhao; |
|||
} |
|||
|
|||
public String getGuankongfangshi() { |
|||
return guankongfangshi; |
|||
} |
|||
|
|||
public void setGuankongfangshi(String guankongfangshi) { |
|||
this.guankongfangshi = guankongfangshi; |
|||
} |
|||
|
|||
public String getGuankongcuoshineiron() { |
|||
return guankongcuoshineiron; |
|||
} |
|||
|
|||
public void setGuankongcuoshineiron(String guankongcuoshineiron) { |
|||
this.guankongcuoshineiron = guankongcuoshineiron; |
|||
} |
|||
|
|||
public String getYinhuanpaichaneiron1() { |
|||
return yinhuanpaichaneiron1; |
|||
} |
|||
|
|||
public void setYinhuanpaichaneiron1(String yinhuanpaichaneiron1) { |
|||
this.yinhuanpaichaneiron1 = yinhuanpaichaneiron1; |
|||
} |
|||
|
|||
public String getGuankongcuoshifenlei() { |
|||
return guankongcuoshifenlei; |
|||
} |
|||
|
|||
public void setGuankongcuoshifenlei(String guankongcuoshifenlei) { |
|||
this.guankongcuoshifenlei = guankongcuoshifenlei; |
|||
} |
|||
|
|||
public String getGuankongcuoshifenle1() { |
|||
return guankongcuoshifenle1; |
|||
} |
|||
|
|||
public void setGuankongcuoshifenle1(String guankongcuoshifenle1) { |
|||
this.guankongcuoshifenle1 = guankongcuoshifenle1; |
|||
} |
|||
|
|||
public String getGuankongcuoshifenle2() { |
|||
return guankongcuoshifenle2; |
|||
} |
|||
|
|||
public void setGuankongcuoshifenle2(String guankongcuoshifenle2) { |
|||
this.guankongcuoshifenle2 = guankongcuoshifenle2; |
|||
} |
|||
|
|||
public String getGuankongzhuti() { |
|||
return guankongzhuti; |
|||
} |
|||
|
|||
public void setGuankongzhuti(String guankongzhuti) { |
|||
this.guankongzhuti = guankongzhuti; |
|||
} |
|||
|
|||
public String getJiluren() { |
|||
return jiluren; |
|||
} |
|||
|
|||
public void setJiluren(String jiluren) { |
|||
this.jiluren = jiluren; |
|||
} |
|||
|
|||
public String getJilushijian() { |
|||
return jilushijian; |
|||
} |
|||
|
|||
public void setJilushijian(String jilushijian) { |
|||
this.jilushijian = jilushijian; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "Fxgkcs{" + |
|||
"qiyemingcheng='" + qiyemingcheng + '\'' + |
|||
", qiyebianma='" + qiyebianma + '\'' + |
|||
", weixianhuaxuepindeng='" + weixianhuaxuepindeng + '\'' + |
|||
", fengxianfenxiduixian='" + fengxianfenxiduixian + '\'' + |
|||
", fengxianfenxiduixia1='" + fengxianfenxiduixia1 + '\'' + |
|||
", qukuaimingcheng='" + qukuaimingcheng + '\'' + |
|||
", qukuaibianma='" + qukuaibianma + '\'' + |
|||
", fengxianshijianmingc='" + fengxianshijianmingc + '\'' + |
|||
", fengxianshijianid='" + fengxianshijianid + '\'' + |
|||
", xuhao='" + xuhao + '\'' + |
|||
", guankongfangshi='" + guankongfangshi + '\'' + |
|||
", guankongcuoshineiron='" + guankongcuoshineiron + '\'' + |
|||
", yinhuanpaichaneiron1='" + yinhuanpaichaneiron1 + '\'' + |
|||
", guankongcuoshifenlei='" + guankongcuoshifenlei + '\'' + |
|||
", guankongcuoshifenle1='" + guankongcuoshifenle1 + '\'' + |
|||
", guankongcuoshifenle2='" + guankongcuoshifenle2 + '\'' + |
|||
", guankongzhuti='" + guankongzhuti + '\'' + |
|||
", jiluren='" + jiluren + '\'' + |
|||
", jilushijian='" + jilushijian + '\'' + |
|||
'}'; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue