现象:
在开发平台,举例如下图,我们想要对贴现申请这个单据进行扩展,扩展应用内并没有发现贴现申请的扩展页面,系统
提示,该页面只允许扩展1次。
这样的情况造成了标准单据无法扩展了。
继续分析下去,我们可以点开页面下的继承关系视图,可以看到这个标准页面下是有一个扩展页面的。如下图
那就能回答这个单据提示只允许扩展1次的原因,就是原来它是有扩展的,但是在系统里面是看不到的。
我们可以选择下面的扩展标识打开,并点击确定,此时系统就报错了
cosmic-kingdee-EnKiS5e4:null Key: btnok TraceId:1860501c33ef900a Instance:cosmic-kingdee-EnKiS5e4-8810347426 发生时间:Sun Mar 31 00:02:57 CST 2024 =================================================== 调用堆栈: java.lang.NullPointerException at kd.bos.devportal.plugin.BizHierarchyPlugin.gotoSelectedPage(BizHierarchyPlugin.java:75) at kd.bos.devportal.plugin.BizHierarchyPlugin.click(BizHierarchyPlugin.java:49) at kd.bos.form.control.Button.fireClick(Button.java:219) at kd.bos.form.control.Button.click(Button.java:159) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:278) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:222) at kd.bos.mservice.form.FormServiceImpl.invokeMethod(FormServiceImpl.java:1558) at kd.bos.mservice.form.FormServiceImpl.invokeAction(FormServiceImpl.java:995) at kd.bos.mservice.form.FormServiceImpl.batchInvokeAction(FormServiceImpl.java:646) at sun.reflect.GeneratedMethodAccessor252.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at kd.bos.service.DispatchServiceImpl.invoke(DispatchServiceImpl.java:48) at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at kd.bos.mservice.rpc.dubbo.debug.LocalDebugProxy$1.lambda$invoke$0(LocalDebugProxy.java:61) at kd.bos.mservice.rpc.dubbo.debug.DubboDebugUtil.invoke(DubboDebugUtil.java:46) at kd.bos.mservice.rpc.dubbo.debug.LocalDebugProxy$1.invoke(LocalDebugProxy.java:58) at com.sun.proxy.$Proxy43.invoke(Unknown Source) at kd.bos.web.DispatchServiceHelper.invokeBOSServiceByAppId(DispatchServiceHelper.java:93) at kd.bos.web.actions.FormAction.batchInvokeAction(FormAction.java:224) at sun.reflect.GeneratedMethodAccessor251.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at kd.bos.actiondispatcher.Invoker.invoke(Invoker.java:23) at kd.bos.actiondispatcher.ActionFilter.doFilter(ActionFilter.java:174) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.cage.controller.CageActionFilter.doFilter(CageActionFilter.java:23) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.login.filter.LoginFilter.doFilter(LoginFilter.java:725) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.metric.instruments.servlet.MetricFilter.doFilter(MetricFilter.java:95) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.trace.instrument.web.TraceFilter.generateTraceId(TraceFilter.java:139) at kd.bos.trace.instrument.web.TraceFilter.doFilter(TraceFilter.java:103) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.framework.filter.ThreadLifeCycleFilter.doFilter(ThreadLifeCycleFilter.java:36) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.mservice.circuitbreaker.filter.web.CircuitbreakerFilter.lambda$doFilter$0(CircuitbreakerFilter.java:50) at kd.bos.mservice.circuitbreaker.noop.NoopCircuitbreaker.call(NoopCircuitbreaker.java:43) at kd.bos.mservice.circuitbreaker.filter.web.CircuitbreakerFilter.doFilter(CircuitbreakerFilter.java:49) at kd.bos.service.web.filter.KFilterConfig$2.doFilter(KFilterConfig.java:278) at kd.bos.service.web.filter.KDCommonFilter$2.doFilter(KDCommonFilter.java:75) at kd.bos.service.web.filter.KDCommonFilter.doFilter(KDCommonFilter.java:103) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:292) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:234) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.Server.handle(Server.java:516) at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) at java.lang.Thread.run(Thread.java:748)
同时我们把扩展的bidt_cdm_discount_app_ext 这个标识放到搜索框也是查询不到的
问题分析:
在苍穹旧版本元数据迁移到新版本过程中偶有出现这种问题,因为旧版本对单据控制不严格
也有现场开发手动修改xml元数据,造成了关系错乱,
也有单据多重横向扩展的问题,中间又删除部分应用的问题。
种种的原因造成了,扩展应用与扩展单据的关联关系丢失,而这个扩展单据就像一个“幽灵”,在系统里面查不到,但是却是实际存在数据库中的。
解决方案:
方案1
如果手里有这个扩展单据的元数据的zip包,可以通过脚本在环境上通过脚本删除数据,再在扩展应用上导入这个扩展单据。
公有云沙箱在系统库,其他环境都在meta库
ps.操作前记得备份,并进行数据的确认,是否为对应的数据
DELETE FROM T_META_FORMDESIGN WHERE FNUMBER = "xxxxxxx_ext";
DELETE FROM T_META_ENTITYDESIGN WHERE FNUMBER = "xxxxxxx_ext";
DELETE FROM T_META_ENTITYDESIGN_L WHERE FNUMBER = "xxxxxxx_ext";
DELETE FROM T_META_FORMDESIGN_L WHERE FNUMBER = "xxxxxxx_ext";
DELETE FROM T_META_FORM WHERE FNUMBER LIKE "xxxxxxx_ext%";
DELETE FROM T_META_ENTITY WHERE FNUMBER LIKE "xxxxxxx_ext%";
方案2
也可以直接通过修改脚本,把扩展应用与扩展单据的关联关系重新关联起来
公有云沙箱在系统库,其他环境都在meta库
update t_meta_formdesign set fbizappid ='当前扩展应用的id' where FID = '当前扩展单据的id';
update t_meta_entitydesign set fbizappid ='当前扩展应用的id' where FID = '当前扩展单据的id';
update T_meta_bizunitrelform set fbizappid='当前扩展应用的id' where fformid='当前扩展单据的id';
那如何去查当前扩展应用的id
select fid,fnumber from t_meta_bizapp where fnumber ='xxxxxxx_ext'
--xxxxxxx_ext为应用编码
那如何去查当前扩展单据的id
select fid,fnumber from t_meta_formdesign where FNUMBER = 'xxxxxxx_ext';
--xxxxxxx_ext为单据编码
脚本执行完,刷新开发平台重新进入即可
如果方案2,依然在扩展页面里面找不到,可以通过开发体检来修复一次试下
推荐阅读