312 lines
9.3 KiB
C#
312 lines
9.3 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Web;
|
||
using System.Web.Services;
|
||
using System.Data;
|
||
using BLWWS_BLL;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace BLWWS
|
||
{
|
||
/// <summary>
|
||
/// syncstatus 的摘要说明
|
||
/// </summary>
|
||
[WebService(Namespace = "http://www.blw.com/")]
|
||
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
|
||
[System.ComponentModel.ToolboxItem(false)]
|
||
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
|
||
[System.Web.Script.Services.ScriptService]
|
||
public class syncstatus : System.Web.Services.WebService
|
||
{
|
||
/// <summary>
|
||
/// 获取客户记录
|
||
/// </summary>
|
||
/// <param name="code"></param>
|
||
/// <param name="roomNumber"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataSet GetRoomRecord(string code, string roomNumber, string tableName)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetRoomRecords(code, roomNumber, tableName);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 根据酒店ID,房号获取当前入住人信息
|
||
/// </summary>
|
||
/// <param name="hotelID">酒店ID</param>
|
||
/// <param name="roomNumber">房号</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public string GetRoomCustomerByHotelID(int hotelID, string roomNumber, ref string phoneNumber)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetRoomCustomer(hotelID, roomNumber, ref phoneNumber);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return "";
|
||
}
|
||
/// <summary>
|
||
/// 获取入住人信息
|
||
/// </summary>
|
||
/// <param name="checkInID"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataSet GetRoomCustomer(long checkInID)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetRoomCustomer(checkInID);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 获取酒店编码
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataSet GetHotelCode()
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetHotelCode();
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 获取酒店编码
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataTable GetHotelByCode(string code)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetHotelCode(code);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 定时获取酒店新的开房/退房/待租记录
|
||
/// </summary>
|
||
/// <param name="code">酒店编码</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataSet GetCheckInOrOutRecord(string code)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetCheckInOrOutRecord(code);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 获取人脸机设备信息
|
||
/// </summary>
|
||
/// <param name="code"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataSet GetDevices(string code)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetDevices(code);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 人脸机绑定房号
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <param name="hotelCode"></param>
|
||
/// <param name="roomNumber"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public int SaveDevice(long id, string hotelCode, string roomNumber)
|
||
{
|
||
try
|
||
{
|
||
return BLL.SaveDevice(id, hotelCode, roomNumber);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return 0;
|
||
}
|
||
/// <summary>
|
||
/// 更新已同步的新开房/退房/待租状态
|
||
/// </summary>
|
||
/// <param name="code">酒店编码</param>
|
||
/// <param name="id">记录ID</param>
|
||
/// <param name="flag">0开房,1退房,2待租</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public int UpdateCheckInOrOutRecord(string code, Int64 id, int flag)
|
||
{
|
||
try
|
||
{
|
||
return BLL.UpdateCheckInOrOutRecord(code, id, flag);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return 0;
|
||
}
|
||
/// <summary>
|
||
/// 判断验证码是否正确
|
||
/// </summary>
|
||
/// <param name="hotelID">酒店ID</param>
|
||
/// <param name="roomNumber">房号</param>
|
||
/// <param name="validateCode">用户输入验证码</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public bool ValidateNumber(int hotelID, string roomNumber, string validateCode)
|
||
{
|
||
try
|
||
{
|
||
return BLL.ValidateNumber(hotelID, roomNumber, validateCode);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return false;
|
||
}
|
||
/// <summary>
|
||
/// 判断验证码是否正确
|
||
/// </summary>
|
||
/// <param name="code">酒店编码</param>
|
||
/// <param name="roomNumber">房号</param>
|
||
/// <param name="validateCode">用户输入验证码</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public bool ValidateNumberByCode(string code, string roomNumber, string validateCode)
|
||
{
|
||
try
|
||
{
|
||
return BLL.ValidateNumberByCode(code, roomNumber, validateCode);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return false;
|
||
}
|
||
/// <summary>
|
||
/// 根据手机号获取当前入住记录信息
|
||
/// </summary>
|
||
/// <param name="phone"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public DataTable GetCodeAndRoomNumberByPhone(string phone)
|
||
{
|
||
try
|
||
{
|
||
return BLL.GetCodeAndRoomNumberByPhone(phone);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return null;
|
||
}
|
||
/// <summary>
|
||
/// 上传/变更图像及信息
|
||
/// </summary>
|
||
/// <param name="idType">证件类型:0身份证,1护照</param>
|
||
/// <param name="idCard">证件号码</param>
|
||
/// <param name="name">姓名</param>
|
||
/// <param name="sex">性别:0女,1男</param>
|
||
/// <param name="photo">图像</param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public bool UploadPhoto(int idType, string idCard, string name, int sex, string birthday, byte[] photo)
|
||
{
|
||
try
|
||
{
|
||
if (BLL.UploadPhoto(idType, idCard, name, sex, birthday, photo) > 0)
|
||
{
|
||
return true;
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return false;
|
||
}
|
||
/// <summary>
|
||
/// 人脸识别
|
||
/// </summary>
|
||
/// <param name="photo"></param>
|
||
/// <param name="idType"></param>
|
||
/// <param name="idCard"></param>
|
||
/// <param name="name"></param>
|
||
/// <param name="sex"></param>
|
||
/// <param name="matchPhoto"></param>
|
||
/// <returns></returns>
|
||
[WebMethod]
|
||
public bool FaceMatch(byte[] photo, ref int idType, ref string idCard, ref string name, ref int sex, ref byte[] matchPhoto)
|
||
{
|
||
try
|
||
{
|
||
return BLL.FaceMatch(photo, ref idType, ref idCard, ref name, ref sex, ref matchPhoto);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
LogHelper.WriteLog(ex.ToString());
|
||
}
|
||
return false;
|
||
}
|
||
|
||
//[WebMethod]
|
||
//public int SendSMS(string phoneNumber)
|
||
//{
|
||
// try
|
||
// {
|
||
// string validateCode = Tools.CreateValidateCode(4);
|
||
// //发送短信验证码
|
||
// AliyunSMSHelper.SendVerifySMS(phoneNumber, validateCode);
|
||
// }
|
||
// catch (Exception ex)
|
||
// {
|
||
// LogHelper.WriteLog(ex.ToString());
|
||
// }
|
||
// return 0;
|
||
//}
|
||
}
|
||
}
|