This commit is contained in:
佘春生 2024-06-07 15:13:19 +08:00
parent 6bbff852fb
commit 39915654b8
17 changed files with 7786 additions and 47 deletions

View File

@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BLL</RootNamespace>
<AssemblyName>BLL</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>

View File

@ -56,6 +56,59 @@ namespace BLL.Common
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)
{
HttpWebRequest request = null;

View File

@ -8,4 +8,4 @@
</dependentAssembly>
</assemblyBinding>
</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>

View File

@ -75,7 +75,7 @@
<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>
</f:TemplateField>
<f:TemplateField HeaderText="承包商<br/>Contractor" HeaderTextAlign="Center" Width="200px">
@ -216,12 +216,14 @@
console.log(rowId);
var columnId = grid1.getColumnId(cellEl);
var columnName = grid1.getColumn(columnId).columnId;
console.log();
//获取控件值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 + "星");

View File

@ -3,6 +3,7 @@ using BLL.Common;
using FineUIPro.Web.common.SysManage;
using Model;
using Newtonsoft.Json;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@ -12,6 +13,7 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using static NPOI.POIFS.Crypt.CryptoFunctions;
namespace FineUIPro.Web.Evaluation
{
@ -252,6 +254,7 @@ namespace FineUIPro.Web.Evaluation
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 isEvaluateType = Grid1.Rows[i].DataKeys[1].ToString();
@ -270,50 +273,55 @@ namespace FineUIPro.Web.Evaluation
// 违章扣分
if (userType == "1")
{
var sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && p.Requisitioner == CurrUser.Account).ToList();
var max = sesList.Select(x => x.ViolationDegree).Max();
switch (max)
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":
hidMaxScore2.Text = "4.5";
hidMaxScore1.Text = "4.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在一般违章,";
break;
case "2":
hidMaxScore2.Text = "4";
hidMaxScore1.Text = "4";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在严重违章,";
break;
case "3":
hidMaxScore2.Text = "3.5";
hidMaxScore1.Text = "3.5";
hidMsg.Text = $"当前合同号:{foNo}下,SES:{sesList?.SES_No}存在零容忍违章,";
break;
default:
hidMaxScore2.Text = "5";
hidMaxScore1.Text = "5";
hidMsg.Text = "";
break;
}
}
else
{
var sesList = new List<FC_SESReportView>();
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 = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && p.Requisitioner != "" && p.Requisitioner != null).ToList();
}
sesList = sesList.Where(p => p.FO_NO == foNo && p.Requisitioner != "" && p.Requisitioner != null).OrderByDescending(t=>t.ViolationDegree);
else
{
sesList = Funs.DB.FC_SESReportView.Where(p => p.FO_NO == foNo && (p.MainCoordinatorUser == CurrUser.Account || p.ContractAdminUser == CurrUser.Account || p.UserRepresentativeUser == CurrUser.Account)).ToList();
}
var max = sesList.Select(x => x.ViolationDegree).Max();
switch (max)
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;
}
}

View File

@ -221,6 +221,15 @@ namespace FineUIPro.Web.Evaluation
/// </remarks>
protected global::FineUIPro.HiddenField hidMaxScore2;
/// <summary>
/// hidMsg 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidMsg;
/// <summary>
/// lblContractor 控件。
/// </summary>

View File

@ -12,7 +12,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FineUIPro.Web</RootNamespace>
<AssemblyName>FineUIPro.Web</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<SccProjectName>
</SccProjectName>
@ -52,9 +52,6 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<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">
<HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
@ -67,9 +64,6 @@
</Reference>
<Reference Include="Microsoft.CSharp" />
<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">
<HintPath>..\packages\Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1484.0\lib\net40\Microsoft.ReportViewer.Common.dll</HintPath>
</Reference>
@ -133,10 +127,6 @@
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
<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>
<Content Include="AttachFile\res\webuploader\Uploader.swf" />
@ -2560,7 +2550,6 @@
<Content Include="Doc\FC操作手册.docx" />
<Content Include="File\Excel\SES Report.xlsx" />
<Content Include="File\Excel\SES ReportToCPT.xlsx" />
<Content Include="File\Excel\EvaluationReport.xls" />
<Content Include="File\Excel\CPTReport.xlsx" />
<Content Include="File\Excel\承包商评估表.xlsx" />
<None Include="packages.config" />

View File

@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress>
</Use64BitIISExpress>
@ -11,6 +11,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<NameOfLastUsedPublishProfile>E:\MyProject\FCL\Basf_FCL\FCL\FineUIPro.Web\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

View File

@ -224,8 +224,8 @@
}
})
$("#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 url = "https://login.microsoftonline.com/" + clientId + "/oauth2/v2.0/authorize";
let response_type = "code";
let redirect_url = encodeURIComponent("http://localhost:6166/ssocallback.aspx");
let scope = "openid profile";

View File

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

View File

@ -51,7 +51,7 @@
<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"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.8">
<compilation debug="false" targetFramework="4.6.1">
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
</buildProviders>

View File

@ -16,6 +16,7 @@ namespace FineUIPro.Web
protected void Page_Load(object sender, EventArgs e)
{
this.code = Request.Params["code"];
BLL.ErrLogInfo.WriteLog($"获取code={this.code}");
if (string.IsNullOrEmpty(this.code))
{
Response.Redirect("~/login.aspx");
@ -37,16 +38,16 @@ namespace FineUIPro.Web
string clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8";
string clientSecret = "iLu8Q~4DRYAn~sMjvO1j.tgRERFWhILvLYRPNc9S";
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 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
{
string postData = $"code={code}&client_id={clientId}&client_secret={clientSecret}&grant_type={grant_type}&redirect_uri={redirect_url}&scope={scope}";
string result = BLL.Common.HttpHelper.HttpPostRequest(baseUrl, postData, string.Empty);
BLL.ErrLogInfo.WriteLog($"请求参数postData={postData}");
string result = BLL.Common.HttpHelper.HttpPost(baseUrl, postData);
BLL.ErrLogInfo.WriteLog($"请求API Result={result}");
var Data = JsonConvert.DeserializeObject<AccessTokenModel>(result);
return Data;
@ -67,11 +68,12 @@ namespace FineUIPro.Web
try
{
var result = HttpHelper.HttpGetRequest(baseUrl, token.access_token);
BLL.ErrLogInfo.WriteLog($"获取用户信息:{result}");
if (result.IndexOf("sub") > -1)
{
var info = JsonConvert.DeserializeObject<UserTokenModel>(result);
//写入session信息
//写入cookie信息
return info;

View File

@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Model</RootNamespace>
<AssemblyName>Model</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>

View File

@ -27,7 +27,7 @@
</system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.8"/>
<compilation debug="false" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
</system.web>
<system.webServer>

View File

@ -14,7 +14,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebApi</RootNamespace>
<AssemblyName>WebApi</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
@ -58,9 +58,9 @@
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Routing" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />

View File

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