销售订单选择物料 后录入数量后报错
金蝶云社区-云社区用户7x6E5966
云社区用户7x6E5966
0人赞赏了该文章 685次浏览 未经作者许可,禁止转载编辑于2017年11月08日 12:34:37
销售订单选择物料 然后录入数量后 报错 如下:
[{"operation":"SAL_SaleOrder.UpdateValue"}]发生时间: 2017-11-07 12:25:09错误编号: BOS_ExecuteNonQuery错误信息: MERGE 语句试图多次更新或删除同一行。目标行与多个源行匹配时会出现这种情况。MERGE 语句无法多次更新/删除目标表的同一行。请简化 ON 子句,以确保目标行最多与一个源行匹配,也可以使用 GROUP BY 子句对源行分组。Sql语句: merge into #TM_BD_UnitBatchConvert u1using(SELECT DISTINCT A.FMTRL, A.FCURID, A.FDESTID, A.FID, ISNULL(TM.FMASTERID,0) fmasterid, CONVERT(DECIMAL(23,10), CASE WHEN T4.FUNITGROUPID = T6.FUNITGROUPID THEN (CAST((BD1.FCONVERTNUMERATOR* BD2.FCONVERTDENOMINATOR) AS NUMERIC(23, 10)) / CAST((BD1.FCONVERTDENOMINATOR* BD2.FCONVERTNUMERATOR) AS NUMERIC(23, 10))) ELSEISNULL((CAST((CAST((CAST((BD1.FCONVERTNUMERATOR * T8.FCONVERTNUMERATOR) ASNUMERIC(23, 10)) * BD2.FCONVERTDENOMINATOR) AS NUMERIC(23, 10)) * T9.FCONVERTDENOMINATOR)AS NUMERIC(23, 10)) / CAST((CAST((CAST((BD1.FCONVERTDENOMINATOR *T8.FCONVERTDENOMINATOR) AS NUMERIC(23, 10)) * BD2.FCONVERTNUMERATOR) ASNUMERIC(23, 10)) * T9.FCONVERTNUMERATOR) AS NUMERIC(23, 10))), -1) END) rate,ISNULL(T3.FPrecision, 0) fprecision, ISNULL(T3.FRoundType, '1') froundtype,CASE WHEN T4.FUNITGROUPID =T6.FUNITGROUPID THEN CAST((BD1.FCONVERTNUMERATOR * BD2.FCONVERTDENOMINATOR) ASNUMERIC(23, 10)) ELSE ISNULL(CAST((CAST((CAST((BD1.FCONVERTNUMERATOR *T8.FCONVERTNUMERATOR) AS NUMERIC(23, 10)) * BD2.FCONVERTDENOMINATOR) ASNUMERIC(23, 10)) * T9.FCONVERTDENOMINATOR) AS NUMERIC(23, 10)), -1.0) ENDfconvertnumerator, CASE WHENT4.FUNITGROUPID = T6.FUNITGROUPID THEN CAST((BD1.FCONVERTDENOMINATOR *BD2.FCONVERTNUMERATOR) AS NUMERIC(23, 10)) ELSEISNULL(CAST((CAST((CAST((BD1.FCONVERTDENOMINATOR * T8.FCONVERTDENOMINATOR) ASNUMERIC(23, 10)) * BD2.FCONVERTNUMERATOR) AS NUMERIC(23, 10)) *T9.FCONVERTNUMERATOR) AS NUMERIC(23, 10)), -1.0) END fconvertdenominator, CASE WHEN T4.FUNITGROUPID = T6.FUNITGROUPID THEN 1ELSE 0 END isgroup, CASE WHEN A.FCURID =A.FDESTID THEN '0' ELSE CASE WHENT4.FUNITGROUPID = T6.FUNITGROUPID THEN CASE WHEN (BD1.FCONVERTTYPE = '1' OR BD2.FCONVERTTYPE = '1') THEN '1' ELSE'0' END ELSE CASE WHEN ((((BD1.FCONVERTDENOMINATOR* T8.FCONVERTDENOMINATOR) * BD2.FCONVERTNUMERATOR) * T9.FCONVERTNUMERATOR) ISNULL) THEN '-1' ELSE CASE WHEN(BD1.FCONVERTTYPE = '1' OR BD2.FCONVERTTYPE = '1' OR T8.FCONVERTTYPE = '1' ORT9.FCONVERTTYPE = '1') THEN '1' ELSE '0' END END END END converttype FROM#TM_BD_UnitBatchConvert A LEFT OUTER JOIN T_BD_MATERIAL TM ON (A.FMTRL =TM.FMasterId AND TM.FCREATEORGID = TM.FUSEORGID) LEFT OUTER JOINT_BD_MATERIALBASE TB ON TM.FMaterialId = TB.FMaterialId LEFT OUTER JOINT_BD_UNIT T2 ON A.FCURID = T2.FUNITID LEFT OUTER JOIN T_BD_UNIT T3 ON A.FDESTID= T3.FUNITID LEFT OUTER JOIN T_BD_UNITGROUP T4 ON T4.FUNITGROUPID =T2.FUNITGROUPID LEFT OUTER JOIN T_BD_UNIT T5 ON (T4.FBASEUNITNUMBER =T5.FNUMBER AND T4.FUNITGROUPID = T5.FUNITGROUPID) LEFT OUTER JOINT_BD_UNITCONVERTRATE BD1 ON ((BD1.FCURRENTUNITID = A.FCURID AND BD1.FDESTUNITID= T5.FUNITID) AND BD1.FMASTERID = 0) LEFT OUTER JOIN T_BD_UNITGROUP T6 ONT6.FUNITGROUPID = T3.FUNITGROUPID LEFT OUTER JOIN T_BD_UNIT T7 ON(T6.FBASEUNITNUMBER = T7.FNUMBER AND T6.FUNITGROUPID = T7.FUNITGROUPID) LEFTOUTER JOIN T_BD_UNITCONVERTRATE BD2 ON ((A.FDESTID = BD2.FCURRENTUNITID ANDT7.FUNITID = BD2.FDESTUNITID) AND BD1.FMASTERID = 0) LEFT OUTER JOINT_BD_UNITCONVERTRATE T8 ON ((T5.FUNITID = T8.FCURRENTUNITID AND TB.FBASEUNITID= T8.FDESTUNITID) AND (T8.FMASTERID = TM.FMASTERID OR T8.FMASTERID = 0)) LEFTOUTER JOIN T_BD_UNITCONVERTRATE T9 ON ((T7.FUNITID = T9.FCURRENTUNITID ANDTB.FBASEUNITID = T9.FDESTUNITID) AND (T9.FMASTERID = TM.FMASTERID ORT9.FMASTERID = 0))) u2 on (u1.FID = u2.FID) when matched then update set u1.FRATENUM=u2.FCONVERTNUMERATOR,u1.FRATENOM=u2.FCONVERTDENOMINATOR, u1.FPRECESION=u2.FPrecision,u1.FROUNDTYPE=u2.FRoundType,u1.FISGROUP =u2.IsGroup, u1.FCONVERTTYPE=u2.CONVERTTYPE;===================================================调用堆栈: Server stack trace: atKingdee.BOS.App.Data.AbstractDatabase.ExecuteNonQuery(DbCommand command,IEnumerable`1 listParam) atKingdee.BOS.App.Data.DBUtils.Execute(Context ctx, String strSQL, IEnumerable`1paramList, Boolean needTranslate) atKingdee.BOS.App.Data.DBUtils.Execute(Context ctx, String strSQL) Exception rethrown at [0]: atSystem.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) atSystem.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData, Int32 type) atKingdee.BOS.Contracts.IDBService.Execute(Context ctx, String strSQL) atKingdee.K3.BD.App.Core.UnitConvertService.GetUnitConvertRateBatch(Context ctx,List`1 lstParam) atKingdee.K3.BD.App.Core.UnitConvertService.GetUnitConvertRate(Context ctx,GetUnitConvertRateArgs param) atKingdee.K3.BD.ServiceHelper.UnitConvertServiceHelper.GetUnitConvertRate(Contextctx, GetUnitConvertRateArgs param) atKingdee.K3.BD.Business.BusinessService.QTYConversion.GetUnitConvertRate(Int64materialId, Int64 msterId, Int64 destUnitId, Int64 srcUnitId) atKingdee.K3.BD.Business.BusinessService.QTYConversion.GetRateByActiveRow(BOSDynamicRowactiveBOSRow, String destQtyFieldKey, String srcQtyFieldKey, StringmaterialFieldKey, QtyConvertParameter& qtyParam) atKingdee.K3.BD.Business.BusinessService.QTYConversion.SetDestQtyPropertyData(String[]parameters, String roundTypeParam, FormBusinessServiceArgs e) atKingdee.K3.BD.Business.BusinessService.QTYConversion.DoAction(FormBusinessServiceArgse) atKingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.ExceuteServices(List`1sers, DynamicObject activeRow, Int32 rowIndex) atKingdee.BOS.Core.DependencyRules.EntityRule.Execute(BOSActionExecuteContextcontext) atKingdee.BOS.Core.DependencyRules.RuleContainer`6.Execute(C executeContext,TaskCollection tasks) atKingdee.BOS.Core.DependencyRules.RuleContainer`6.Resume(C executeContext) atKingdee.BOS.Core.DependencyRules.RuleContainer`6.Raise(S arg, C executeContext) atKingdee.BOS.Core.DependencyRules.BOSRuleContainer.RaiseDataChanged(StringfieldKey, Object dataEntity, BOSActionExecuteContext executeContext) atKingdee.BOS.Web.DynamicForm.DataBinder.FieldDataChanged(ModelDataChangedEventArgse) atKingdee.BOS.Core.DynamicForm.ModelDataChangedHandle.Invoke(Object sender,ModelDataChangedEventArgs e) atKingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.UpdateField(Field field,DynamicObject activeRow, Object value, Int32 rowIndex, Object oldValue) atKingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Field field, DynamicObjectactiveRow, Object value, Int32 rowIndex) atKingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(Field field,Object value, Int32 row) atKingdee.BOS.Core.DynamicForm.AbstractDynamicFormModel.SetValue(String key,Object value, Int32 row) atKingdee.BOS.Web.DynamicForm.DynamicWebFormView.UpdateValue(String key, Int32row, Object value) atKingdee.BOS.Web.Bill.BillView.UpdateValue(String key, Int32 row, Object value) atKingdee.BOS.Web.DynamicForm.DynamicWebFormController.UpdateValue(String key,Object value, Int32 row, JSONArray postDatas)

报错.png(72.22KB)