首页
喃喃低语
Search
1
【023】新增客开参数设置
36 阅读
2
平台领域应用合集 - U9HUB
26 阅读
3
【052】查找DataAccess的DLL路径获取密码
26 阅读
4
【056】使用警告弹窗提示用户信息
22 阅读
5
【050】客开补丁加补丁说明
21 阅读
用友U9
登录
Search
秋驰雪隙
累计撰写
60
篇文章
累计收到
2
条评论
首页
栏目
用友U9
页面
喃喃低语
搜索到
60
篇与
秋驰雪隙
的结果
2025-04-08
【039】U9私有字段自定义值集的多语言表的SQL更新
最新U9C更新方式https://success.yonyou.com/community/askDetail?aId=5816881121fbf549e5b4247c41ea84d91d9f7ed00d9da70f&cid=d65f538614c87d47&themeType=3exec dbo.P_SyncFieldCombineNameNew 'UFIDA.U9.CBO.SCM.Item.ItemMaster','Global',3,'admin',1002011066091830更新销售订单行第18个扩展字段(ZDY016配送点值集)的示例SQL,A.ID=1002111020110059为销售订单行示例ID-- 查询销售订单行的扩展字段18(配送点自定义值集,非枚举,使用Fun_Cust_Table_DefineValue存储过程关联) SELECT A.ID,ISNULL(def.Code, '') Code,ISNULL(def.Name, '') Name,'zh-CN' as SysMLFlag INTO #TempDataID FROM dbo.SM_SOLine A LEFT JOIN dbo.Fun_Cust_Table_DefineValue('ZDY016') def ON def.Code=A.DescFlexField_PrivateDescSeg18 WHERE A.ID=1002111020110059 -- 50的意思公有段有50个,私有段就是50往上加,如果是刷新公有段,直接是几就是几 EXEC dbo.P_Samuel_CombineNameUpdate 'SM_SOLine','#TempDataID',68 -- 68=50+18 DROP TABLE #TempDataID;存储过程:Fun\_Cust\_Table\_DefineValue/****** Object: UserDefinedFunction [dbo].[Fun_Cust_Table_DefineValue] Script Date: 2021/11/2 15:50:12 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE OR ALTER FUNCTION [dbo].[Fun_Cust_Table_DefineValue] (@code NVARCHAR(50)) RETURNS @t TABLE(ID BIGINT, Code NVARCHAR(50),Name NVARCHAR(50)) AS BEGIN INSERT INTO @t SELECT c.ID,c.Code,C2.Name FROM dbo.Base_DefineValue C INNER JOIN dbo.Base_ValueSetDef C1 ON C1.ID=C.ValueSetDef INNER JOIN dbo.Base_DefineValue_Trl AS C2 ON C.ID=C2.ID WHERE C1.Code=@code RETURN END GO C# 方法封装/// <summary> /// 更新表中扩展字段是自定义值集的多语言 /// </summary> /// <param name="tbName">要更新的表名</param> /// <param name="define">要更新的自定义值集编码</param> /// <param name="fieldIdx">要更新的表的扩展字段索引</param> /// <param name="ids">要更新的表的id集合,null或者长度为0则更新全部</param> public static void UpdateTrlByDefineValue(string tbName, string define, int fieldIdx, List<long> ids) { string updTrlSql = string.Format(@"SELECT A.ID,ISNULL(def.Code, '') Code,ISNULL(def.Name, '') Name,'zh-CN' as SysMLFlag INTO #TempDataID FROM dbo.{0} A LEFT JOIN dbo.Fun_Cust_Table_DefineValue('{1}') def ON def.Code=A.DescFlexField_PrivateDescSeg{2} {4} EXEC dbo.P_Samuel_CombineNameUpdate '{0}','#TempDataID',{3} DROP TABLE #TempDataID", tbName, define, fieldIdx, 50 + fieldIdx , ids != null && ids.Count > 0 ? string.Format("WHERE A.ID in ({0})", string.Join(",", ids)) : ""); DataAccessor.RunSQL(DataAccessor.GetConn(), updTrlSql, null); }
2025年04月08日
12 阅读
0 评论
0 点赞
2025-04-08
【038】U9私有扩展字段枚举的多语言表的SQL更新
最新U9C更新方式https://success.yonyou.com/community/askDetail?aId=5816881121fbf549e5b4247c41ea84d91d9f7ed00d9da70f&cid=d65f538614c87d47&themeType=3exec dbo.P_SyncFieldCombineNameNew 'UFIDA.U9.CBO.SCM.Item.ItemMaster','Global',3,'admin',1002011066091830枚举名称更新到出货行私有段2Select SMSL.ID as ID, ISNULL(UBF_Sys_E1.Code, '') as Code, ISNULL(UBF_Sys_ET1.name, '') as Name, 'zh-CN' as SysMLFlag Into #TempDataID from SM_Shipline as SMSL join UBF_Sys_ExtEnumValue as UBF_Sys_E1 on SMSL.DescFlexField_PrivateDescSeg2=UBF_Sys_E1.Code left join [UBF_Sys_ExtEnumValue_Trl] as UBF_Sys_ET1 on (UBF_Sys_ET1.SysMlFlag='zh-CN') and (UBF_Sys_E1.[ID]=UBF_Sys_ET1.[ID]) where SMSL.ID='1001605211160465' and UBF_Sys_E1.[ExtEnumType]=1001510090000043 --select * from #TempDataID exec P_Samuel_CombineNameUpdate 'SM_Shipline','#TempDataID',52 DropTable #TempDataID其中:UBF\_Sys\_E1.Code是枚举编码,UBF\_Sys\_ET1.name是枚举名称,SMSL.ID是更新的表记录ID,TempDataID 是存储更新表记录的ID,枚举编码,枚举名称和语言的临时表,P\_Samuel\_CombineNameUpdate是更新多语言表的存储过程,SM\_Shipline是要更新的表的名称,52,是扩展第二个字段。扩展第一个字段是51,第三是53,依次类推。
2025年04月08日
11 阅读
0 评论
0 点赞
2025-04-08
【037】U9手动更新菜单发布包
使用存储过程生成要设置的SQL语句此处以小辣椒为例子,新增一个【BOM子项替代关系】【BOM子项替代列表】的页面,然后还有对应的BE跟UI以及LIstUI的DLL,以及对应的菜单if object_id('tempdb..#insertSQL') is not null drop table #insertSQL create table #insertSQL(seq int IDENTITY(1,1),sqlstr nvarchar(max)) insert into #insertSQL(sqlstr) values('-- 页面[BOM子项替代关系]'); insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Page]', 'Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Page_Trl]', 'ID in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageColumn]', 'Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageColumn_Trl]', 'ID IN (select ID from UBF_Assemble_PageColumn where Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Part]', 'Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Part_Trl]', 'ID in (select ID from UBF_Assemble_Part where Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_ColumnPart]', 'PageColumn IN (select ID from UBF_Assemble_PageColumn where Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_ParamBinding]', 'PageParameter IN (select ID from UBF_Assemble_PageParameter where Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageParameter]', 'Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PartRelation]', 'Page in (select ID from UBF_Assemble_Page where Code = ''5fdb9458-9d7f-4cb1-8d11-ae25470707d8'')'; insert into #insertSQL(sqlstr) values('-- 页面[BOM子项替代关系列表]'); insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Page]', 'Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Page_Trl]', 'ID in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageColumn]', 'Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageColumn_Trl]', 'ID IN (select ID from UBF_Assemble_PageColumn where Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Part]', 'Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Part_Trl]', 'ID in (select ID from UBF_Assemble_Part where Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_ColumnPart]', 'PageColumn IN (select ID from UBF_Assemble_PageColumn where Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_ParamBinding]', 'PageParameter IN (select ID from UBF_Assemble_PageParameter where Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08''))'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PageParameter]', 'Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'')'; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_PartRelation]', 'Page in (select ID from UBF_Assemble_Page where Code = ''ae537b14-55d9-48e4-ba75-f33b2f8d2b08'')'; insert into #insertSQL(sqlstr) values('-- DLL'); insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_AppComponents]', 'Component = ''UFIDA.U9.SH.PubUI.WebPart.dll'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_AppComponents]', 'Component = ''UFIDA.U9.SH.PubQryListUI.WebPart.dll'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_AppComponents]', 'Component = ''UFIDA.U9.SH.PubBE.dll'''; insert into #insertSQL(sqlstr) values('-- 菜单[客开]'); insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Menu]', 'Code = ''a6dcc019-7877-4c5a-9a2f-e50653104337'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Menu_Trl]', 'ID IN (select ID from UBF_Assemble_Menu where Code = ''a6dcc019-7877-4c5a-9a2f-e50653104337'')'; insert into #insertSQL(sqlstr) values('-- 菜单[BOM子项替代关系]'); insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Menu]', 'Code = ''25f8fca6-3ce5-425d-9956-1d108ebc84f3'''; insert into #insertSQL(sqlstr) exec proc_insert '[dbo].[UBF_Assemble_Menu_Trl]', 'ID IN (select ID from UBF_Assemble_Menu where Code = ''25f8fca6-3ce5-425d-9956-1d108ebc84f3'')'; select * from #insertSQL order by seq;生成Insert语句的存储过程/****** Object: StoredProcedure [dbo].[proc_insert] Script Date: 2023/9/21 13:04:42 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: qxq -- Create date: 2023/9/21 -- Description: 生成单表的Insert语句 -- ============================================= CREATE OR ALTER proc [dbo].[Proc_Insert] ( @tablename varchar(256), -- 表名 @where varchar(max) -- 条件 ) as begin set nocount on declare @sqlstr varchar(MAX) declare @sqlstr1 varchar(MAX) declare @sqlstr2 varchar(MAX) select @sqlstr='select ''INSERT '+@tablename select @sqlstr1='' select @sqlstr2=' (' select @sqlstr1= ' VALUES ( ''+' select @sqlstr1=@sqlstr1+col+'+'',''+' ,@sqlstr2=@sqlstr2+name +',' from (select case -- when a.xtype =173 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar('+convert(varchar(4),a.length*2+2)+'),'+a.name +')'+' end' when a.xtype =36 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'replace('+a.name+','''''''','''''''''''')' + '+'''''''''+' end' when a.xtype =127 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(20),'+a.name +')'+' end' when a.xtype =104 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(1),'+a.name +')'+' end' when a.xtype =175 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'replace('+a.name+','''''''','''''''''''')' + '+'''''''''+' end' when a.xtype =61 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'convert(varchar(23),'+a.name +',121)'+ '+'''''''''+' end' when a.xtype =106 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar('+convert(varchar(4),a.xprec+2)+'),'+a.name +')'+' end' when a.xtype =62 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(23),'+a.name +',2)'+' end' when a.xtype =56 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(11),'+a.name +')'+' end' when a.xtype =60 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(22),'+a.name +')'+' end' when a.xtype =239 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'replace('+a.name+','''''''','''''''''''')' + '+'''''''''+' end' when a.xtype =108 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar('+convert(varchar(4),a.xprec+2)+'),'+a.name +')'+' end' when a.xtype =231 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'replace('+a.name+','''''''','''''''''''')' + '+'''''''''+' end' when a.xtype =59 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(23),'+a.name +',2)'+' end' when a.xtype =58 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'convert(varchar(23),'+a.name +',121)'+ '+'''''''''+' end' when a.xtype =52 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(12),'+a.name +')'+' end' when a.xtype =122 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(22),'+a.name +')'+' end' when a.xtype =48 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(6),'+a.name +')'+' end' -- when a.xtype =165 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar('+convert(varchar(4),a.length*2+2)+'),'+a.name +')'+' end' when a.xtype =167 then 'case when '+a.name+' is null then ''NULL'' else '+'''''''''+'+'replace('+a.name+','''''''','''''''''''')' + '+'''''''''+' end' else '''NULL''' end as col,a.colid,a.name from syscolumns a where a.id = object_id(@tablename) and a.xtype <>189 and a.xtype <>34 and a.xtype <>35 -- and a.xtype <>36 AND COLUMNPROPERTY(a.id, a.name, 'IsIdentity') <> 1 )t order by colid select @sqlstr=@sqlstr+left(@sqlstr2,len(@sqlstr2)-1)+') '+left(@sqlstr1,len(@sqlstr1)-3)+')'' from '+@tablename + ' where '+@where -- print @sqlstr exec(@sqlstr) set nocount off end GO执行SQL在执行完成的结果集,选中sqlstr列,Ctrl+C复制到新的查询窗口执行即可 其中的主键ID可使用系统获取ID的存储过程替换执行结果如下,选中sqlstr列,Ctrl+C复制出来即可 U9获取IDdeclare @SNIndex bigint if object_id('InnerAllocSerials') is null exec [dbo].[AllocSerials] @AllocCount = 20000, @StartSN = @SNIndex output else exec [dbo].[InnerAllocSerials] @AllocCount = 20000, @StartSN = @SNIndex output手动卸载菜单发布以小辣椒刚刚新增的为例子删除页面--删除页面[BOM子项替代关系] DELETE FROM UBF_Assemble_PartRelation WHERE Page in (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8') ; DELETE FROM UBF_Assemble_PageParameter WHERE Page in (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8') ; with PageID as (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8'), PageParameterID as (select ID from UBF_Assemble_PageParameter where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_ParamBinding WHERE PageParameter in (select ID from PageParameterID) ; with PageID as (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8'), PagePartID as (select ID from UBF_Assemble_Part where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_Part_Trl WHERE ID in (select ID from PagePartID) ; DELETE FROM UBF_Assemble_Part WHERE Page in (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8') ; with PageID as (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8'), PageColumnID as (select ID from UBF_Assemble_PageColumn where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_ColumnPart WHERE PageColumn in (select ID from PageColumnID) ; with PageID as (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8'), PageColumnID as (select ID from UBF_Assemble_PageColumn where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_PageColumn_Trl WHERE ID in (select ID from PageColumnID) ; DELETE FROM UBF_Assemble_PageColumn WHERE Page in (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8') ; DELETE FROM UBF_Assemble_Page_Trl WHERE ID in (select ID from UBF_Assemble_Page where Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8') ; DELETE FROM UBF_Assemble_Page WHERE Code = '5fdb9458-9d7f-4cb1-8d11-ae25470707d8' ; --删除页面[BOM子项替代关系列表] DELETE FROM UBF_Assemble_PartRelation WHERE Page in (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08') ; DELETE FROM UBF_Assemble_PageParameter WHERE Page in (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08') ; with PageID as (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08'), PageParameterID as (select ID from UBF_Assemble_PageParameter where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_ParamBinding WHERE PageParameter in (select ID from PageParameterID) ; with PageID as (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08'), PagePartID as (select ID from UBF_Assemble_Part where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_Part_Trl WHERE ID in (select ID from PagePartID) ; DELETE FROM UBF_Assemble_Part WHERE Page in (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08') ; with PageID as (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08'), PageColumnID as (select ID from UBF_Assemble_PageColumn where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_ColumnPart WHERE PageColumn in (select ID from PageColumnID) ; with PageID as (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08'), PageColumnID as (select ID from UBF_Assemble_PageColumn where Page in (select ID from PageID)) DELETE FROM UBF_Assemble_PageColumn_Trl WHERE ID in (select ID from PageColumnID) ; DELETE FROM UBF_Assemble_PageColumn WHERE Page in (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08') ; DELETE FROM UBF_Assemble_Page_Trl WHERE ID in (select ID from UBF_Assemble_Page where Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08') ; DELETE FROM UBF_Assemble_Page WHERE Code = 'ae537b14-55d9-48e4-ba75-f33b2f8d2b08' ;删除DLLDELETE FROM UBF_Assemble_AppComponents WHERE Component = 'UFIDA.U9.SH.PubUI.WebPart.dll' ; DELETE FROM UBF_Assemble_AppComponents WHERE Component = 'UFIDA.U9.SH.PubQryListUI.WebPart.dll' ; DELETE FROM UBF_Assemble_AppComponents WHERE Component = 'UFIDA.U9.SH.PubBE.dll' ;删除菜单-- 删除菜单[客开] delete from UBF_Assemble_Menu_Trl where ID in (select ID from UBF_Assemble_Menu where Code = 'a6dcc019-7877-4c5a-9a2f-e50653104337') ; delete from UBF_Assemble_Menu where Code = 'a6dcc019-7877-4c5a-9a2f-e50653104337' ; -- 删除菜单[BOM子项替代关系] delete from UBF_Assemble_Menu_Trl where ID in (select ID from UBF_Assemble_Menu where Code = '25f8fca6-3ce5-425d-9956-1d108ebc84f3') ; delete from UBF_Assemble_Menu where Code = '25f8fca6-3ce5-425d-9956-1d108ebc84f3' ;
2025年04月08日
10 阅读
0 评论
0 点赞
2025-04-08
【036】U9列表事件(双击行与新增)
双击行:在WebPart的DataGrid1_GridRowDbClicked_Extend中//DataGrid1_GridRowDbClicked... private void DataGrid1_GridRowDbClicked_Extend(object sender, GridDBClickEventArgs e) { //调用模版提供的默认实现.--默认实现可能会调用相应的Action. string DataID = this.Model.RtnProfitOrder.FocusedRecord["MainID"].ToString(); OnNavigatCard("Browse", DataID, "UFIDA.U9.DW.QXQ.RtnProfitOrderBE.RtnProfitOrderUrl"); DataGrid1_GridRowDbClicked_DefaultImpl(sender,e); } private void OnNavigatCard(string type, string dataID, string formID) { if (dataID == String.Empty && type == "Browse") return; System.Collections.Specialized.NameValueCollection nameValCol = new System.Collections.Specialized.NameValueCollection(); nameValCol.Add("PDPageStatus", type); nameValCol.Add("ID", dataID); this.NavigatePage(formID, nameValCol); } 新增:在Action的OnNew_Extend中private void OnNew_Extend(object sender, UIActionEventArgs e) { NavigateToCard("UFIDA.U9.DW.QXQ.RtnProfitOrderBE.RtnProfitOrderUrl", string.Empty, "New", ""); //调用模版定义的默认实现方法.如需扩展,请直接在此编程. this.OnNew_DefaultImpl(sender,e); } private void NavigateToCard(string pageID, string dataID, string type, string fieldName) { //页面参数,将传递到页面 NaviteParamter parameter = new NaviteParamter(); //如果当前表头记录不为空 if (!string.IsNullOrEmpty(fieldName)) { if (this.MainView.FocusedRecord != null && this.MainView.Fields.Contains(fieldName) && this.MainView.FocusedRecord[fieldName] != null) parameter.NameValues.Add(fieldName, this.MainView.FocusedRecord[fieldName].ToString()); } string DataID = dataID; if (DataID == string.Empty && type == "Browse") return; parameter.NameValues.Add("PDPageStatus", type); //设置数据状态New,Browse parameter.AddPDPageID(DataID); //传递一条数据记录ID,在IPart.NameValues[PDPageID]中 parameter.NameValues.Add("ID", DataID); NavigateManager.NavigatePage(this.CurrentPart, pageID, parameter); }
2025年04月08日
8 阅读
0 评论
0 点赞
2025-04-08
【035】U9根据单据类型编号方式改变单号文本框的ReadOnly
在UIModel中增加单据类型的编号方式字段将编号方式拖入界面并隐藏在单据类型参照返回值绑定中将编号方式绑定到界面上的编号方式接下来有两种方式关联单号文本框1、通过使能关联控件2、通过TextChange事件 private void DocumentType190_TextChanged_Extend(object sender, EventArgs e) { // 有ID的时候不需要判断了,不然会把单号的值覆盖 if (this.Model.PackingFiles.FocusedRecord?.ID > 0) { DocumentType190_TextChanged_DefaultImpl(sender, e); return; } if (this.Model.PackingFiles.FocusedRecord?.DocumentType_DocHeaderSequenceStyle == 0) { ((IUIFieldBindingDataBindControl)this.DocNo134).ReadOnly = true; this.DocNo134.Value = "自动编号"; } else { ((IUIFieldBindingDataBindControl)this.DocNo134).ReadOnly = false; this.DocNo134.Value = ""; } DocumentType190_TextChanged_DefaultImpl(sender, e); }
2025年04月08日
8 阅读
0 评论
0 点赞
2025-04-08
【034】U9各日志文件位置
单据、档案、列表错误日志通常在应用日志位置报表错误日志通常在报表日志位置系统调度执行错误日志在Job服务日志位置列表项应用日志,文件位置:例如D:\UFIDA\U9V21\Portal\log\All.log性能日志,文件位置:例如D:\UFIDA\U9V21\Portal\log\ufida.ubf.perfJOB服务日志,文件位置:例如D:\UFIDA\U9V21\Portal\ApplicationServer\log\All.log 等文件Mail服务日志,文件位置:例如D:\UFIDA\U9V21\MailService\log\All.log报表服务日志,文件位置:报表服务器目录下\LogFiles\ 文件名以ReportServerService开头,取对应日期的文件。例如D:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\LogFiles精灵服务日志,文件位置:例如D:\UFIDA\U9V21\NotificationService\log\All.log搜索服务日志,文件位置:例如D:\UFIDA\U9V21\SearchService\log\SearchService.log系统服务日志,文件位置:例如D:\UFIDA\U9V21\Portal\SysManageServer\log
2025年04月08日
7 阅读
0 评论
0 点赞
2025-04-08
【033】U9调度任务插入SQL
If Not Exists(SELECT TOP 1 FullName From UBF_JOB_NoParaRunableBPSVList WHERE FullName='UFIDA.U9.DW.QXQ.PubBP.BJCreditBP.CreateDebt') begin INSERT INTO UBF_JOB_NoParaRunableBPSVList(ID,FullName,Memo) VALUES(NEWID(),'UFIDA.U9.DW.QXQ.PubBP.BJCreditBP.CreateDebt','写进中间表数据') END
2025年04月08日
12 阅读
0 评论
0 点赞
2025-04-08
【032】DataGrid列动态精度设置
1、新建或者从单位参照拉取三个字段(Round_RoundType、Round_RoundValue、Round_Precision)1.1 示例新建:1.2 示例拉取(从料品档案-销售单位-精度参照拉取)2、在想要设置动态精度的列上绑定对应值2.1 按值舍入值(对应Round\_RoundValue)2.2 舍入规则(对应Round\_RoundType)2.3 小数位数(对应Round\_Precision)3、在代码中对这三个字段赋值
2025年04月08日
11 阅读
0 评论
0 点赞
2025-04-08
【031】DataGrid删除跟批量修改行不重新计算合计
在开启列表复选框的时候,删除行跟批量修改合计列的值都不会自动更新合计,需要编写客户端事件监控,手动重新计算合计并赋值public void AfterCreateChildControls() { OnBatchModifyCallBack(); OnAfterRowDeletedCallBack(); } // 批量修改事件 private void OnBatchModifyCallBack() { AssociationControl assocControl = new AssociationControl();//交互关联控件实例 assocControl.SourceServerControl = this.DataGrid8;//触发源控件 assocControl.SourceControl.EventName = "OnBatchModify"; // 触发事件 ClientCallBackFrm cbf = new ClientCallBackFrm(); cbf.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(OnAfterRowDeletedOrBatchModify);//定义服务器端的处理方法 cbf.ParameterControls.Add(this.DataGrid8); //添加传送到服务器端的控件值 cbf.Add(assocControl); this.Controls.Add(cbf); } // 删除行之后的事件 private void OnAfterRowDeletedCallBack() { AssociationControl assocControl = new AssociationControl();//交互关联控件实例 assocControl.SourceServerControl = this.DataGrid8;//触发源控件 assocControl.SourceControl.EventName = "OnAfterRowDeleted"; // 触发事件 ClientCallBackFrm cbf = new ClientCallBackFrm(); cbf.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(OnAfterRowDeletedOrBatchModify);//定义服务器端的处理方法 cbf.ParameterControls.Add(this.DataGrid8); //添加传送到服务器端的控件值 cbf.Add(assocControl); this.Controls.Add(cbf); } private object OnAfterRowDeletedOrBatchModify(CustomerActionEventArgs args) { UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid8); // 列表 ArrayList list = (ArrayList)args.ArgsHash[this.DataGrid8.ClientID]; HashSet<string> sumField = new HashSet<string>(); Dictionary<string, decimal> dicTotalValve = new Dictionary<string, decimal>(); var dataGrid = this.DataGrid8 as UFGrid; // 从当前的DataGrid中把合计列存到集合与字典,并初始化字典的合计值=0 for (int i = 0; i < dataGrid.ColumnCollection.Count; i++) { if (dataGrid.ColumnCollection[i].HasSum) { sumField.Add(dataGrid.ColumnCollection[i].FieldId); dicTotalValve.Add(dataGrid.ColumnCollection[i].FieldId, 0); } } decimal num; foreach (Hashtable hashT in list) { // 循环累加需要合计的列的值 foreach (string colName in sumField) { decimal.TryParse(hashT[colName].ToString(), out num); dicTotalValve[colName] += num; } } foreach (string colName in dicTotalValve.Keys) { args.ArgsResult.Add(grid.ClientInstanceWithSetTotalValue(colName, dicTotalValve[colName].ToString())); } return args; } 合计刷新之后,点击放弃,合计列的值还是上一次的缓存public void AfterUIModelBinding() { ((UFWebDataGridAdapter)this.DataGrid8).ClearTotalValue(); // 清除所有列的合计值 ((UFWebDataGridAdapter)this.DataGrid8).ResetSumData = true; // 刷新合计列的值 }
2025年04月08日
7 阅读
0 评论
0 点赞
2025-04-08
【030】DataGrid清除合计行
DataGrid设置 累计选中行=true时会有在有选中行有合计数量时,再次查询合计数据并未清空的bug需要使用以下代码进行清空((UFWebDataGridAdapter)this.DataGrid0).ClearTotalValue(); //清除所有列的合计值 ((UFWebDataGridAdapter)this.DataGrid0).ResetSumData = true; // 刷新合计列的值如果还开启了 累计所有行=true则在取消全选的时候并不会清空合计数量,可将上两句代码写在AfterUIModelBinding函数中public void AfterUIModelBinding() { if (this.Model.DetailListView.GetSelectedRecordIDs().Count() == 0) { // 取消全选的时候,并不会自动变成0 ((UFWebDataGridAdapter)this.DataGrid8).ClearTotalValue(); // 清除所有列的合计值 ((UFWebDataGridAdapter)this.DataGrid8).ResetSumData = true; // 刷新合计列的值 } }以下为bug重现的GIF图
2025年04月08日
9 阅读
0 评论
0 点赞
1
2
3
4
...
6