Commit 6caac36f authored by 吴春's avatar 吴春

1

parent b6d92378
......@@ -162,6 +162,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "REBORN.Services.AlipayComme
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "REBORN.HuaTuQUART", "REBORN.HuaTuQUART\REBORN.HuaTuQUART.csproj", "{FF7660D5-90CA-4239-9E8B-5A23F34DBAF1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "REBORN.HuaTuQuartClient", "REBORN.HuaTuQuartClient\REBORN.HuaTuQuartClient.csproj", "{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -432,6 +434,10 @@ Global
{FF7660D5-90CA-4239-9E8B-5A23F34DBAF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF7660D5-90CA-4239-9E8B-5A23F34DBAF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF7660D5-90CA-4239-9E8B-5A23F34DBAF1}.Release|Any CPU.Build.0 = Release|Any CPU
{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}.Debug|Any CPU.Build.0 = Debug|Any CPU
{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}.Release|Any CPU.ActiveCfg = Release|Any CPU
{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -499,6 +505,7 @@ Global
{715607F5-9050-4F94-AB98-B0B73C6073A6} = {B646CF37-90E6-4130-8467-62CB2B2C788F}
{7AA3BA7D-7E2A-4F8E-BC6F-1B903DD8DFD9} = {E11B04D0-CE75-4339-BB3D-9752FF101351}
{FF7660D5-90CA-4239-9E8B-5A23F34DBAF1} = {E6DB58DA-96EC-4C12-99F5-E70D45091422}
{207CBF6E-E96C-4B36-BB10-F69CCF7CB964} = {E6DB58DA-96EC-4C12-99F5-E70D45091422}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EE4F9A23-3AA4-430B-9021-32060E109663}
......
......@@ -155,7 +155,7 @@ namespace REBORN.Common.Plugin
{
Common.Plugin.LogHelper.RequestInfo(string.Format("OrderMessagePush_url::{0} params::{1} ", url, Common.Plugin.JsonHelper.Serialize(postdata)));
}
string content = $"订单信息!";
string content = $"订单尾款!";
if (dic != null && dic.Count > 0)
{
foreach (var item in dic)
......
......@@ -15,6 +15,7 @@ using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
......@@ -30,16 +31,12 @@ namespace REBORN.HuaTuQUART
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new RebornTimerServer(),
new RebornTimerHuaTuServer(),
};
ServiceBase.Run(ServicesToRun);
// QuarzHelper quarzHelper = new QuarzHelper();
// quarzHelper.StartAsync();
// quarzHelper.StartSellTaskStatistics();
// quarzHelper.StartUpdateAnnualLeaves();
// quarzHelper.StartUpdateRevenueReport().GetAwaiter();
// quarzHelper.StartAsync();
// Console.ReadKey();
//QuarzHelper quarzHelper = new QuarzHelper();
//quarzHelper.StartAsync();
//Console.ReadKey();
//注: 发布时 app.confing需要配置成正式数据库连接地址
}
......@@ -50,8 +47,7 @@ namespace REBORN.HuaTuQUART
{
public async Task StartAsync()
{
//更新币种汇率 2019-05-07 修改为每天凌晨定时更新
string cronExpression = "0 30 0 * * ?";
string cronExpression = "0 0 10 * * ?"; // 修改为每天10:00执行
NameValueCollection props = new NameValueCollection
{
{ "quartz.serializer.type", "binary" }
......@@ -99,193 +95,258 @@ namespace REBORN.HuaTuQUART
public Task Execute(IJobExecutionContext context)
{
var mpcList = repository.GetList(new RB_MessagePushConfig());//消息推送配置
string groupId = "";
if (mpcList != null && mpcList.Any())
{
groupId = string.Join(",", mpcList.Select(x => x.RB_Group_Id ?? 0).Distinct());
#region 订单信息
StringBuilder builder = new StringBuilder();
//跟团游订单
builder.AppendFormat(@"SELECT A.RB_Group_id,A.OrderSource,A.OrderId,A.GuestNum,A.EnterID,b.StartDate,B.PriceTeamType,c.Title,A.FinalPriceTips from rb_travel_order AS A INNER JOIN rb_travel_price AS B ON A.TCID=B.TCID
#region 订单信息
StringBuilder builder = new StringBuilder();
//跟团游订单
builder.AppendFormat($@"SELECT A.RB_Group_id,A.OrderSource,A.OrderId,A.GuestNum,A.EnterID,b.StartDate,B.PriceTeamType,c.Title,A.FinalPriceTips from rb_travel_order AS A INNER JOIN rb_travel_price AS B ON A.TCID=B.TCID
LEFT JOIN rb_travel_config as c on c.ID=b.ConfigID
where FinalPriceTips>0 and b.StartDate>NOW()");
var orderList = orderRepository.Get<RB_Travel_Order_Extend>(builder.ToString()).ToList();
where FinalPriceTips>0 and ifnull(a.IsChargeLossOrders,0)=0 and a.OrderState<>4 and b.StartDate>NOW() and a.RB_Group_Id in({groupId})
and (IFNULL(a.PreferPrice,0)-IFNULL(a.Income,0)-IFNULL(a.ZaiTuMoney,0)+IFNULL(a.Refund,0)-IFNULL(a.PlatformTax,0)-IFNULL(a.ZaiTuMoney,0)-IFNULL(a.DiscountMoney,0)-IFNULL(a.RedEnvelopeMoney,0))<> 0
");
var orderList = orderRepository.Get<RB_Travel_Order_Extend>(builder.ToString()).ToList();
//签证订单
StringBuilder builderVisaOrder = new StringBuilder();
builderVisaOrder.AppendFormat(@"SELECT A.RB_Group_id,A.Id,a.PeopleNum,a.CreateBy,b.`Name`,a.SignOutTime,A.FinalPriceTips from rb_sell_visaorder as a LEFT JOIN RB_Sell_VisaProduct as b on a.VisaId=b.Id where FinalPriceTips>0 and a.SignOutTime>NOW()");
var visaOrderList = sellVisaOrderRepository.Get<RB_Sell_VisaOrder_Extend>(builderVisaOrder.ToString()).ToList();
//签证订单
StringBuilder builderVisaOrder = new StringBuilder();
builderVisaOrder.AppendFormat($@"SELECT A.RB_Group_id,A.Id,a.PeopleNum,a.CreateBy,b.`Name`,a.SignOutTime,A.FinalPriceTips from rb_sell_visaorder as a
LEFT JOIN RB_Sell_VisaProduct as b on a.VisaId=b.Id where FinalPriceTips>0 and a.RB_Group_Id in({groupId}) and a.VisaOrderStatus <>2 and IFNULL(a.TotalPrice,0) <> (IFNULL(a.Income,0) + IFNULL(a.PlatformTax,0)+ IFNULL(a.PlatformTax,0) - IFNULL(a.RefundMoney,0)) and a.SignOutTime>NOW()");
var visaOrderList = sellVisaOrderRepository.Get<RB_Sell_VisaOrder_Extend>(builderVisaOrder.ToString()).ToList();
//酒店
StringBuilder builderHotelOrder = new StringBuilder();
builderHotelOrder.AppendFormat(@"SELECT A.RB_Group_id,a.OrderNo,A.EnterID,c.`Name` as HotelName,a.CheckIn,A.FinalPriceTips from rb_customer_hotelorder as a LEFT JOIN rb_customer_hotelorderdetail as b on a.OrderId=b.OrderId INNER JOIN rb_hotel as c on c.ID=b.HotelId where FinalPriceTips>0 and a.CheckIn>NOW()");
var hotelOrderList = customer_HotelOrderRepository.Get<RB_Customer_HotelOrder_Extend>(builderHotelOrder.ToString()).ToList();
//酒店
StringBuilder builderHotelOrder = new StringBuilder();
builderHotelOrder.AppendFormat($@"SELECT A.RB_Group_id,a.OrderNo,A.EnterID,c.`Name` as HotelName,a.CheckIn,A.FinalPriceTips from rb_customer_hotelorder as a
LEFT JOIN rb_customer_hotelorderdetail as b on a.OrderId=b.OrderId INNER JOIN rb_hotel as c on c.ID=b.HotelId where FinalPriceTips>0 and a.GroupId in({groupId}) and a.CheckIn>NOW()
and a.OrderStatus <>3 and a.Money <> (a.Income + a.PlatformTax+a.PlatformMoney - a.Refund)
");
var hotelOrderList = customer_HotelOrderRepository.Get<RB_Customer_HotelOrder_Extend>(builderHotelOrder.ToString()).ToList();
//邮轮订单
StringBuilder builderTicketOrder = new StringBuilder();
builderTicketOrder.AppendFormat(@"SELECT A.GroupId,A.OrderNo,a.EnterID,b.`Name` as CouponsName,a.UseDate,A.FinalPriceTips from rb_customer_ticketorder as a LEFT JOIN rb_ticketcoupons as b on a.CouponsId=b.ID where FinalPriceTips>0 and a.UseDate>NOW()");
var ticketOrderList = customerTicketOrderRepository.Get<RB_Customer_TicketOrder_Extend>(builderTicketOrder.ToString()).ToList();
//邮轮订单
StringBuilder builderTicketOrder = new StringBuilder();
builderTicketOrder.AppendFormat($@"SELECT A.GroupId,A.OrderNo,a.EnterID,b.`Name` as CouponsName,a.UseDate,A.FinalPriceTips from rb_customer_ticketorder as a
LEFT JOIN rb_ticketcoupons as b on a.CouponsId=b.ID where FinalPriceTips>0 and a.GroupId in({groupId}) and a.OrderStatus <>3 and a.Money <> (a.Income + a.PlatformTax+a.PlatformMoney - a.Refund) and a.UseDate>NOW()");
var ticketOrderList = customerTicketOrderRepository.Get<RB_Customer_TicketOrder_Extend>(builderTicketOrder.ToString()).ToList();
//单机票订单
StringBuilder builderCRMTicketOrder = new StringBuilder();
builderCRMTicketOrder.AppendFormat(@"SELECT A.GroupId,A.GuestCount,A.DepartTime,A.EnterID,A.FinalPriceTips from reborn_sell.RB_Ticket_Order as A where FinalPriceTips>0 and a.DepartTime>NOW()");
var cRMTicket_OrderList = cRMTicket_OrderRepository.Get<RB_CRMTicket_Order_Extend>(builderCRMTicketOrder.ToString()).ToList();
#endregion
//单机票订单
StringBuilder builderCRMTicketOrder = new StringBuilder();
builderCRMTicketOrder.AppendFormat($@"SELECT A.GroupId,A.GuestCount,A.DepartTime,A.EnterID,A.FinalPriceTips from reborn_sell.RB_Ticket_Order as A
where FinalPriceTips>0 and a.DepartTime>NOW() and a.GroupId in({groupId}) and a.OrderStatus <>2 and a.Money <> (a.IncomeMoney + a.TaxMoney+a.PlatformMoney - a.BackMoney)");
var cRMTicket_OrderList = cRMTicket_OrderRepository.Get<RB_CRMTicket_Order_Extend>(builderCRMTicketOrder.ToString()).ToList();
#endregion
#region 员工信息
List<int> employeeList = new List<int>();
if (orderList != null && orderList.Any())
{
employeeList.AddRange(orderList.Where(x => x.EnterID > 0).Select(x => x.EnterID ?? 0));
}
if (visaOrderList != null && visaOrderList.Any())
{
employeeList.AddRange(visaOrderList.Where(x => x.CreateBy > 0).Select(x => x.CreateBy ?? 0));
}
if (hotelOrderList != null && hotelOrderList.Any())
{
employeeList.AddRange(hotelOrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
if (ticketOrderList != null && ticketOrderList.Any())
{
employeeList.AddRange(ticketOrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
if (cRMTicket_OrderList != null && cRMTicket_OrderList.Any())
{
employeeList.AddRange(cRMTicket_OrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
List<RB_Employee_Extend> employeeNameList = new List<RB_Employee_Extend>();
if (employeeList != null && employeeList.Any())
{
employeeNameList = employeeRepository.GetEmpInfoListByIds(string.Join(",", employeeList.Select(x => x)));
}
#endregion
#region 员工信息
List<int> employeeList = new List<int>();
if (orderList != null && orderList.Any())
{
employeeList.AddRange(orderList.Where(x => x.EnterID > 0).Select(x => x.EnterID ?? 0));
}
if (visaOrderList != null && visaOrderList.Any())
{
employeeList.AddRange(visaOrderList.Where(x => x.CreateBy > 0).Select(x => x.CreateBy ?? 0));
}
if (hotelOrderList != null && hotelOrderList.Any())
{
employeeList.AddRange(hotelOrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
if (ticketOrderList != null && ticketOrderList.Any())
{
employeeList.AddRange(ticketOrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
if (cRMTicket_OrderList != null && cRMTicket_OrderList.Any())
{
employeeList.AddRange(cRMTicket_OrderList.Where(x => x.EnterID > 0).Select(x => x.EnterID));
}
List<RB_Employee_Extend> employeeNameList = new List<RB_Employee_Extend>();
if (employeeList != null && employeeList.Any())
{
employeeNameList = employeeRepository.GetEmpInfoListByIds(string.Join(",", employeeList.Select(x => x)));
}
#endregion
#region 推送尾款提醒消息
var nowDay = DateTime.Now;
if (orderList != null && orderList.Any())
{
foreach (var item in orderList)
#region 推送尾款提醒消息
var nowDay = DateTime.Now;
if (orderList != null && orderList.Any())
{
if (item.FinalPriceTips > 0 && item.StartDate.HasValue && StringHelper.FormatDate(item.StartDate.Value.AddDays(item.FinalPriceTips - 1)) == StringHelper.FormatDate(nowDay))
foreach (var item in orderList)
{
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>();
string teamTypeName = "";
if (item.PriceTeamType == (int)PriceTeamTypeEnum.SanPing)
// 检查是否每隔2天(包括第0天)
if (IsSend(item.FinalPriceTips, item.StartDate.Value))
{
teamTypeName = "定制团";
}
else if (item.PriceTeamType == (int)PriceTeamTypeEnum.OutTravel)
{
teamTypeName = "外交团";
}
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>();
string teamTypeName = "";
if (item.PriceTeamType == (int)PriceTeamTypeEnum.SanPing)
{
teamTypeName = "定制团";
}
else if (item.PriceTeamType == (int)PriceTeamTypeEnum.OutTravel)
{
teamTypeName = "外交团";
}
if (!string.IsNullOrWhiteSpace(teamTypeName))
{
dic.Add("订单类型", teamTypeName);
}
string orderSourceStr = item?.OrderSource?.ToName();
if (!string.IsNullOrEmpty(orderSourceStr))
{
dic.Add("订单来源", orderSourceStr);
if (!string.IsNullOrWhiteSpace(teamTypeName))
{
dic.Add("订单类型", teamTypeName);
}
dic.Add("出发时间", StringHelper.FormatDate(item.StartDate));
dic.Add("订单编号", item.OrderId.ToString());
dic.Add("产品名称", item?.Title ?? "");
dic.Add("订单人数", (item?.GuestNum ?? 0).ToString() + "人");
dic.Add("销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID)?.EmName ?? "");
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == (item.RB_Group_Id ?? 0))?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.RB_Group_Id ?? 0, dic, MessagePushSendType.PaymentReminder);
}
dic.Add("订单编号", item.OrderId.ToString());
dic.Add("产品名称", item?.Title ?? "");
dic.Add("订单人数", (item?.GuestNum ?? 0).ToString() + "人");
dic.Add("销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID)?.EmName ?? "");
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == (item.RB_Group_Id ?? 0))?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.RB_Group_Id ?? 0, dic, MessagePushSendType.PaymentReminder);
}
}
}
if (visaOrderList != null && visaOrderList.Any())
{
foreach (var item in visaOrderList)
if (visaOrderList != null && visaOrderList.Any())
{
if (item.FinalPriceTips > 0 && item.SignOutTime.HasValue && StringHelper.FormatDate(item.SignOutTime.Value.AddDays(item.FinalPriceTips - 1)) == StringHelper.FormatDate(nowDay))
{
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("订单类型", "签证产品");
dic.Add("订单编号", item.Id.ToString());
dic.Add("产品名称", item?.Name ?? "");
dic.Add("订单人数", (item.PeopleNum).ToString() + "人");
dic.Add("销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == (item.CreateBy ?? 0))?.EmName ?? "");
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == (item.RB_Group_Id ?? 0))?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.RB_Group_Id ?? 0, dic, MessagePushSendType.PaymentReminder);
foreach (var item in visaOrderList)
{ // 检查是否每隔2天(包括第0天)
if (IsSend(item.FinalPriceTips, item.SignOutTime.Value))
{
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("订单类型", "签证产品");
dic.Add("送签日期", StringHelper.FormatDate(item.SignOutTime));
dic.Add("订单编号", item.Id.ToString());
dic.Add("产品名称", item?.Name ?? "");
dic.Add("订单人数", (item.PeopleNum).ToString() + "人");
dic.Add("销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == (item.CreateBy ?? 0))?.EmName ?? "");
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == (item.RB_Group_Id ?? 0))?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.RB_Group_Id ?? 0, dic, MessagePushSendType.PaymentReminder);
}
}
}
}
if (hotelOrderList != null && hotelOrderList.Any())
{
foreach (var item in hotelOrderList)
if (hotelOrderList != null && hotelOrderList.Any())
{
if (item.FinalPriceTips > 0 && item.CheckIn.HasValue && StringHelper.FormatDate(item.CheckIn.Value.AddDays(item.FinalPriceTips - 1)) == StringHelper.FormatDate(nowDay))
foreach (var item in hotelOrderList)
{
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>
if (IsSend(item.FinalPriceTips, item.CheckIn.Value))
{
//新增订单,推送消息
Dictionary<string, string> dic = new Dictionary<string, string>
{
{ "订单类型", "酒店产品" },
{ "订单编号", item.OrderNo.ToString() },
{ "入住时间-离店时间",StringHelper.FormatDate(item.CheckIn)+"/"+StringHelper.FormatDate(item.OrderDate)},
{ "订单编号", item.OrderId.ToString() },
{ "产品名称", item.HotelName },
{ "销售人员",employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID )?.EmName ?? "" }
};
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
}
}
}
}
if (ticketOrderList != null && ticketOrderList.Any())
{
foreach (var item in ticketOrderList)
if (ticketOrderList != null && ticketOrderList.Any())
{
if (item.FinalPriceTips > 0 && item.UseDate.HasValue && StringHelper.FormatDate(item.UseDate.Value.AddDays(item.FinalPriceTips - 1)) == StringHelper.FormatDate(nowDay))
foreach (var item in ticketOrderList)
{
Dictionary<string, string> dic = new Dictionary<string, string>
if (IsSend(item.FinalPriceTips, item.UseDate.Value))
{
{ "订单类型", "邮轮产品" },
{ "订单编号", item.OrderNo.ToString() },
{ "产品名称", item.CouponsName },
{ "销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID )?.EmName ?? "" }
};
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
Dictionary<string, string> dic = new Dictionary<string, string>
{
{ "订单类型", "邮轮产品" },
{ "出行时间",StringHelper.FormatDate(item.UseDate)},
{ "订单编号", item.OrderId.ToString() },
{ "产品名称", item.CouponsName },
{ "销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID )?.EmName ?? "" }
};
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
}
}
}
}
if (cRMTicket_OrderList != null && cRMTicket_OrderList.Any())
{
foreach (var item in cRMTicket_OrderList)
if (cRMTicket_OrderList != null && cRMTicket_OrderList.Any())
{
if (item.FinalPriceTips > 0 && item.DepartTime.HasValue && StringHelper.FormatDate(item.DepartTime.Value.AddDays(item.FinalPriceTips - 1)) == StringHelper.FormatDate(nowDay))
foreach (var item in cRMTicket_OrderList)
{
Dictionary<string, string> dic = new Dictionary<string, string>
if (IsSend(item.FinalPriceTips, item.DepartTime.Value))
{
{ "订单类型", "单机票产品" },
{ "出行人数", item.GuestCount.ToString() },
{ "出发时间", StringHelper.FormatDate(item.DepartTime) },
{ "销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID )?.EmName ?? "" }
};
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
Dictionary<string, string> dic = new Dictionary<string, string>
{
{ "订单类型", "单机票产品" },
{ "出行人数", item.GuestCount.ToString() },
{ "订单编号", item.OrderId.ToString() },
{ "出发时间", StringHelper.FormatDate(item.DepartTime) },
{ "销售人员", employeeNameList?.FirstOrDefault(x => x.EmployeeId == item.EnterID )?.EmName ?? "" }
};
//新增订单,推送消息
var nowmpcList = mpcList.Where(x => x.RB_Group_Id == item.GroupId)?.ToList() ?? new List<RB_MessagePushConfig>();
MessagePushSend(nowmpcList, item.GroupId, dic, MessagePushSendType.PaymentReminder);
}
}
}
#endregion
Console.WriteLine("执行了没有?");
}
#endregion
Console.WriteLine("执行了没有?");
return null;
}
/// <summary>
/// 判断是否满足每2天提醒一次
/// </summary>
/// <param name="reminderDays"></param>
/// <param name="startDate"></param>
/// <returns></returns>
public bool IsSend(int reminderDays, DateTime? oldStartDate)
{
var nowDay = DateTime.Now;
bool result = false;
//if (reminderDays > 0 && oldStartDate.HasValue)
//{
// DateTime startDate = oldStartDate.Value;
// DateTime reminderStartDate = startDate.AddDays(-reminderDays);
// // 计算当前时间与提醒开始日期之间的天数差
// double daysSinceReminderStart = (nowDay - reminderStartDate).TotalDays;
// // 检查是否在提醒期内且满足每隔2天的条件
// if (daysSinceReminderStart >= 0 && daysSinceReminderStart <= reminderDays)
// {
// // 检查是否每隔2天(包括第0天)
// if (daysSinceReminderStart % 2 == 0)
// {
// result = true;
// }
// }
//}
if (reminderDays > 0 && oldStartDate.HasValue)
{
DateTime reminderStartDate = oldStartDate.Value.AddDays(-reminderDays);
// 计算当前时间与提醒开始日期之间的天数差
double totalDaysSinceReminderStart = (nowDay - reminderStartDate).TotalDays;
int daysSinceReminderStart = (int)Math.Floor(totalDaysSinceReminderStart);
// 检查是否在提醒期内(包括开始和结束当天)
if (daysSinceReminderStart >= 0 && daysSinceReminderStart <= reminderDays)
{
// 检查是否满足每隔2天的条件(第0天、第2天、第4天...)
// 或者如果是最后一天(reminderDays)也要提醒
if (daysSinceReminderStart % 2 == 0 || daysSinceReminderStart == reminderDays)
{
result = true;
// 确保最后一天只提醒一次(如果reminderDays是偶数,%2==0已经包含)
//if (daysSinceReminderStart == reminderDays && daysSinceReminderStart % 2 != 0)
//{
// // 最后一天且不是偶数天,单独处理
//}
}
}
}
return result;
}
/// <summary>
/// 消息推送信息
......@@ -318,7 +379,7 @@ LEFT JOIN rb_travel_config as c on c.ID=b.ConfigID
{
List<string> emailRecipientsList = new List<string>();
if (!string.IsNullOrWhiteSpace(mpcModel.EmailRecipients))
{
try
......@@ -338,7 +399,7 @@ LEFT JOIN rb_travel_config as c on c.ID=b.ConfigID
{
}
}
}
catch (Exception ex)
{
......
......@@ -61,11 +61,11 @@
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RebornTimerServer.cs">
<Compile Include="RebornTimerHuaTuServer.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RebornTimerServer.Designer.cs">
<DependentUpon>RebornTimerServer.cs</DependentUpon>
<Compile Include="RebornTimerHuaTuServer.Designer.cs">
<DependentUpon>RebornTimerHuaTuServer.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
......
namespace REBORN.HuaTuQUART
{
partial class RebornTimerServer
partial class RebornTimerHuaTuServer
{
/// <summary>
/// 必需的设计器变量。
......
......@@ -11,9 +11,9 @@ using System.Threading.Tasks;
namespace REBORN.HuaTuQUART
{
partial class RebornTimerServer : ServiceBase
partial class RebornTimerHuaTuServer : ServiceBase
{
public RebornTimerServer()
public RebornTimerHuaTuServer()
{
InitializeComponent();
}
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<appSettings>
<add key="VoiceIndexPath" value="SearchIndex\\Voice" />
<!--更新汇率时间间隔以及获取第三方汇率https://www.cngold.org/fx/huansuan.html金投网-->
<add key="WithIntervalInMinutes" value="30" />
<add key="Number" value="1" />
<add key="Referer" value="https://www.cngold.org/fx/huansuan.html" />
<add key="RequestURL" value="https://api.jijinhao.com/plus/convert.htm" />
<!--获取中国银行实时汇率-->
<add key="ChinaBankReferer" value="http://srh.bankofchina.com/search/whpj/search_cn.jsp" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<!--Mongo配置-->
<add key="Mongo" value="mongodb://admin:Viitto2018@172.16.48.131:27017/?authSource=admin" />
<!--Mongo数据库名称-->
<add key="MongoDBName" value="DMC" />
<!--IM 配置-->
<add key="ImKey" value="b612b31e837c79c68f141aeb719d2b20" />
<add key="ImSecret" value="66000451fb72" />
<!--Redis配置-->
<add key="RedisServer" value="172.16.48.131" />
<add key="RedisPort" value="6379" />
<add key="RedisPwd" value="Viitto2018" />
<add key="IsOnline" value="true" />
</appSettings>
<connectionStrings>
<add name="DefaultConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_user;CharSet=utf8;Convert Zero Datetime=true;" />
<!--allow zero datetime=true;Convert Zero Datetime=true;-->
<add name="DMCConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_dmc;CharSet=utf8;Convert Zero Datetime=true;" />
<!--日志数据库-->
<add name="LogConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_log;CharSet=utf8;Convert Zero Datetime=true;" />
<!--销售数据库-->
<add name="SellConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_sell;CharSet=utf8;Convert Zero Datetime=true;" />
<!--财务数据库-->
<add name="FinanceConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_finance;CharSet=utf8;Convert Zero Datetime=true;" />
<!--国内票务-->
<add name="DomesticConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_domestic_ticket;CharSet=utf8;Convert Zero Datetime=true;" />
<!--统计数据库-->
<add name="DataStatisticsConnection" providerName="MySql.Data.MySqlClient" connectionString="server=rm-bp1tj77h6kp0d02fb.mysql.rds.aliyuncs.com;port=3306;user id=reborn;password=Reborn@2018;database=uat_reborn_datastatistics;CharSet=utf8; Convert Zero Datetime=true;" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.86.0.518" newVersion="0.86.0.518" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.14.0" newVersion="8.0.14.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.9.0" newVersion="2.0.9.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
\ No newline at end of file
namespace REBORN.HuaTuQuartClient
{
partial class ClientServerControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnStopServer = new System.Windows.Forms.Button();
this.btnUninstallServer = new System.Windows.Forms.Button();
this.btnStartServer = new System.Windows.Forms.Button();
this.btnInstallationServer = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnStopServer
//
this.btnStopServer.Location = new System.Drawing.Point(12, 56);
this.btnStopServer.Name = "btnStopServer";
this.btnStopServer.Size = new System.Drawing.Size(75, 23);
this.btnStopServer.TabIndex = 6;
this.btnStopServer.Text = "停止服务";
this.btnStopServer.UseVisualStyleBackColor = true;
this.btnStopServer.Click += new System.EventHandler(this.btnStopServer_Click);
//
// btnUninstallServer
//
this.btnUninstallServer.Location = new System.Drawing.Point(142, 56);
this.btnUninstallServer.Name = "btnUninstallServer";
this.btnUninstallServer.Size = new System.Drawing.Size(75, 23);
this.btnUninstallServer.TabIndex = 7;
this.btnUninstallServer.Text = "卸载服务";
this.btnUninstallServer.UseVisualStyleBackColor = true;
this.btnUninstallServer.Click += new System.EventHandler(this.btnUninstallServer_Click);
//
// btnStartServer
//
this.btnStartServer.Location = new System.Drawing.Point(142, 12);
this.btnStartServer.Name = "btnStartServer";
this.btnStartServer.Size = new System.Drawing.Size(75, 23);
this.btnStartServer.TabIndex = 5;
this.btnStartServer.Text = "启动服务";
this.btnStartServer.UseVisualStyleBackColor = true;
this.btnStartServer.Click += new System.EventHandler(this.btnStartServer_Click);
//
// btnInstallationServer
//
this.btnInstallationServer.Location = new System.Drawing.Point(12, 12);
this.btnInstallationServer.Name = "btnInstallationServer";
this.btnInstallationServer.Size = new System.Drawing.Size(75, 23);
this.btnInstallationServer.TabIndex = 4;
this.btnInstallationServer.Text = "安装服务";
this.btnInstallationServer.UseVisualStyleBackColor = true;
this.btnInstallationServer.Click += new System.EventHandler(this.btnInstallationServer_Click);
//
// ClientServerControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(265, 86);
this.Controls.Add(this.btnStopServer);
this.Controls.Add(this.btnUninstallServer);
this.Controls.Add(this.btnStartServer);
this.Controls.Add(this.btnInstallationServer);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ClientServerControl";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Reborn定时器服务控制台";
this.Load += new System.EventHandler(this.SocketServerControl_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnStopServer;
private System.Windows.Forms.Button btnUninstallServer;
private System.Windows.Forms.Button btnStartServer;
private System.Windows.Forms.Button btnInstallationServer;
}
}
\ No newline at end of file
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Data;
using System.Drawing;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace REBORN.HuaTuQuartClient
{
public partial class ClientServerControl : Form
{
public ClientServerControl()
{
InitializeComponent();
}
private static string serviceFilePath = $"{Application.StartupPath}\\REBORN.HuaTuQUART.exe";
private static string serviceName = "RebornTimerHuaTuServer";
private void SocketServerControl_Load(object sender, EventArgs e)
{
if (this.IsServiceExisted(serviceName))
{
this.btnInstallationServer.Enabled = false;
this.btnUninstallServer.Enabled = true;
if (ServiceStatus(serviceName) == ServiceControllerStatus.Running)
{
this.btnStartServer.Enabled = false;
this.btnStopServer.Enabled = true;
}
else
{
this.btnStartServer.Enabled = true;
this.btnStopServer.Enabled = false;
}
}
else
{
this.btnInstallationServer.Enabled = true;
this.btnStartServer.Enabled = false;
this.btnStopServer.Enabled = false;
this.btnUninstallServer.Enabled = false;
}
}
private void btnInstallationServer_Click(object sender, EventArgs e)
{
if (!this.IsServiceExisted(serviceName))
{
this.InstallService(serviceFilePath);
}
this.btnInstallationServer.Enabled = false;
this.btnStartServer.Enabled = true;
this.btnStopServer.Enabled = false;
this.btnUninstallServer.Enabled = true;
}
private void btnStartServer_Click(object sender, EventArgs e)
{
if (this.IsServiceExisted(serviceName))
{
if (ServiceStatus(serviceName) == ServiceControllerStatus.Running)
{
this.ServiceStop(serviceName);
}
this.ServiceStart(serviceName);
this.btnStartServer.Enabled = false;
this.btnStopServer.Enabled = true;
}
else
{
MessageBox.Show("服务不存在");
}
}
private void btnStopServer_Click(object sender, EventArgs e)
{
if (this.IsServiceExisted(serviceName))
{
this.ServiceStop(serviceName);
this.btnStartServer.Enabled = true;
this.btnStopServer.Enabled = false;
}
else
{
MessageBox.Show("服务不存在");
}
}
private void btnUninstallServer_Click(object sender, EventArgs e)
{
if (this.IsServiceExisted(serviceName))
{
this.ServiceStop(serviceName);
this.UninstallService(serviceFilePath);
this.btnInstallationServer.Enabled = true;
this.btnStartServer.Enabled = false;
this.btnStopServer.Enabled = false;
this.btnUninstallServer.Enabled = false;
}
else
{
MessageBox.Show("服务不存在");
}
}
//判断服务是否存在
private bool IsServiceExisted(string serviceName)
{
ServiceController[] services = ServiceController.GetServices();
foreach (ServiceController sc in services)
{
if (sc.ServiceName.ToLower() == serviceName.ToLower())
{
return true;
}
}
return false;
}
//安装服务
private void InstallService(string serviceFilePath)
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
IDictionary savedState = new Hashtable();
installer.Install(savedState);
installer.Commit(savedState);
}
}
//卸载服务
private void UninstallService(string serviceFilePath)
{
using (AssemblyInstaller installer = new AssemblyInstaller())
{
installer.UseNewContext = true;
installer.Path = serviceFilePath;
installer.Uninstall(null);
}
}
//启动服务
private void ServiceStart(string serviceName)
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Stopped)
{
control.Start();
}
}
}
//停止服务
private void ServiceStop(string serviceName)
{
using (ServiceController control = new ServiceController(serviceName))
{
if (control.Status == ServiceControllerStatus.Running)
{
control.Stop();
}
}
}
//获取服务状态
private ServiceControllerStatus ServiceStatus(string serviceName)
{
using (ServiceController control = new ServiceController(serviceName))
{
return control.Status;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs\perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="errorAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<File value="Logs/err.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="infoAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/info.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="debugAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="DEBUG" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/debug.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
</layout>
</appender>
<appender name="perfAppender" type="log4net.Appender.RollingFileAppender">
<filter type="log4net.Filter.LevelMatchFilter">
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<file value="Logs/perf.log" />
<encoding value="utf-8"/>
<preserveLogFileNameExtension value="true" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<datePattern value="yyyyMMdd" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="errorAppender" />
<appender-ref ref="infoAppender" />
<appender-ref ref="debugAppender" />
</root>
<logger name="Performance" additivity="false">
<level value="ALL" />
<appender-ref ref="perfAppender" />
</logger>
</log4net>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace REBORN.HuaTuQuartClient
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ClientServerControl());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("REBORN.HuaTuQuartClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("REBORN.HuaTuQuartClient")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("207cbf6e-e96c-4b36-bb10-f69ccf7cb964")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace REBORN.HuaTuQuartClient.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("REBORN.HuaTuQuartClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace REBORN.HuaTuQuartClient.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{207CBF6E-E96C-4B36-BB10-F69CCF7CB964}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>REBORN.HuaTuQuartClient</RootNamespace>
<AssemblyName>REBORN.HuaTuQuartClient</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=2.0.9.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.10\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="SuperSocket.Common, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.Common.dll</HintPath>
</Reference>
<Reference Include="SuperSocket.Facility, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.Facility.dll</HintPath>
</Reference>
<Reference Include="SuperSocket.SocketBase, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.1.6.6.1\lib\net45\SuperSocket.SocketBase.dll</HintPath>
</Reference>
<Reference Include="SuperSocket.SocketEngine, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.Engine.1.6.6.1\lib\net45\SuperSocket.SocketEngine.dll</HintPath>
</Reference>
<Reference Include="SuperSocket.SocketService, Version=1.6.6.1, Culture=neutral, PublicKeyToken=6c80000676988ebb, processorArchitecture=MSIL">
<HintPath>..\packages\SuperSocket.Engine.1.6.6.1\lib\net45\SuperSocket.SocketService.exe</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClientServerControl.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ClientServerControl.Designer.cs">
<DependentUpon>ClientServerControl.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="ClientServerControl.resx">
<DependentUpon>ClientServerControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Config\log4net.config" />
<None Include="Config\log4net.unix.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="supersocket.cmd" />
<None Include="supersocket.sh" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.10" targetFramework="net461" />
<package id="SuperSocket" version="1.6.6.1" targetFramework="net461" />
<package id="SuperSocket.Engine" version="1.6.6.1" targetFramework="net461" />
</packages>
\ No newline at end of file
@echo off
SuperSocket.SocketService.exe -c %1 %2
\ No newline at end of file
#!/bin/bash
mono SuperSocket.SocketService.exe -c $1 $2
\ No newline at end of file
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