package shkd.todotask; import com.alibaba.fastjson.JSON; import kd.bos.form.FormShowParameter; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; import kd.bos.mvc.form.FormView; import kd.bos.workflow.taskcenter.plugin.validate.IApprovalSubPlugin; import shkd.utils.OAUtils; import java.util.HashMap; import java.util.Map; /** * 待办提交关闭页面 */ public class closeTaskPagePlugin implements IApprovalSubPlugin { private static final Log logger = LogFactory.getLog(closeTaskPagePlugin.class); @Override public boolean executeClosePageAfterSubmitTask(boolean isPCShow, Map customParams) { logger.info("进入页面关闭方法"); boolean flag = false; FormView view = (FormView) customParams.get("formView"); FormShowParameter parameter = view.getFormShowParameter(); logger.info("获取view对象成功"); if (parameter.getCustomParams().containsKey("apptype")) { String apptype = parameter.getCustomParam("apptype"); if ("zhiyuan".equals(apptype)) { if (isPCShow) { try { view.close(); } catch (Exception e) { logger.info("发送指令时异常" + e.getMessage()); throw new RuntimeException(e); } flag = true; } else { // HashMap map = new HashMap<>(); // map.put("method", "closeWebView"); // String mapString = JSON.toJSONString(map); // view.executeClientCommand("callAPPApi", map); // logger.info("准备发送指令" + mapString); logger.info("准备关闭移动页面"); view.close(); flag = true; } } } return flag; } }