Commit d258fc7e authored by liudong1993's avatar liudong1993
parents c0d08e85 57301dd3
......@@ -1779,7 +1779,7 @@ namespace Mall.Module.User
}
else
{
LogHelper.Write(string.Format("SendMemberLevelMsg:wenXinResult:{0}", wenXinResult));
LogHelper.Write(string.Format("GetLiveInfo:wenXinResult:{0}", wenXinResult));
}
}
return false;
......
......@@ -22,19 +22,50 @@ namespace Mall.Repository.Finance
string where = $" where 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Finance_Record.TenantId)}={dmodel.TenantId}";
where += $@" and {nameof(RB_Finance_RecordDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Finance_Record.MallBaseId)}={dmodel.MallBaseId}";
where += $@" and {nameof(RB_Finance_RecordDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Finance_Record.Type)}={dmodel.Type}";
where += $@" and {nameof(RB_Finance_RecordDetail.Type)}={dmodel.Type}";
}
string sql = $@"SELECT * FROM {TableName} {where} order by Id asc";
return Get<RB_Finance_RecordDetail>(sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Finance_RecordDetail> GetListByOrderIds(string orderIds, RB_Finance_RecordDetail dmodel)
{
string where = $" where 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Finance_RecordDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Finance_RecordDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Finance_RecordDetail.Type)}={dmodel.Type}";
}
if (!string.IsNullOrWhiteSpace(orderIds))
{
where += $@" and {nameof(RB_Finance_RecordDetail.OrderId)} in ({orderIds})";
}
string sql = $@"SELECT * FROM {TableName} {where} order by Id asc";
return Get<RB_Finance_RecordDetail>(sql).ToList();
}
}
}
......@@ -31,6 +31,8 @@ namespace Mall.WebApi.Controllers.User
private readonly UserModule userModule = new UserModule();
private readonly Module.MarketingCenter.CouponModule couponModule = new Module.MarketingCenter.CouponModule();
private readonly Module.MarketingCenter.RechargeModule rechargeModule = new Module.MarketingCenter.RechargeModule();
private readonly MiniProgramModule appletWeChatModule = new MiniProgramModule();
#region 收货地址
/// <summary>
......@@ -1115,5 +1117,58 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Success("",new { rechargeRules , rechargeSettings });
}
#endregion
#region 直播房间信息
[HttpPost]
[Obsolete]
public ApiResult GetLiveHouseList()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
Model.Entity.AppletWeChat.RB_Live_House demodel = JsonConvert.DeserializeObject<Model.Entity.AppletWeChat.RB_Live_House>(RequestParm.msg.ToString());
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
var list = appletWeChatModule.GetLiveHousePageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.roomid,
x.name,
x.anchor_img,
x.anchor_name,
x.cover_img,
x.live_status,
start_time = GetTime(x.start_time),
end_time = GetTime(x.end_time),
});
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 时间戳转为C#格式时间
/// </summary>
/// <param name="timeStamp">Unix时间戳格式</param>
/// <returns>C#格式时间</returns>
[Obsolete]
public static string GetTime(string timeStamp)
{
try
{
DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
long lTime = long.Parse(timeStamp + "0000000");
TimeSpan toNow = new TimeSpan(lTime);
return dtStart.Add(toNow).ToString("yyyy-MM-dd HH:mm:ss");
}
catch (Exception)
{
return "";
}
}
#endregion
}
}
\ No newline at end of file
......@@ -122,8 +122,10 @@ namespace Mall.WindowsService.Module
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat($@" SELECT a.*,b.OrderNo from rb_goods_orderdetail as a LEFT JOIN rb_goods_order as b on a.OrderId=b.OrderId
where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and DATE_FORMAT(b.CreateDate,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d')
and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') and b.OrderStatus in(2,3,4,5,6) ");
where b.TenantId={item.TenantId} and b.MallBaseId={item.MallBaseId} and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')>= DATE_FORMAT('{startDate}','%y-%m-%d')
and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') AND (
b.OrderStatus IN (2, 3, 4, 5, 6) OR ( b.OrderStatus = 7 AND DATE_FORMAT(b.PaymentTime, '%y-%m-%d') >= DATE_FORMAT('{startDate}', '%y-%m-%d')
AND DATE_FORMAT(b.PaymentTime, '%y-%m-%d') < DATE_FORMAT('{endDate}', '%y-%m-%d')))");
Helper.LogHelper.Write("sql语句:" + builder.ToString());
var goodsDetailList = goodsOrderDetailRepository.Get<RB_Goods_OrderDetail_Extend>(builder.ToString()).ToList();
......@@ -136,9 +138,33 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
record.Type = 1;
record.CreateDate = System.DateTime.Now;
record.RecordDetailList = new List<RB_Finance_RecordDetail>();
foreach (var orderGoodsItem in goodsDetailList)
List<RB_Finance_RecordDetail> orderGoodsList = new List<RB_Finance_RecordDetail>();
if (goodsDetailList != null && goodsDetailList.Any())//获取当前需要生成入款单的订单是否已经生成财务单据
{
string orderIds = string.Join(",", goodsDetailList.Select(x => x.OrderId));
orderGoodsList = financeRecordDetailRepository.GetListByOrderIds(orderIds, new RB_Finance_RecordDetail { TenantId = item.TenantId, MallBaseId = item.MallBaseId, Type = 1 });
}
else
{
Helper.LogHelper.Write("暂无数据");
return false;
}
foreach (var orderGoodsItem in goodsDetailList)
{
bool isAdd = true;
if (orderGoodsList != null && orderGoodsList.Any())
{
if (orderGoodsList.Where(x => x.OrderDetailId == orderGoodsItem.Id).Count() > 0)//判断订单是否已经有入款单据生成
{
isAdd = false;
}
}
if (isAdd)
{
if (orderGoodsItem.Final_Price > 0)
{
var newOrderGoods = new RB_Goods_OrderDetail_Extend();
......@@ -176,7 +202,10 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
};
record.RecordDetailList.Add(financeRecordDetail);
}
}
if (result!=null&& result.Any())
{
var detailList = result.Select(x => new
{
CostTypeId = x.FinanceType == 1 ? item.IncomeCostTypeId : item.FreightCostTypeId,
......@@ -228,6 +257,7 @@ and DATE_FORMAT(b.CreateDate,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') an
}
}
}
}
catch (Exception ex)
{
......
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