首页
喃喃低语
Search
1
【023】新增客开参数设置
36 阅读
2
平台领域应用合集 - U9HUB
26 阅读
3
【052】查找DataAccess的DLL路径获取密码
26 阅读
4
【056】使用警告弹窗提示用户信息
22 阅读
5
【050】客开补丁加补丁说明
21 阅读
用友U9
登录
Search
秋驰雪隙
累计撰写
60
篇文章
累计收到
2
条评论
首页
栏目
用友U9
页面
喃喃低语
搜索到
60
篇与
用友U9
的结果
2025-04-08
【029】PostBack事件注册
private void RegisterGridCellDataChangedPostBack() { AssociationControl assocControl = new AssociationControl(); assocControl.SourceServerControl = this.DataGrid8; assocControl.SourceControl.EventName = "OnCellDataValueChanged"; //针对数量和价格这两个列的变化 ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("ItemQty"); ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("Price"); CodeBlock cb = new CodeBlock(); UFWebClientGridAdapter gridAdapter = new UFWebClientGridAdapter(this.DataGrid8); gridAdapter.IsPostBack = true; gridAdapter.PostBackTag = "OnCellDataValueChanged"; cb.TargetControls.addControl(gridAdapter); assocControl.addBlock(cb); UFGrid itemGrid = this.DataGrid8 as UFGrid; itemGrid.GridCustomerPostBackEvent += new GridCustomerPostBackDelegate(GridCellOnChanged_DoCustomerAction_Grid); }
2025年04月08日
10 阅读
0 评论
0 点赞
2025-04-08
【028】CallBack事件注册
/// <summary> /// 注册列表本次发运数量值变化事件 /// </summary> private void SchemaCallBack() { AssociationControl assocControl = new AssociationControl();//交互关联控件实例 assocControl.SourceServerControl = this.DataGrid8;//触发源控件 assocControl.SourceControl.EventName = "OnCellDataValueChanged"; // 触发事件 ((IUFClientAssoGrid)assocControl.SourceControl).FireEventCols.Add("ShipQty"); ClientCallBackFrm cbf = new ClientCallBackFrm(); cbf.DoCustomerAction += new ClientCallBackFrm.ActionCustomer(DoCellDataValueChanged);//定义服务器端的处理方法 cbf.ParameterControls.Add(this.DataGrid8); //添加传送到服务器端的控件值 cbf.Add(assocControl); this.Controls.Add(cbf); } /// <summary> /// 本次发运数量值发生变化 /// </summary> /// <param name="args"></param> /// <returns>计算本行总体积,总重量</returns> private object DoCellDataValueChanged(CustomerActionEventArgs args) { UFWebClientGridAdapter grid = new UFWebClientGridAdapter(this.DataGrid8); // 列表 ArrayList list = (ArrayList)args.ArgsHash[this.DataGrid8.ClientID]; int curIndex = Convert.ToInt32(args.ArgsHash[UFWebClientGridAdapter.FocusRow]); Hashtable hashT = (Hashtable)list[curIndex]; decimal volume = 0m; decimal weight = 0m; decimal shipQty = 0m; decimal.TryParse(hashT["Volume"].ToString(), out volume); decimal.TryParse(hashT["Weight"].ToString(), out weight); decimal.TryParse(hashT["ShipQty"].ToString(), out shipQty); decimal totalVolume = volume * shipQty; decimal totalWeight = weight * shipQty; grid.CellValue.Add(new object[] { curIndex, "TotalVolume", new string[] { totalVolume.ToString(), totalVolume.ToString(), totalVolume.ToString() } }); grid.CellValue.Add(new object[] { curIndex, "TotalWeight", new string[] { totalWeight.ToString(), totalWeight.ToString(), totalWeight.ToString() } }); args.ArgsResult.Add(grid.ClientInstanceWithValue); return args; }
2025年04月08日
10 阅读
0 评论
0 点赞
2025-04-08
【027】增加客开管理模块
1.脚本新增客开-客开管理系统模块Tips:执行脚本之后即可在角色菜单看到此模块,客开Code=CU,客开管理Code=CUST。如需在客开下增加其他二级模块,参照脚本举一反三即可。-- 客开-客开管理-加新应用脚本 --此脚本用于二级应用 declare @YY0 nvarchar(10) declare @YY1 nvarchar(10) declare @YYID0 bigint declare @YYID1 bigint declare @YYShortName0 nvarchar(10) declare @YYShortName1 nvarchar(10) declare @YYName0 nvarchar(10) declare @YYName1 nvarchar(10) declare @CreatedBy nvarchar(20) set @YY0='80000' set @YY1='80005' set @YYShortName0='CU' set @YYShortName1='CUST' set @YYName0='客开' set @YYName1='客开管理' set @YYID0 =(select top 1 id from Base_Application where Code=@YY0) set @YYID1 =(select top 1 ID from Base_Application where Code=@YY1) set @CreatedBy ='Peter' if (@YYID0 is null) set @YYID0=(CAST (@yy0 as bigint)) if (@YYID1 is null) set @YYID1=(CAST (@yy1 as bigint)) --Base_Application 菜单应用 DELETE FROM Base_Application_TRL WHERE ID in(@YYID0 ,@YYID1) DELETE FROM Base_Application WHERE ID in(@YYID0,@YYID1) --第一级0 INSERT INTO Base_Application(ID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,Code,ShortName,Effective_IsEffective,Effective_EffectiveDate,Effective_DisableDate,[Level],IsLeaf,ParentNode,SysVersion) VALUES(@YYID0 ,GETDATE(),@CreatedBy ,NULL,NULL,@YY0 ,@YYShortName0 ,1,GETDATE (),'9999-12-31',1,0,NULL,0) INSERT INTO Base_Application_TRL(ID,SysMLFlag,[Name]) VALUES(@YYID0,'zh-CN',@YYName0) INSERT INTO Base_Application_TRL(ID,SysMLFlag,[Name]) VALUES(@YYID0,'en-US',@YYShortName0) --第二级1 INSERT INTO Base_Application(ID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,Code,ShortName,Effective_IsEffective,Effective_EffectiveDate,Effective_DisableDate,[Level],IsLeaf,ParentNode,SysVersion) VALUES(@YYID1,GETDATE(),@CreatedBy,NULL,NULL,@YY1,@YYShortName1,1,GETDATE(),'9999-12-31',2,1,@YYID0,0) INSERT INTO Base_Application_TRL(ID,SysMLFlag,[Name]) VALUES(@YYID1,'zh-CN',@YYName1) INSERT INTO Base_Application_TRL(ID,SysMLFlag,[Name]) VALUES(@YYID1,'en-US',@YYShortName1) --UBF_SM_AppOperatorMap 应用控制类分布 --仅末级需要预置 DELETE FROM UBF_SM_AppOperatorMap WHERE [Application] IN (@YYID1) INSERT INTO UBF_SM_AppOperatorMap (ID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,SysVersion,[Application],OperatorLocation,EnableAppOperatorFullName,DisableAppOperatorFullName,LockAppOperatorFullName,UnlockAppOperatorFullName,EnableCheckOperatorFullName,MataDataState,MenuState,AuthorityState) VALUES ( (select isnull(max(id),0)+1 from ubf_sm_appoperatormap), getdate(), @createdby, NULL, NULL, 0 ,@YYID1 ,'UFIDA.U9.BS.AppController.AppControllerBP.dll' ,'UFIDA.U9.BS.AppController.EnableAppOperator' ,'UFIDA.U9.BS.AppController.DisableAppOperator' ,'UFIDA.U9.BS.AppController.LockAppOperator' ,'UFIDA.U9.BS.AppController.UnlockAppOperator' ,'','false','false','false'); --启用时不检查脚本 update UBF_SM_AppOperatorMap set MataDataState=1 ,MenuState=1 where [Application]=@YYID1 --UBF_SM_OrgTypeAppMap 组织性质与应用 --仅末级需要预置 DELETE FROM UBF_SM_OrgTypeAppMap WHERE [Application] in (@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,1,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,2,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,3,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,4,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,5,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,6,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,7,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,8,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,9,@YYID1) INSERT INTO UBF_SM_OrgTypeAppMap ([ID],[CreatedOn],[CreatedBy],[ModifiedOn],[ModifiedBy],[SysVersion],[OrgType],[Application]) VALUES((select isnull(max(id),0)+1 from UBF_SM_OrgTypeAppMap) ,GETDATE(),@CreatedBy,NUll,NULL,0,10,@YYID1) --Base_Role 角色 --仅末级需要预置 DELETE FROM Base_Role_trl WHERE id in (SELECT id FROM Base_Role WHERE [Application] in (@YYID1)) DELETE FROM Base_Role WHERE [Application] in (@YYID1) INSERT INTO Base_Role (ID, CreatedOn, CreatedBy, ModifiedOn,ModifiedBy,Code,ShortName,[Type],Effective_IsEffective,Effective_EffectiveDate,Effective_DisableDate,[Application],IsPrefab) VALUES((select isnull(max(id),0)+1 from Base_Role),getdate(),@createdby,NULL,NULL,@YYShortName1+'AppAdmin','AA',4,1,GETDATE(),'9999-12-31',@YYID1,3) INSERT INTO Base_Role_trl (ID,SysMLFlag,[Name]) VALUES((select top 1 id from Base_Role where [application]=@yyid1 ),'zh-CN',@yyname1+'应用管理员角色') INSERT INTO Base_Role_trl (ID,SysMLFlag,[Name]) VALUES((select top 1 id from Base_Role where [application]=@yyid1 ),'en-US',@YYShortName1+' Manage Application Administrator') --v2.1补充 --2.1版本一个角色可对应多个应用,所以2.1新增了角色应用表,角色-角色应用为组合关系 --所以需增加一条角色应用记录 --删除该应用的角色记录 DELETE FROM Base_RoleApplication WHERE [Application] in (@YYID1) --新增该应用的角色 INSERT INTO Base_RoleApplication (ID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,SysVersion,[Application],[Role]) VALUES((select isnull(max(id),0)+1 from Base_RoleApplication),getdate(),@createdby,NULL,NULL,0,@YYID1,(select top 1 id from Base_Role where [application]=@yyid1 ))* 执行完脚本之后,在角色菜单可查(EA账号):2.编辑应用组装工具的菜单读取配置文件BuildupApp.bdcfgTips:路径:C:\yonyou\UBFV60\U9.VOB.Product.UBF\UBFStudio\BuildupApp.bdcfg(实际路径看自己的UBF在哪个盘)。在<Apps>的节点中新增如下节点配置项(注意shortName需与上面脚本中定义的一致):<App id="80000" code="80000" shortName="CU" name="客开" level="1"> <App id="80005" code="80005" shortName="CUST" name="客开管理" level="2" /> </App>3.给相应的用户分配此模板角色(EA账号)4.启用系统(系统管理员账号)5.发布菜单到新增的客开模块Tips:第二步未执行配置节点的增加则无法在应用组装工具中看到客开-客开管理6.分配菜单权限(系统管理员账号)7.重新登录即可看到新增的客开模块
2025年04月08日
6 阅读
0 评论
0 点赞
2025-04-08
【026】在列表显示改变特定数据行的底色
行数据中,发货地可用量小于等于0时,底色变红(因为可用量小于等于0时,不可选择拉单)public void AfterCreateChildControls() { RegisterTdStoreBackroundColorScript(this.DataGrid0.ClientID); } /// <summary> /// 注册根据发货地可用量是否小于等于0显示不同的底色的前端函数 /// </summary> /// <param name="gridId"></param> private void RegisterTdStoreBackroundColorScript(string gridId) { StringBuilder _script = new StringBuilder("<script language=\"javascript\">"); _script.Append(" if(!window.runStoreJudge) {"); _script.Append(" function runStoreJudge(){ "); string mainBodyID = gridId + "_MainBody"; _script.AppendFormat(" var $mainTable = $('#{0} table');", mainBodyID); _script.Append(" var $thead_tds = $mainTable.find('thead td');"); _script.Append(" var storeIdx = -1;"); _script.Append(" $.each($thead_tds, function(i, _td) { if($(_td).attr('data-ca') == '{\"fieldid\":\"Store\"}') { storeIdx = i; } });"); _script.Append(" var $tbody_trs = $mainTable.find('tbody tr');"); _script.Append(" var $tr, $storeTd, store = 0;"); _script.Append(" $.each($tbody_trs, function(_, tr) {"); _script.Append(" $tr = $(tr);"); _script.Append(" $storeTd = $tr.find('td:eq(' + storeIdx + ')');"); _script.Append(" store = +((+($storeTd.text().replace(/,/g, ''))).toFixed(8));"); _script.Append(" if(store<=0) { $tr.addClass('error_tr'); }"); _script.Append(" });"); _script.Append(" $.each($mainTable.find('tr.error_tr td'), function(_, td) { $(td).css('background', '#ffccc7'); });"); _script.Append(" };"); _script.Append(" }"); _script.AppendFormat("setTimeout(window.runStoreJudge, {0});", 200); _script.Append(" </script>"); UFSoft.UBF.UI.AtlasHelper.RegisterAtlasStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), _script.ToString(), false); } 显示效果
2025年04月08日
11 阅读
0 评论
0 点赞
2025-04-08
【025】远程更新扩展字段示例
exec sp_addlinkedserver @server='remoteDB', --链接服务器别名 @srvproduct='', @provider='SQLOLEDB', @datasrc='139.9.102.220' --要访问的的数据库所在的服务器的ip GO EXEC sp_addlinkedsrvlogin 'remoteDB', --链接服务器别名 'false', NULL, 'sa', --要访问的数据库的用户 'dwjj!@$2017' --要访问的数据库,用户的密码 GO --以后不再使用时删除链接服务器 -- exec sp_dropserver 'remoteDB','droplogins' update Cust_RtnProfitOrder set DescFlexField_PrivateDescSeg1 = B.DescFlexField_PrivateDescSeg1 ,DescFlexField_PrivateDescSeg2 = B.DescFlexField_PrivateDescSeg2 ,DescFlexField_PrivateDescSeg3 = B.DescFlexField_PrivateDescSeg3 ,DescFlexField_PrivateDescSeg4 = B.DescFlexField_PrivateDescSeg4 ,DescFlexField_PrivateDescSeg5 = B.DescFlexField_PrivateDescSeg5 ,DescFlexField_PrivateDescSeg6 = B.DescFlexField_PrivateDescSeg6 ,DescFlexField_PrivateDescSeg7 = B.DescFlexField_PrivateDescSeg7 ,DescFlexField_PrivateDescSeg8 = B.DescFlexField_PrivateDescSeg8 ,DescFlexField_PrivateDescSeg9 = B.DescFlexField_PrivateDescSeg9 ,DescFlexField_PrivateDescSeg10= B.DescFlexField_PrivateDescSeg10 ,DescFlexField_PrivateDescSeg11= B.DescFlexField_PrivateDescSeg11 ,DescFlexField_PrivateDescSeg12= B.DescFlexField_PrivateDescSeg12 ,DescFlexField_PrivateDescSeg13= B.DescFlexField_PrivateDescSeg13 ,DescFlexField_PrivateDescSeg14= B.DescFlexField_PrivateDescSeg14 ,DescFlexField_PrivateDescSeg15= B.DescFlexField_PrivateDescSeg15 ,DescFlexField_PrivateDescSeg16= B.DescFlexField_PrivateDescSeg16 ,DescFlexField_PrivateDescSeg17= B.DescFlexField_PrivateDescSeg17 ,DescFlexField_PrivateDescSeg18= B.DescFlexField_PrivateDescSeg18 ,DescFlexField_PrivateDescSeg19= B.DescFlexField_PrivateDescSeg19 ,DescFlexField_PrivateDescSeg20= B.DescFlexField_PrivateDescSeg20 ,DescFlexField_PrivateDescSeg21= B.DescFlexField_PrivateDescSeg21 ,DescFlexField_PrivateDescSeg22= B.DescFlexField_PrivateDescSeg22 ,DescFlexField_PrivateDescSeg23= B.DescFlexField_PrivateDescSeg23 ,DescFlexField_PrivateDescSeg24= B.DescFlexField_PrivateDescSeg24 ,DescFlexField_PrivateDescSeg25= B.DescFlexField_PrivateDescSeg25 ,DescFlexField_PrivateDescSeg26= B.DescFlexField_PrivateDescSeg26 ,DescFlexField_PrivateDescSeg27= B.DescFlexField_PrivateDescSeg27 ,DescFlexField_PrivateDescSeg28= B.DescFlexField_PrivateDescSeg28 ,DescFlexField_PrivateDescSeg29= B.DescFlexField_PrivateDescSeg29 ,DescFlexField_PrivateDescSeg30= B.DescFlexField_PrivateDescSeg30 ,DescFlexField_PubDescSeg1= B.DescFlexField_PubDescSeg1 ,DescFlexField_PubDescSeg2 = B.DescFlexField_PubDescSeg2 ,DescFlexField_PubDescSeg3 = B.DescFlexField_PubDescSeg3 ,DescFlexField_PubDescSeg4 = B.DescFlexField_PubDescSeg4 ,DescFlexField_PubDescSeg5 = B.DescFlexField_PubDescSeg5 ,DescFlexField_PubDescSeg6 = B.DescFlexField_PubDescSeg6 ,DescFlexField_PubDescSeg7 = B.DescFlexField_PubDescSeg7 ,DescFlexField_PubDescSeg8 = B.DescFlexField_PubDescSeg8 ,DescFlexField_PubDescSeg9 = B.DescFlexField_PubDescSeg9 ,DescFlexField_PubDescSeg10= B.DescFlexField_PubDescSeg10 ,DescFlexField_PubDescSeg11= B.DescFlexField_PubDescSeg11 ,DescFlexField_PubDescSeg12= B.DescFlexField_PubDescSeg12 ,DescFlexField_PubDescSeg13= B.DescFlexField_PubDescSeg13 ,DescFlexField_PubDescSeg14= B.DescFlexField_PubDescSeg14 ,DescFlexField_PubDescSeg15= B.DescFlexField_PubDescSeg15 ,DescFlexField_PubDescSeg16= B.DescFlexField_PubDescSeg16 ,DescFlexField_PubDescSeg17= B.DescFlexField_PubDescSeg17 ,DescFlexField_PubDescSeg18= B.DescFlexField_PubDescSeg18 ,DescFlexField_PubDescSeg19= B.DescFlexField_PubDescSeg19 ,DescFlexField_PubDescSeg20= B.DescFlexField_PubDescSeg20 ,DescFlexField_PubDescSeg21= B.DescFlexField_PubDescSeg21 ,DescFlexField_PubDescSeg22= B.DescFlexField_PubDescSeg22 ,DescFlexField_PubDescSeg23= B.DescFlexField_PubDescSeg23 ,DescFlexField_PubDescSeg24= B.DescFlexField_PubDescSeg24 ,DescFlexField_PubDescSeg25= B.DescFlexField_PubDescSeg25 ,DescFlexField_PubDescSeg26= B.DescFlexField_PubDescSeg26 ,DescFlexField_PubDescSeg27= B.DescFlexField_PubDescSeg27 ,DescFlexField_PubDescSeg28= B.DescFlexField_PubDescSeg28 ,DescFlexField_PubDescSeg29= B.DescFlexField_PubDescSeg29 ,DescFlexField_PubDescSeg30= B.DescFlexField_PubDescSeg30 ,DescFlexField_PubDescSeg31= B.DescFlexField_PubDescSeg31 ,DescFlexField_PubDescSeg32= B.DescFlexField_PubDescSeg32 ,DescFlexField_PubDescSeg33= B.DescFlexField_PubDescSeg33 ,DescFlexField_PubDescSeg34= B.DescFlexField_PubDescSeg34 ,DescFlexField_PubDescSeg35= B.DescFlexField_PubDescSeg35 ,DescFlexField_PubDescSeg36= B.DescFlexField_PubDescSeg36 ,DescFlexField_PubDescSeg37= B.DescFlexField_PubDescSeg37 ,DescFlexField_PubDescSeg38= B.DescFlexField_PubDescSeg38 ,DescFlexField_PubDescSeg39= B.DescFlexField_PubDescSeg39 ,DescFlexField_PubDescSeg40= B.DescFlexField_PubDescSeg40 ,DescFlexField_PubDescSeg41= B.DescFlexField_PubDescSeg41 ,DescFlexField_PubDescSeg42= B.DescFlexField_PubDescSeg42 ,DescFlexField_PubDescSeg43= B.DescFlexField_PubDescSeg43 ,DescFlexField_PubDescSeg44= B.DescFlexField_PubDescSeg44 ,DescFlexField_PubDescSeg45= B.DescFlexField_PubDescSeg45 ,DescFlexField_PubDescSeg46= B.DescFlexField_PubDescSeg46 ,DescFlexField_PubDescSeg47= B.DescFlexField_PubDescSeg47 ,DescFlexField_PubDescSeg48= B.DescFlexField_PubDescSeg48 ,DescFlexField_PubDescSeg49= B.DescFlexField_PubDescSeg49 ,DescFlexField_PubDescSeg50= B.DescFlexField_PubDescSeg50 from Cust_RtnProfitOrder A,remoteDB.[T20211231].[dbo].[Cust_RtnProfitOrder] B where A.ID=B.ID -- 多语言表 update Cust_RtnProfitOrder_Trl set DescFlexField_CombineName=B.DescFlexField_CombineName from Cust_RtnProfitOrder_Trl A,remoteDB.[T20211231].[dbo].[Cust_RtnProfitOrder_Trl] B where A.ID=B.ID
2025年04月08日
10 阅读
0 评论
0 点赞
2025-04-08
【024】修改EA密码
永久修改EA密码-- 设置密码123456: update Base_User set Password=upper(substring(sys.fn_VarBinToHexStr(hashbytes('MD5', CAST('zgv9FQWbaNZ2iIhNej0+jA==' as varchar(50)) + convert(char(36),base_user.salt))),3,32)) where Code = 'EA'临时修改EA密码-- 先保存一下原来的EA密码 declare @Pwd nvarchar(50) select @Pwd=Password from Base_User where Code = 'EA' select @Pwd -- 设置密码123456: update Base_User set Password=upper(substring(sys.fn_VarBinToHexStr(hashbytes('MD5', CAST('zgv9FQWbaNZ2iIhNej0+jA==' as varchar(50)) + convert(char(36),base_user.salt))),3,32)) where Code = 'EA' -- 用完之后还原 update Base_User set Password= @Pwd where Code = 'EA'启用用户-- 启用用户 update Base_User set IsAlive=1 where code='adminwc'
2025年04月08日
7 阅读
0 评论
0 点赞
2025-04-08
【023】新增客开参数设置
使用SQL语句DECLARE @Application BIGINT,@ID BIGINT select @Application=a.ID from Base_Application a left join Base_Application_Trl a1 on a.ID=a1.ID and a1.SysMLFlag='zh-CN' where a1.Name='工程数据' set @ID=202309221001 -- 先删除 DELETE FROM Base_Profile WHERE ID=@ID; DELETE FROM Base_Profile_Trl WHERE ID=@ID; -- 再新增 -- Application 应用 -- ProfileValueType 参数类型 -- ControlScope 作用范围 -- SensitiveType 敏感性 -- IsSend 是否可下发 -- IsModify 是否可修改 -- AllowMultiValue 是否多选 INSERT Base_Profile (ID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,ProfileValueType ,SubTypeName,DefaultValue,Application,ControlScope,SensitiveType,SysVersion ,Code,ShortName,ReferenceID,Sort,Hidden,ShowPecent,IsSend,IsModify,AllowMultiValue) VALUES(@ID,GETDATE(),'系统管理员',GETDATE(),'系统管理员',0 ,'string','',@Application,1,4,0 ,'BOMComponentMapping_StoreNotExistsWh','BOM子项替代料可用量仓库排除',NULL,-1,0,0,1,1,0) ; INSERT Base_Profile_Trl (ID,SysMLFlag,ProfileGroup,Name,Description) VALUES(@ID,'zh-CN','BOM子项替代料可用量仓库排除','BOM子项替代料可用量仓库排除','BOM子项替代功能弹出界面查询可用量时,将排除此参数设置的所有仓库') ;
2025年04月08日
36 阅读
0 评论
0 点赞
2025-04-08
【022】推式生单配置目标单据类型编码查询
调用系统BP示例从收货单配置杂发单(MES对接自动生成场景)public CommonRes MiscShipCreateFromRcv(string jsonData) { CommonRes res = new CommonRes(); var jObj = JObject.Parse(jsonData); long? id = jObj["ID"]?.Value<long>(); if (!id.HasValue) return res.Fail("收货单主键为空,不能操作"); Receivement rcv = Receivement.Finder.FindByID(id.Value); if (rcv == null) return res.Fail($"收货单不存在或无权访问:{id}"); Organization org = rcv.Org; // 查询推式生单配置 GetPushToDocTypeByRule docTypeByRule = new GetPushToDocTypeByRule { ConditionValue = new PushToDocTypeConditionValueDTO { SourceOrgKey = org.Key, SourceDocEntityFullName = Receivement.EntityRes.BE_FullName, TargetOrgKey = org.Key, TargetDocEntityFullName = MiscShipment.EntityRes.BE_FullName, ConditionValue1 = rcv.RcvDocTypeKey.ID.ToString() // 条件1 来源单据类型 } }; List<long> docList = docTypeByRule.Do(); if (docList == null || docList.Count == 0) return res.Fail($"根据收货单:{rcv.DocNo},单据类型:{rcv.RcvDocType.Name},查询推式生单配置失败,请检查是否配置"); MiscShipDocType doctype = MiscShipDocType.Finder.FindByID(docList[0]); if (doctype == null) return res.Fail($"杂发单单据类型查询失败:{docList[0]}"); // dosomething return res; }c#方法/// <summary> /// 推式生单配置 /// </summary> /// <param name="SrcOrg">来源组织</param> /// <param name="DocType">来源单据类型</param> /// <param name="SourceEntityKey">来源实体ID</param> /// <param name="TargetEntityKey">目标实体ID</param> /// <returns></returns> public static string GetPushToDocTypeConfig(Organization SrcOrg, long DocType, long SourceEntityKey, long TargetEntityKey,string tab) { // 生单规则 PushToDocTypeRule PTTRData = PushToDocTypeRule.Finder.Find($"PushToDocTypeConfig.SourceEntity = {SourceEntityKey} and PushToDocTypeConfig.TargetEntity = {TargetEntityKey} and TargetOrg = {SrcOrg.ID}"); // 生单规则条件 PushToDocTypeRuleLine PTTRLData = PushToDocTypeRuleLine.Finder.Find($"PushToDocTypeRule = {PTTRData.ID} and SourceOrg = {SrcOrg.ID} and EntityFieldValue{tab} = {DocType}"); return PTTRLData?.TargetDocTypeCode; }SQL函数SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: qxq -- Create date: 2023年8月30日 -- Description: 查询推式生单配置的下游单据类型编码 -- Example: select dbo.Fun_Cust_GetTargetDocTypeCode('UFIDA.U9.SM.ShipPlan.ShipPlan', 'UFIDA.U9.SM.Ship.Ship', 1002109230000231, (select ID from Base_Organization where Code='T001')) -- ============================================= CREATE OR ALTER FUNCTION Fun_Cust_GetTargetDocTypeCode ( @SourceEntityName varchar(255), -- 来源实体类型全称 @TargetEntityName varchar(255), -- 目标实体类型全称 @SourceDocType bigint, -- 来源单据类型 @TargetOrg bigint -- 目标组织 ) RETURNS nvarchar(255) AS BEGIN declare @SourceEntity bigint,@TargetEntity bigint,@TargetDocTypeCode nvarchar(255) select @SourceEntity=Local_ID from UBF_MD_Class where FullName=@SourceEntityName select @TargetEntity=Local_ID from UBF_MD_Class where FullName=@TargetEntityName select @TargetDocTypeCode=TargetDocTypeCode from Base_PushToDocTypeRuleLine line join Base_PushToDocTypeRule head on head.ID=line.PushToDocTypeRule and head.TargetOrg=@TargetOrg join Base_PushToDocTypeConfig conf on conf.ID=head.PushToDocTypeConfig and SourceEntity=@SourceEntity and TargetEntity=@TargetEntity where (EntityFieldValue1=@SourceDocType or EntityFieldValue2=@SourceDocType or EntityFieldValue3=@SourceDocType or EntityFieldValue4=@SourceDocType or EntityFieldValue5=@SourceDocType or EntityFieldValue6=@SourceDocType) return @TargetDocTypeCode END GO
2025年04月08日
19 阅读
0 评论
0 点赞
2025-04-08
【021】通过URL强制删除个性化模板
如:http://localhost/U9/erp/display.aspx?lnk=UFIDA.U9.KL.FrontOrderURL&sId=3015nid&mId=1002109150660095&__curOId=1002106180060265改为:http://localhost/U9/errors/pdisplay.aspx?lnk=UFIDA.U9.KL.FrontOrderURL&sId=3015nid&mId=1002109150660095&__curOId=1002106180060265将erp 改为 errors 将display 改为 pdisplay前置订单 个性化管理工具界面
2025年04月08日
11 阅读
0 评论
0 点赞
2025-04-08
【020】事务单独提交
// System.Transactions.Transaction需要引用系统程序集System.Transactions.DLL System.Transactions.Transaction old = System.Transactions.Transaction.Current; try { System.Transactions.TransactionOptions txOptions = new System.Transactions.TransactionOptions(); txOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; System.Transactions.Transaction.Current = new System.Transactions.CommittableTransaction(txOptions); // 需要独立提交事务的代码 // DoSomething(...) ((System.Transactions.CommittableTransaction)System.Transactions.Transaction.Current).Commit(); } catch (Exception ex) { ((System.Transactions.CommittableTransaction)System.Transactions.Transaction.Current).Rollback(); throw ex; } finally { System.Transactions.Transaction.Current = old; }
2025年04月08日
8 阅读
0 评论
0 点赞
1
...
3
4
5
6