Commit da3e6ffd authored by 吴春's avatar 吴春

提交代码

parent 854f1d25
......@@ -70,6 +70,16 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 储值卡收入费用
/// </summary>
public int? DepositIncomeTypeId
{
get;
set;
}
/// <summary>
/// 运费收入费用
/// </summary>
......
......@@ -16,6 +16,7 @@ namespace Mall.WindowsService.Helper
private static int inTimer4 = 0;
private static int inTimer5 = 0;
private static int inTimer6 = 0;
private static int inTimer7 = 0;
/// <summary>
/// 收入单子服务开始执行方法
/// </summary>
......@@ -182,5 +183,30 @@ namespace Mall.WindowsService.Helper
Interlocked.Exchange(ref inTimer6, 0);
}
}
/// <summary>
///用户储值卡赠送状态更新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void DepositIncomeFinanceShelves(object sender, System.Timers.ElapsedEventArgs e)
{
if (Interlocked.Exchange(ref inTimer7, 1) == 0)
{
try
{
string str = Common.Config.GetConnectionString("DefaultConnection");
LogHelper.Write("DepositIncomeFinanceShelves=====Start" + str);
Module.FinanceModule.DepositIncomeFinanceModule();
LogHelper.Write("DepositIncomeFinanceShelves=====End");
}
catch (Exception ex)
{
LogHelper.Write("DepositIncomeFinanceShelves=====ex" + ex.Message);
}
Interlocked.Exchange(ref inTimer7, 0);
}
}
}
}
......@@ -3,6 +3,11 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<StartupObject>Mall.WindowsService.Program</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>D:\project\GitProject\Mall\oldMall\Mall.WindowsService\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
<_LastSelectedProfileId>D:\project\GitProject\Shopping\Mall.WindowsService\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
</PropertyGroup>
<ItemGroup>
<Compile Update="WindowsService.cs">
......
......@@ -37,7 +37,7 @@ namespace Mall.WindowsService.Module
builder.AppendFormat(@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND GoodsStatus<>1
WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND ArticleStatus<>1
", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var list = educationArticleRepository.Get<RB_Education_Article>(builder.ToString()).ToList();
......@@ -67,7 +67,7 @@ WHERE Status=0 AND '{0}'>=ShelvesDate AND '{0}'<=DownDate AND GoodsStatus<>1
builder.AppendFormat(@"
SELECT ID,ArticleStatus,ShelvesDate,DownDate
FROM rb_education_article
WHERE Status=0 AND DownDate<='{0}' AND GoodsStatus=1 ", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
WHERE Status=0 AND DownDate<='{0}' AND ArticleStatus=1 ", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var list = educationArticleRepository.Get<RB_Education_Article>(builder.ToString()).ToList();
if (list != null && list.Count > 0)
......@@ -97,7 +97,7 @@ SELECT *
FROM RB_Member_DepositBuy
WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 ", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var list = educationArticleRepository.Get<Model.Entity.User.RB_Member_DepositBuy>(builder.ToString()).ToList();
var list = memberDepositBuyRepository.Get<Model.Entity.User.RB_Member_DepositBuy>(builder.ToString()).ToList();
if (list != null && list.Count > 0)
{
foreach (var item in list)
......@@ -107,7 +107,7 @@ WHERE Status=1 AND SendTime<='{0}' and SendStatus=2 ", DateTime.Now.ToString("yy
{nameof(Model.Entity.User.RB_Member_DepositBuy.SendStatus),0 },
{nameof(Model.Entity.User.RB_Member_DepositBuy.SendTime),null }
};
flag = educationArticleRepository.Update(fileds, new WhereHelper(nameof(Model.Entity.User.RB_Member_DepositBuy.Id), item.Id));
flag = memberDepositBuyRepository.Update(fileds, new WhereHelper(nameof(Model.Entity.User.RB_Member_DepositBuy.Id), item.Id));
}
}
return flag;
......
......@@ -475,7 +475,7 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
var addFinance = false;
DateTime startDate = System.DateTime.Now.AddDays(-1);
var recordModel = financeRecordRepository.GetList(new RB_Finance_Record_Extend { TenantId = item.TenantId, MallBaseId = item.MallBaseId, Type = 1 }).OrderByDescending(x => x.CreateDate).FirstOrDefault();
var recordModel = financeRecordRepository.GetList(new RB_Finance_Record_Extend { TenantId = item.TenantId, MallBaseId = item.MallBaseId, Type = 5 }).OrderByDescending(x => x.CreateDate).FirstOrDefault();
if (recordModel == null)//今天没生成单据
{
if (Convert.ToDateTime(item.StartTime.Value.AddDays(item.IntervalDay ?? 0).ToString("yyyy-MM-dd 00:00:00")) <= Convert.ToDateTime(System.DateTime.Now.ToString("yyyy-MM-dd 00:00:00")))//判断开始时间加上执行周期是否等于当前日期
......@@ -511,7 +511,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
RB_Finance_Record_Extend record = new RB_Finance_Record_Extend();
record.MallBaseId = item.MallBaseId;
record.TenantId = item.TenantId;
record.Type = 1;
record.Type = 5;
record.CreateDate = System.DateTime.Now;
record.RecordDetailList = new List<RB_Finance_RecordDetail_Extend>();
......@@ -587,7 +587,7 @@ and DATE_FORMAT(a.PayTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND a
}
var detailList = goodsDetailList.Select(x => new
{
CostTypeId = item.IncomeCostTypeId ,
CostTypeId = item.DepositIncomeTypeId,
Number = 1,
OriginalMoney =x.SalePrice,
UnitPrice = x.SalePrice,
......
......@@ -18,7 +18,7 @@ namespace Mall.WindowsService
private System.Timers.Timer timer5; //定时上架和下架
private System.Timers.Timer timer6; //资讯定时上架和下架
private System.Timers.Timer timer7; //会员储值卡赠送状态更新
private System.Timers.Timer timer8;//会员购买储值卡收入
public WindowsService()
{
InitializeComponent();
......@@ -69,6 +69,7 @@ namespace Mall.WindowsService
#endregion
#region 商品定时上下架
timer5 = new System.Timers.Timer();
timer5 = new System.Timers.Timer
{
......@@ -76,7 +77,7 @@ namespace Mall.WindowsService
};
timer5.Elapsed += new System.Timers.ElapsedEventHandler(helper.GoodsShelves);
timer5.Enabled = true;
#region
#endregion
#region 资讯上下架
......@@ -98,7 +99,20 @@ namespace Mall.WindowsService
timer7.Elapsed += new System.Timers.ElapsedEventHandler(helper.MemberDepositBuyShelves);
timer7.Enabled = true;
#endregion
#region 储值卡收入
timer8 = new System.Timers.Timer();
timer8 = new System.Timers.Timer
{
Interval = 1000 * (60 * 30) //10分钟调用一次
};
timer8.Elapsed += new System.Timers.ElapsedEventHandler(helper.DepositIncomeFinanceShelves);
timer8.Enabled = true;
#endregion
}
protected override void OnStop()
......
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