Compare commits

..

1 Commits

Author SHA1 Message Date
shecs 39915654b8 1212 2024-06-07 15:13:19 +08:00
18 changed files with 7871 additions and 80 deletions
@@ -1,48 +0,0 @@
ALTER TABLE dbo.EMC_Punishment ADD IsEvaluated BIT NULL
GO
ALTER TABLE dbo.SyncDataUserLogs ADD Josn NVARCHAR(MAX)
GO
ALTER VIEW [dbo].[FC_SESReportView]
AS
SELECT
a.SES_No,
a.FO AS FO_NO,
a.Short_Descrption,
CONVERT(VARCHAR(50),a.Start_Date,23) AS Start_Date,
CONVERT(VARCHAR(50),a.End_Date,23) AS End_Date,
CONVERT(VARCHAR(50),a.TECO_Date,23) AS TECO_Date,
CONVERT(VARCHAR(50),a.SES_CONF_Format,23) AS SES_CONF_Format,
CONVERT(VARCHAR(50),a.Claim_sheets_receive,23) AS Claim_sheets_receive,
(CASE WHEN a.Claim_sheets_receive IS NULL THEN a.TECO_Date ELSE a.Claim_sheets_receive END) AS Claim_TECO_Date,
YEAR(CASE WHEN a.Claim_sheets_receive IS NULL THEN a.TECO_Date ELSE a.Claim_sheets_receive END) AS dateYear,
MONTH(CASE WHEN a.Claim_sheets_receive IS NULL THEN a.TECO_Date ELSE a.Claim_sheets_receive END) AS dateMonth,
a.Requisitioner,
u1.Account AS MainCoordinatorUser,
u2.Account AS UserRepresentativeUser,
u3.Account AS ContractAdminUser,
b.DisciplineId,
dis.Discipline AS Discipline_Eng,
dis.DisciplineCN AS Discipline_CN,
(CASE WHEN dis.Discipline IS NULL THEN dis.DisciplineCN
WHEN dis.DisciplineCN IS NULL THEN dis.Discipline
ELSE dis.Discipline+dis.DisciplineCN END) AS Discipline,
(SELECT TOP 1 p.ViolationDegree FROM dbo.EMC_Punishment p
WHERE p.FO_NO=a.FO AND p.ViolationRelatedSes=a.SES_No AND p.Flag='1' AND IsEvaluated IS NULL) AS ViolationDegree
FROM FC_SESReport AS a
LEFT JOIN FC_SESRelatedData AS b ON a.FO=b.FO_NO
LEFT JOIN Base_Discipline AS dis ON dis.DisciplineId = b.DisciplineId
LEFT JOIN Sys_User AS u1 ON u1.UserId=b.Main_Coordinator
LEFT JOIN Sys_User AS u2 ON u2.UserId=b.User_Representative
LEFT JOIN Sys_User AS u3 ON u3.UserId=b.Contract_Admin
WHERE YEAR(CASE WHEN a.Claim_sheets_receive IS NULL THEN a.TECO_Date ELSE a.Claim_sheets_receive END)=(CASE MONTH(GETDATE()) WHEN 1 THEN YEAR(GETDATE())-1 ELSE YEAR(GETDATE()) END)
AND MONTH(CASE WHEN a.Claim_sheets_receive IS NULL THEN a.TECO_Date ELSE a.Claim_sheets_receive END)=(CASE MONTH(GETDATE()) WHEN 1 THEN 12 ELSE MONTH(GETDATE())-1 END)
--and a.SES_No not in (select SES_No from Score_JournalEvaluation)
AND (a.Claim_sheets_receive IS NOT NULL OR a.TECO_Date IS NOT NULL)
GO
+1 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BLL</RootNamespace> <RootNamespace>BLL</RootNamespace>
<AssemblyName>BLL</AssemblyName> <AssemblyName>BLL</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName> <SccProjectName>
</SccProjectName> </SccProjectName>
+53
View File
@@ -56,6 +56,59 @@ namespace BLL.Common
return strPostReponse; return strPostReponse;
} }
public static string HttpPost(string Url, string jsonParas)
{
string strURL = Url;
//创建一个HTTP请求
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL);
//Post请求方式
request.Method = "POST";
//内容类型
request.ContentType = "application/x-www-form-urlencoded";
//设置参数,并进行URL编码
string paraUrlCoded = jsonParas;//System.Web.HttpUtility.UrlEncode(jsonParas);
byte[] payload;
//将Json字符串转化为字节
payload = System.Text.Encoding.UTF8.GetBytes(paraUrlCoded);
//设置请求的ContentLength
request.ContentLength = payload.Length;
//发送请求,获得请求流
Stream writer;
try
{
writer = request.GetRequestStream();//获取用于写入请求数据的Stream对象
}
catch (Exception)
{
writer = null;
BLL.ErrLogInfo.WriteLog("连接服务器失败!");
}
//将请求参数写入流
writer.Write(payload, 0, payload.Length);
writer.Close();//关闭请求流
// String strValue = "";//strValue为http响应所返回的字符流
HttpWebResponse response;
try
{
//获得响应流
response = (HttpWebResponse)request.GetResponse();
}
catch (WebException ex)
{
response = ex.Response as HttpWebResponse;
}
Stream s = response.GetResponseStream();
// Stream postData = Request.InputStream;
StreamReader sRead = new StreamReader(s);
string postContent = sRead.ReadToEnd();
sRead.Close();
return postContent;//返回Json数据
}
private static HttpWebRequest CreateHttpRequest(string url, string requestType, string token, params object[] strJson) private static HttpWebRequest CreateHttpRequest(string url, string requestType, string token, params object[] strJson)
{ {
HttpWebRequest request = null; HttpWebRequest request = null;
+1 -1
View File
@@ -8,4 +8,4 @@
</dependentAssembly> </dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
@@ -73,7 +73,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">
@@ -211,8 +213,43 @@
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);
grid1.updateCellValue(rowId, columnId, value); 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("最大只能评" + 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("最大只能评" + maxScore2 + "星");
var html = F.rateHtml(0, {
allowClear: true,
allowHalf: true,
textVisible: false
});
grid1.getCellEl(rowId, columnId).html(html)
}
else {
//更新单元格的值
grid1.updateCellValue(rowId, columnId, value);
}
}); });
}); });
@@ -3,6 +3,7 @@ using BLL.Common;
using FineUIPro.Web.common.SysManage; 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;
@@ -12,6 +13,7 @@ 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
{ {
@@ -252,6 +254,7 @@ namespace FineUIPro.Web.Evaluation
HiddenField hidMaxScore1 = Grid1.Rows[i].FindControl("hidMaxScore1") as HiddenField; HiddenField hidMaxScore1 = Grid1.Rows[i].FindControl("hidMaxScore1") as HiddenField;
HiddenField hidMaxScore2 = Grid1.Rows[i].FindControl("hidMaxScore2") 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();
@@ -267,6 +270,62 @@ namespace FineUIPro.Web.Evaluation
} }
} }
// 违章扣分
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).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")
{ {
@@ -203,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>
+1 -12
View File
@@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FineUIPro.Web</RootNamespace> <RootNamespace>FineUIPro.Web</RootNamespace>
<AssemblyName>FineUIPro.Web</AssemblyName> <AssemblyName>FineUIPro.Web</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<SccProjectName> <SccProjectName>
</SccProjectName> </SccProjectName>
@@ -52,9 +52,6 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="AxInterop.SYNCARDOCXLib">
<HintPath>..\Lib\AxInterop.SYNCARDOCXLib.dll</HintPath>
</Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL"> <Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
@@ -67,9 +64,6 @@
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.JScript" /> <Reference Include="Microsoft.JScript" />
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL"> <Reference Include="Microsoft.ReportViewer.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1484.0\lib\net40\Microsoft.ReportViewer.Common.dll</HintPath> <HintPath>..\packages\Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1484.0\lib\net40\Microsoft.ReportViewer.Common.dll</HintPath>
</Reference> </Reference>
@@ -133,10 +127,6 @@
<Reference Include="System.Web.Services" /> <Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" /> <Reference Include="System.EnterpriseServices" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="ThoughtWorks.QRCode, Version=1.0.2774.19990, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\ThoughtWorks.QRCode.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="AttachFile\res\webuploader\Uploader.swf" /> <Content Include="AttachFile\res\webuploader\Uploader.swf" />
@@ -2560,7 +2550,6 @@
<Content Include="Doc\FC操作手册.docx" /> <Content Include="Doc\FC操作手册.docx" />
<Content Include="File\Excel\SES Report.xlsx" /> <Content Include="File\Excel\SES Report.xlsx" />
<Content Include="File\Excel\SES ReportToCPT.xlsx" /> <Content Include="File\Excel\SES ReportToCPT.xlsx" />
<Content Include="File\Excel\EvaluationReport.xls" />
<Content Include="File\Excel\CPTReport.xlsx" /> <Content Include="File\Excel\CPTReport.xlsx" />
<Content Include="File\Excel\承包商评估表.xlsx" /> <Content Include="File\Excel\承包商评估表.xlsx" />
<None Include="packages.config" /> <None Include="packages.config" />
@@ -11,6 +11,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<NameOfLastUsedPublishProfile>E:\MyProject\FCL\Basf_FCL\FCL\FineUIPro.Web\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
+1 -1
View File
@@ -224,8 +224,8 @@
} }
}) })
$("#faskloginUrl").click(function () { $("#faskloginUrl").click(function () {
let url = "https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize";
let clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; let clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8";
let url = "https://login.microsoftonline.com/" + clientId + "/oauth2/v2.0/authorize";
let response_type = "code"; let response_type = "code";
let redirect_url = encodeURIComponent("http://localhost:6166/ssocallback.aspx"); let redirect_url = encodeURIComponent("http://localhost:6166/ssocallback.aspx");
let scope = "openid profile"; let scope = "openid profile";
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>E:\MyProject\FCL\publish</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
<SiteUrlToLaunchAfterPublish />
</PropertyGroup>
</Project>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -51,7 +51,7 @@
<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="false" targetFramework="4.8"> <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>
+8 -6
View File
@@ -16,6 +16,7 @@ namespace FineUIPro.Web
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
this.code = Request.Params["code"]; this.code = Request.Params["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");
@@ -37,16 +38,16 @@ namespace FineUIPro.Web
string clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; string clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8";
string clientSecret = "iLu8Q~4DRYAn~sMjvO1j.tgRERFWhILvLYRPNc9S"; string clientSecret = "iLu8Q~4DRYAn~sMjvO1j.tgRERFWhILvLYRPNc9S";
string grant_type = "authorization_code"; string grant_type = "authorization_code";
string redirect_url = "http://localhost:6166/ssocallback.aspx"; string redirect_url = "https://fcl-test.basf-ypc.net.cn/ssocallback.aspx";
string scope = "profile openid"; string scope = "profile openid";
string baseUrl = $" https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01740cbdb5ba55/oauth2/v2.0/token"; string baseUrl = $"https://login.microsoftonline.com/{clientId}/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}");
string result = BLL.Common.HttpHelper.HttpPostRequest(baseUrl, postData, string.Empty); string result = BLL.Common.HttpHelper.HttpPost(baseUrl, postData);
BLL.ErrLogInfo.WriteLog($"请求API Result={result}");
var Data = JsonConvert.DeserializeObject<AccessTokenModel>(result); var Data = JsonConvert.DeserializeObject<AccessTokenModel>(result);
return Data; return Data;
@@ -67,11 +68,12 @@ namespace FineUIPro.Web
try try
{ {
var result = HttpHelper.HttpGetRequest(baseUrl, token.access_token); var result = HttpHelper.HttpGetRequest(baseUrl, token.access_token);
BLL.ErrLogInfo.WriteLog($"获取用户信息:{result}");
if (result.IndexOf("sub") > -1) if (result.IndexOf("sub") > -1)
{ {
var info = JsonConvert.DeserializeObject<UserTokenModel>(result); var info = JsonConvert.DeserializeObject<UserTokenModel>(result);
//写入session信息 //写入session信息
//写入cookie信息 //写入cookie信息
return info; return info;
-4
View File
@@ -29,10 +29,6 @@ namespace Model
#region 可扩展性方法定义 #region 可扩展性方法定义
partial void OnCreated(); partial void OnCreated();
partial void OnCreated()
{
this.CommandTimeout = 600;
}
partial void InsertAttachFile(AttachFile instance); partial void InsertAttachFile(AttachFile instance);
partial void UpdateAttachFile(AttachFile instance); partial void UpdateAttachFile(AttachFile instance);
partial void DeleteAttachFile(AttachFile instance); partial void DeleteAttachFile(AttachFile instance);
+1 -1
View File
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Model</RootNamespace> <RootNamespace>Model</RootNamespace>
<AssemblyName>Model</AssemblyName> <AssemblyName>Model</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName> <SccProjectName>
</SccProjectName> </SccProjectName>
+1 -1
View File
@@ -27,7 +27,7 @@
</system.Web> </system.Web>
--> -->
<system.web> <system.web>
<compilation debug="true" targetFramework="4.8"/> <compilation debug="false" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/> <httpRuntime targetFramework="4.6.1"/>
</system.web> </system.web>
<system.webServer> <system.webServer>
+2 -2
View File
@@ -14,7 +14,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebApi</RootNamespace> <RootNamespace>WebApi</RootNamespace>
<AssemblyName>WebApi</AssemblyName> <AssemblyName>WebApi</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews> <MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress /> <Use64BitIISExpress />
@@ -58,9 +58,9 @@
<Reference Include="System.Web.Entity" /> <Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" /> <Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" /> <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" /> <Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Routing" /> <Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />