From b529de4a5af28920d36d7659cd8b18c0d8cf05da Mon Sep 17 00:00:00 2001 From: fly-l <1420031550@qq.com> Date: Wed, 13 Sep 2023 15:13:41 +0800 Subject: [PATCH] 2023-09-13 --- .../BLL/API/HJGL/APIPackagingManageService.cs | 8 +++ SGGL/BLL/Common/Funs.cs | 2 + SGGL/BLL/SysManage/SysConstSetService.cs | 42 +++++++++++ .../TaskScheduling/TimerTask/TimerTaskBase.cs | 1 - SGGL/FineUIPro.Mobile/FineUIPro.Mobile.csproj | 1 - .../HJGL/PreDesign/PrePipeline.aspx.cs | 3 +- SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx | 9 +++ .../SysManage/SysConstSet.aspx.cs | 72 +++++++++++++++++++ .../SysManage/SysConstSet.aspx.designer.cs | 27 +++++++ 9 files changed, 162 insertions(+), 3 deletions(-) diff --git a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs index c6f1c409..c6fa17cf 100644 --- a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs +++ b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs @@ -74,6 +74,14 @@ namespace BLL }).ToList(); bool isPower = Person_PersonsService.IsGeneralUnitByPersonId(personId, projectId); + if (!isPower) + { + var roleList= Person_PersonsService.GetRoleListByProjectIdPersonId(projectId, personId); + if (roleList.Contains(Const.CQEngineer)) + { + isPower=true; + } + } packagingManageItem.packagingManageDetailItem = q; packagingManageItem.packagingPrepipeItems = packagingPrepipeItem; packagingManageItem.isPower = isPower; diff --git a/SGGL/BLL/Common/Funs.cs b/SGGL/BLL/Common/Funs.cs index c70e5b10..74b20799 100644 --- a/SGGL/BLL/Common/Funs.cs +++ b/SGGL/BLL/Common/Funs.cs @@ -1408,6 +1408,8 @@ namespace BLL client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("token", Token); + request.AddHeader("ClientId", SysConstSetService.ClientId); + request.AddHeader("OperationCode", Baseurl.Substring(Baseurl.LastIndexOf("/", StringComparison.Ordinal))); if (!string.IsNullOrEmpty(JsonBody)) { request.AddJsonBody(JsonBody); diff --git a/SGGL/BLL/SysManage/SysConstSetService.cs b/SGGL/BLL/SysManage/SysConstSetService.cs index df34d5aa..c1d86199 100644 --- a/SGGL/BLL/SysManage/SysConstSetService.cs +++ b/SGGL/BLL/SysManage/SysConstSetService.cs @@ -6,8 +6,10 @@ public static class SysConstSetService { private static string _CNCECPath; + private static string _CncecEsbPath; private static string _CNCECToken; private static string _CNCECTokenExTime; + private static string _ClientId; public static string CNCECPath { @@ -29,6 +31,46 @@ _CNCECPath = value; } } + public static string CncecEsbPath + { + get + { + var sysSet5 = (from x in Funs.DB.Sys_Const where x.ConstText == "集团ESB地址" select x).ToList().FirstOrDefault(); + if (sysSet5 != null) + { + _CncecEsbPath = sysSet5.ConstValue; + } + else + { + _CncecEsbPath = ""; + } + return _CncecEsbPath; + } + set + { + _CncecEsbPath = value; + } + } + public static string ClientId + { + get + { + var sysSet5 = (from x in Funs.DB.Sys_Const where x.ConstText == "ClientId" select x).ToList().FirstOrDefault(); + if (sysSet5 != null) + { + _ClientId = sysSet5.ConstValue; + } + else + { + _ClientId = ""; + } + return _ClientId; + } + set + { + _ClientId = value; + } + } public static string CNCECToken { get diff --git a/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs b/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs index c4459a66..b15c4519 100644 --- a/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs +++ b/SGGL/BLL/TaskScheduling/TimerTask/TimerTaskBase.cs @@ -23,7 +23,6 @@ using System.Threading.Tasks; //初始化计划者 StdSchedulerFactory factory = new StdSchedulerFactory(); - // StdSchedulerFactory factory = new StdSchedulerFactory(properties); IScheduler scheduler = await factory.GetScheduler(); var jobAndTriggerMapping = new Dictionary>(); // 将映射关系包装成制度字典集合 diff --git a/SGGL/FineUIPro.Mobile/FineUIPro.Mobile.csproj b/SGGL/FineUIPro.Mobile/FineUIPro.Mobile.csproj index c4c16785..8ac391f6 100644 --- a/SGGL/FineUIPro.Mobile/FineUIPro.Mobile.csproj +++ b/SGGL/FineUIPro.Mobile/FineUIPro.Mobile.csproj @@ -3322,7 +3322,6 @@ uploader.aspx - ASPXCodeBehind uploader.aspx diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs index 14b62b2f..4aea321d 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/PrePipeline.aspx.cs @@ -376,7 +376,8 @@ namespace FineUIPro.Web.HJGL.PreDesign from unitwork in unitworkJoin.DefaultIfEmpty() join mater in db.Base_Material on pipe.MaterialId equals mater.MaterialId into materJoin from mater in materJoin.DefaultIfEmpty() - where com.QRCode != "" & com.PipelineId == PipelineId + where com.QRCode != "" & com.PipelineId == PipelineId + orderby com.PipelineComponentCode select new { com.PipelineComponentId, diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx index 171b4368..1837ca84 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx @@ -113,6 +113,15 @@ + + + + + + + + diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs index ff98d9b9..675988a1 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs @@ -134,6 +134,16 @@ namespace FineUIPro.Web.SysManage { txtSerVerUrl.Text = sysSet9.ConstValue; } + var sysSet10 = (from x in Funs.DB.Sys_Const where x.ConstText == "集团ESB地址" select x).ToList().FirstOrDefault(); + if (sysSet10 != null) + { + txtESBSerVerUrl.Text = sysSet10.ConstValue; + } + var sysSet11 = (from x in Funs.DB.Sys_Const where x.ConstText == "ClientId" select x).ToList().FirstOrDefault(); + if (sysSet11 != null) + { + txtClientId.Text = sysSet11.ConstValue; + } var sysSet18 = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_SafeReferer).Select(x => new { x.ConstText, x.ConstValue }).ToList(); var txtReferer = ""; foreach (var item in sysSet18) @@ -343,6 +353,48 @@ namespace FineUIPro.Web.SysManage Funs.DB.Sys_Const.InsertOnSubmit(newSysSet9); Funs.DB.SubmitChanges(); } + Model.Sys_Const sysSet10 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "集团ESB地址"); + if (sysSet10 != null) + { + if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim())) + { + sysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim(); + } + db.SubmitChanges(); + } + else + { + Model.Sys_Const newSysSet10 = new Model.Sys_Const(); + newSysSet10.ID = SQLHelper.GetNewID(); + if (!string.IsNullOrEmpty(this.txtESBSerVerUrl.Text.Trim())) + { + newSysSet10.ConstValue = this.txtESBSerVerUrl.Text.Trim(); + } + newSysSet10.ConstText = "集团ESB地址"; + Funs.DB.Sys_Const.InsertOnSubmit(newSysSet10); + Funs.DB.SubmitChanges(); + } + Model.Sys_Const sysSet11 = db.Sys_Const.FirstOrDefault(x => x.ConstText == "ClientId"); + if (sysSet11 != null) + { + if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim())) + { + sysSet11.ConstValue = this.txtClientId.Text.Trim(); + } + db.SubmitChanges(); + } + else + { + Model.Sys_Const newSysSet11 = new Model.Sys_Const(); + newSysSet11.ID = SQLHelper.GetNewID(); + if (!string.IsNullOrEmpty(this.txtClientId.Text.Trim())) + { + newSysSet11.ConstValue = this.txtClientId.Text.Trim(); + } + newSysSet11.ConstText = "ClientId"; + Funs.DB.Sys_Const.InsertOnSubmit(newSysSet11); + Funs.DB.SubmitChanges(); + } ConstValue.DeleteConstValueBygroupId(BLL.ConstValue.Group_SafeReferer); var q = txtRefererWhitelist.Text.Split('&'); foreach (var item in q) @@ -1100,5 +1152,25 @@ namespace FineUIPro.Web.SysManage } + + protected void txtTestPost_OnClick(object sender, EventArgs e) + { + System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; + string CncecEsbPath = SysConstSetService.CncecEsbPath; + string ClientId = SysConstSetService.ClientId; + + string baseurl = CncecEsbPath + "/cn.cncec.group.qhsePROD.common.GetToken"; + var client = new RestClient(baseurl); + client.Timeout = -1; + var request = new RestRequest(Method.POST); + var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + request.AddHeader("ClientId", ClientId); + request.AddHeader("OperationCode", "cn.cncec.group.qhsePROD.common.GetToken"); + request.AddParameter("UnitName", thisUnit.UnitName); + request.AddParameter("CollCropCode", thisUnit.CollCropCode); + IRestResponse response = client.Execute(request); + + Alert.Show(response.Content); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs index 317e7691..33bca25f 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs @@ -311,6 +311,33 @@ namespace FineUIPro.Web.SysManage /// protected global::FineUIPro.Button btnApply; + /// + /// txtESBSerVerUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtESBSerVerUrl; + + /// + /// txtClientId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtClientId; + + /// + /// txtTestPost 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button txtTestPost; + /// /// txtRefererWhitelist 控件。 ///