发布流程复用代码优化

This commit is contained in:
yujh 2024-06-21 15:40:00 +08:00
parent cd3d1f7841
commit 0194c57f44

View File

@ -302,18 +302,70 @@ public class ApplyTasAfterkComplete extends ExecuteListener implements ExecuteLi
bo.set("SUBMITUID",sourceBo.getString("APPLYUSERID"));
bo.set("SUBMITNAME",sourceBo.getString("APPLYUSERNAME"));
bo.set("SEND_SCOPE_ORG",sourceBo.getString("SEND_SCOPE_ORG"));
bo.set("SEND_SCOPE_ORG_NAME", SDK.getORGAPI().getDepartmentById(sourceBo.getString("SEND_SCOPE_ORG")).getName());
bo.set("SEND_SCOPE_ORG_NAME", getSelectedOrg(sourceBo.getString("SEND_SCOPE_ORG")));
bo.set("SEND_SCOPE_POST",sourceBo.getString("SEND_SCOPE_POST"));
String sendScopePost = DBSql.getString("select NAME from VIEW_EU_TESTBZP where ID =?", new Object[]{sourceBo.getString("SEND_SCOPE_POST")});
bo.set("SEND_SCOPE_POST_NAME",sendScopePost);
bo.set("SEND_SCOPE_POST_NAME",getSelectedPost(sourceBo.getString("SEND_SCOPE_POST")));
bo.set("SEND_SCOPE_LEVEL",sourceBo.getString("SEND_SCOPE_LEVEL"));
String sendScopeLevel = DBSql.getString("SELECT RANKSUB_NAME FROM BO_ACT_PAL_LEVEL_SUB WHERE RANKSUB_NO =?", new Object[]{sourceBo.getString("SEND_SCOPE_LEVEL")});
bo.set("SEND_SCOPE_LEVEL_NAME",sendScopeLevel);
bo.set("SEND_SCOPE_LEVEL_NAME",getSelectedLevel(sourceBo.getString("SEND_SCOPE_LEVEL")));
bo.set("MARKAR",sourceBo.getString("MARKAR"));
bo.set("PROCESS_TITLE",sourceBo.getString("PROCESS_TITLE"));
bo.set("PUBLICSTATUS",0);
ProcessInstance processInstance = SDK.getProcessAPI().createBOProcessInstance(PublisherConstant.PROCESSID_HIS_DATA, ctx.getUserContext().getUID(), "");
int i = SDK.getBOAPI().create(PublisherConstant.BO_ACT_PUBLISH_HIS, bo, processInstance, ctx.getUserContext());
}
/**
* 获取选中的部门名称
* @param orgIds
* @return
*/
public String getSelectedOrg(String orgIds) {
String[] split = orgIds.split(",");
String orgNames = "";
for (String orgId : split) {
orgNames += SDK.getORGAPI().getDepartmentById(orgId).getName()+",";
}
if(split.length>1){
//去掉最后一个字符
orgNames = orgNames.substring(0, orgNames.length()-1);
}
return orgNames;
}
/**
* 获取选中的岗位名称
* @param orgIds
* @return
*/
public String getSelectedPost(String postIds) {
String[] split = postIds.split(",");
String postNames = "";
for (String postId : split) {
postNames += DBSql.getString("select NAME from VIEW_EU_TESTBZP where ID =?", new Object[]{postId}) + ",";
}
if(split.length>1){
//去掉最后一个字符
postNames = postNames.substring(0, postNames.length()-1);
}
return postNames;
}
/**
* 获取选中的职级信息
* @param postIds
* @return
*/
public String getSelectedLevel(String levelIds) {
String[] split = levelIds.split(",");
String levelNames = "";
for (String levelId : split) {
levelNames += DBSql.getString("SELECT RANKSUB_NAME FROM BO_ACT_PAL_LEVEL_SUB WHERE RANKSUB_NO =?", new Object[]{levelId}) + ",";
}
if(split.length>1){
//去掉最后一个字符
levelNames = levelNames.substring(0, levelNames.length()-1);
}
return levelNames;
}
}