This commit is contained in:
佘春生 2024-06-18 10:34:42 +08:00
parent 3d69c04346
commit 20904bda17
11 changed files with 465 additions and 219 deletions

View File

@ -59,6 +59,27 @@ namespace BLL
} }
} }
// 单点登陆ClientId参数
public static string ClientId
{
get;
set;
}
// 单点登陆ClientSecret参数
public static string ClientSecret
{
get;
set;
}
// 单点登陆Redirect_url参数
public static string Redirect_url
{
get;
set;
}
/// <summary> /// <summary>
/// 데貫<EB8DB0> /// 데貫<EB8DB0>
/// </summary> /// </summary>

View File

@ -213,7 +213,7 @@
var target = $(event.target); var target = $(event.target);
var cellEl = target.closest('.f-grid-cell'); var cellEl = target.closest('.f-grid-cell');
var rowId = grid1.getRowId(cellEl); var rowId = grid1.getRowId(cellEl);
console.log(rowId); //console.log(rowId);
var columnId = grid1.getColumnId(cellEl); var columnId = grid1.getColumnId(cellEl);
var columnName = grid1.getColumn(columnId).columnId; var columnName = grid1.getColumn(columnId).columnId;

View File

@ -14,6 +14,13 @@
color: #fff; color: #fff;
} }
.f-grid-row.color2,
.f-grid-row.color2 .f-icon,
.f-grid-row.color2 a {
background-color: red;
color: #fff;
}
.f-rate .f-rate-star.f-rate-star-half .f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full .f-rate .f-rate-star.f-rate-star-half .f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full
.f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full .f-rate-star-second .f-rate-star-icon { .f-rate-star-first .f-rate-star-icon, .f-rate .f-rate-star.f-rate-star-full .f-rate-star-second .f-rate-star-icon {
color: #cc0033; color: #cc0033;
@ -67,6 +74,9 @@
<f:HiddenField runat="server" ID="hidisDepScore4"></f:HiddenField> <f:HiddenField runat="server" ID="hidisDepScore4"></f:HiddenField>
<f:HiddenField runat="server" ID="hidisDepScore5"></f:HiddenField> <f:HiddenField runat="server" ID="hidisDepScore5"></f:HiddenField>
<f:HiddenField runat="server" ID="hidisDepScore6"></f:HiddenField> <f:HiddenField runat="server" ID="hidisDepScore6"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMaxScore1"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMaxScore2"></f:HiddenField>
<f:HiddenField runat="server" Text="" ID="hidMsg"></f:HiddenField>
</ItemTemplate> </ItemTemplate>
</f:TemplateField> </f:TemplateField>
<f:TemplateField HeaderText="承包商<br/>Contractor" HeaderTextAlign="Center" Width="200px"> <f:TemplateField HeaderText="承包商<br/>Contractor" HeaderTextAlign="Center" Width="200px">
@ -138,7 +148,7 @@
<Items> <Items>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server" <f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
BoxFlex="1" DataKeyNames="SES_No" AllowCellEditing="true" ClicksToEdit="2" DataIDField="SES_No" BoxFlex="1" DataKeyNames="SES_No" AllowCellEditing="true" ClicksToEdit="2" DataIDField="SES_No"
PageSize="15" EnableRowSelectEvent="true" Height="200px"> PageSize="15" EnableRowSelectEvent="true" Height="200px" OnRowDataBound="Grid2_RowDataBound">
<Columns> <Columns>
<f:RenderField ColumnID="SES_No" DataField="SES_No" SortField="SES_No" <f:RenderField ColumnID="SES_No" DataField="SES_No" SortField="SES_No"
FieldType="String" HeaderText="SES No." HeaderTextAlign="Center"> FieldType="String" HeaderText="SES No." HeaderTextAlign="Center">
@ -161,6 +171,12 @@
<f:RenderField ColumnID="Requisitioner" DataField="Requisitioner" Width="200px" SortField="Requisitioner" <f:RenderField ColumnID="Requisitioner" DataField="Requisitioner" Width="200px" SortField="Requisitioner"
FieldType="String" HeaderText="Requisitioner" HeaderTextAlign="Center"> FieldType="String" HeaderText="Requisitioner" HeaderTextAlign="Center">
</f:RenderField> </f:RenderField>
<f:TemplateField ColumnID="ShowViolationDegree" Width="110px" HeaderText="违章程度"
HeaderTextAlign="Center" TextAlign="Center" SortField="ShowViolationDegree">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# ConvertViolationDegree(Eval("ShowViolationDegree")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
</Columns> </Columns>
</f:Grid> </f:Grid>
</Items> </Items>
@ -183,10 +199,12 @@
function renderRateUser(value, row) { function renderRateUser(value, row) {
var evaltype = row.rowValue["IsEvaluateType"]; var evaltype = row.rowValue["IsEvaluateType"];
return F.rateHtml(value, { return F.rateHtml(value, {
allowClear: true,
readonly: evaltype == 1 ? true : false, readonly: evaltype == 1 ? true : false,
allowHalf: true, allowHalf: true,
textVisible: false textVisible: false
}); });
return html;
} }
F.ready(function () { F.ready(function () {
var grid1 = F(grid1ClientID); var grid1 = F(grid1ClientID);
@ -194,13 +212,46 @@
F.rateEvents(grid1.el, function (event, value) { F.rateEvents(grid1.el, function (event, value) {
var target = $(event.target); var target = $(event.target);
var cellEl = target.closest('.f-grid-cell'); var cellEl = target.closest('.f-grid-cell');
var rowId = grid1.getRowId(cellEl); var rowId = grid1.getRowId(cellEl);
//console.log(rowId);
var columnId = grid1.getColumnId(cellEl); var columnId = grid1.getColumnId(cellEl);
var columnName = grid1.getColumn(columnId).columnId;
//获取控件值1
var maxScore1 = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMaxScore1-inputEl").val();
//获取控件值2
var maxScore2 = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMaxScore2-inputEl").val()
var hidMsg = $("#Panel1_panelTopRegion_Grid1_ftpl_" + rowId + "_0_hidMsg-inputEl").val()
// 用户EHSS
if (columnName == "Score3" && value > parseFloat(maxScore1)) {
F.alert(hidMsg + "最大只能评" + maxScore1 + "星");
var html = F.rateHtml(0, {
allowClear: true,
allowHalf: true,
textVisible: false
});
grid1.getCellEl(rowId, columnId).html(html)
}
// 部门安全监管
else if (columnName == "Score1" && value > parseFloat(maxScore2)) {
F.alert(hidMsg + "最大只能评" + maxScore2 + "星");
var html = F.rateHtml(0, {
allowClear: true,
allowHalf: true,
textVisible: false
});
grid1.getCellEl(rowId, columnId).html(html)
}
else {
//更新单元格的值 //更新单元格的值
grid1.updateCellValue(rowId, columnId, value); grid1.updateCellValue(rowId, columnId, value);
}
}); });
}); });
</script> </script>
</body> </body>

View File

@ -1,15 +1,19 @@
using BLL; using BLL;
using BLL.Common; using BLL.Common;
using FineUIPro.Web.common.SysManage;
using Model; using Model;
using Newtonsoft.Json; using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SqlClient; using System.Data.SqlClient;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using System.Web.UI; using System.Web.UI;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using static NPOI.POIFS.Crypt.CryptoFunctions;
namespace FineUIPro.Web.Evaluation namespace FineUIPro.Web.Evaluation
{ {
@ -247,10 +251,15 @@ namespace FineUIPro.Web.Evaluation
HiddenField hidisDepScore4 = Grid1.Rows[i].FindControl("hidisDepScore4") as HiddenField; HiddenField hidisDepScore4 = Grid1.Rows[i].FindControl("hidisDepScore4") as HiddenField;
HiddenField hidisDepScore5 = Grid1.Rows[i].FindControl("hidisDepScore5") as HiddenField; HiddenField hidisDepScore5 = Grid1.Rows[i].FindControl("hidisDepScore5") as HiddenField;
HiddenField hidisDepScore6 = Grid1.Rows[i].FindControl("hidisDepScore6") as HiddenField; HiddenField hidisDepScore6 = Grid1.Rows[i].FindControl("hidisDepScore6") as HiddenField;
HiddenField hidMaxScore1 = Grid1.Rows[i].FindControl("hidMaxScore1") as HiddenField;
HiddenField hidMaxScore2 = Grid1.Rows[i].FindControl("hidMaxScore2") as HiddenField;
HiddenField hidMsg = Grid1.Rows[i].FindControl("hidMsg") as HiddenField;
var foNo = Grid1.Rows[i].DataKeys[0].ToString(); var foNo = Grid1.Rows[i].DataKeys[0].ToString();
var isEvaluateType = Grid1.Rows[i].DataKeys[1].ToString(); var isEvaluateType = Grid1.Rows[i].DataKeys[1].ToString();
var evaluateType = Grid1.Rows[i].DataKeys[2].ToString(); var evaluateType = Grid1.Rows[i].DataKeys[2].ToString();
var userType = Grid1.Rows[i].DataKeys[3].ToString();
if (contractorList != null && contractorList.Count(p => p.FO_NO == foNo) > 0) if (contractorList != null && contractorList.Count(p => p.FO_NO == foNo) > 0)
{ {
@ -260,6 +269,63 @@ namespace FineUIPro.Web.Evaluation
lblContractor.Text = contractModel.Contractor; lblContractor.Text = contractModel.Contractor;
} }
} }
// 违章扣分
if (userType == "1")
{
var sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && p.Requisitioner == CurrUser.Account).OrderByDescending(t => t.ViolationDegree).FirstOrDefault();
switch (sesList?.ViolationDegree)
{
case "1":
hidMaxScore1.Text = "4.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在一般违章,";
break;
case "2":
hidMaxScore1.Text = "4";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在严重违章,";
break;
case "3":
hidMaxScore1.Text = "3.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在零容忍违章,";
break;
default:
hidMaxScore1.Text = "5";
hidMsg.Text = "";
break;
}
}
else
{
var sesList = Funs.DB.FC_SESReportView.AsQueryable();
var setList = Funs.DB.Sys_User.Where(p => new string[] { Const.Role_CTSSId, Const.Role_CTSCId, Const.Role_CTMTId }.Contains(p.RoleId) && p.UserId == CurrUser.UserId).ToList();
if (setList.Count > 0)
sesList = sesList.Where(p => p.FO_NO == foNo && p.Requisitioner != "" && p.Requisitioner != null && p.Requisitioner != string.Empty).OrderByDescending(t => t.ViolationDegree);
else
sesList = sesList.Where(p => p.FO_NO == foNo && (p.MainCoordinatorUser == CurrUser.Account || p.ContractAdminUser == CurrUser.Account || p.UserRepresentativeUser == CurrUser.Account)).OrderByDescending(t => t.ViolationDegree);
var max = sesList.FirstOrDefault();
switch (max?.ViolationDegree)
{
case "1":
hidMaxScore2.Text = "4.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在一般违章,";
break;
case "2":
hidMaxScore2.Text = "4";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在严重违章,";
break;
case "3":
hidMaxScore2.Text = "3.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{max?.SES_No}存在零容忍违章,";
break;
default:
hidMaxScore2.Text = "5";
hidMsg.Text = "";
break;
}
}
if (isEvaluateType == "1") if (isEvaluateType == "1")
{ {
Grid1.Rows[i].RowCssClass = "color1"; Grid1.Rows[i].RowCssClass = "color1";
@ -758,6 +824,21 @@ namespace FineUIPro.Web.Evaluation
} }
Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList); Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList);
} }
// 回写违章捐款(用户)
var PunishList = from x in pjSESReport where x.ViolationDegree != null select x;
if (PunishList.Count() > 0)
{
foreach (var p in PunishList)
{
var punish = Funs.DB.EMC_Punishment.FirstOrDefault(x => x.FO_NO == p.FO_NO && x.ViolationRelatedSes == p.SES_No);
if (punish != null)
{
punish.IsUserEvaluated = true;
Funs.DB.SubmitChanges();
}
}
}
} }
//部门 //部门
if (item.EvaluateType == "Dep") if (item.EvaluateType == "Dep")
@ -872,6 +953,21 @@ namespace FineUIPro.Web.Evaluation
} }
Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList); Funs.DB.Score_JournalEvaluation.InsertAllOnSubmit(scoreJournalList);
} }
// 回写违章捐款(部门)
var PunishList = from x in pjSESReport where x.ViolationDegree != null select x;
if (PunishList.Count() > 0)
{
foreach (var p in PunishList)
{
var punish = Funs.DB.EMC_Punishment.FirstOrDefault(x => x.FO_NO == p.FO_NO && x.ViolationRelatedSes == p.SES_No);
if (punish != null)
{
punish.IsDepEvaluated = true;
Funs.DB.SubmitChanges();
}
}
}
} }
} }
} }
@ -908,7 +1004,7 @@ namespace FineUIPro.Web.Evaluation
{ {
sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == FoNo && p.Requisitioner == CurrUser.Account).ToList(); sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == FoNo && p.Requisitioner == CurrUser.Account).ToList();
} }
Grid2.DataSource = sesList; Grid2.DataSource = sesList.OrderByDescending(x => x.ShowViolationDegree);
Grid2.DataBind(); Grid2.DataBind();
} }
#endregion #endregion
@ -1357,5 +1453,38 @@ namespace FineUIPro.Web.Evaluation
BindGrid(); BindGrid();
} }
#endregion #endregion
protected void Grid2_RowDataBound(object sender, GridRowEventArgs e)
{
var row = e.DataItem as Model.FC_SESReportView;
if (!string.IsNullOrEmpty(row.ShowViolationDegree))
{
e.RowCssClass = "color2";
}
}
protected string ConvertViolationDegree(object violationDegree)
{
string degree = string.Empty;
if (violationDegree != null)
{
if (violationDegree.ToString() == "1")
{
degree = "一般违章";
}
if (violationDegree.ToString() == "2")
{
degree = "严重违章";
}
if (violationDegree.ToString() == "3")
{
degree = "零容忍违章";
}
}
return degree;
}
} }
} }

View File

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace FineUIPro.Web.Evaluation { namespace FineUIPro.Web.Evaluation
{
public partial class SafetyEvaluation { public partial class SafetyEvaluation
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -201,6 +203,33 @@ namespace FineUIPro.Web.Evaluation {
/// </remarks> /// </remarks>
protected global::FineUIPro.HiddenField hidisDepScore6; protected global::FineUIPro.HiddenField hidisDepScore6;
/// <summary>
/// hidMaxScore1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMaxScore1;
/// <summary>
/// hidMaxScore2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMaxScore2;
/// <summary>
/// hidMsg 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMsg;
/// <summary> /// <summary>
/// lblContractor 控件。 /// lblContractor 控件。
/// </summary> /// </summary>
@ -237,6 +266,15 @@ namespace FineUIPro.Web.Evaluation {
/// </remarks> /// </remarks>
protected global::FineUIPro.Grid Grid2; protected global::FineUIPro.Grid Grid2;
/// <summary>
/// Label3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label3;
/// <summary> /// <summary>
/// Window1 控件。 /// Window1 控件。
/// </summary> /// </summary>

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectView>ProjectFiles</ProjectView> <ProjectView>ProjectFiles</ProjectView>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress> <Use64BitIISExpress>
</Use64BitIISExpress> </Use64BitIISExpress>

View File

@ -32,6 +32,10 @@
Funs.RootPath = Server.MapPath("~/"); Funs.RootPath = Server.MapPath("~/");
// 日志文件所在目录 // 日志文件所在目录
ErrLogInfo.DefaultErrLogFullPath = Server.MapPath("~/ErrLog.txt"); ErrLogInfo.DefaultErrLogFullPath = Server.MapPath("~/ErrLog.txt");
Funs.ClientId = ConfigurationManager.AppSettings["clientId"];
Funs.ClientSecret = ConfigurationManager.AppSettings["clientSecret"];
Funs.Redirect_url = ConfigurationManager.AppSettings["redirect_url"];
Funs.SystemName = ConfigurationManager.AppSettings["SystemName"]; Funs.SystemName = ConfigurationManager.AppSettings["SystemName"];
Funs.ConnString = ConfigurationManager.ConnectionStrings["FCLDBConnectionString"].ConnectionString; Funs.ConnString = ConfigurationManager.ConnectionStrings["FCLDBConnectionString"].ConnectionString;
} }
@ -117,7 +121,8 @@
// 承包商资质提前3个过期提示 // 承包商资质提前3个过期提示
var queListOne = from x in Funs.DB.EMC_Contractor_Qualification var queListOne = from x in Funs.DB.EMC_Contractor_Qualification
where x.LimitEndDate != null join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
where x.LimitEndDate != null && y.FC_Status == "Valid"
&& x.LimitEndDate.Value.AddMonths(-3).Date <= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-3).Date <= DateTime.Now.Date
&& x.LimitEndDate.Value.AddMonths(-3).AddDays(15).Date >= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-3).AddDays(15).Date >= DateTime.Now.Date
select x; select x;
@ -134,7 +139,8 @@
// 承包商资质提前1个过期提示 // 承包商资质提前1个过期提示
var queListTwo = from x in Funs.DB.EMC_Contractor_Qualification var queListTwo = from x in Funs.DB.EMC_Contractor_Qualification
where x.LimitEndDate != null join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
where x.LimitEndDate != null && y.FC_Status == "Valid"
&& x.LimitEndDate.Value.AddMonths(-1).Date <= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-1).Date <= DateTime.Now.Date
&& x.LimitEndDate.Value.AddMonths(-1).AddDays(15).Date >= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-1).AddDays(15).Date >= DateTime.Now.Date
select x; select x;
@ -176,7 +182,8 @@
{ {
// 承包商资质提前3个过期提示 // 承包商资质提前3个过期提示
var queList = from x in Funs.DB.EMC_Contractor_Qualification var queList = from x in Funs.DB.EMC_Contractor_Qualification
where x.LimitEndDate != null join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
where x.LimitEndDate != null && y.FC_Status == "Valid"
&& x.LimitEndDate.Value.AddMonths(-3).Date <= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-3).Date <= DateTime.Now.Date
&& x.LimitEndDate.Value.AddMonths(-3).AddDays(15).Date >= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-3).AddDays(15).Date >= DateTime.Now.Date
select x; select x;
@ -433,7 +440,8 @@
{ {
// 承包商资质提前1个过期提示 // 承包商资质提前1个过期提示
var queList = from x in Funs.DB.EMC_Contractor_Qualification var queList = from x in Funs.DB.EMC_Contractor_Qualification
where x.LimitEndDate != null join y in Funs.DB.FC_SESRelatedData on x.FoId equals y.ID
where x.LimitEndDate != null && y.FC_Status == "Valid"
&& x.LimitEndDate.Value.AddMonths(-1).Date <= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-1).Date <= DateTime.Now.Date
&& x.LimitEndDate.Value.AddMonths(-1).AddDays(15).Date >= DateTime.Now.Date && x.LimitEndDate.Value.AddMonths(-1).AddDays(15).Date >= DateTime.Now.Date
select x; select x;

View File

@ -224,10 +224,10 @@
} }
}) })
$("#faskloginUrl").click(function () { $("#faskloginUrl").click(function () {
let clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; let clientId = '<%= BLL.Funs.ClientId %>';
let url = "https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize"; let url = "https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize";
let response_type = "code"; let response_type = "code";
let redirect_url = encodeURIComponent("https://fcl-test.basf-ypc.net.cn/ssocallback.aspx"); let redirect_url = encodeURIComponent('<%= BLL.Funs.Redirect_url %>');
let scope = "openid profile"; let scope = "openid profile";
let response_mode = "query"; let response_mode = "query";
let state = "state123"; let state = "state123";

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0"?>
<!-- <!--
有关如何配置 ASP.NET 应用程序的详细消息,请访问 有关如何配置 ASP.NET 应用程序的详细消息,请访问
@ -6,27 +6,27 @@
--> -->
<configuration> <configuration>
<configSections> <configSections>
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false" /> <section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
</configSections> </configSections>
<connectionStrings> <connectionStrings>
<add name="FCLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=FCLDB;uid=sa;pwd=1111;" providerName="System.Data.SqlClient" /> <add name="FCLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=FCLDB;uid=sa;pwd=1111;" providerName="System.Data.SqlClient"/>
</connectionStrings> </connectionStrings>
<FineUIPro DebugMode="false" CustomTheme="Metro_Dark_Blue" EnableAnimation="true" JSLibrary="All" /> <FineUIPro DebugMode="false" CustomTheme="Metro_Dark_Blue" EnableAnimation="true" JSLibrary="All"/>
<appSettings> <appSettings>
<!--连接字符串--> <!--连接字符串-->
<!--<add key="ConnectionString" value="Server=.;Database=FCLDB;Integrated Security=False; User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>--> <!--<add key="ConnectionString" value="Server=.;Database=FCLDB;Integrated Security=False; User ID=sa;Password=1111;MultipleActiveResultSets=true;Max Pool Size = 1000;Connect Timeout=1200"/>-->
<!--系统名称--> <!--系统名称-->
<add key="clientId" value="9379ad91-eef9-4956-a1ee-8b04bb3d42c8"/> <add key="clientId" value="db8ff79d-c3b5-4f08-b56d-0e1913a13bbb"/>
<add key="clientSecret" value="iLu8Q~4DRYAn~sMjvO1j.tgRERFWhILvLYRPNc9S"/> <add key="clientSecret" value="N5E8Q~gvFJ665-GZGD7AHfo6sZNzVTQcdBgN4diX"/>
<add key="redirect_url" value="https://fcl-test.basf-ypc.net.cn/ssocallback.aspx"/> <add key="redirect_url" value="https://fcl.basf-ypc.net.cn/ssocallback.aspx"/>
<add key="SystemName" value="FC" /> <add key="SystemName" value="FC"/>
<add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;" /> <add key="ChartImageHandler" value="storage=file;timeout=20;url=~/Images/;"/>
<add key="aspnet:MaxHttpCollectionKeys" value="50000" /> <add key="aspnet:MaxHttpCollectionKeys" value="50000"/>
<add key="Https" value="false" /> <add key="Https" value="false"/>
<add key="mailSmtpServer" value="smtp.163.com" /> <add key="mailSmtpServer" value="smtp.163.com"/>
<add key="MailServerFrom" value="hfnbd_test@163.com" /> <add key="MailServerFrom" value="hfnbd_test@163.com"/>
<add key="MailServerpassword" value="hfnbd123456" /> <add key="MailServerpassword" value="hfnbd123456"/>
<add key="MailServeruserName" value="hfnbd" /> <add key="MailServeruserName" value="hfnbd"/>
<!--<add key="Serial" value="7e00000004870a85c98afc0a2d000000000004"/>--> <!--<add key="Serial" value="7e00000004870a85c98afc0a2d000000000004"/>-->
</appSettings> </appSettings>
<!-- <!--
@ -39,134 +39,134 @@
--> -->
<system.web> <system.web>
<!-- 会话状态设置 默认情况下ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。若要禁用 Cookie请设置 sessionState cookieless="true" --> <!-- 会话状态设置 默认情况下ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。若要禁用 Cookie请设置 sessionState cookieless="true" -->
<sessionState mode="InProc" cookieless="UseCookies" timeout="1200" /> <sessionState mode="InProc" cookieless="UseCookies" timeout="1200"/>
<!--<processModel enable="true" requestQueueLimit="100000"/>--> <!--<processModel enable="true" requestQueueLimit="100000"/>-->
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID" viewStateEncryptionMode="Always"> <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID" viewStateEncryptionMode="Always">
<controls> <controls>
<add tagPrefix="f" namespace="FineUIPro" assembly="FineUIPro" /> <add tagPrefix="f" namespace="FineUIPro" assembly="FineUIPro"/>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls> </controls>
</pages> </pages>
<httpModules> <httpModules>
<add name="FineUIProScriptModule" type="FineUIPro.ScriptModule, FineUIPro" /> <add name="FineUIProScriptModule" type="FineUIPro.ScriptModule, FineUIPro"/>
</httpModules> </httpModules>
<httpHandlers> <httpHandlers>
<add path="res.axd" verb="GET" type="FineUIPro.ResourceHandler, FineUIPro" validate="false" /> <add path="res.axd" verb="GET" type="FineUIPro.ResourceHandler, FineUIPro" validate="false"/>
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" /> <add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers> </httpHandlers>
<compilation debug="true" targetFramework="4.6.1"> <compilation debug="false" targetFramework="4.6.1">
<buildProviders> <buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</buildProviders> </buildProviders>
</compilation> </compilation>
<!--requestPathInvalidCharacters=""--> <!--requestPathInvalidCharacters=""-->
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000" /> <httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000"/>
<authentication mode="Forms"> <authentication mode="Forms">
<forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/" /> <forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/"/>
</authentication> </authentication>
<membership> <membership>
<providers> <providers>
<clear /> <clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" /> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers> </providers>
</membership> </membership>
<profile> <profile>
<providers> <providers>
<clear /> <clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /> <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers> </providers>
</profile> </profile>
<roleManager enabled="false"> <roleManager enabled="false">
<providers> <providers>
<clear /> <clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" /> <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers> </providers>
</roleManager> </roleManager>
<customErrors defaultRedirect="LogOff.aspx" mode="RemoteOnly"> <customErrors defaultRedirect="LogOff.aspx" mode="RemoteOnly">
<error redirect="https://localhost/FCL/OperationError.aspx" statusCode="404" /> <error redirect="https://localhost/FCL/OperationError.aspx" statusCode="404"/>
</customErrors> </customErrors>
<!--Unencrypted __VIEWSTATE parameterviewstate 保存没有加密,解决方法--> <!--Unencrypted __VIEWSTATE parameterviewstate 保存没有加密,解决方法-->
<machineKey validation="3DES" compatibilityMode="Framework20SP1" /> <machineKey validation="3DES" compatibilityMode="Framework20SP1"/>
<!--Body Parameters Accepted in Query:https才能访问--> <!--Body Parameters Accepted in Query:https才能访问-->
<!--<httpCookies httpOnlyCookies="true" requireSSL="true"/>--> <!--<httpCookies httpOnlyCookies="true" requireSSL="true"/>-->
</system.web> </system.web>
<location path="res.axd" /> <location path="res.axd"/>
<system.webServer> <system.webServer>
<staticContent> <staticContent>
<mimeMap fileExtension=".dat" mimeType="application/ChinaExcel Report File" /> <mimeMap fileExtension=".dat" mimeType="application/ChinaExcel Report File"/>
<mimeMap fileExtension=".tab" mimeType="application/ChinaExcel Report File" /> <mimeMap fileExtension=".tab" mimeType="application/ChinaExcel Report File"/>
</staticContent> </staticContent>
<httpProtocol> <httpProtocol>
<customHeaders> <customHeaders>
<!--<add name="Content-Security-Policy" value="default-src 'self'"/>--> <!--<add name="Content-Security-Policy" value="default-src 'self'"/>-->
<remove name="X-Powered-By" /> <remove name="X-Powered-By"/>
<!-- SAMEORIGIN表示该页面可以在相同域名页面的 frame 中展示 --> <!-- SAMEORIGIN表示该页面可以在相同域名页面的 frame 中展示 -->
<add name="X-XSS-Protection" value="1;mode=block" /> <add name="X-XSS-Protection" value="1;mode=block"/>
<add name="X-Frame-Options" value="SAMEORIGIN" /> <add name="X-Frame-Options" value="SAMEORIGIN"/>
<add name="X-Content-Type-Options" value="nosniff" /> <add name="X-Content-Type-Options" value="nosniff"/>
<add name="Strict-Transport-Security" value="max-age=31536000" /> <add name="Strict-Transport-Security" value="max-age=31536000"/>
</customHeaders> </customHeaders>
</httpProtocol> </httpProtocol>
<validation validateIntegratedModeConfiguration="false" /> <validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"> <modules runAllManagedModulesForAllRequests="true">
<add name="FineUIProScriptModule" type="FineUIPro.ScriptModule, FineUIPro" /> <add name="FineUIProScriptModule" type="FineUIPro.ScriptModule, FineUIPro"/>
<remove name="ScriptModule" /> <remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules> </modules>
<handlers> <handlers>
<remove name="ChartImageHandler" /> <remove name="ChartImageHandler"/>
<add name="FineUIProResourceHandler" verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro" /> <add name="FineUIProResourceHandler" verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers> </handlers>
<defaultDocument> <defaultDocument>
<files> <files>
<add value="Login.aspx" /> <add value="Login.aspx"/>
</files> </files>
</defaultDocument> </defaultDocument>
<httpErrors> <httpErrors>
<remove statusCode="403" subStatusCode="-1" /> <remove statusCode="403" subStatusCode="-1"/>
<error statusCode="403" prefixLanguageFilePath="https://localhost/FCL/" path="OperationError.aspx" responseMode="File" /> <error statusCode="403" prefixLanguageFilePath="https://localhost/FCL/" path="OperationError.aspx" responseMode="File"/>
</httpErrors> </httpErrors>
<security> <security>
<requestFiltering> <requestFiltering>
<requestLimits maxAllowedContentLength="500000000" /> <requestLimits maxAllowedContentLength="500000000"/>
</requestFiltering> </requestFiltering>
</security> </security>
</system.webServer> </system.webServer>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> <bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <assemblyIdentity name="Microsoft.IdentityModel.Logging" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-7.6.0.0" newVersion="7.6.0.0" /> <bindingRedirect oldVersion="0.0.0.0-7.6.0.0" newVersion="7.6.0.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" /> <bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>

View File

@ -17,7 +17,7 @@ namespace FineUIPro.Web
{ {
this.code = Request.Params["code"]; this.code = Request.Params["code"];
BLL.ErrLogInfo.WriteLog($"获取code={this.code}"); //BLL.ErrLogInfo.WriteLog($"获取code={this.code}");
if (string.IsNullOrEmpty(this.code)) if (string.IsNullOrEmpty(this.code))
{ {
Response.Redirect("~/login.aspx"); Response.Redirect("~/login.aspx");
@ -36,23 +36,22 @@ namespace FineUIPro.Web
private AccessTokenModel GetAccessToken(string _code) private AccessTokenModel GetAccessToken(string _code)
{ {
string clientId = System.Web.Configuration.WebConfigurationManager.AppSettings["clientId"]; string clientId = Funs.ClientId;
string clientSecret = System.Web.Configuration.WebConfigurationManager.AppSettings["clientSecret"]; string clientSecret = Funs.ClientSecret;
string redirect_url = Funs.Redirect_url;
string grant_type = "authorization_code"; string grant_type = "authorization_code";
string redirect_url = System.Web.Configuration.WebConfigurationManager.AppSettings["redirect_url"];
string scope = "profile openid"; string scope = "profile openid";
string baseUrl = $"https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/token"; string baseUrl = $"https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/token";
try try
{ {
string postData = $"code={code}&client_id={clientId}&client_secret={clientSecret}&grant_type={grant_type}&redirect_uri={redirect_url}&scope={scope}"; string postData = $"code={code}&client_id={clientId}&client_secret={clientSecret}&grant_type={grant_type}&redirect_uri={redirect_url}&scope={scope}";
BLL.ErrLogInfo.WriteLog($"请求参数postData={postData}"); //BLL.ErrLogInfo.WriteLog($"请求参数postData={postData}");
string result = BLL.Common.HttpHelper.HttpPost(baseUrl, postData); string result = BLL.Common.HttpHelper.HttpPost(baseUrl, postData);
BLL.ErrLogInfo.WriteLog($"请求API Result={result}"); //BLL.ErrLogInfo.WriteLog($"请求API Result={result}");
var Data = JsonConvert.DeserializeObject<AccessTokenModel>(result); var Data = JsonConvert.DeserializeObject<AccessTokenModel>(result);
return Data; return Data;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -71,7 +70,7 @@ namespace FineUIPro.Web
string[] toke_split= token.id_token.Split('.'); string[] toke_split= token.id_token.Split('.');
var header = Encoding.UTF8.GetString(Base64UrlEncoder.DecodeBytes(toke_split[0])); var header = Encoding.UTF8.GetString(Base64UrlEncoder.DecodeBytes(toke_split[0]));
var clamis= Encoding.UTF8.GetString(Base64UrlEncoder.DecodeBytes(toke_split[1])); var clamis= Encoding.UTF8.GetString(Base64UrlEncoder.DecodeBytes(toke_split[1]));
BLL.ErrLogInfo.WriteLog("clamis=" + clamis); //BLL.ErrLogInfo.WriteLog("clamis=" + clamis);
JObject jo = JObject.Parse(clamis); JObject jo = JObject.Parse(clamis);
if (jo["cn"] != null) if (jo["cn"] != null)
{ {

View File

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>