diff --git a/FCL/BLL/Common/HttpHelper.cs b/FCL/BLL/Common/HttpHelper.cs index a5c2e97..3d1d014 100644 --- a/FCL/BLL/Common/HttpHelper.cs +++ b/FCL/BLL/Common/HttpHelper.cs @@ -116,7 +116,7 @@ namespace BLL.Common const string post = "POST"; if (string.Equals(requestType, get, StringComparison.OrdinalIgnoreCase)) { - request = CreateGetHttpWebRequest(url); + request = CreateGetHttpWebRequest(url,token); } if (string.Equals(requestType, post, StringComparison.OrdinalIgnoreCase)) { @@ -125,12 +125,22 @@ namespace BLL.Common return request; } - private static HttpWebRequest CreateGetHttpWebRequest(string url) + private static HttpWebRequest CreateGetHttpWebRequest(string url,string token) { + var getRequest = HttpWebRequest.Create(url) as HttpWebRequest; + if (!string.IsNullOrEmpty(token)) + { + getRequest.ContentType = "application/json"; + getRequest.Headers.Add("token", token); + } + else + { + getRequest.ContentType = "text/html;charset=UTF-8"; + } getRequest.Method = "GET"; getRequest.Timeout = 5000; - getRequest.ContentType = "text/html;charset=UTF-8"; + getRequest.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; return getRequest; } diff --git a/FCL/FineUIPro.Web/FineUIPro.Web.csproj b/FCL/FineUIPro.Web/FineUIPro.Web.csproj index db8bcfe..ebfc00e 100644 --- a/FCL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/FCL/FineUIPro.Web/FineUIPro.Web.csproj @@ -62,7 +62,22 @@ ..\packages\SharpZipLib.1.3.2\lib\net45\ICSharpCode.SharpZipLib.dll + + ..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.IdentityModel.Abstractions.7.6.0\lib\net461\Microsoft.IdentityModel.Abstractions.dll + + + ..\packages\Microsoft.IdentityModel.JsonWebTokens.7.6.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll + + + ..\packages\Microsoft.IdentityModel.Logging.7.6.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + + ..\packages\Microsoft.IdentityModel.Tokens.7.6.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + ..\packages\Microsoft.ReportingServices.ReportViewerControl.WebForms.150.1484.0\lib\net40\Microsoft.ReportViewer.Common.dll @@ -103,14 +118,43 @@ ..\packages\NPOI.2.5.5\lib\net45\NPOI.OpenXmlFormats.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.IdentityModel.Tokens.Jwt.7.6.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Text.Encodings.Web.4.7.2\lib\net461\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll + diff --git a/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user b/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user index c498d8f..c048173 100644 --- a/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/FCL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -2,7 +2,7 @@ ProjectFiles - Release|Any CPU + Debug|Any CPU true diff --git a/FCL/FineUIPro.Web/Login.aspx b/FCL/FineUIPro.Web/Login.aspx index ec50e3a..724d7fc 100644 --- a/FCL/FineUIPro.Web/Login.aspx +++ b/FCL/FineUIPro.Web/Login.aspx @@ -225,9 +225,9 @@ }) $("#faskloginUrl").click(function () { let clientId = "9379ad91-eef9-4956-a1ee-8b04bb3d42c8"; - let url = "https://login.microsoftonline.com/" + clientId + "/oauth2/v2.0/authorize"; + let url = "https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize"; let response_type = "code"; - let redirect_url = encodeURIComponent("http://localhost:6166/ssocallback.aspx"); + let redirect_url = encodeURIComponent("https://fcl-test.basf-ypc.net.cn/ssocallback.aspx"); let scope = "openid profile"; let response_mode = "query"; let state = "state123"; diff --git a/FCL/FineUIPro.Web/packages.config b/FCL/FineUIPro.Web/packages.config index 397ea48..bc90019 100644 --- a/FCL/FineUIPro.Web/packages.config +++ b/FCL/FineUIPro.Web/packages.config @@ -1,9 +1,23 @@  + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FCL/FineUIPro.Web/ssocallback.aspx.cs b/FCL/FineUIPro.Web/ssocallback.aspx.cs index f8aa4cf..a7c3270 100644 --- a/FCL/FineUIPro.Web/ssocallback.aspx.cs +++ b/FCL/FineUIPro.Web/ssocallback.aspx.cs @@ -3,6 +3,7 @@ using BLL.Common; using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; using System.Linq; using System.Web; using System.Web.UI; @@ -22,14 +23,14 @@ namespace FineUIPro.Web Response.Redirect("~/login.aspx"); return; } - var token= GetAccessToken(this.code); + var token = GetAccessToken(this.code); var userInfo = getUserInfo(token); if (userInfo == null) { Response.Redirect("~/login.aspx"); return; } - + Response.Redirect("~/index.aspx"); } @@ -40,7 +41,7 @@ namespace FineUIPro.Web string grant_type = "authorization_code"; string redirect_url = "https://fcl-test.basf-ypc.net.cn/ssocallback.aspx"; string scope = "profile openid"; - string baseUrl = $"https://login.microsoftonline.com/{clientId}/oauth2/v2.0/token"; + string baseUrl = $"https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/token"; try { @@ -62,23 +63,35 @@ namespace FineUIPro.Web } - private UserTokenModel getUserInfo(AccessTokenModel token) + private Model.Sys_User getUserInfo(AccessTokenModel token) { - string baseUrl = "https://graph.microsoft.com/oidc/userinfo"; + try { - var result = HttpHelper.HttpGetRequest(baseUrl, token.access_token); - BLL.ErrLogInfo.WriteLog($"获取用户信息:{result}"); - if (result.IndexOf("sub") > -1) + var handler = new JwtSecurityTokenHandler(); + var jwtToken = handler.ReadJwtToken(token.id_token); + string username = string.Empty; + var result = jwtToken.Claims.Where(t => t.Type == "cn").FirstOrDefault(); + if (result != null) { - var info = JsonConvert.DeserializeObject(result); - //写入session信息 - - //写入cookie信息 - - return info; + BLL.ErrLogInfo.WriteLog("cn="+result?.Value); + username = result?.Value; } - + else{ + username = jwtToken.Claims.Where(t => t.Type == "preferred_username").FirstOrDefault()?.Value; + BLL.ErrLogInfo.WriteLog("username=" + username); + if (!string.IsNullOrEmpty(username)) + { + username = username.Split('@')[0]; + } + } + var info = Funs.DB.Sys_User.Where(t => t.Account == username && t.IsPost == true).FirstOrDefault(); + if (info != null) + { + Session[SessionName.CurrUser] = info; + } + + return info; } catch (Exception ex) { @@ -90,18 +103,4 @@ namespace FineUIPro.Web } - public class UserTokenModel - { - public string sub { get; set; } - - public string name { get; set; } - - public string family_name { get; set; } - - public string given_name { get; set; } - - public string picture { get; set; } - public string email { get; set; } - - } } \ No newline at end of file diff --git a/FCL/WebApi/WebApi.csproj.user b/FCL/WebApi/WebApi.csproj.user index 643f3e5..ca0d73e 100644 --- a/FCL/WebApi/WebApi.csproj.user +++ b/FCL/WebApi/WebApi.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU diff --git a/FCLPackFile_2024.05.24/PackFile/BaseInfo/FileType.aspx b/FCLPackFile_2024.05.24/PackFile/BaseInfo/FileType.aspx deleted file mode 100644 index a47cf9e..0000000 --- a/FCLPackFile_2024.05.24/PackFile/BaseInfo/FileType.aspx +++ /dev/null @@ -1,98 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileType.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.FileType" %> - - - - - - - 文件类型 - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluation.aspx b/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluation.aspx deleted file mode 100644 index 8a064c5..0000000 --- a/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluation.aspx +++ /dev/null @@ -1,120 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorEvaluation.aspx.cs" Inherits="FineUIPro.Web.Evaluation.ContractorEvaluation" %> - - - - - - Frame Contractor Evaluation Form - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluationEdit.aspx b/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluationEdit.aspx deleted file mode 100644 index b1dcf29..0000000 --- a/FCLPackFile_2024.05.24/PackFile/Evaluation/ContractorEvaluationEdit.aspx +++ /dev/null @@ -1,305 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorEvaluationEdit.aspx.cs" Inherits="FineUIPro.Web.Evaluation.ContractorEvaluationEdit" %> - - - - - 项目经理编辑器 - - <%----%> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - - - - - - - - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/File/Excel/Contractor_Qualification.xlsx b/FCLPackFile_2024.05.24/PackFile/File/Excel/Contractor_Qualification.xlsx deleted file mode 100644 index d83e26e..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/File/Excel/Contractor_Qualification.xlsx and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_CN.xlsx b/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_CN.xlsx deleted file mode 100644 index aa70386..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_CN.xlsx and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_EN.xlsx b/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_EN.xlsx deleted file mode 100644 index eafe9d6..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/File/Excel/Performance Report_EN.xlsx and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/File/Excel/Punishment.xlsx b/FCLPackFile_2024.05.24/PackFile/File/Excel/Punishment.xlsx deleted file mode 100644 index 9405ffd..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/File/Excel/Punishment.xlsx and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/File/Excel/承包商评估表.xlsx b/FCLPackFile_2024.05.24/PackFile/File/Excel/承包商评估表.xlsx deleted file mode 100644 index 6d5e382..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/File/Excel/承包商评估表.xlsx and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/SES/CSafePunish.aspx b/FCLPackFile_2024.05.24/PackFile/SES/CSafePunish.aspx deleted file mode 100644 index e3c0cf2..0000000 --- a/FCLPackFile_2024.05.24/PackFile/SES/CSafePunish.aspx +++ /dev/null @@ -1,181 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CSafePunish.aspx.cs" Inherits="FineUIPro.Web.SES.CSafePunish" %> - - - - - - - - Contractor Safety Punishment - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/SES/CSafePunishEdit.aspx b/FCLPackFile_2024.05.24/PackFile/SES/CSafePunishEdit.aspx deleted file mode 100644 index 1d69937..0000000 --- a/FCLPackFile_2024.05.24/PackFile/SES/CSafePunishEdit.aspx +++ /dev/null @@ -1,144 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CSafePunishEdit.aspx.cs" Inherits="FineUIPro.Web.SES.CSafePunishEdit" %> - - - - - - - Contractor Safety Punishment Edit - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualification.aspx b/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualification.aspx deleted file mode 100644 index 493cb5b..0000000 --- a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualification.aspx +++ /dev/null @@ -1,888 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorQualification.aspx.cs" Inherits="FineUIPro.Web.SES.ContractorQualification" %> - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualificationEdit.aspx b/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualificationEdit.aspx deleted file mode 100644 index 35195ba..0000000 --- a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQualificationEdit.aspx +++ /dev/null @@ -1,76 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorQualificationEdit.aspx.cs" Inherits="FineUIPro.Web.SES.ContractorQualificationEdit" %> - - - - - - - Signed Contracts - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQueCopy.aspx b/FCLPackFile_2024.05.24/PackFile/SES/ContractorQueCopy.aspx deleted file mode 100644 index 2074a30..0000000 --- a/FCLPackFile_2024.05.24/PackFile/SES/ContractorQueCopy.aspx +++ /dev/null @@ -1,36 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContractorQueCopy.aspx.cs" Inherits="FineUIPro.Web.SES.ContractorQueCopy" %> - - - - - - RT委托替换 - - - -
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FCLPackFile_2024.05.24/PackFile/bin/App_GlobalResources.compiled b/FCLPackFile_2024.05.24/PackFile/bin/App_GlobalResources.compiled deleted file mode 100644 index bb5af6b..0000000 --- a/FCLPackFile_2024.05.24/PackFile/bin/App_GlobalResources.compiled +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/FCLPackFile_2024.05.24/PackFile/bin/App_global.asax.compiled b/FCLPackFile_2024.05.24/PackFile/bin/App_global.asax.compiled deleted file mode 100644 index 7759987..0000000 --- a/FCLPackFile_2024.05.24/PackFile/bin/App_global.asax.compiled +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/FCLPackFile_2024.05.24/PackFile/bin/BLL.dll b/FCLPackFile_2024.05.24/PackFile/bin/BLL.dll deleted file mode 100644 index 2ab4c1f..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/bin/BLL.dll and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/bin/FineUIPro.Web.dll b/FCLPackFile_2024.05.24/PackFile/bin/FineUIPro.Web.dll deleted file mode 100644 index b6b8a57..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/bin/FineUIPro.Web.dll and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/bin/Model.dll b/FCLPackFile_2024.05.24/PackFile/bin/Model.dll deleted file mode 100644 index 9ec851c..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/bin/Model.dll and /dev/null differ diff --git a/FCLPackFile_2024.05.24/PackFile/bin/UI.dll b/FCLPackFile_2024.05.24/PackFile/bin/UI.dll deleted file mode 100644 index d3b8323..0000000 Binary files a/FCLPackFile_2024.05.24/PackFile/bin/UI.dll and /dev/null differ diff --git a/FCLPackFile_2024.05.24/版本日志/FCLDB_2024.05.16.sql b/FCLPackFile_2024.05.24/版本日志/FCLDB_2024.05.16.sql deleted file mode 100644 index ef49a2d..0000000 --- a/FCLPackFile_2024.05.24/版本日志/FCLDB_2024.05.16.sql +++ /dev/null @@ -1,44 +0,0 @@ -ALTER TABLE dbo.FC_SESRelatedData ADD OtherDef NVARCHAR(300) NULL -GO -ALTER TABLE dbo.Base_FileType ADD IsExport BIT NULL -GO -UPDATE dbo.Base_FileType SET IsExport=0 -GO - -ALTER VIEW [dbo].[View_FC_ContractManagement] -AS -SELECT cm.OccurDate,fc.FO_NO,dis.Discipline AS DisciplineEn,dis.DisciplineCN,con.Contractor AS ContractorEn,con.ContractorCN, - (CASE WHEN con.Contractor IS NULL THEN con.ContractorCN WHEN con.ContractorCN IS NULL THEN con.Contractor ELSE con.Contractor+con.ContractorCN END)AS Contractor, - (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, - cm.Remark,ftype.FileType,u.UserName AS Contract_Admin, u2.UserName AS Main_Coordinator,mcdep.DepartName AS MCDept, - u3.UserName AS User_Representative, bycDep.DepartCode AS BycDept,ftype.IsExport -FROM dbo.FC_ContractManagement cm -LEFT JOIN dbo.FC_SESRelatedData fc ON fc.ID = cm.FC_ID -LEFT JOIN dbo.Base_Discipline AS dis ON dis.DisciplineId = fc.DisciplineId -LEFT JOIN dbo.Base_Contractor AS con ON con.ContractorId = fc.Contractor -LEFT JOIN dbo.Base_FileType ftype ON ftype.FileTypeId = cm.FileTypeId -LEFT JOIN dbo.Sys_User AS u ON u.UserId = fc.Contract_Admin -LEFT JOIN dbo.Sys_User AS u2 ON u2.UserId = fc.Main_Coordinator -LEFT JOIN dbo.Sys_User AS u3 ON u3.UserId=fc.User_Representative -LEFT JOIN dbo.Base_Depart mcdep ON mcdep.DepartId = u2.DepartId -LEFT JOIN dbo.Base_Depart bycDep ON bycDep.DepartId=cm.BycDept - - -GO - -CREATE VIEW [dbo].[View_EMC_Contractor_Qualification] -AS -SELECT cm.FoId,fc.FO_NO,cm.QueName,cm.QueDef,cm.QueType,cm.LimitStartDate,cm.LimitEndDate,cm.Remark, - (CASE WHEN con.Contractor IS NULL THEN con.ContractorCN WHEN con.ContractorCN IS NULL THEN con.Contractor ELSE con.Contractor+con.ContractorCN END)AS Contractor, - (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, - u.UserName AS Contract_Admin, u2.UserName AS Main_Coordinator,fc.Expire_Date,fc.Contractor AS ContractorId ,fc.FC_Status -FROM dbo.EMC_Contractor_Qualification cm -LEFT JOIN dbo.FC_SESRelatedData fc ON fc.ID = cm.FoId -LEFT JOIN dbo.Base_Discipline AS dis ON dis.DisciplineId = fc.DisciplineId -LEFT JOIN dbo.Base_Contractor AS con ON con.ContractorId = fc.Contractor -LEFT JOIN dbo.Sys_User AS u ON u.UserId = fc.Contract_Admin -LEFT JOIN dbo.Sys_User AS u2 ON u2.UserId = fc.Main_Coordinator - -GO - -