WISE14.2 新开发的BOS单据下推调拨单报错解决
BOS中新开发一个单据,在打补丁PT119105、PT145265、PT155779后下推调拨单报错:
使用SQL Profiler跟踪得到以下语句:
SELECT Getdate()
SELECT t2.FName_CHS AS FName,t1.FSourClassTypeID As FSourClassTypeID FROM ICClassLink t1 INNER JOIN ICClassType t2 ON t1.FSourClassTypeID=t2.FID WHERE FIsUsed=2 AND FMustSelected IN(1,3) AND FDestClassTypeID =-41
SET NOCount ON
CREATE Table #TempTable(FItemID int)
INSERT INTO #TempTable VALUES(9492)
INSERT INTO #TempTable VALUES(20097)
INSERT INTO #TempTable VALUES(8449)
INSERT INTO #TempTable VALUES(36385)
INSERT INTO #TempTable VALUES(42141)
select isnull(FSerialclassID,0) as FSerialclassID,isnull(FIsSNManage,0) as FIsSNManage,t1.FItemID from t_IcItem t1
INNER JOIN #TempTable t2 ON t1.FItemID=t2.FItemID
SELECT FIndex,FComponentName,FComponentSrv FROM t_ThirdPartyComponent WHERE FTypeID=0 AND FTypeDetailID=41 AND FComponentName <> 'K3AuditTransBill.cAuditLog' AND FComponentSrv <> 'K3MAuditTransBill.cAudit_Bill' ORDER BY FIndex
SELECT count(c.name) FROM sysobjects o inner join syscolumns c on o.id=c.id inner join systypes t on c.xtype=t.xtype and c.xusertype=t.xusertype where t.name='uniqueidentifier' and o.name='ICStockBill' and c.name='FUUID'
select FProjectVal from t_billcoderule where fbilltypeid=41 and fprojectid=9
Update t_BillCodeRule Set FReChar = FReChar Where FBillTypeID = '41'
Update t_BillCodeBy Set FProjectVal = FProjectVal Where FBillTypeID = '41'
select a.*,isnull(b.fitemid,0) as fitemclassid,isnull(b.ftable,'') as ftable,isnull(e.ffieldname,'') as FieldName from t_billcoderule a
left join t_option e on a.fprojectid=e.fprojectid and a.fformatindex=e.fid
Left OUter join t_checkproject b on a.fbilltype=b.fbilltypeid and a.fprojectval=b.ffield
where a.fbilltypeid = '41' order by a.FClassIndex
GO
SELECT fid from icclasstype where FID>0 And FBillTypeID Not In(5,6)
and FBillTypeID<> 1 and fid =41
go
select distinct a.fheadtable as TableName,b.ffieldname as BillFieldName from ictransactiontype a
inner join ictemplate b on a.ftemplateid = b.fid
and b.fctltype = 4 and a.fid = 41
select FBillNo from ICStockBill where FBillNo='CHG004346'
UPDATE t_BillCodeRule SET FProjectVal = 4347,FLength=CASE WHEN (FLength-LEN('4347')) >= 0 THEN FLength ELSE LEN('4347') END WHERE FBillTypeID='41' AND FProjectID=3
UPDATE ICBillNo SET FCurNo = 4347 WHERE FBillID = 41
SELECT FTemplateID FROM ICTransactionType WHERE FID=41
Select * From t_BillCodeRule Where FBillTypeID = '41' Order By FClassIndex
Update ICBillNo Set FDesc = 'CHG+004347' Where FBillID = '41'
SELECT FComponentSrv FROM t_ThirdPartyComponent WHERE FTypeID=4 AND FTypeDetailID=41 ORDER BY FIndex
SELECT 1 FROM ICStockBill WHERE FBillNo='CHG004346' And FTranType = 41
INSERT INTO ICStockBillEntry (FInterID,FEntryID,FBrNo,FItemID,FQty,FDefaultBaseQty,FRealStockBaseQty,FDefaultQty,FRealStockQty,FUnitID,FBatchNo,Fauxqty,FSCStockID,FDCStockID,FSecCoefficient,Fauxprice,Famount,FAuxPriceRef,FAmtRef,Fnote,FKFDate,FKFPeriod,FPeriodDate,FICMOBillNo,FAuxPlanPrice,FPlanAmount,FSourceBillNo,FSourceTranType,FSourceInterId,FSourceEntryID,FSCSPID,FDCSPID,FICMOInterID,FOrderBillNo,FPPBomEntryID,FOrderEntryID,FOrderInterID,FClientOrderNo,FClientEntryID,FSecQty,FEntrySupply,FPlanMode,FChkPassItem,FContractBillNO,FContractEntryID,FContractInterID,FIsVMI,FSNListID,FMTONo,FLockFlag,FAuxPropID) SELECT 88701,1,'0',9492,4782,0,0,0,0,254,'HW2020030705',4782,3398,3413,0,0,0,0,0,'',Null,0,Null,'',0,0,'FX20210401001',200000004,1143,451,0,0,0,'',0,0,0,'','',0,0,14036,0,'',0,0,0,0,'',0,0 union all
SELECT 88701,2,'0',20097,3370,0,0,0,0,254,'HW2020031603',3370,3398,3413,0,0,0,0,0,'',Null,0,Null,'',0,0,'FX20210401001',200000004,1143,452,0,0,0,'',0,0,0,'','',0,0,14036,0,'',0,0,0,0,'',0,0 union all
SELECT 88701,3,'0',8449,956,0,0,0,0,254,'HW2019110410',956,3398,3413,0,0,0,0,0,'',Null,0,Null,'',0,0,'FX20210401001',200000004,1143,453,0,0,0,'',0,0,0,'','',0,0,14036,0,'',0,0,0,0,'',0,0 union all
SELECT 88701,4,'0',36385,1576,0,0,0,0,254,'HW2020081212',1576,3398,3413,0,0,0,0,0,'',Null,0,Null,'',0,0,'FX20210401001',200000004,1143,454,0,0,0,'',0,0,0,'','',0,0,14036,0,'',0,0,0,0,'',0,0 union all
SELECT 88701,5,'0',42141,30320,0,0,0,0,254,'HW2020111213',30320,3398,3413,0,0,0,0,0,'',Null,0,Null,'',0,0,'FX20210401001',200000004,1143,455,0,0,0,'',0,0,0,'','',0,0,14036,0,'',0,0,0,0,'',0,0
EXEC p_UpdateBillRelateData 41,88701,'ICStockBill','ICStockBillEntry'
INSERT INTO ICStockBill(FInterID,FBillNo,FBrNo,FTranType,FCancellation,FStatus,FUpStockWhenSave,FHookStatus,Fdate,FCheckDate,FFManagerID,FSManagerID,FBillerID,FMultiCheckDate1,FMultiCheckDate2,FMultiCheckDate3,FMultiCheckDate4,FMultiCheckDate5,FMultiCheckDate6,FSelTranType,FBrID,FDeptID,FEmpID,FRefType,FPrintCount,FHeadSelfD0134,FHeadSelfD0135) SELECT 88701,'CHG004346','0',41,0,0,1,0,'2021-04-07',Null,324,324,16394,Null,Null,Null,Null,Null,Null,0,0,312,0,12561,0,Null,Null
UPDATE ICStockBill SET FUUID=NEWID() WHERE FInterID=88701
SELECT FComponentSrv,FDescription FROM t_ThirdPartyComponent WHERE FTypeID=2 AND FTypeDetailID=300009 ORDER BY FIndex
SELECT t1.FHeadTable,t1.FEntryTable,t2.FLookUpCls
FROM ICTransactiontype t1 left join ICTemplate t2 on t1.FTemplateID=t2.FID and t2.FLookUpCls=-35
where t1.FID=41
Select top 1 t1.FSourceTranType, t2.FName as FName, t2.FHeadTable, t2.FEntryTable
From ICStockBillEntry t1
Left Join ICTransactiontype t2 On t1.FSourceTranType=t2.FID
Where t1.FSourceTranType<>0 AND t1.FInterID = 88701
select t1.*,t2.FTableName,t2.FName_CHS as FName
from ICWriteBackTemplate t1 left join ICClassType t2 on t1.FSrcTranType=abs(t2.FID)
where t1.FDestTranType=41 and t1.FSrcTranType=200000004
order by FExecuteIndex
select FIsUserDeFine,* from icclasslink where abs(FSourClassTypeid)='200000004' and abs(FDestClassTypeid)='41'
select 1 from ICTranSactiontype where FID= 200000004
SELECT 1 FROM ICBillRelations_Sale WHERE FBILLTYPE = 41 And FBILLID = 88701
set nocount on
declare @fcheck_fail int
declare @fsrccommitfield_prevalue decimal(28,13)
declare @fsrccommitfield_endvalue decimal(28,13)
declare @maxorder int
update src set @fsrccommitfield_prevalue= isnull(abs(src.ffxsqqty),0),
@fsrccommitfield_endvalue=@fsrccommitfield_prevalue+dest.fauxqty,
@fcheck_fail=case isnull(@maxorder,0) when 1 then 0 else (case when (1=1) then @fcheck_fail else -1 end) end,
src.ffxsqqty= case when src.fqty < 0 then -1 * @fsrccommitfield_endvalue else @fsrccommitfield_endvalue end
from t_bossecchosetaskentry src
inner join
(select u1.fsourceinterid as fsourceinterid,u1.fsourceentryid,u1.fitemid,sum(u1.fauxqty) as fauxqty
from icstockbillentry u1
where u1.finterid=88701
group by u1.fsourceinterid,u1.fsourceentryid,u1.fitemid) dest
on dest.fsourceinterid = src.fid
and dest.fitemid = src.fitem
and src.fentryid = dest.fsourceentryid
SELECT FDefault, FAllowForceCheck FROM ICClassLink Where FSourClassTypeID = 200000004 AND FDestClassTypeID = -41
Select FValue From t_SystemProfile Where FCategory='IC' and FKey='MaterialReturnDirect'
SELECT Count(*) FROM SYSCOLUMNS C INNER JOIN SYSOBJECTS O ON C.ID=O.ID AND O.NAME='t_BOSSecChoseTask' AND O.XTYPE='U'WHERE C.NAME ='FCLOSED'
UPDATE T1 SET T1.FTBQty=
CASE WHEN EXISTS (SELECT 1 FROM t_BOSSecChoseTaskEntry WHERE FID=T1.FID AND FEntryID = T1.FEntryID AND abs(FQty) > abs(FFXSQQty) ) THEN 0
ELSE 1 END
FROM t_BOSSecChoseTaskEntry T1, ICStockBillEntry T2
WHERE T1.FID = T2.FSourceInterID AND T1.FEntryID = T2.FSourceEntryID AND T2.FInterID=88701
SELECT * FROM ICClassType WHERE FID = 200000004
IF EXISTS ( SELECT 1 FROM syscolumns WHERE name = 'FConnectFlag' AND id = object_id('t_BOSSecChoseTask') ) AND EXISTS ( SELECT 1 FROM syscolumns WHERE name='FSourceInterID' AND id = object_id('ICStockBillEntry') ) EXEC('UPDATE t3 SET t3.FConnectFlag=t3.FConnectFlag+1
FROM ICStockBill t1 INNER JOIN ICStockBillEntry t2 ON t1.FInterID=t2.FInterID
INNER JOIN t_BOSSecChoseTask t3 ON t3.FTranType=t2.FSourceTranType AND t3.FID=t2.FSourceInterID
WHERE t1.FTranType=41 AND t1.FInterID=88701 AND t2.FSourceInterID>0 ' )
ELSE IF EXISTS ( SELECT 1 FROM syscolumns WHERE name = 'FChildren' AND id = object_id('t_BOSSecChoseTask') ) AND EXISTS ( SELECT 1 FROM syscolumns WHERE name='FSourceInterID' AND id = object_id('ICStockBillEntry') ) EXEC('UPDATE t3 SET t3.FChildren=t3.FChildren+1
FROM ICStockBill t1 INNER JOIN ICStockBillEntry t2 ON t1.FInterID=t2.FInterID
INNER JOIN t_BOSSecChoseTask t3 ON t3.FTranType=t2.FSourceTranType AND t3.FID=t2.FSourceInterID
WHERE t1.FTranType=41 AND t1.FInterID=88701 AND t2.FSourceInterID>0 ' )
IF EXISTS ( SELECT 1
FROM syscolumns
WHERE name = 'FConnectFlag'
AND id = OBJECT_ID('t_BOSSecChoseTask'))
AND EXISTS ( SELECT 1
FROM syscolumns
WHERE name = 'FSourceInterID'
AND id = OBJECT_ID('ICStockBillEntry'))
EXEC ('UPDATE t3 SET t3.FConnectFlag=t3.FConnectFlag+1
FROM ICStockBill t1 INNER JOIN ICStockBillEntry t2 ON t1.FInterID=t2.FInterID
INNER JOIN t_BOSSecChoseTask t3 ON t3.FTranType=t2.FSourceTranType AND t3.FID=t2.FSourceInterID
WHERE t1.FTranType=41 AND t1.FInterID=88701 AND t2.FSourceInterID>0 ');
ELSE IF EXISTS ( SELECT 1
FROM syscolumns
WHERE name = 'FChildren'
AND id = OBJECT_ID('t_BOSSecChoseTask'))
AND EXISTS ( SELECT 1
FROM syscolumns
WHERE name = 'FSourceInterID'
AND id = OBJECT_ID('ICStockBillEntry'))
EXEC ('UPDATE t3 SET t3.FChildren=t3.FChildren+1
FROM ICStockBill t1 INNER JOIN ICStockBillEntry t2 ON t1.FInterID=t2.FInterID
INNER JOIN t_BOSSecChoseTask t3 ON t3.FTranType=t2.FSourceTranType AND t3.FID=t2.FSourceInterID
WHERE t1.FTranType=41 AND t1.FInterID=88701 AND t2.FSourceInterID>0 ');
SELECT TOP 100 FID,FPushTypeID,FBillTypeID,FInterID,FEntryID,FStatus,FExtInfo
FROM t_SuspendWorkPushQueue WITH(NOLOCK)
ORDER BY FID ASC
SELECT t.FCategory FROM t_SmeComponents t WHERE FComponent='BillDataAccess.SysInfo' AND t.FCategory='SPHY'
Select FValue from t_SystemProfile where FCategory='BOS' and FKey='AccessDataUsed'
select FUserID from t_Group where FUserID = 16394 and FGroupID = 1
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED select sum(t1.FQty),SUM(ISNULL(t1.FSecQty,0)) AS FSecQty from ICInventory t1 INNER join t_IcItem t2 ON t1.FItemID = t2.FItemID
INNER JOIN t_Stock ts ON t1.FStockID = ts.FItemID
WHERE t1.FStockID=3398 AND t1.FItemID=9492 AND ((ts.FProperty <> 12 and EXISTS(SELECT 1 FROM t_SystemProfile WHERE FCategory='IC' and FKey='InCludeDefectiveProducts' and fvalue =0)) or (EXISTS(SELECT 1 FROM t_SystemProfile WHERE FCategory='IC' and FKey='InCludeDefectiveProducts' and fvalue =1))) AND t1.FBatchNo='HW2020030705' AND t1.FMtoNo=''
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT ti.FQtyDecimal,tm.FName AS FUnitName FROM t_ICItemBase ti LEFT JOIN t_MeasureUnit tm ON ti.FUnitID = tm.FMeasureUnitID Where ti.FItemID = 9492
select FCoefficient,FScale from t_MeasureUnit Where FItemID=254
SELECT FValue FROM t_SystemProfile WHERE FKey ='AvailableInventory' AND FCategory = 'IC'
go
SELECT ISNULL(SUM(FQty),0) AS FQty FROM
(SELECT ti.FQty FROM ICInventory ti
WHERE 1=1 AND ti.FItemID=9492 AND ti.FBatchNo='HW2020030705' AND ti.FStockID=3398
UNION ALL
SELECT ti.FQty FROM POInventory ti
WHERE 1=1 AND ti.FItemID=9492 AND ti.FBatchNo='HW2020030705' AND ti.FStockID=3398
) tinv
SELECT FValue,* FROM t_SystemProfile WHERE FKey ='AvailableInventory' AND FCategory = 'IC'
SELECT ISNULL(SUM(FQty),0) AS FQty FROM
(SELECT ti.FQty FROM ICInventory ti
WHERE 1=1 AND ti.FItemID=20097 AND ti.FBatchNo='HW2020031603' AND ti.FStockID=3398
UNION ALL
SELECT ti.FQty FROM POInventory ti
WHERE 1=1 AND ti.FItemID=20097 AND ti.FBatchNo='HW2020031603' AND ti.FStockID=3398
) tinv
SELECT FValue FROM t_SystemProfile WHERE FKey ='AvailableInventory' AND FCategory = 'IC'
go
SELECT ISNULL(SUM(FQty),0) AS FQty FROM
(SELECT ti.FQty FROM ICInventory ti
WHERE 1=1 AND ti.FItemID=8449 AND ti.FBatchNo='HW2019110410' AND ti.FStockID=3398
UNION ALL
SELECT ti.FQty FROM POInventory ti
WHERE 1=1 AND ti.FItemID=8449 AND ti.FBatchNo='HW2019110410' AND ti.FStockID=3398
) tinv
SELECT FValue FROM t_SystemProfile WHERE FKey ='AvailableInventory' AND FCategory = 'IC'
SELECT ISNULL(SUM(FQty),0) AS FQty FROM
(SELECT ti.FQty FROM ICInventory ti
WHERE 1=1 AND ti.FItemID=36385 AND ti.FBatchNo='HW2020081212' AND ti.FStockID=3398
UNION ALL
SELECT ti.FQty FROM POInventory ti
WHERE 1=1 AND ti.FItemID=36385 AND ti.FBatchNo='HW2020081212' AND ti.FStockID=3398
) tinv
SELECT FValue FROM t_SystemProfile WHERE FKey ='AvailableInventory' AND FCategory = 'IC'
SELECT ISNULL(SUM(FQty),0) AS FQty FROM
(SELECT ti.FQty FROM ICInventory ti
WHERE 1=1 AND ti.FItemID=42141 AND ti.FBatchNo='HW2020111213' AND ti.FStockID=3398
UNION ALL
SELECT ti.FQty FROM POInventory ti
WHERE 1=1 AND ti.FItemID=42141 AND ti.FBatchNo='HW2020111213' AND ti.FStockID=3398
) tinv
go
SELECT dtb.name AS [Name], dtb.state AS [State] FROM master.sys.databases dtb
SELECT TOP 100 FID,FPushTypeID,FBillTypeID,FInterID,FEntryID,FStatus,FExtInfo
FROM t_SuspendWorkPushQueue WITH(NOLOCK)
ORDER BY FID ASC
直接运行跟踪出来的语句,提示以下错误:
在跟踪出来的语句中搜索报错是的FTranType字段,查找到与该字段相关的表并分析:
查询 t_TableDescription 表,发现该表无对应字段:
SELECT * FROM t_TableDescription where FTableName='t_BOSSecChoseTask'
SELECT * FROM dbo.t_BOSSecChoseTask
查询对应表,发现有数据,也没有对应字段:
接着查看有无第三方插件、及对应的表名信息:
结论:新开发的单据缺少FTranType字段(该字段是打补丁后新增加的,在打补丁前单据可以正常下推);
解决方法:在BOS平台打开对应单据,增加一个空的文本框,改名称为FTranType(字段名称也修改为“FTranType”);
测试,下推的调拨单可以正常保存、审核:
-----<结束>-----
WISE14.2 新开发的BOS单据下推调拨单报错解决
本文2024-09-16 15:51:11发表“k3wise知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3wise-5482.html