起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3924|回复: 5

[结贴] 数据权限出错

[复制链接]

171

主题

481

帖子

2394

积分

金牌会员

Rank: 6Rank: 6

积分
2394
QQ
发表于 2017-3-20 11:56:46 | 显示全部楼层 |阅读模式
版本: BeX5V3.5 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
我的语句中增加了两个子语句,在增加数据权限时,如下图,就报错了。而我在没有设置子表查询的query action中就没有错。请问这个能处理吗?
12.jpg



SELECT FT_PurchaseHeader.*,(select sum(o.fAmount) from FT_PurchaseLine o where o.fPurchaseHeader = FT_PurchaseHeader) as fAmount,(select sum(o.fAmountIncludingVAT) from FT_PurchaseLine o where o.fPurchaseHeader = FT_PurchaseHeader) as fAmountIncludingVAT FROM FT_PurchaseHeader FT_PurchaseHeader WHERE ((FT_PurchaseHeader.fDocumentType='1') AND ((FT_PurchaseHeader.fStatus='2'))) ORDER BY fNo DESC LIMIT 0, 5







2017-03-20 11:52:53 结束-中间文件生成缓存文件: /UI2/FTERP/purchaseMgt/process/purchaseOrder/PurchaseOrder.w
2017-03-20 11:52:55 excute stream action, params:{"accept":"application/json","action":"queryFT_PurchaseHeaderAction","actionFlag":"__action_0__","activity":"PurchaseOrder","contentType":"json","executeContext":"","executor":"","parameters":{"columns":"FT_PurchaseHeader,fAmount,fAmountIncludingVAT,fBuyfromAddress,fBuyfromCity,fBuyfromContact,fBuyfromVendor,fBuyfromVendorName,fBuyfromVendorNo,fCompletelyReceived,fContactName,fCurrency,fDeptCode,fDeptName,fDocumentDate,fDocumentType,fDocumentTypeName,fExpectedReceiptDate,fGenBusPostingGroup,fGlobalDimension1Code,fGlobalDimension2Code,fLastReturnShipmentNo,fLeadTimeCalculation,fLocationCode,fMCNo,fMemo,fNo,fNoSeries,fOrderDate,fPaymentMethodCode,fPaytoAddress,fPaytoCity,fPaytoContact,fPaytoVendor,fPaytoVendorName,fPaytoVendorNo,fPostingDate,fPricesIncludingVAT,fPurchaseName,fPurchaserCode,fReturnShipmentNo,fShipmentMethodCode,fStatus,fStatusName,fSubcontracting,fVATBusPostingGroup,fVendorInvoiceNo,fVendorOrderNo,fVendorPostingGroup,fVersionComment,fVersionNo,sCreateTime,sCreatorCode,sOrgName,version","filter":"(FT_PurchaseHeader.fDocumentType='1') AND ((FT_PurchaseHeader.fStatus='2'))","limit":5,"offset":0,"orderBy":"fNo DESC","variables":{}},"process":"/FTERP/purchaseMgt/process/purchaseOrder/purchaseOrderProcess","translateParameter":{"cellnameByRelation":false,"dataType":"row-list","includeState":true,"rowsConfig":{"concept":"FT_PurchaseHeader","sequence":"FT_PurchaseHeader,fAmount,fAmountIncludingVAT,fBuyfromAddress,fBuyfromCity,fBuyfromContact,fBuyfromVendor,fBuyfromVendorName,fBuyfromVendorNo,fCompletelyReceived,fContactName,fCurrency,fDeptCode,fDeptName,fDocumentDate,fDocumentType,fDocumentTypeName,fExpectedReceiptDate,fGenBusPostingGroup,fGlobalDimension1Code,fGlobalDimension2Code,fLastReturnShipmentNo,fLeadTimeCalculation,fLocationCode,fMCNo,fMemo,fNo,fNoSeries,fOrderDate,fPaymentMethodCode,fPaytoAddress,fPaytoCity,fPaytoContact,fPaytoVendor,fPaytoVendorName,fPaytoVendorNo,fPostingDate,fPricesIncludingVAT,fPurchaseName,fPurchaserCode,fReturnShipmentNo,fShipmentMethodCode,fStatus,fStatusName,fSubcontracting,fVATBusPostingGroup,fVendorInvoiceNo,fVendorOrderNo,fVendorPostingGroup,fVersionComment,fVersionNo,sCreateTime,sCreatorCode,sOrgName,version"},"transformIdcolumn":true,"useNamespace":true}}
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: SELECT FT_PurchaseHeader.*,(select  sum(o.fAmount) from FT_PurchaseLine o  where o.fPurchaseHeader = FT_PurchaseHeader) as fAmount,(select  sum(o.fAmountIncludingVAT) from FT_PurchaseLine o  where o.fPurchaseHeader = FT_PurchaseHeader) as fAmountIncludingVAT  FROM FT_PurchaseHeader FT_PurchaseHeader WHERE ((FT_PurchaseHeader.fDocumentType='1') AND ((FT_PurchaseHeader.fStatus='2'))) ORDER BY fNo DESC LIMIT 0, 5
--> sql:
--> binds: []
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.BizData.query(Unknown Source)
        at BizProcedure.query(BizProcedure.java:12)
        ... 26 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.justep.system.data.DataPermission
        ... 31 more


91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36064
发表于 2017-3-20 14:02:46 | 显示全部楼层
不加数据权限时
SELECT FT_PurchaseHeader.*,(select  sum(o.fAmount) from FT_PurchaseLine o  where o.fPurchaseHeader = FT_PurchaseHeader) as fAmount,(select  sum(o.fAmountIncludingVAT) from FT_PurchaseLine o  where o.fPurchaseHeader = FT_PurchaseHeader) as fAmountIncludingVAT  FROM FT_PurchaseHeader FT_PurchaseHeader WHERE ((FT_PurchaseHeader.fDocumentType='1') AND ((FT_PurchaseHeader.fStatus='2'))) ORDER BY fNo DESC LIMIT 0, 5
执行正确吗?
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

171

主题

481

帖子

2394

积分

金牌会员

Rank: 6Rank: 6

积分
2394
QQ
 楼主| 发表于 2017-3-20 14:18:16 | 显示全部楼层
jishuang 发表于 2017-3-20 14:02
不加数据权限时
SELECT FT_PurchaseHeader.*,(select  sum(o.fAmount) from FT_PurchaseLine o  where o.fP ...

删除了数据权限执行没有问题的。我估计是和子查询有关的问题。
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36064
发表于 2017-3-20 15:10:53 | 显示全部楼层
你好楼主,这个问题需要我在本地环境进行问题重现,所以会花费较长时间,请你耐心等待,我完成后会第一时间反馈结果,谢谢!
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

171

主题

481

帖子

2394

积分

金牌会员

Rank: 6Rank: 6

积分
2394
QQ
 楼主| 发表于 2017-3-20 15:18:13 | 显示全部楼层
jishuang 发表于 2017-3-20 15:10
你好楼主,这个问题需要我在本地环境进行问题重现,所以会花费较长时间,请你耐心等待,我完成后会第一时间 ...

我们在客户现场,比较着急,谢谢您了
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36064
发表于 2017-3-20 17:14:33 | 显示全部楼层
用一个子查询报错吗?本地测试一个子查询是没问题的
data.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-22 01:42 , Processed in 0.108313 second(s), 28 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表