初始化

This commit is contained in:
2025-11-20 14:38:48 +08:00
commit f9e0cc8a4a
534 changed files with 247694 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,99 @@
using BLV_API.Dal;
using BLV_API.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml.Linq;
namespace BLV_API.Controllers
{
public class ApiController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "宝来威客控与PMS对接API";
return View();
}
/// <summary>
/// Luopan PMS对接
/// </summary>
/// <returns></returns>
public ActionResult LuopanToBLV()
{
Request.InputStream.Position = 0;
byte[] reqBody = new byte[Request.InputStream.Length];
Request.InputStream.Read(reqBody, 0, reqBody.Length);
string reqData = System.Text.Encoding.UTF8.GetString(reqBody);
if (string.IsNullOrEmpty(reqData))
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = "传递参数不能为空" }, JsonRequestBehavior.AllowGet);
}
LogHelper.WriteLog("收到Luopan请求" + reqData);
try
{
LuopanEntity.Root req = JsonConvert.DeserializeObject<LuopanEntity.Root>(reqData);
ServiceReference1.blwwsSoapClient client = new ServiceReference1.blwwsSoapClient();
string errorMsg = "";
bool blvResult;
StringBuilder xmlString = new StringBuilder();
string phoneNumber = "";
string idNumber = "";
switch (req.Action)
{
case "CheckIn"://入住
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", req.HotelId, req.RoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
case "CheckOut"://退房
blvResult = client.CheckOut("blw_ws@2015", req.HotelId, req.RoomNo, req.CheckOutTime, ref errorMsg);
LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
break;
case "MoveRoom"://换房
//先退房
blvResult = client.CheckOut("blw_ws@2015", req.HotelId, req.OldRoomNo, req.MoveTime, ref errorMsg);
LogHelper.WriteLog($"转发BLV内部退房接口结果{blvResult},消息:{errorMsg}");
//再开房
if (req.GuestInfo.Count > 0)
{
phoneNumber = req.GuestInfo[0].Mobile;
idNumber = req.GuestInfo[0].IDCardNo;
xmlString.Append("<interface>");
foreach (LuopanEntity.GuestInfo guest in req.GuestInfo)
{
xmlString.Append("<item idtype=\"" + guest.IDCardTypeId + "\" idcard = \"" + guest.IDCardNo + "\" customer = \"" + guest.GuestName + "\" sex =\"" +
(guest.Gender == 0 ? "男" : "女") + "\" country =\"0\" checkindate = \"" + req.CheckInTime.ToString("yyyy-MM-dd HH:mm:ss") + "\"/>");
}
xmlString.Append("</interface>");
}
blvResult = client.CheckIn("blw_ws@2015", req.HotelId, req.NewRoomNo, req.CheckInTime, xmlString.ToString(), ref errorMsg, phoneNumber, idNumber);
LogHelper.WriteLog($"转发BLV内部开房接口结果{blvResult},消息:{errorMsg}");
break;
case "Extend"://续住
break;
}
return Json(new LuopanEntity.Result() { status = 0, error_msg = "" }, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(new LuopanEntity.Result() { status = 1, error_msg = ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
@(Compile);
@(_CoreCompileResourceInputs);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ReferencePath);
@(CompiledLicenseFile);
@(LinkResource);
@(EmbeddedDocumentation);
$(Win32Resource);
$(Win32Manifest);
@(CustomAdditionalCompileInputs);
$(ResolvedCodeAnalysisRuleSet)"
Outputs="@(DocFileItem);
@(IntermediateAssembly);
@(_DebugSymbolsIntermediatePath);
$(NonExistentFile);
@(CustomAdditionalCompileOutputs)"
Returns="@(CscCommandLineArgs)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<!-- These two compiler warnings are raised when a reference is bound to a different version
than specified in the assembly reference version number. MSBuild raises the same warning in this case,
so the compiler warning would be redundant. -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">
<NoWarn>$(NoWarn);1701;1702</NoWarn>
</PropertyGroup>
<PropertyGroup>
<!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->
<NoWarn Condition=" '$(BuildingInsideVisualStudio)' == 'true' and '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0' ">$(NoWarn);2008</NoWarn>
</PropertyGroup>
<ItemGroup Condition="'$(TargetingClr2Framework)'=='true'">
<ReferencePath>
<EmbedInteropTypes/>
</ReferencePath>
</ItemGroup>
<PropertyGroup>
<!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
then we'll use AppConfig -->
<AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' and '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
<!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->
<PdbFile Condition="'$(PdbFile)' == '' and '$(OutputType)' == 'winmdobj' and '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>
</PropertyGroup>
<!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
<AdditionalFileItems Include="$(AdditionalFileItemNames)" />
<AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
</ItemGroup>
<PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
<Csc Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
AdditionalLibPaths="$(AdditionalLibPaths)"
AddModules="@(AddModules)"
AdditionalFiles="@(AdditionalFiles)"
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
Analyzers="@(Analyzer)"
ApplicationConfiguration="$(AppConfigForCompiler)"
BaseAddress="$(BaseAddress)"
CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
ChecksumAlgorithm="$(ChecksumAlgorithm)"
CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"
CodePage="$(CodePage)"
DebugType="$(DebugType)"
DefineConstants="$(DefineConstants)"
DelaySign="$(DelaySign)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmitDebugInformation="$(DebugSymbols)"
EnvironmentVariables="$(CscEnvironment)"
ErrorEndLocation="$(ErrorEndLocation)"
ErrorLog="$(ErrorLog)"
ErrorReport="$(ErrorReport)"
Features="$(Features)"
FileAlignment="$(FileAlignment)"
GenerateFullPaths="$(GenerateFullPaths)"
HighEntropyVA="$(HighEntropyVA)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
LangVersion="$(LangVersion)"
LinkResources="@(LinkResource)"
MainEntryPoint="$(StartupObject)"
ModuleAssemblyName="$(ModuleAssemblyName)"
NoConfig="true"
NoLogo="$(NoLogo)"
NoStandardLib="$(NoCompilerStandardLib)"
NoWin32Manifest="$(NoWin32Manifest)"
Optimize="$(Optimize)"
Deterministic="$(Deterministic)"
PublicSign="$(PublicSign)"
OutputAssembly="@(IntermediateAssembly)"
PdbFile="$(PdbFile)"
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
References="@(ReferencePath)"
ReportAnalyzer="$(ReportAnalyzer)"
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
RuntimeMetadataVersion="$(RuntimeMetadataVersion)"
SkipCompilerExecution="$(SkipCompilerExecution)"
Sources="@(Compile)"
SubsystemVersion="$(SubsystemVersion)"
TargetType="$(OutputType)"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
UseSharedCompilation="$(UseSharedCompilation)"
Utf8Output="$(Utf8Output)"
VsSessionGuid="$(VsSessionGuid)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
Win32Icon="$(ApplicationIcon)"
Win32Manifest="$(Win32Manifest)"
Win32Resource="$(Win32Resource)"
PathMap="$(PathMap)"
>
<Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />
</Csc>
<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
</ItemGroup>
<CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
</Target>
</Project>