This commit is contained in:
高飞 2023-09-14 10:44:01 +08:00
commit 1cacd53725
9 changed files with 162 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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<IJobDetail, IReadOnlyCollection<ITrigger>>();
// 将映射关系包装成制度字典集合

View File

@ -3322,7 +3322,6 @@
</Compile>
<Compile Include="AttachFile\uploader.aspx.cs">
<DependentUpon>uploader.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="AttachFile\uploader.aspx.designer.cs">
<DependentUpon>uploader.aspx</DependentUpon>

View File

@ -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,

View File

@ -113,6 +113,15 @@
</f:Button>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="70% 25% 5%">
<Items>
<f:TextBox ID="txtESBSerVerUrl" runat="server" Label="集团ESB地址" LabelWidth="230px"></f:TextBox>
<f:TextBox ID="txtClientId" runat="server" Label="ClientId" LabelWidth="230px"></f:TextBox>
<f:Button ID="txtTestPost" Icon="SystemSave" Text="测试对接" runat="server" ValidateForms="SimpleForm1"
OnClick="txtTestPost_OnClick">
</f:Button>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea runat="server" ID="txtRefererWhitelist" Label="数据穿透白名单"></f:TextArea>

View File

@ -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);
}
}
}

View File

@ -311,6 +311,33 @@ namespace FineUIPro.Web.SysManage
/// </remarks>
protected global::FineUIPro.Button btnApply;
/// <summary>
/// txtESBSerVerUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtESBSerVerUrl;
/// <summary>
/// txtClientId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtClientId;
/// <summary>
/// txtTestPost 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button txtTestPost;
/// <summary>
/// txtRefererWhitelist 控件。
/// </summary>