天眼查接口

This commit is contained in:
weiyunlong 2024-09-29 17:14:51 +08:00
parent 8e9c6009a7
commit 7792be805b
3 changed files with 143 additions and 0 deletions

View File

@ -104,6 +104,10 @@ public class ContractFormPlugin extends AbstractFormPlugin implements UploadList
}
@Override
public void afterDoOperation(AfterDoOperationEventArgs args) {
DynamicObject dataEntity = this.getView().getModel().getDataEntity();
String billtype = dataEntity.getDynamicObjectType().getName();
super.afterDoOperation(args);
// 开头结尾根据(项目名称和计量单位都有值的记录行导入系统中)---序号属于数字的
// 重复点击时覆盖明细列表数据(先删除再新增)----提示先删除行

View File

@ -0,0 +1,45 @@
package shkd.repc.resm.opplugin;
import com.alibaba.fastjson.JSONObject;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.util.HttpClientUtils;
import kd.bos.util.StringUtils;
import shkd.utils.OAUtils;
import shkd.utils.TycUtils;
import java.util.HashMap;
import java.util.Map;
/**
* 正式供应商一键查询
* qeug_resm_tyc_supplie_ext
*/
public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn {
//天眼查API_测试供应商
public static final String tyc_Test_keyword = "贵州力源液压股份有限公司";
private static final Log logger = LogFactory.getLog(TycSupplierSearchOPPlugin.class);
@Override
public void afterExecuteOperationTransaction(AfterOperationArgs e){
super.afterExecuteOperationTransaction(e);
String operationKey = e.getOperationKey();
//一键查询
if ("search_tyc".equals(operationKey)) {
for (DynamicObject dataEntity : e.getDataEntities()) {
}
}
}
}

View File

@ -0,0 +1,94 @@
package shkd.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.bes.enterprise.hc.core.http.message.BasicNameValuePair;
import com.bes.mq.org.apache.http.HttpEntity;
import com.bes.mq.org.apache.http.HttpResponse;
import com.bes.mq.org.apache.http.NameValuePair;
import com.bes.mq.org.apache.http.client.ClientProtocolException;
import com.bes.mq.org.apache.http.client.methods.HttpGet;
import com.bes.mq.org.apache.http.client.utils.URLEncodedUtils;
import com.bes.mq.org.apache.http.impl.client.DefaultHttpClient;
import com.bes.mq.org.apache.http.params.BasicHttpParams;
import com.bes.mq.org.apache.http.params.HttpConnectionParams;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.util.HttpClientUtils;
import kd.bos.util.StringUtils;
import okhttp3.OkHttpClient;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.*;
import java.net.URI;
import java.util.*;
/**
* 天眼查集成工具类
*/
public class TycUtils {
//天眼查接口正式_token
public static final String tyc_Token = "29493db8-db63-4efe-8530-7b87e0b4b87a";
//天眼查API_企业基本信息(含主要人员)_819
public static final String tyc_Baseinfo = "http://open.api.tianyancha.com/services/open/ic/baseinfoV3/2.0";
//天眼查API_实际控制权_747
public static final String tyc_Companyholding = "http://open.api.tianyancha.com/services/v4/open/companyholding";
//天眼查API_总公司_963
public static final String tyc_ParentCompany = "http://open.api.tianyancha.com/services/open/ic/parentCompany/2.0";
//天眼查API_工商信息_1001
public static final String tyc_Ic = "http://open.api.tianyancha.com/services/open/cb/ic/2.0";
//天眼查API_建筑资质-注册人员_1009
public static final String tyc_RegHuman = "http://open.api.tianyancha.com/services/open/bq/regHuman/2.0";
//天眼查API_建筑资质-工程项目_1011
public static final String tyc_Project = "http://open.api.tianyancha.com/services/open/bq/project/2.0";
//天眼查API_失信被执行人(人员)_1076
public static final String tyc_Dishonest = "http://open.api.tianyancha.com/services/v4/open/human/dishonest";
//天眼查API_被执行(人员)_1077
public static final String tyc_ZhiXingInfo = "http://open.api.tianyancha.com/services/v4/open/human/zhixinginfo";
private static final Log logger = LogFactory.getLog(TycUtils.class);
/**
* http get请求
* @param url 接口url
* @param token token
* @return 返回接口数据
*/
public static String executeGet(String token,String url) {
// 创建 OkHttpClient 对象
OkHttpClient client = new OkHttpClient();
// 创建请求对象设置请求地址
Request request = new Request.Builder()
.url(url)
.header("Content-Type", "application/json")
.header("Authorization", token)
.build();
String resultData = null;
try {
Response response = client.newCall(request).execute();
resultData = response.body().string();
logger.info("接口返回结果:\n{}", resultData);
return resultData;
} catch (IOException e) {
logger.info(String.format("接口异常:%s", e.getMessage()));
throw new RuntimeException(e);
}
}
}