Commit 4554fa9d authored by 吴春's avatar 吴春

提交代码

parent cfb7aaee
This diff is collapsed.
......@@ -2,9 +2,11 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User;
using Mall.Model.Query;
using Mall.Module.MarketingCenter;
......@@ -169,7 +171,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
new ExcelColumn(value: "总代理返佣") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "总代理") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "特一级返佣") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "特一级") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "特一级") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "一级返佣") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "一级返佣人") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
new ExcelColumn(value: "二级返佣") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER },
......@@ -253,6 +255,92 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
/// <summary>
/// 获取商品
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetGoodsList(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
var query = JsonConvert.DeserializeObject<RB_Goods_Extend>(requestParm.msg.ToString());
query.TenantId = requestParm.TenantId;
query.MallBaseId = requestParm.MallBaseId;
var oldLogisticsList = productModule.GetGoodsList(query).Take(15);
return ApiResult.Success("", oldLogisticsList);
}
/// <summary>
/// 获取分销商
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetDistributorInfoList(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
var query = JsonConvert.DeserializeObject<RB_Distributor_Info_Extend>(requestParm.msg.ToString());
query.TenantId = requestParm.TenantId;
query.MallBaseId = requestParm.MallBaseId;
var oldLogisticsList = productModule.GetDistributorInfoList(query).Take(15);
return ApiResult.Success("", oldLogisticsList);
}
/// <summary>
/// 获取分销商
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetTotalOrderProfitLoss(object requestMsg)
{
var requestParm = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
OrderStatistics_Query demodel = JsonConvert.DeserializeObject<OrderStatistics_Query>(requestParm.msg.ToString());
demodel.TenantId = requestParm.TenantId;
demodel.MallBaseId = requestParm.MallBaseId;
var list = statisticsModule.GetAllOrderProfitLossList(demodel);
foreach (var item in list)
{
item.ALLCommission = item.CostFreight + item.CostMoney + item.PackingMoney + item.GoodsFreight + item.OneCommission + item.TwoCommission + item.OtherPrice;
item.NoPaid = item.ALLCommission - item.Paid;
item.GrossProfit = item.AllPrice - item.ALLCommission;
item.GrossProfitRate = item.AllPrice == 0 ? 0 : Math.Round((item.GrossProfit / item.AllPrice), 2, MidpointRounding.AwayFromZero);
}
var retult = new
{
TotalFinal_Price = list.Sum(x => x.Final_Price),//结算款小计
TotalFreightMoney = list.Sum(x => string.IsNullOrWhiteSpace(x.FreightMoney) ? 0 : Convert.ToDecimal(x.FreightMoney)),//运费小计
TotalAllPrice = list.Sum(x => x.AllPrice),//已收小计
TotalNoAllPrice = list.Sum(x => 0),//未收小计
TotalPay = list.Sum(x => x.AllPrice),//合计小计
TotalCostMoney = list.Sum(x => x.CostMoney),//采购成本小计
TotalPackingMoney = list.Sum(x => x.PackingMoney),//包装费摊销小计
TotalCostFreight = list.Sum(x => x.CostFreight),//快递成本小计
TotalGoodsFreight = list.Sum(x => x.GoodsFreight),//商品运费小计
TotalBranchCommission = list.Sum(x => x.BranchCommission),//分公司小计
TotalGeneralAgentCommission = list.Sum(x => x.GeneralAgentCommission),//总代理小计
TotalSpecialCommission = list.Sum(x => x.SpecialCommission),//特一级小计
TotalOneCommission = list.Sum(x => x.OneCommission),//一级返佣小计
TotalOneTwoCommission = list.Sum(x => x.TwoCommission),//二级返佣小计
TotalOneOtherPrice = list.Sum(x => x.OtherPrice),//其他费用小计
TotalALLCommission = list.Sum(x => x.ALLCommission),//营业合计小计
TotalPaid = list.Sum(x => x.Paid),//已付小计
TotalNoPaid = list.Sum(x => x.NoPaid),//未付小计
TotalGrossProfit = list.Sum(x => x.GrossProfit),//毛利小计
};
return ApiResult.Success("", retult);
}
#endregion
}
}
\ No newline at end of file
......@@ -256,8 +256,8 @@ and DATE_FORMAT(b.PaymentTime,'%y-%m-%d')<DATE_FORMAT('{endDate}','%y-%m-%d') A
WBMoney = (result.Sum(x => x.FinanceType == 1 ? (x.Final_Price ?? 0) : (x.FreightMoney ?? 0))) - OriginalFee,
RB_Branch_Id = Config.IncomeBranchId,
RemitterName = item.RemitterName,
TradeDate = System.DateTime.Now.ToString("yyyy-MM-dd"),
AccountNumber = System.DateTime.Now.ToString("yyyyMMdd"),
TradeDate = System.DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"),
AccountNumber = System.DateTime.Now.AddDays(-1).ToString("yyyyMMdd"),
TemplateId = item.WorkFlowId,
OrderSource = 16,
Remark = System.DateTime.Now.ToString("yyyy年MM月dd日") + "自动生成财务单据",
......
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