致远审批完成后,自动关闭当前审批页面

--xiefeng
This commit is contained in:
xiaosuonian 2024-11-16 13:29:28 +08:00
parent deee720684
commit 2ed76b5de3
1 changed files with 21 additions and 2 deletions

View File

@ -1,10 +1,13 @@
package shkd.todotask; package shkd.todotask;
import kd.bos.form.FormShowParameter;
import kd.bos.logging.Log; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory; import kd.bos.logging.LogFactory;
import kd.bos.mvc.form.FormView;
import kd.bos.workflow.taskcenter.plugin.validate.IApprovalSubPlugin; import kd.bos.workflow.taskcenter.plugin.validate.IApprovalSubPlugin;
import shkd.utils.OAUtils; import shkd.utils.OAUtils;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
@ -15,8 +18,24 @@ public class closeTaskPagePlugin implements IApprovalSubPlugin {
@Override @Override
public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map<String, Object> customParams) { public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map<String, Object> customParams) {
logger.info("进入页面关闭方法"); logger.info("进入页面关闭方法");
logger.info("进入页面关闭方法"); boolean flag = false;
return false; FormView view = (FormView) customParams.get("formView");
FormShowParameter parameter = view.getFormShowParameter();
logger.info("获取view对象成功");
HashMap<String,Object> map = new HashMap<>();
if (parameter.getCustomParams().containsKey("apptype")) {
String apptype = parameter.getCustomParam("apptype");
if ("zhiyuan".equals(apptype)) {
try {
view.close();
}catch (Exception e) {
logger.info("发送指令时异常" + e.getMessage());
throw new RuntimeException(e);
}
flag = true;
}
}
return flag;
} }
} }