2024-11-04 15:32:41 +00:00
|
|
|
package shkd.repc.resm.opplugin;
|
|
|
|
|
|
|
|
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.orm.query.QCP;
|
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
|
2024-11-20 10:22:26 +00:00
|
|
|
import static shkd.utils.TycUtils.*;
|
2024-11-04 15:32:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 正式供应商一键查询(正式供应商_风险查询)
|
|
|
|
* qeug_resm_tyc_supplie_ext
|
|
|
|
*/
|
|
|
|
public class TycSupplierSearchOPPlugin extends AbstractOperationServicePlugIn {
|
|
|
|
|
|
|
|
//天眼查API_供应商名字
|
|
|
|
// public static String tyc_Test_keyword = "";
|
|
|
|
|
|
|
|
private static final Log logger = LogFactory.getLog(TycSupplierSearchOPPlugin.class);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e){
|
|
|
|
|
|
|
|
super.afterExecuteOperationTransaction(e);
|
2024-11-20 10:22:26 +00:00
|
|
|
//把供应商画像是否查询过天眼查字段改为是
|
|
|
|
//正式供应商_风险查询(供应商画像)--查询天眼查按钮
|
2024-11-04 15:32:41 +00:00
|
|
|
String operationKey = e.getOperationKey();
|
|
|
|
if("query_tyc".equals(operationKey)){
|
|
|
|
DynamicObject[] dataEntities1 = e.getDataEntities();
|
|
|
|
DynamicObject dynamicObject = dataEntities1[0];
|
|
|
|
Long supplierid = dynamicObject.getLong("supplierid");
|
|
|
|
QFilter q1 = new QFilter("id", QCP.equals, supplierid);
|
|
|
|
DynamicObject supplier_t = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1});
|
|
|
|
if (null != supplier_t) {
|
2024-11-20 10:22:26 +00:00
|
|
|
queryTyc(supplier_t,1);
|
2024-11-04 15:32:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
//todo 测试定时任务代码
|
|
|
|
//正式供应商列表批量查询
|
|
|
|
if ("query_tyc_zs".equals(operationKey)) {
|
|
|
|
DynamicObject[] dataEntities = e.getDataEntities();
|
|
|
|
for (DynamicObject dataEntity : dataEntities) {
|
|
|
|
String name = dataEntity.getString("name");
|
|
|
|
QFilter q1 = new QFilter("name", QCP.equals, name);
|
|
|
|
//正式供应商
|
|
|
|
DynamicObject supplier = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1});
|
|
|
|
if (null != supplier) {
|
2024-11-20 10:22:26 +00:00
|
|
|
queryTyc(supplier,1);
|
|
|
|
showPreaudits(supplier);//比对天眼查数据
|
2024-11-04 15:32:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|