田工版本初次提交
This commit is contained in:
@@ -376,7 +376,7 @@ namespace BLWWS_BLL
|
||||
int result = 0;
|
||||
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
string sql = "update tb_RoomCheck set CheckOutDate='" + checkOutDate.ToString("yyyy-MM-dd HH:mm:ss") + "' where Code='" + code + "' and RoomNumber='" + roomNumber + "' and isnull(CheckOutDate,'')=''";
|
||||
string sql = "update tb_RoomCheck set CheckOutDate='" + checkOutDate.ToString("yyyy-MM-dd HH:mm:ss") + "',SyncCheckOut=0 where Code='" + code + "' and RoomNumber='" + roomNumber + "' and isnull(CheckOutDate,'')=''";
|
||||
result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionString, CommandType.Text, sql);
|
||||
if (result > 0 && !string.IsNullOrEmpty(_face_url))
|
||||
{
|
||||
@@ -437,7 +437,7 @@ namespace BLWWS_BLL
|
||||
"','" + roomNumber +
|
||||
"','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") +
|
||||
"'," + 0 +
|
||||
"," + 1 +
|
||||
"," + 0 +
|
||||
"," + 0 +
|
||||
")";
|
||||
result = SqlHelper.ExecuteNonQuery(SqlHelper.connectionString, CommandType.Text, sql);
|
||||
|
||||
96
BLWWS_BLL/CSRedisCacheHelper.cs
Normal file
96
BLWWS_BLL/CSRedisCacheHelper.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using CSRedis;
|
||||
|
||||
namespace BLWWS_BLL.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Redis缓存辅助类
|
||||
/// </summary>
|
||||
public class CSRedisCacheHelper
|
||||
{
|
||||
public static CSRedisClient redis;
|
||||
public static CSRedisClient redis3;
|
||||
public static CSRedisClient redis5;
|
||||
|
||||
private const string ip = "127.0.0.1";
|
||||
private const string port = "6379";
|
||||
static CSRedisCacheHelper()
|
||||
{
|
||||
var redisHostStr = string.Format("{0}:{1}", ip, port);
|
||||
if (!string.IsNullOrEmpty(redisHostStr))
|
||||
{
|
||||
redis = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=1");
|
||||
redis3 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=3");
|
||||
//准备存储取电数据
|
||||
redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5");
|
||||
//string channel = "__keyevent@1__:expired";
|
||||
//var QQQ = new ValueTuple<string, Action<CSRedisClient.SubscribeMessageEventArgs>>(channel, (msg) =>
|
||||
// {
|
||||
// if (channel.Equals(""))
|
||||
// {
|
||||
|
||||
// }
|
||||
// Console.WriteLine(msg.MessageId);
|
||||
// Console.WriteLine(msg.Body);
|
||||
// Console.WriteLine("11111111");
|
||||
// });
|
||||
//redis.Subscribe(QQQ);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加缓存
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="value"></param>
|
||||
public static void Set<T>(string key, T value, int ExpireTime)
|
||||
{
|
||||
redis?.Set(key, value, ExpireTime * 60);
|
||||
}
|
||||
|
||||
public static T Get<T>(string key)
|
||||
{
|
||||
return redis.Get<T>(key);
|
||||
}
|
||||
|
||||
public static void Forever<T>(string key, T value)
|
||||
{
|
||||
redis.Set(key, value, -1);
|
||||
}
|
||||
public static void Del(string key)
|
||||
{
|
||||
redis.Del(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="mac"></param>
|
||||
/// <returns></returns>
|
||||
public static bool Contains(string key, string mac)
|
||||
{
|
||||
bool result = redis.Exists(mac);
|
||||
if (!result)
|
||||
{
|
||||
result = redis.Exists(key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool Contains(string key)
|
||||
{
|
||||
bool result = redis.Exists(key);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void Publish(string Topic, string Payload)
|
||||
{
|
||||
CSRedisCacheHelper.redis3.Publish(Topic, Payload);
|
||||
}
|
||||
}
|
||||
}
|
||||
59
BLWWS_BLL/EntityData.cs
Normal file
59
BLWWS_BLL/EntityData.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLWWS_BLL
|
||||
{
|
||||
public class StaticData
|
||||
{
|
||||
public static string PMSLogMonitor = "PMSLogMonitor";
|
||||
}
|
||||
public class CheckInYuanShidata
|
||||
{
|
||||
public string CommandType { get; set; }
|
||||
public double Step { get; set; }
|
||||
public string IP { get; set; }
|
||||
|
||||
public string RequestId { get; set; }
|
||||
public JianJie JianJieData { get; set; }
|
||||
public ZhiJie ZhiJieData { get; set; }
|
||||
public DateTime CurrentTime { get; set; }
|
||||
|
||||
public string ReturnMsg { get; set; }
|
||||
}
|
||||
public class JianJie
|
||||
{
|
||||
public string OriginallData { get; set; }
|
||||
}
|
||||
public class ZhiJie
|
||||
{
|
||||
public CheckInData CheckInData { get; set; }
|
||||
public CheckOutData CheckOutData { get; set; }
|
||||
public RentData RentData { get; set; }
|
||||
}
|
||||
public class CheckInData
|
||||
{
|
||||
public string key { get; set; }
|
||||
public string code { get; set; }
|
||||
public string roomNumber { get; set; }
|
||||
public DateTime checkInDate;
|
||||
public string xmlString { get; set; }
|
||||
public string phoneNumber { get; set; }
|
||||
public string idNumber { get; set; }
|
||||
}
|
||||
public class CheckOutData
|
||||
{
|
||||
public string key { get; set; }
|
||||
public string code { get; set; }
|
||||
public string roomNumber { get; set; }
|
||||
public DateTime checkOutDate { get; set; }
|
||||
}
|
||||
public class RentData
|
||||
{
|
||||
public string key { get; set; }
|
||||
public string code { get; set; }
|
||||
public string roomNumber { get; set; }
|
||||
public DateTime rentDate { get; set; }
|
||||
}
|
||||
}
|
||||
13
BLWWS_BLL/ExtraData.cs
Normal file
13
BLWWS_BLL/ExtraData.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLWWS_BLL
|
||||
{
|
||||
public class ExtraData
|
||||
{
|
||||
public string OriginalData { get; set; }
|
||||
public string RequestIP { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user