异构系统技能接入设计文档
异构系统技能接入数字员工管理平台,除了需在管理平台新增技能外,还需要代码二开实现sdk-fi.jar中的kd.sdk.fi.fatvs.extpoint.skill.ISkillRunnableExtPlugin接口。同时根据业务需求在开发服务云-扩展平台-业务拓展点-业务拓展插件注册,实现以下业务拓展场景:
获取技能运行数据,必须实现的方法。该方法用于数字员工管理平台定时任务拉取异构系统技能的运行数据;
展示技能使用指标,非必须实现的方法。该方法用于数字员工管理平台异构系统技能的详情页点击运行指标时跳转第三方页面;
展示技能运行分析页,非必须实现的方法。该方法用于数字员工管理平台异构系统技能的详情页是否展示技能运行分析页,如果不实现该方法默认展示技能指标
代码参考如下:
package kd.fi.fatvs.business.task; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.List;
import java.util.Map;
import kd.bos.dataentity.resource.ResManager; import kd.bos.form.FormMetadataCache;
import kd.bos.form.FormShowParameter; import kd.bos.form.IFormView;
import kd.bos.form.ShowType; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.report.ReportShowParameter;
import kd.sdk.fi.fatvs.extpoint.skill.ISkillRunnableExtPlugin; import kd.sdk.fi.fatvs.extpoint.skill.SkillIndicatorParam;
import kd.sdk.fi.fatvs.extpoint.skill.SkillRunAnalysisPageParam; import kd.sdk.fi.fatvs.extpoint.skill.SkillRunExtContext;
import kd.sdk.fi.fatvs.extpoint.skill.SkillRunExtResult;
/**
* @author xq_chen
* @description TODO
* @date 2023/6/7 14:18
*/
public class SkillRunnableExtPluginTestImpl implements ISkillRunnableExtPlugin { private static final Log log =
LogFactory.getLog(SkillRunnableExtPluginTestImpl.class);
@Override
public SkillRunExtResult pullData(SkillRunExtContext runExtContext) { log.info("pull data:" + runExtContext);
// 直接从入参获取 返回对象
SkillRunExtResult skillResult = runExtContext.getSkillResult();
// 获取技能id
Long skillId = runExtContext.getSkillId();
// 获取技能编码
String skillNum = runExtContext.getSkillNum();
// 获取数据的 开始时间 2022-06-29 00:00:00
Date startTime = runExtContext.getStartTime();
// 获取数据的 截止时间 2022-06-29 23:59:59 Date endTime = runExtContext.getEndTime();
// 根据各服务技能获取相关数据,保存入返回值skillResult
// 示例
Map<String, String> param1Map = new HashMap<>();
param1Map.put("name", "自动对账成功率");
param1Map.put("value", "10%");
param1Map.put("valueType", "1");// "0" : 纯数字,"1":带百分号
param1Map.put("number", "zddzcgl");// name 的拼音首字母
Map<String, String> param2Map = new HashMap<>();
param2Map.put("name", "排队任务");
param2Map.put("value", "260");
param2Map.put("valueType", "0");
param2Map.put("number", "pdrw");// name 的拼音首字母
Map<String, String> param3Map = new HashMap<>(); param3Map.put("name", "哈哈");
param3Map.put("value", "77%");
param3Map.put("valueType", "1");
param3Map.put("number", "hh");// name 的拼音首字母Map<String, String> param4Map = new HashMap<>(); param4Map.put("name", "啦啦啦");
param4Map.put("value", "33");
param4Map.put("valueType", "0");
param1Map.put("number", "lll");// name 的拼音首字母
List<Map<String, String>> list = new ArrayList<>(); list.add(param1Map);
list.add(param2Map); list.add(param3Map); list.add(param4Map);
skillResult.setData(list);
skillResult.setDate(runExtContext.getStartTime());
skillResult.setSkillNum(skillNum);
skillResult.setFailCount(20);
skillResult.setTotalCount(2000);
return skillResult;
}
@Override
public void showSkillIndicator(SkillIndicatorParam indicatorParam) { log.info("show skill indicator:" + indicatorParam);
IFormView view = indicatorParam.getView(); view.showSuccessNotification(String.format(
ResManager.loadKDString("技能编码:%s,技能指标:%s",
"SkillRunnableExtPluginTestImpl_0", "fi-fatvs-business"),
indicatorParam.getSkillNum(), indicatorParam.getIndicatorNum()));
}
@Override
public void showSkillRunAnalysisPage(SkillRunAnalysisPageParam pageParam) { log.info("show skill indicator:" + pageParam);
String modelType =
FormMetadataCache.getFormConfig("fatvs_op_record").getModelType(); FormShowParameter showParam = new FormShowParameter();
if ("report".equalsIgnoreCase(modelType)) { showParam = new ReportShowParameter();
}
showParam.setFormId("fatvs_op_record");
showParam.getOpenStyle().setShowType(ShowType.InContainer); showParam.getOpenStyle().setTargetKey("content");
showParam.setCustomParam("fatvsFlag", "true"); pageParam.getView().showForm(showParam);
}
}
异构系统技能接入设计文档
本文2024-09-22 22:57:37发表“云星瀚知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-xinghan-129962.html