目录
1 Himall商城BillingApplication
1.1 获取营销服务费用明细(需移至营销服务BLL但目前没有此BLL)
1.2 分页获取平台的收支明细
1.3 非分页获取平台的收支明细
///
/// 获取营销服务费用明细(需移至营销服务BLL但目前没有此BLL)
///
/// query">营销费用购买Id
///
public static MarketServicesRecord GetMarketServiceRecord(long Id, long? shopId = null)
{
var model = MarketApplication.GetShopMarketServiceRecordInfo(Id);
if (shopId.HasValue && shopId.Value != model.ActiveMarketServiceInfo.ShopId)
{
throw new Core.HimallException("找不到店铺的购买明细");
}
var record = ConvertToMarketServicesRecord(model);
return record;
}
private static MarketServicesRecord ConvertToMarketServicesRecord(MarketServiceRecordInfo info)
{
MarketServicesRecord record = null;
if (info != null)
{
record = new MarketServicesRecord();
record.BuyTime = info.BuyTime.ToString("yyyy-MM-dd HH:mm:ss");
record.BuyingCycle = info.StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "至" + info.EndTime.ToString("yyyy-MM-dd HH:mm:ss");
record.MarketType = (info.ActiveMarketServiceInfo.TypeId).ToDescription();
record.Price = info.Price;
record.ShopId = info.ActiveMarketServiceInfo.ShopId;
record.ShopName = info.ActiveMarketServiceInfo.ShopName;
}
return record;
}
///
/// 分页获取平台的收支明细
///
/// query">查询实体
///
public static QueryPageModel
{
var model = _iBillingService.GetPlatAccountItem(query);
QueryPageModel
item.Total = model.Total;
List
foreach (var m in model.Models)
{
PlatAccountItem PlatAccountItem = new PlatAccountItem();
PlatAccountItem.AccountNo = m.AccountNo;
PlatAccountItem.Balance = m.Balance.ToString();
PlatAccountItem.CreateTime = m.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
PlatAccountItem.DetailId = m.DetailId;
PlatAccountItem.PlatAccountType = m.TradeType;
if (m.IsIncome)
{
PlatAccountItem.Income = m.Amount.ToString();
}
else
{
PlatAccountItem.Expenditure = m.Amount.ToString();
}
PlatAccountItem.Id = m.Id;
items.Add(PlatAccountItem);
}
item.Models = items;
return item;
}
///
/// 分页获取平台的收支明细
///
/// query">查询实体
///
public static List
{
var models = _iBillingService.GetPlatAccountItemNoPage(query);
List
foreach (var m in models)
{
PlatAccountItem PlatAccountItem = new PlatAccountItem();
PlatAccountItem.AccountNo = m.AccountNo;
PlatAccountItem.Balance = m.Balance.ToString();
PlatAccountItem.CreateTime = m.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
PlatAccountItem.DetailId = m.DetailId;
PlatAccountItem.PlatAccountType = m.TradeType;
if (m.IsIncome)
{
PlatAccountItem.Income = m.Amount.ToString();
}
else
{
PlatAccountItem.Expenditure = m.Amount.ToString();
}
PlatAccountItem.Id = m.Id;
items.Add(PlatAccountItem);
}
return items;
}