Commit 2be0ea2a authored by 吴春's avatar 吴春
parents 6d75fcdf bdbc7607
......@@ -22,6 +22,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public int? GoodsId { get; set; }
/// <summary>
/// 商品购买的数量
/// </summary>
public int? GoodsBuyNum { get; set; }
/// <summary>
/// 视频播放方向 1向下 2向上
/// </summary>
public int? SelectVideoDirection { get; set; }
......
......@@ -1607,8 +1607,10 @@ namespace Mall.Module.Product
}
price_member_max = Math.Round(price_member_max, 2, MidpointRounding.AwayFromZero);
price_member_min = Math.Round(price_member_min, 2, MidpointRounding.AwayFromZero);
price_min = Math.Round(price_min, 2, MidpointRounding.AwayFromZero);
price_max = Math.Round(price_max, 2, MidpointRounding.AwayFromZero);
//price_min = Math.Round(price_min, 2, MidpointRounding.AwayFromZero);
//price_max = Math.Round(price_max, 2, MidpointRounding.AwayFromZero);//先使用会员的
price_min = price_member_min;
price_max = price_member_max;
#endregion
#region 订单信息
......@@ -3164,6 +3166,7 @@ namespace Mall.Module.Product
//查询分类
string ids = string.Join(",", list.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var olist = goods_OrderRepository.GetGoodsOrderNum(ids);
foreach (var item in list)
{
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
......@@ -3176,6 +3179,8 @@ namespace Mall.Module.Product
item.CoverImage = CarouselIdList[0];
//轮播图
}
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
}
}
return list;
......
......@@ -123,8 +123,14 @@ namespace Mall.Module.User
/// 财务单据规则
/// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
private Repository.User.RB_Member_CouponRepository memberCouponRepository = new Repository.User.RB_Member_CouponRepository();
/// <summary>
/// 用户优惠券
/// </summary>
private RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
#region 基础配置
......@@ -4143,6 +4149,20 @@ namespace Mall.Module.User
#endregion
#region 获取分销海报
/// <summary>
/// 根据查询条件获取分销海报实体
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public RB_MiniProgram_FenXiaoPoster_Extend GetFenXiaoPosterEntityModule(RB_MiniProgram_FenXiaoPoster_Extend query)
{
return fenXiaoPosterRepository.GetEntityExtRepository(query);
}
#endregion
#region 获取小程序码
/// <summary>
......
......@@ -19,6 +19,7 @@ namespace Mall.Repository.BaseSetUp
/// 表名称
/// </summary>
public string MinTableName { get { return nameof(RB_MiniProgram); } }
/// <summary>
/// 获取小程序列表
/// </summary>
......
......@@ -393,7 +393,7 @@ WHERE od.GoodsId={goodsId} and o.`Status`=0 and o.OrderStatus <> 7 GROUP BY o.Us
public List<RB_Goods_Order_Extend> GetGoodsOrderNum(string goodsIds)
{
string sql2 = $@"
SELECT od.GoodsId ,SUM(od.Number) as GoodsNum FROM rb_goods_order o
SELECT od.GoodsId ,SUM(od.Number) as OrderNum FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE od.GoodsId in({goodsIds}) and o.`Status`=0 and o.OrderStatus <> 7 group by od.GoodsId";
return Get<RB_Goods_Order_Extend>(sql2).ToList();
......@@ -889,5 +889,34 @@ GROUP BY od.GoodsId,o.OrderId
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
#endregion
#region
/// <summary>
/// 获取超时取消的订单列表
/// </summary>
/// <param name="cancelTime"></param>
/// <param name="t"></param>
/// <param name="m"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetCanCancelOrderList(int cancelTime,int t,int m)
{
string sql = $@"SELECT OrderId,UserId,OrderNo,OrderSource,CouponsIds FROM rb_goods_order where TenantId ={t} and MallBaseId ={m} and `Status`=0 and OrderStatus =1 and DATE_ADD(CreateDate,INTERVAL {cancelTime} MINUTE) < '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
/// <summary>
/// 获取可自动收货的订单列表
/// </summary>
/// <param name="day"></param>
/// <param name="t"></param>
/// <param name="m"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetCanReceivingOrderList(int day, int t, int m)
{
string sql = $@"SELECT OrderId,UserId,OrderNo,OrderSource,CouponsIds FROM rb_goods_order where TenantId ={t} and MallBaseId ={m} and `Status`=0 and OrderStatus =3 and DATE_ADD(DeliveryTime,INTERVAL {day} DAY) < '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}'";
return Get<RB_Goods_Order_Extend>(sql).ToList();
}
#endregion
}
}
......@@ -172,7 +172,7 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.GoodsStatus = 1;//只查询销售中的
var list = productModule.GetAppletGoodsPageListForZY(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
List<object> RList = new List<object>();
int UserId = demodel.UserId ?? 0;
int UserId = parms.UserId;
RB_Member_User_Extend userModel = new RB_Member_User_Extend();
RB_Member_Grade_Extend memberGrade = new RB_Member_Grade_Extend();
if (UserId > 0)
......
......@@ -1089,6 +1089,7 @@ namespace Mall.WebApi.Controllers.MallBase
x.SellingPrice,
x.InventoryNum,
x.SalesNum,
x.GoodsBuyNum,
x.IsQuickBuy,
x.GoodsStatus,
x.TenantId,
......
......@@ -1027,6 +1027,24 @@ namespace Mall.WebApi.Controllers.User
#endregion
#region 获取分销海报
/// <summary>
/// 获取分销海报
/// </summary>
/// <returns></returns>
public ApiResult GetFenXiaoPoster()
{
var userInfo = AppletUserInfo;
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_FenXiaoPoster_Extend>(RequestParm.msg.ToString());
extModel.TenantId = userInfo.TenantId;
extModel.MallBaseId = userInfo.MallBaseId;
var result = userModule.GetFenXiaoPosterEntityModule(extModel);
return ApiResult.Success(data: result);
}
#endregion
#region 个人中心余额/积分/优惠券气泡
/// <summary>
/// 个人中心- 积分明细
......
......@@ -28,5 +28,39 @@ namespace Mall.WindowsService.Helper
Interlocked.Exchange(ref inTimer, 0);
}
}
/// <summary>
/// 自动取消订单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void AutoCancelOrder(object sender, System.Timers.ElapsedEventArgs e) {
if (Interlocked.Exchange(ref inTimer, 1) == 0)
{
LogHelper.Write("AutoCancelOrder=====Start");
Module.FinanceModule.AutoCancelOrder();
LogHelper.Write("AutoCancelOrder=====End");
Interlocked.Exchange(ref inTimer, 0);
}
}
/// <summary>
/// 自动收货订单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void AutoReceivingOrder(object sender, System.Timers.ElapsedEventArgs e)
{
if (Interlocked.Exchange(ref inTimer, 1) == 0)
{
if (DateTime.Now.Hour == 1)
{
LogHelper.Write("AutoReceivingOrder=====Start");
Module.FinanceModule.AutoReceivingOrder();
LogHelper.Write("AutoReceivingOrder=====End");
Interlocked.Exchange(ref inTimer, 0);
}
}
}
}
}
......@@ -11,11 +11,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
......
This diff is collapsed.
......@@ -12,6 +12,8 @@ namespace Mall.WindowsService
partial class WindowsService : ServiceBase
{
System.Timers.Timer timer1; //计时器
private System.Timers.Timer timer2; //订单取消计时器
private System.Timers.Timer timer3; //订单自动收货计时器
public WindowsService()
{
......@@ -27,6 +29,29 @@ namespace Mall.WindowsService
timer1.Interval = 1000 * (60 * 30); //60分钟
timer1.Elapsed += new System.Timers.ElapsedEventHandler(helper.RevenueFinance);
timer1.Enabled = true;
#region 订单取消定时器
timer2 = new System.Timers.Timer
{
Interval = 1000 * (60 * 10) //10分钟处理一次
};
timer2.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoCancelOrder);
timer2.Enabled = true;
#endregion
#region 订单自动完成定时器
timer3 = new System.Timers.Timer();
timer2 = new System.Timers.Timer
{
Interval = 1000 * (60 * 60) //60分钟调用一次
};
timer3.Elapsed += new System.Timers.ElapsedEventHandler(helper.AutoReceivingOrder);
timer3.Enabled = true;
#endregion
}
protected override void OnStop()
......@@ -34,6 +59,8 @@ namespace Mall.WindowsService
// TODO: 在此处添加代码以执行停止服务所需的关闭操作。
Helper.LogHelper.Write("主服务停止运行......");
this.timer1.Enabled = false;
this.timer2.Enabled = false;
this.timer3.Enabled = false;
}
}
}
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