2024-11-04 15:32:41 +00:00
|
|
|
|
package shkd.repc.resm.opplugin;
|
|
|
|
|
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
|
|
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
|
|
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.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_regsupplier_ext
|
|
|
|
|
*/
|
|
|
|
|
public class TycQzSupplierSearchOPPlugin extends AbstractOperationServicePlugIn{
|
|
|
|
|
|
|
|
|
|
//天眼查API_供应商名字
|
2024-11-20 10:22:26 +00:00
|
|
|
|
// public static String tyc_Test_keyword = "";
|
2024-11-04 15:32:41 +00:00
|
|
|
|
|
|
|
|
|
private static final Log logger = LogFactory.getLog(TycSupplierSearchOPPlugin.class);
|
|
|
|
|
|
|
|
|
|
@Override
|
2024-11-15 09:36:04 +00:00
|
|
|
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
2024-11-04 15:32:41 +00:00
|
|
|
|
super.afterExecuteOperationTransaction(e);
|
|
|
|
|
|
|
|
|
|
String operationKey = e.getOperationKey();
|
2024-11-15 09:36:04 +00:00
|
|
|
|
DynamicObject[] dataEntities = e.getDataEntities();
|
|
|
|
|
if (dataEntities.length == 0) {
|
|
|
|
|
return; // 如果没有数据实体,直接返回
|
|
|
|
|
}
|
|
|
|
|
DynamicObject dynamicObject = dataEntities[0];
|
|
|
|
|
if ("query_tyc".equals(operationKey) || isPreauditQueryNeeded(operationKey, dynamicObject)) {
|
2024-11-20 10:22:26 +00:00
|
|
|
|
//潜在供应商
|
|
|
|
|
DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), "resm_regsupplier");
|
|
|
|
|
queryTyc(resm_regsupplier,0);
|
|
|
|
|
showPreaudits(resm_regsupplier);//比对天眼查数据
|
2024-11-15 09:36:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-04 15:32:41 +00:00
|
|
|
|
|
2024-11-20 10:22:26 +00:00
|
|
|
|
|
2024-11-15 09:36:04 +00:00
|
|
|
|
private boolean isPreauditQueryNeeded(String operationKey, DynamicObject dynamicObject) {
|
|
|
|
|
if ("preaudit".equals(operationKey)) {
|
|
|
|
|
Object pkValue = dynamicObject.getPkValue();
|
|
|
|
|
DynamicObject resm_regsupplier = BusinessDataServiceHelper.loadSingle(pkValue, "resm_regsupplier");
|
|
|
|
|
if (resm_regsupplier != null) {
|
|
|
|
|
DynamicObjectCollection qeugInfocheckentry = resm_regsupplier.getDynamicObjectCollection("qeug_infocheckentry");
|
|
|
|
|
return qeugInfocheckentry.isEmpty(); // 如果集合为空,返回true,表示需要查询
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false; // 不是预审或不需要查询的情况
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-04 15:32:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|