|
@@ -1,82 +0,0 @@
|
|
|
-package cn.com.taiji.gjyzj.task;
|
|
|
-
|
|
|
-import cn.com.taiji.gjyzj.util.ApioneUtils;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import okhttp3.ResponseBody;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import java.io.*;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-/**
|
|
|
- * 任务执行类
|
|
|
- * @author chen mh
|
|
|
- * @date 2023/8/14 10:07
|
|
|
- */
|
|
|
-@Component
|
|
|
-@Slf4j
|
|
|
-public class Schedule {
|
|
|
-
|
|
|
- String region="INTRA";
|
|
|
- String requestUrl="https://api-one.digitalhainan.com.cn/apione";
|
|
|
- String mediaType="application/json";
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 国家邮政局_疑似涉私寄件快递信息(协查函)
|
|
|
- */
|
|
|
- public void gjyzjYsssjjkdxxXch() throws IOException {
|
|
|
- String contentJson = "";
|
|
|
- String ak="AKc7ab48f6470444fa83f55a56c407e2be";
|
|
|
- String sk="SK60d3df8fe75f4ccf938da7fc22179eec";
|
|
|
- String apiName="gjyzj_ysssjjkdxx_xch";
|
|
|
- String path="";
|
|
|
- Map<String, String> headerParamsMap=new HashMap<>();
|
|
|
- headerParamsMap.put("Authorization","Bearer 7bee4ad2-1d1f-36e0-b9ab-625a7e495de2");
|
|
|
- Map<String, String> queryParamsMap=new HashMap<>();
|
|
|
-
|
|
|
- queryParamsMap.put("photo","");
|
|
|
- queryParamsMap.put("photoName","");
|
|
|
- queryParamsMap.put("operateOrg","");
|
|
|
- queryParamsMap.put("operator","");
|
|
|
-
|
|
|
- String call = ApioneUtils.call(contentJson,ak, sk, apiName, region, requestUrl, mediaType, path, headerParamsMap, queryParamsMap);
|
|
|
-
|
|
|
- ResponseBody response = JSON.parseObject(call, ResponseBody.class);
|
|
|
- InputStream in = response.byteStream();
|
|
|
- File outputFile = new File("test.xlsx");
|
|
|
- FileOutputStream outputStream = new FileOutputStream(outputFile);
|
|
|
- byte[] buffer = new byte[1024];
|
|
|
- int bytesRead;
|
|
|
- while ((bytesRead = in.read(buffer)) != -1) {
|
|
|
- outputStream.write(buffer, 0, bytesRead);
|
|
|
- }
|
|
|
-
|
|
|
- outputStream.close();
|
|
|
- in.close();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 国家邮政局_疑似涉私寄件快递信息(结果下载)
|
|
|
- */
|
|
|
- public void gjyzjYsssjjkdxxjgxz(){
|
|
|
- String contentJson = "{\"OPERATEORG\":\"海南省打私办\",\"OPERATOR\":\"王鹏\"}";
|
|
|
- String ak="AKe8fbb21605e04a3f88d78e1110f63c28";
|
|
|
- String sk="SKd7fd481703b64387bab49ff2368d3d5d";
|
|
|
- String apiName="gjyzj_ysssjjkdxx_jgxz";
|
|
|
-
|
|
|
- String path="";
|
|
|
- Map<String, String> headerParamsMap=new HashMap<>();
|
|
|
- headerParamsMap.put("Authorization","Bearer 7bee4ad2-1d1f-36e0-b9ab-625a7e495de2");
|
|
|
- Map<String, String> queryParamsMap=new HashMap<>();
|
|
|
-
|
|
|
- queryParamsMap.put("operateOrg","");
|
|
|
- queryParamsMap.put("operator","");
|
|
|
-
|
|
|
- String call = ApioneUtils.call(contentJson,ak, sk, apiName, region, requestUrl, mediaType, path, headerParamsMap, queryParamsMap);
|
|
|
-
|
|
|
- }
|
|
|
-}
|