fix:一人一档导出
This commit is contained in:
@@ -897,5 +897,74 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public static List<Model.TestRecordItem> getTrainingTestRecordListByDepartId( string unitId, string departId, string strPass, string strParam)
|
||||
{
|
||||
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = (from x in db.Training_TestRecord
|
||||
join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId
|
||||
join z in db.Sys_User on x.TestManId equals z.UserId
|
||||
where x.ProjectId == null && x.TestStartTime.HasValue && x.TestEndTime.HasValue
|
||||
orderby x.TestStartTime descending
|
||||
select new Model.TestRecordItem
|
||||
{
|
||||
TestRecordId = x.TestRecordId,
|
||||
ProjectId = x.ProjectId,
|
||||
TestPlanId = x.TestPlanId,
|
||||
TestPlanName = y.PlanName,
|
||||
UnitId = z.UnitId,
|
||||
UnitName = getUnitName(z.UnitId),
|
||||
WorkPostId = z.WorkPostId,
|
||||
WorkPostName = db.Base_WorkPost.FirstOrDefault(p => p.WorkPostId == z.WorkPostId).WorkPostName,
|
||||
DepartId = z.DepartId,
|
||||
TestManId = x.TestManId,
|
||||
TestManName = db.SitePerson_Person.FirstOrDefault(p => p.PersonId == x.TestManId).PersonName,
|
||||
TestStartTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime),
|
||||
TestEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestEndTime),
|
||||
Duration = x.Duration,
|
||||
TestPlanEndTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.TestStartTime.Value.AddMinutes(x.Duration)),
|
||||
TotalScore = y.TotalScore ?? 0,
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
});
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.UnitId == unitId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(departId))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.DepartId == departId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(strParam))
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestManName.Contains(strParam));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(strPass))
|
||||
{
|
||||
int PassingScore = SysConstSetService.getPassScoreForApi();
|
||||
if (strPass == "0")
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestScores < PassingScore);
|
||||
}
|
||||
else
|
||||
{
|
||||
getDataLists = getDataLists.Where(x => x.TestScores >= PassingScore);
|
||||
}
|
||||
}
|
||||
foreach(var item in getDataLists)
|
||||
{
|
||||
var depart = db.Base_Depart.FirstOrDefault(x => x.DepartId == item.DepartId);
|
||||
if (depart != null)
|
||||
{
|
||||
item.DepartName = depart.DepartName;
|
||||
}
|
||||
|
||||
}
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+34
-2
@@ -67,8 +67,11 @@
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.3.11, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.3.3\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.QualityTools.Testing.Fakes.16.11.230815\lib\net35\Microsoft.QualityTools.Testing.Fakes.dll</HintPath>
|
||||
@@ -78,6 +81,7 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ManagedDTS\v4.0_16.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ManagedDTS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -97,12 +101,18 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\FineUIPro\Reference BLL\NPOI.OpenXmlFormats.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.8\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Quartz, Version=3.7.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Quartz.3.7.0\lib\netstandard2.0\Quartz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\StackExchange.Redis.2.7.33\lib\net461\StackExchange.Redis.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
@@ -119,6 +129,12 @@
|
||||
</Reference>
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.5.0.1\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
@@ -129,6 +145,9 @@
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.AccessControl, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
@@ -142,6 +161,9 @@
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Threading.Channels, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Channels.5.0.0\lib\net461\System.Threading.Channels.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
@@ -263,6 +285,9 @@
|
||||
<Compile Include="Common\NPOIHelper.cs" />
|
||||
<Compile Include="Common\PrinterDocService.cs" />
|
||||
<Compile Include="Common\ProjectDataFlowSetService.cs" />
|
||||
<Compile Include="Common\Redis\ICache.cs" />
|
||||
<Compile Include="Common\Redis\Redis.cs" />
|
||||
<Compile Include="Common\Redis\RedisHelper.cs" />
|
||||
<Compile Include="Common\UploadFileService.cs" />
|
||||
<Compile Include="Common\UpLoadImageService.cs" />
|
||||
<Compile Include="Common\UserShowColumnsService.cs" />
|
||||
@@ -1504,6 +1529,13 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\Microsoft.QualityTools.Testing.Fakes.16.11.230815\build\Microsoft.Qualitytools.Testing.Fakes.targets" Condition="Exists('..\packages\Microsoft.QualityTools.Testing.Fakes.16.11.230815\build\Microsoft.Qualitytools.Testing.Fakes.targets')" />
|
||||
<Import Project="..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
||||
@@ -8,6 +8,8 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using Aspose.Words.Drawing;
|
||||
using Shape = Aspose.Words.Drawing.Shape;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -29,6 +31,40 @@ namespace BLL
|
||||
{
|
||||
wordDoc = new Document(path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加图片
|
||||
/// </summary>
|
||||
/// <param name="filename">文件路径+文件名</param>
|
||||
/// <param name="field">文本域名</param>
|
||||
/// <param name="width">宽</param>
|
||||
/// <param name="height">高</param>
|
||||
public void AddImage(string filename, string field, double width, double height, double left, double top)
|
||||
{
|
||||
DocumentBuilder builder = new DocumentBuilder(wordDoc);
|
||||
Shape shape = new Shape(wordDoc, ShapeType.Image);
|
||||
|
||||
if (!string.IsNullOrEmpty(filename))
|
||||
{
|
||||
shape.ImageData.SetImage(filename);
|
||||
shape.Width = width;//设置宽和高
|
||||
shape.Height = height;
|
||||
shape.Left = left;
|
||||
shape.Top = top;
|
||||
shape.WrapType = WrapType.None;
|
||||
shape.BehindText = true;
|
||||
builder.MoveToMergeField(field);
|
||||
builder.InsertNode(shape);
|
||||
}
|
||||
else
|
||||
{
|
||||
//没有图片用空替换占位域值
|
||||
builder.MoveToMergeField(field);
|
||||
builder.Write("");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 书签赋值用法
|
||||
@@ -269,7 +305,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="Html">html代码</param>
|
||||
/// <param name="path">保存路径</param>
|
||||
public static void HtmlIntoWord(string Html,string path)
|
||||
public void HtmlIntoWord(string Html,string path)
|
||||
{
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -1304,5 +1304,29 @@ namespace BLL
|
||||
|
||||
return personId;
|
||||
}
|
||||
|
||||
|
||||
public static string GetPersonIdByUserIdForApi(string userId)
|
||||
{
|
||||
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
|
||||
{
|
||||
string personId = userId;
|
||||
var getPerson = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == userId);
|
||||
if (getPerson == null)
|
||||
{
|
||||
var getUser = db.Sys_User.FirstOrDefault(e => e.UserId == userId);
|
||||
if (getUser != null)
|
||||
{
|
||||
getPerson = db.SitePerson_Person.FirstOrDefault(e => e.IdentityCard == getUser.IdentityCard);
|
||||
if (getPerson != null)
|
||||
{
|
||||
personId = getPerson.PersonId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return personId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,5 +394,19 @@
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static int getPassScoreForApi()
|
||||
{
|
||||
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
|
||||
{
|
||||
int passScore = 80;
|
||||
var testRule = db.Sys_TestRule.FirstOrDefault();
|
||||
if (testRule != null)
|
||||
{
|
||||
passScore = testRule.PassingScore;
|
||||
}
|
||||
return passScore;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user