Commit 5aade965 by Neo Turing

升级优化

parent 92ad8192
...@@ -9,5 +9,9 @@ namespace Kivii.Sample.ImageUploader ...@@ -9,5 +9,9 @@ namespace Kivii.Sample.ImageUploader
internal class Configs internal class Configs
{ {
public const string TableUiSetting = "ui_settings"; public const string TableUiSetting = "ui_settings";
public const string RouteFilesUploadAndDownload = "/Storages";
public const string RouteReportRequest = "/Restful/Kivii.Lims.Entities.Report/Query";
} }
} }
using Kivii.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Sample.ImageUploader.Entities
{
internal class Report:EntityWithMetadata
{
public string ReportId { get; set; }
public string SupplierName { get; set; }
public string DemanderName { get; set; }
public string PayerName { get; set; }
#region 样品相关,和sample冗余
[ApiMember(Description = "样品Kvid")]
[IgnoreUpdate]
[Required]
public Guid SampleKvid { get; set; }
/// <summary>
/// 样品名称
/// </summary>
[ApiMember(Description = "样品名称")]
[StringLength(200), Required]
public string SampleName { get; set; }
/// <summary>
/// 样品名称
/// </summary>
[ApiMember(Description = "样品编号")]
//[SerialNumber]
[StringLength(50), Default("")]
public string SampleSerialNumber { get; set; }
/// <summary>
/// 样品批次号
/// </summary>
[ApiMember(Description = "样品批次号")]
[StringLength(200), Default("")]
public string SampleBatchNumber { get; set; }
/// <summary>
/// 样品品牌
/// </summary>
[ApiMember(Description = "样品品牌")]
[StringLength(200), Default("")]
public string SampleBrand { get; set; }
/// <summary>
/// 样品规格型号
/// </summary>
[ApiMember(Description = "样品规格型号")]
[StringLength(200), Default("")]
public string SampleModel { get; set; }
/// <summary>
/// 样品数量
/// </summary>
[ApiMember(Description = "样品数量")]
[DecimalLength(10, 2), Default(0)]
public decimal SampleQuantity { get; set; }
/// <summary>
/// 数量单位,老数据的样品数量和单位记到metadata中了
/// </summary>
[ApiMember(Description = "样品数量单位")]
[StringLength(50), Default("")]
public string SampleQuantityUnit { get; set; }
/// <summary>
/// 样品品级
/// </summary>
[ApiMember(Description = "样品品级")]
[StringLength(200), Default("")]
public string SampleGrade { get; set; }
/// <summary>
/// 安全类别
/// </summary>
[ApiMember(Description = "安全类别")]
[StringLength(200), Default("")]
public string SampleGradeSafety { get; set; }
/// <summary>
/// 功能等级
/// </summary>
[ApiMember(Description = "功能等级")]
[StringLength(200), Default("")]
public string SampleGradeFunction { get; set; }
[ApiMember(Description = "生产单位Kvid")]
[DefaultEmptyGuid]
public Guid SampleManufacturerKvid { get; set; }
[ApiMember(Description = "生产单位")]
[StringLength(100), Default("")]
public string SampleManufacturerName { get; set; }
[ApiMember(Description = "生产单位联系人Kvid")]
[DefaultEmptyGuid]
[IgnoreUpdate]
public Guid SampleManufacturerContactKvid { get; set; }
[ApiMember(Description = "生产单位联系人姓名")]
[StringLength(50), Default("")]
public string SampleManufacturerContactName { get; set; }
[ApiMember(Description = "生产单位联系人电话")]
[StringLength(50), Default("")]
//正则表达式验证:(^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})
public string SampleManufacturerContactNumber { get; set; }
[ApiMember(Description = "生产单位地址")]
[StringLength(200), Default("")]
public string SampleManufacturerAddress { get; set; }
#endregion
#region 样品来源相关,和SampleSource冗余
[DefaultEmptyGuid]
public Guid SampleSourceKvid { get; set; }
/// <summary>
/// 样品来源编号,计划编号,快递号等
/// </summary>
[ApiMember(Description = "来源编号")]
[StringLength(200), Default("")]
public string SampleSourceBatchNumber { get; set; }
#endregion
#region 报告受理,编制,审核,签发人员信息
/// <summary>
/// 受理人Kvid
/// </summary>
[DefaultEmptyGuid]
public Guid OperatorKvid { get; set; }
/// <summary>
/// 受理人姓名,不一定是Creator(从第三方系统进来的报告)
/// </summary>
[ApiMember(Description = "受理人")]
[StringLength(20), Default("")]
public string OperatorName { get; set; }
/// <summary>
/// 主检人
/// </summary>
[ApiMember(Description = "主检人")]
[StringLength(50), Default("")]
public string ManagerName { get; set; }
/// <summary>
/// 主检人Kvid
/// </summary>
[DefaultEmptyGuid]
public Guid ManagerKvid { get; set; }
/// <summary>
/// 编制人Kvid
/// </summary>
[DefaultEmptyGuid]
public Guid PreparerKvid { get; set; }
/// <summary>
/// 编制人姓名
/// </summary>
[ApiMember(Description = "编制人")]
[StringLength(50), Default("")]
public string PreparerName { get; set; }
/// <summary>
/// 审核人Kvid
/// </summary>
[DefaultEmptyGuid]
public Guid ReviewerKvid { get; set; }
/// <summary>
/// 审核人姓名
/// </summary>
[ApiMember(Description = "审核人")]
[StringLength(50), Default("")]
public string ReviewerName { get; set; }
/// <summary>
/// 签发人Kvid
/// </summary>
[DefaultEmptyGuid]
public Guid IssuerKvid { get; set; }
/// <summary>
/// 签发人姓名
/// </summary>
[ApiMember(Description = "签发人")]
[StringLength(50), Default("")]
public string IssuerName { get; set; }
#endregion
}
}
...@@ -31,6 +31,15 @@ ...@@ -31,6 +31,15 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Kivii.Common.V4.5, Version=5.6.2024.1160, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Common.5.6.2024.1160\lib\net45\Kivii.Common.V4.5.dll</HintPath> <HintPath>..\..\packages\Kivii.Common.5.6.2024.1160\lib\net45\Kivii.Common.V4.5.dll</HintPath>
...@@ -68,6 +77,7 @@ ...@@ -68,6 +77,7 @@
<DependentUpon>VideoSourcePlayer.cs</DependentUpon> <DependentUpon>VideoSourcePlayer.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Entities\Photo.cs" /> <Compile Include="Entities\Photo.cs" />
<Compile Include="Entities\Report.cs" />
<Compile Include="Entities\UiSetting.cs" /> <Compile Include="Entities\UiSetting.cs" />
<Compile Include="FrmMain.cs"> <Compile Include="FrmMain.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -77,6 +87,7 @@ ...@@ -77,6 +87,7 @@
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Requests.cs" />
<EmbeddedResource Include="FrmMain.resx"> <EmbeddedResource Include="FrmMain.resx">
<DependentUpon>FrmMain.cs</DependentUpon> <DependentUpon>FrmMain.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
...@@ -91,6 +102,7 @@ ...@@ -91,6 +102,7 @@
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 清单选项
如果想要更改 Windows 用户帐户控制级别,请使用
以下节点之一替换 requestedExecutionLevel 节点。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
如果你的应用程序需要此虚拟化来实现向后兼容性,则移除此
元素。
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
Windows 版本的列表。取消评论适当的元素,
Windows 将自动选择最兼容的环境。 -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
选择加入。选择加入此设置的 Windows 窗体应用程序(面向 .NET Framework 4.6)还应
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。
将应用程序设为感知长路径。请参阅 https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
\ No newline at end of file
using Kivii.Sample.ImageUploader.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kivii.Sample.ImageUploader
{
[Route(Configs.RouteReportRequest, "Get,Post")]
internal class ReportRequest : IReturn<RestfulQueryResponse<Report>>
{
public string ReportId { get; set; }
}
[Route(Configs.RouteFilesUploadAndDownload, "Get,Post")]
public class FileRequest : FileRequestBase, IReturn<FileResponse>
{
}
public class FileRequestBase
{
public bool Override { get; set; }
public string Description { get; set; }
public Guid OwnerKvid { get; set; }
public string OwnerName { get; set; }
public string Name { get; set; }
public string FolderPath { get; set; }
public string Tags { get; set; }
}
public class DbFile : Entity
{
public string Name { get; set; }
public string Extension { get; set; }
public long Length { get; set; }
public DateTime PublishTime { get; set; }
public string RemoteUrl { get; set; }
public decimal Version { get; set; }
public string Folder { get; set; }
public string VirtualPath { get; set; }
public string OwnerName { get; set; }
public Guid OwnerKvid { get; set; }
public string Tags { get; set; }
public Guid CreatorKvid { get; set; }
public string CreatorName { get; set; }
}
public class FileResponse : RestfulCreateResponse<DbFile>
{
public bool success
{
get
{
return ResponseStatus == null;
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment