初始化
This commit is contained in:
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace BLV_API.Models
|
||||
{
|
||||
public class Luopan2Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 客人信息
|
||||
/// </summary>
|
||||
public class GuestsItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 客人编码,Qtels系统内部使用,每个客人唯一
|
||||
/// </summary>
|
||||
public string code { get; set; }
|
||||
/// <summary>
|
||||
/// 客人姓
|
||||
/// </summary>
|
||||
public string last_name { get; set; }
|
||||
/// <summary>
|
||||
/// 客人名
|
||||
/// </summary>
|
||||
public string first_name { get; set; }
|
||||
/// <summary>
|
||||
/// 性别 0男 1女
|
||||
/// </summary>
|
||||
public int gender_id { get; set; }
|
||||
/// <summary>
|
||||
/// 称呼 1先生 Mr. 2女士 Ms. 3女士 Mrs. 4女士Miss. 5博士 6教授
|
||||
/// </summary>
|
||||
public int salutation_id { get; set; }
|
||||
/// <summary>
|
||||
/// 证件号
|
||||
/// </summary>
|
||||
public string id_card_no { get; set; }
|
||||
/// <summary>
|
||||
/// 证件类型id
|
||||
/// </summary>
|
||||
public int id_card_type_id { get; set; }
|
||||
/// <summary>
|
||||
/// 生日,格式是 yyyyMMdd
|
||||
/// </summary>
|
||||
public string birthday { get; set; }
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
public string address { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string mobile { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string email { get; set; }
|
||||
/// <summary>
|
||||
/// 民族
|
||||
/// </summary>
|
||||
public string ethnicity { get; set; }
|
||||
/// <summary>
|
||||
/// 城市编码(如需要,向Qtels索取数据字典)
|
||||
/// </summary>
|
||||
public string city_code { get; set; }
|
||||
/// <summary>
|
||||
/// 国家代码
|
||||
/// </summary>
|
||||
public string country_code { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 罗盘2接口
|
||||
/// </summary>
|
||||
public class Root
|
||||
{
|
||||
/// <summary>
|
||||
/// 接口类型:新房间入住reg.checkin,在房间添加入住客人guest.checkin,退房reg.checkout,客人退出房间guest.checkout,
|
||||
/// 登记单整体换房reg.move,房间某个住客换房guest.move,房间修改离店日期(提前离店或者延住)reg.change_checkout,
|
||||
/// </summary>
|
||||
public string type { get; set; }
|
||||
/// <summary>
|
||||
/// Qtels内部消息编号
|
||||
/// </summary>
|
||||
public string message_id { get; set; }
|
||||
/// <summary>
|
||||
/// 酒店ID
|
||||
/// </summary>
|
||||
public string hotel_id { get; set; }
|
||||
/// <summary>
|
||||
/// Qtels内部入住单号(每次入住唯一)
|
||||
/// </summary>
|
||||
public string register_id { get; set; }
|
||||
/// <summary>
|
||||
/// 确认号
|
||||
/// </summary>
|
||||
public string conf_no { get; set; }
|
||||
/// <summary>
|
||||
/// 房间号
|
||||
/// </summary>
|
||||
public string room_no { get; set; }
|
||||
/// <summary>
|
||||
/// 旧房间号
|
||||
/// </summary>
|
||||
public string old_room_no { get; set; }
|
||||
/// <summary>
|
||||
/// 新房间号
|
||||
/// </summary>
|
||||
public string new_room_no { get; set; }
|
||||
/// <summary>
|
||||
/// 房型代码
|
||||
/// </summary>
|
||||
public string room_type_code { get; set; }
|
||||
/// <summary>
|
||||
/// 楼代码
|
||||
/// </summary>
|
||||
public string building_code { get; set; }
|
||||
/// <summary>
|
||||
/// 楼层代码
|
||||
/// </summary>
|
||||
public string floor_code { get; set; }
|
||||
/// <summary>
|
||||
/// 入住时间
|
||||
/// </summary>
|
||||
public DateTime check_in_time { get; set; }
|
||||
/// <summary>
|
||||
/// 离店时间
|
||||
/// </summary>
|
||||
public DateTime check_out_time { get; set; }
|
||||
/// <summary>
|
||||
/// 换房时间
|
||||
/// </summary>
|
||||
public DateTime move_time { get; set; }
|
||||
/// <summary>
|
||||
/// 会有多条guest记录
|
||||
/// </summary>
|
||||
public List<GuestsItem> guests { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 返回数据包
|
||||
/// </summary>
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 0表示成功,1表示失败不再重试,2表示失败希望Luopan再重发
|
||||
/// </summary>
|
||||
public int status { get; set; }
|
||||
/// <summary>
|
||||
/// 如果失败,这里返回失败的描述信息
|
||||
/// </summary>
|
||||
public string error_msg { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,111 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Extensions.props"/>
|
||||
|
||||
<ItemGroup>
|
||||
<RoslynCompilerFiles Include="$(RoslynToolPath)\*">
|
||||
<Link>roslyn\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
</RoslynCompilerFiles>
|
||||
</ItemGroup>
|
||||
<Target Name="IncludeRoslynCompilerFilesToFilesForPackagingFromProject" BeforeTargets="PipelineCollectFilesPhase" >
|
||||
<ItemGroup>
|
||||
<FilesForPackagingFromProject Include="@(RoslynCompilerFiles)">
|
||||
<DestinationRelativePath>bin\roslyn\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
<FromTarget>IncludeRoslynCompilerFilesToFilesForPackagingFromProject</FromTarget>
|
||||
<Category>Run</Category>
|
||||
</FilesForPackagingFromProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<Target Name="LocateRoslynToolsDestinationFolder" Condition=" '$(RoslynToolsDestinationFolder)' == '' ">
|
||||
<PropertyGroup>
|
||||
<RoslynToolsDestinationFolder>$(WebProjectOutputDir)\bin\roslyn</RoslynToolsDestinationFolder>
|
||||
<RoslynToolsDestinationFolder Condition=" '$(WebProjectOutputDir)' == '' ">$(OutputPath)\roslyn</RoslynToolsDestinationFolder>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="CopyRoslynCompilerFilesToOutputDirectory" AfterTargets="CopyFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder">
|
||||
<Copy SourceFiles="@(RoslynCompilerFiles)" DestinationFolder="$(RoslynToolsDestinationFolder)" ContinueOnError="true" SkipUnchangedFiles="true" Retries="0" />
|
||||
<ItemGroup Condition="'$(MSBuildLastTaskResult)' == 'True'" >
|
||||
<FileWrites Include="$(RoslynToolsDestinationFolder)\*" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<Target Name="CheckIfShouldKillVBCSCompiler">
|
||||
<CheckIfVBCSCompilerWillOverride src="$(RoslynToolPath)\VBCSCompiler.exe" dest="$(RoslynToolsDestinationFolder)\VBCSCompiler.exe">
|
||||
<Output TaskParameter="WillOverride" PropertyName="ShouldKillVBCSCompiler" />
|
||||
</CheckIfVBCSCompilerWillOverride>
|
||||
</Target>
|
||||
<Target Name = "KillVBCSCompilerBeforeCopy" BeforeTargets="CopyRoslynCompilerFilesToOutputDirectory" DependsOnTargets="LocateRoslynToolsDestinationFolder;CheckIfShouldKillVBCSCompiler" >
|
||||
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" Condition="'$(ShouldKillVBCSCompiler)' == 'True'" />
|
||||
</Target>
|
||||
<Target Name = "KillVBCSCompilerBeforeClean" AfterTargets="BeforeClean" DependsOnTargets="LocateRoslynToolsDestinationFolder">
|
||||
<KillProcess ProcessName="VBCSCompiler" ImagePath="$(RoslynToolsDestinationFolder)" />
|
||||
</Target>
|
||||
<UsingTask TaskName="KillProcess" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<ProcessName ParameterType="System.String" Required="true" />
|
||||
<ImagePath ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Management" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.Linq" />
|
||||
<Using Namespace="System.Diagnostics" />
|
||||
<Using Namespace="System.Management" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try
|
||||
{
|
||||
foreach(var p in Process.GetProcessesByName(ProcessName))
|
||||
{
|
||||
var wmiQuery = "SELECT ProcessId, ExecutablePath FROM Win32_Process WHERE ProcessId = " + p.Id;
|
||||
using(var searcher = new ManagementObjectSearcher(wmiQuery))
|
||||
{
|
||||
using(var results = searcher.Get())
|
||||
{
|
||||
var mo = results.Cast<ManagementObject>().FirstOrDefault();
|
||||
if(mo != null)
|
||||
{
|
||||
var path = (string)mo["ExecutablePath"];
|
||||
var executablePath = path != null ? path : string.Empty;
|
||||
Log.LogMessage("ExecutablePath is {0}", executablePath);
|
||||
|
||||
if(executablePath.StartsWith(ImagePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
p.Kill();
|
||||
p.WaitForExit();
|
||||
Log.LogMessage("{0} is killed", executablePath);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.LogWarning(ex.Message);
|
||||
}
|
||||
return true;
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
<UsingTask TaskName="CheckIfVBCSCompilerWillOverride" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<Src ParameterType="System.String" Required="true" />
|
||||
<Dest ParameterType="System.String" Required="true" />
|
||||
<WillOverride ParameterType="System.Boolean" Output="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.IO" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
WillOverride = false;
|
||||
try {
|
||||
WillOverride = File.Exists(Src) && File.Exists(Dest) && (File.GetLastWriteTime(Src) != File.GetLastWriteTime(Dest));
|
||||
}
|
||||
catch { }
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user