创建了一个新的转换规则,通过采购入库单下推销售出库单,下推后审核销售出库单,系统提示错误,还请各位老师予以处理,谢谢报错信息如下:
不能在具有唯一索引“IDX_STK_INVENTORY_CLUST”的对象“dbo.T_STK_INVENTORY”中插入重复键的行。重复键值为 (106942, 104202, 1, BD_KeeperOrg, 1, BD_OwnerOrg, 1, 0, 0, 10000, 107091, 0, , ,
语句已终止。
详细信息如下:
发生时间: 2015-12-17 06:30:39
错误编号: BOS_ExecuteNonQuery
错误信息: 不能在具有唯一索引“IDX_STK_INVENTORY_CLUST”的对象“dbo.T_STK_INVENTORY”中插入重复键的行。重复键值为 (106942, 104202, 1, BD_KeeperOrg, 1, BD_OwnerOrg, 1, 0, 0, 10000, 107091, 0, , ,
语句已终止。
Sql语句:
MERGE INTO T_STK_INVENTORY IT
USING (SELECT MIN(FINVENTORYID) AS FINVENTORYID, SUM(FBASEQTY) AS FBASEQTY,SUM(FSECQTY) AS FSECQTY,
FSTOCKORGID,FKEEPERTYPEID,FKEEPERID,FOWNERTYPEID,FOWNERID,FSTOCKID,FSTOCKLOCID,FAUXPROPID,FSTOCKSTATUSID,
FLOT,FBOMID,FMTONO,FPROJECTNO,FPRODUCEDATE,FEXPIRYDATE,FBASEUNITID,FSTOCKUNITID,FMATERIALID,FSECUNITID
FROM #TM_STK_UpdateStockToTemp
GROUP BY FMATERIALID,FSTOCKORGID,FKEEPERTYPEID,FKEEPERID,FOWNERTYPEID,FOWNERID,FSTOCKID,FSTOCKLOCID,FAUXPROPID,FSTOCKSTATUSID,
FLOT,FBOMID,FMTONO,FPROJECTNO,FPRODUCEDATE,FEXPIRYDATE,FBASEUNITID,FSTOCKUNITID,FSECUNITID ) IT2
ON (IT.FID = IT2.FINVENTORYID)
WHEN MATCHED THEN
UPDATE SET IT.FBASEQTY = IT.FBASEQTY + IT2.FBASEQTY,IT.FSECQTY = IT.FSECQTY + IT2.FSECQTY
WHEN NOT MATCHED THEN
INSERT (FID,FSTOCKORGID,FKEEPERTYPEID,FKEEPERID,FOWNERTYPEID,FOWNERID,FSTOCKID,
FSTOCKLOCID,FAUXPROPID,FSTOCKSTATUSID,FLOT,FBOMID,FMTONO,FPROJECTNO,FPRODUCEDATE,
FEXPIRYDATE,FBASEUNITID,FBASEQTY,FBASELOCKQTY,FSECQTY,FSECLOCKQTY,FSTOCKUNITID,FMATERIALID,FQTY,FLOCKQTY,FSECUNITID,
FOBJECTTYPEID,FBASEAVBQTY,FAVBQTY,FSECAVBQTY)
VALUES(IT2.FINVENTORYID,IT2.FSTOCKORGID,IT2.FKEEPERTYPEID,IT2.FKEEPERID,IT2.FOWNERTYPEID,IT2.FOWNERID,IT2.FSTOCKID,
IT2.FSTOCKLOCID,IT2.FAUXPROPID,IT2.FSTOCKSTATUSID,IT2.FLOT,IT2.FBOMID,IT2.FMTONO,IT2.FPROJECTNO,IT2.FPRODUCEDATE,
IT2.FEXPIRYDATE,IT2.FBASEUNITID,IT2.FBASEQTY,0,IT2.FSECQTY,0,IT2.FSTOCKUNITID,IT2.FMATERIALID,0,0,IT2.FSECUNITID,
'STK_Inventory',0,0,0) ;
===================================================
调用堆栈:
Server stack trace:
at Kingdee.K3.SCM.App.Core.AppBusinessService.UpdateStockService.DoActionBatch(AppBusinessServiceArgs e)
at Kingdee.BOS.App.Core.AbstractOprerationService.ExecuteFormBusinessService(IAppFormBusinessService iBusiness, ExtendedDataEntity[] dataEntities, FormBusinessService service)
at Kingdee.BOS.App.Core.AbstractOprerationService.InvokeFormBusiness(DynamicObject[] objs, Int32 iActionPoint)
at Kingdee.BOS.App.Core.AbstractOprerationService.CallOperation(DynamicObject[]& objs)
at Kingdee.BOS.App.Core.AbstractOprerationService.CallOperatinTransaction(DynamicObject[] objs)
at Kingdee.BOS.App.Core.AbstractOprerationService.DoExcete()
at Kingdee.BOS.App.Core.AbstractOprerationService.Excute(Object[] ids)
at Kingdee.BOS.App.Core.SetStatusService.SetBillStatus(Context ctx, BusinessInfo businessInfo, List`1 pkEntryIds, List`1 paras, String operationNumber, OperateOption option)
Exception rethrown at [0]:
at Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.SetBillStatus(Context ctx, BusinessInfo businessInfo, List`1 pkEntryIds, List`1 paras, String operationNumber, OperateOption option)
at Kingdee.BOS.Business.Bill.Operation.AbstractStatusConvert.ExecuteBillOperation(List`1 paras, OperateOption option)
at Kingdee.BOS.Business.Bill.Operation.AbstractStatusConvert.ExecuteStatusConvert(List`1 paras)
at Kingdee.BOS.Business.Bill.Operation.Audit.AuditIdeaPrompt()
at Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormOperation.Operation(CallBackWfAfterOperation callbackwf, IOperationResult result)
我的联系QQ:910869714