|
@@ -1,9 +1,11 @@
|
|
|
using Aspose.Cells;
|
|
|
using Aspose.Words.Tables;
|
|
|
using EyeSoft.Collections.Generic;
|
|
|
+using FluentValidation;
|
|
|
using Google.Protobuf.WellKnownTypes;
|
|
|
using Microsoft.AspNetCore.Mvc.ViewEngines;
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
|
+using Microsoft.Extensions.Hosting;
|
|
|
using MySqlX.XDevAPI.Relational;
|
|
|
using NetUV.Core.Handles;
|
|
|
using NodaTime;
|
|
@@ -2213,7 +2215,7 @@ ORDER BY
|
|
|
|
|
|
//收款退还
|
|
|
designer.SetDataSource(SKTHFeeDt);
|
|
|
- designer.SetDataSource("SKTHCNYTotalCost", $"{SKTHCNYTotalCost.ToString("#0.00")} CNY");
|
|
|
+ designer.SetDataSource("SKTHCNYTotalCost", $"{SKTHCNYTotalCost.ToString("#0.00")}");
|
|
|
|
|
|
//操作提成
|
|
|
designer.SetDataSource(royaltyFeeDt);
|
|
@@ -6522,5 +6524,389 @@ WHERE
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 企业利润
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 企业利润 Excel导出
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="_dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost("CorporateProfitExcelDownload")]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> CorporateProfitExcelDownload(CorporateProfitExcelDownloadDto dto)
|
|
|
+ {
|
|
|
+
|
|
|
+ int portType = dto.PortType,
|
|
|
+ userId = dto.UserId,
|
|
|
+ pageId = dto.PageId;
|
|
|
+ #region 参数验证
|
|
|
+
|
|
|
+ var validationRules = new CorporateProfitExcelDownloadDtoFoalidator();
|
|
|
+ var validResult = await validationRules.ValidateAsync(dto);
|
|
|
+ if (!validResult.IsValid)
|
|
|
+ {
|
|
|
+ var errors = new StringBuilder();
|
|
|
+ foreach (var error in validResult.Errors) errors.AppendLine(error.ErrorMessage);
|
|
|
+ return Ok(JsonView(false, errors.ToString()));
|
|
|
+ }
|
|
|
+
|
|
|
+ #region 页面操作权限验证
|
|
|
+ //var pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(userId,pageId);
|
|
|
+
|
|
|
+ //if (pageFunAuthView.FilesDownloadAuth == 0) return Ok(JsonView(false, "您没有文件下载权限!"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ DateTime beginDt = DateTime.Parse($"{dto.BeginDt} 00:00:00"),
|
|
|
+ endDt = DateTime.Parse($"{dto.EndDt} 23:59:59");
|
|
|
+
|
|
|
+ if (portType == 1 || portType == 2 ||portType == 3) // web/Android/IOS
|
|
|
+ {
|
|
|
+ //获取模板
|
|
|
+ string tempPath = (AppSettingsHelper.Get("ExcelBasePath") + "Template/利润报表.xlsx");
|
|
|
+ var designer = new WorkbookDesigner();
|
|
|
+ designer.Workbook = new Workbook(tempPath);
|
|
|
+
|
|
|
+ var currDt = DateTime.Now;
|
|
|
+ DateTime startTimeMonth = new DateTime(currDt.Year, currDt.Month, 1); //月初
|
|
|
+ DateTime endTimeMonth = startTimeMonth.AddMonths(1).AddDays(-1); //月末
|
|
|
+
|
|
|
+ var yearDic = CalculatePrice(beginDt,endDt);
|
|
|
+ var monthDic = CalculatePrice(startTimeMonth, endTimeMonth);
|
|
|
+
|
|
|
+ #region 年
|
|
|
+ //收入
|
|
|
+ designer.SetDataSource("TotalMoney", yearDic["TotalMoney"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("GroupIncome", yearDic["GroupIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("ActivityIncome", yearDic["ActivityIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("CompetitionIncome", yearDic["CompetitionIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("OtherIncome", yearDic["OtherIncome"].ToString("#0.00"));
|
|
|
+
|
|
|
+ //成本
|
|
|
+ designer.SetDataSource("TotalCost", yearDic["TotalCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("GroupCost", yearDic["GroupCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("ActivityCost", yearDic["ActivityCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("CompetitionCost", yearDic["CompetitionCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("OtherCost", yearDic["OtherCost"].ToString("#0.00"));
|
|
|
+
|
|
|
+ //毛利金额
|
|
|
+ designer.SetDataSource("TotalGrossProfit", yearDic["TotalGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("GroupGrossProfit", yearDic["GroupGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("ActivityGrossProfit", yearDic["ActivityGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("CompetitionGrossProfit", yearDic["CompetitionGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("OtherGrossProfit", yearDic["OtherGrossProfit"].ToString("#0.00"));
|
|
|
+
|
|
|
+ //毛利率
|
|
|
+ designer.SetDataSource("TotalInterestRate", yearDic["TotalInterestRate"].ToString("#0.00") + "%");
|
|
|
+ designer.SetDataSource("GroupInterestRate", yearDic["GroupInterestRate"].ToString("#0.00") + "%");
|
|
|
+ designer.SetDataSource("ActivityInterestRate", yearDic["ActivityInterestRate"].ToString("#0.00") + "%");
|
|
|
+ designer.SetDataSource("CompetitionInterestRate", yearDic["CompetitionInterestRate"].ToString("#0.00") + "%");
|
|
|
+ designer.SetDataSource("OtherInterestRate", yearDic["OtherInterestRate"].ToString("#0.00") + "%");
|
|
|
+
|
|
|
+ //数量
|
|
|
+ designer.SetDataSource("TotalQuantity", yearDic["TotalQuantity"].ToString());
|
|
|
+ designer.SetDataSource("GroupQuantity", yearDic["GroupQuantity"].ToString());
|
|
|
+ designer.SetDataSource("ActivityQuantity", yearDic["ActivityQuantity"].ToString());
|
|
|
+ designer.SetDataSource("CompetitionQuantity", yearDic["CompetitionQuantity"].ToString());
|
|
|
+ designer.SetDataSource("OtherQuantity", yearDic["OtherQuantity"].ToString());
|
|
|
+
|
|
|
+ //办公费用
|
|
|
+ designer.SetDataSource("OfficeTotalCost", yearDic["OfficeTotalCost"].ToString());
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 月
|
|
|
+ //收入
|
|
|
+ designer.SetDataSource("MonthAllIncomes", monthDic["TotalMoney"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthtzIncomes", monthDic["GroupIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthhwIncomes", monthDic["ActivityIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthssIncomes", monthDic["CompetitionIncome"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthqtIncomes", monthDic["OtherIncome"].ToString("#0.00"));
|
|
|
+
|
|
|
+ //成本
|
|
|
+ designer.SetDataSource("MonthAllCost", monthDic["TotalCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthtzCost", monthDic["GroupCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthhwCost", monthDic["ActivityCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthssCost", monthDic["CompetitionCost"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthqtCost", monthDic["OtherCost"].ToString("#0.00"));
|
|
|
+
|
|
|
+ //毛利金额
|
|
|
+ designer.SetDataSource("MonthAllGross", monthDic["TotalGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthtzGross", monthDic["GroupGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthhwGross", monthDic["ActivityGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthssGross", monthDic["CompetitionGrossProfit"].ToString("#0.00"));
|
|
|
+ designer.SetDataSource("MonthqtGross", monthDic["OtherGrossProfit"].ToString("#0.00"));
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ designer.Process();
|
|
|
+ //文件名
|
|
|
+ string fileName = $"利润报表({dto.BeginDt}至{dto.EndDt}){DateTime.Now.ToString("yyyyMMddHHmmss")}.xls";
|
|
|
+ designer.Workbook.Save(AppSettingsHelper.Get("ExcelBasePath") + "CorporateProfit/" + fileName);
|
|
|
+ string url = AppSettingsHelper.Get("ExcelBaseUrl") + "Office/Excel/CorporateProfit/" + fileName;
|
|
|
+ return Ok(JsonView(true, "成功", url));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(false));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 计算团组全部费用
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="startTime"></param>
|
|
|
+ /// <param name="endTime"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private Dictionary<string, decimal> CalculatePrice(DateTime startTime, DateTime endTime)
|
|
|
+ {
|
|
|
+ DateTime beginDt = startTime,
|
|
|
+ endDt = endTime;
|
|
|
+ var dic = new Dictionary<string, decimal>();
|
|
|
+
|
|
|
+ decimal totalIncomes = 0.00M; //总收入
|
|
|
+ decimal totalCost = 0.00M; //总成本
|
|
|
+
|
|
|
+ #region 团组
|
|
|
+ //团组收入,会务收入,赛事项目收入,其他非团组收入
|
|
|
+ decimal groupIncome = 0.00M; //团组收入
|
|
|
+ decimal activityIncome = 0.00M; //会务收入
|
|
|
+ decimal competitionIncome = 0.00M; //赛事项目收入
|
|
|
+ decimal otherIncome = 0.00M; //其他非团组收入
|
|
|
+ decimal groupCost = 0.00M; //团组成本
|
|
|
+ decimal activityCost = 0.00M; //会务成本
|
|
|
+ decimal competitionCost = 0.00M; //赛事项目成本
|
|
|
+ decimal otherCost = 0.00M; //其他非团组成本
|
|
|
+
|
|
|
+ var groupDatas = _sqlSugar.Queryable<Grp_DelegationInfo>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.VisitDate >= beginDt && x.VisitDate <= endDt)
|
|
|
+ .Select(x => new { x.Id, x.TeamName,x.TeamDid, x.VisitDate })
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ var groupIds = groupDatas.Select(x => x.Id).ToList();
|
|
|
+ //应收
|
|
|
+ var receivableDatas = _sqlSugar.Queryable<Fin_ForeignReceivables>().Where(x => x.IsDel == 0 && groupIds.Contains(x.Diid)).ToList();
|
|
|
+ //已收
|
|
|
+ var receivedDatas = _sqlSugar.Queryable<Fin_ProceedsReceived>().Where(x => x.IsDel == 0 && groupIds.Contains(x.Diid)).ToList();
|
|
|
+ //成本
|
|
|
+ var costDatas = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && groupIds.Contains(x.DIId) && x.IsPay == 1).ToList();
|
|
|
+ //提成
|
|
|
+ var groupRoyaltyDatas = _sqlSugar.Queryable<Fin_RoyaltyConfirm>().Where(x => x.IsDel == 0 && groupIds.Contains(x.TeamId) && x.IsConfirm == 1).ToList();
|
|
|
+
|
|
|
+ #region 团组
|
|
|
+ var groupTyepIds = new List<int> { 38, 39, 40, 1048 };
|
|
|
+ var groupIncomIds = groupDatas.Where(x => groupTyepIds.Contains(x.TeamDid)).Select(x => x.Id).ToList();
|
|
|
+ //收入
|
|
|
+ groupIncome = receivedDatas.Where(x => groupIncomIds.Contains(x.Diid)).Sum(x => x.Price);
|
|
|
+ //成本
|
|
|
+ groupCost = costDatas.Where(x => groupIncomIds.Contains(x.DIId)).Sum(x => x.PayMoney * x.DayRate);
|
|
|
+ //提成
|
|
|
+ groupCost += groupRoyaltyDatas.Where(x => groupIncomIds.Contains(x.TeamId)).Sum(x => x.Price);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 会务
|
|
|
+ var activityTyepIds = new List<int> { 302, 691 };
|
|
|
+ var activityIncomIds = groupDatas.Where(x => activityTyepIds.Contains(x.TeamDid)).Select(x => x.Id).ToList();
|
|
|
+ //收入
|
|
|
+ activityIncome = receivedDatas.Where(x => activityIncomIds.Contains(x.Diid)).Sum(x => x.Price);
|
|
|
+ //成本
|
|
|
+ activityCost = costDatas.Where(x => activityIncomIds.Contains(x.DIId)).Sum(x => x.PayMoney * x.DayRate);
|
|
|
+ //提成
|
|
|
+ activityCost += groupRoyaltyDatas.Where(x => activityIncomIds.Contains(x.TeamId)).Sum(x => x.Price);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 赛事
|
|
|
+ var competitionTyepIds = new List<int> { 762, 1047 };
|
|
|
+ var competitionIncomIds = groupDatas.Where(x => competitionTyepIds.Contains(x.TeamDid)).Select(x => x.Id).ToList();
|
|
|
+ //收入
|
|
|
+ competitionIncome = receivedDatas.Where(x => competitionIncomIds.Contains(x.Diid)).Sum(x => x.Price);
|
|
|
+ //成本
|
|
|
+ competitionCost = costDatas.Where(x => competitionIncomIds.Contains(x.DIId)).Sum(x => x.PayMoney * x.DayRate);
|
|
|
+ //提成
|
|
|
+ competitionCost += groupRoyaltyDatas.Where(x => competitionIncomIds.Contains(x.TeamId)).Sum(x => x.Price);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 其他非团组
|
|
|
+ //收入
|
|
|
+ var otherTyepIds = new List<int> { 102, 248 };
|
|
|
+ var otherIncomIds = groupDatas.Where(x => otherTyepIds.Contains(x.TeamDid)).Select(x => x.Id).ToList();
|
|
|
+ otherIncome = receivedDatas.Where(x => otherIncomIds.Contains(x.Diid)).Sum(x => x.Price);
|
|
|
+ //成本
|
|
|
+ otherCost = costDatas.Where(x => otherIncomIds.Contains(x.DIId)).Sum(x => x.PayMoney * x.DayRate);
|
|
|
+ //提成
|
|
|
+ competitionCost += groupRoyaltyDatas.Where(x => otherIncomIds.Contains(x.TeamId)).Sum(x => x.Price);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 办公费用
|
|
|
+ //48人员费用 49办公费用 50 销售费用 51 其他费用 55 大运会
|
|
|
+ var typeIds = new List<int>() {
|
|
|
+ 48, //人员费用
|
|
|
+ 49, //办公费用
|
|
|
+ 50, //销售费用
|
|
|
+ 51, //其他费用
|
|
|
+ 55, //大运会
|
|
|
+ 90, //各部门基础固定费用明细
|
|
|
+ };
|
|
|
+ //var priceTypeData = _sqlSugar.Queryable<Sys_SetData>().Where(s => typeIds.Contains(s.Id)).ToList();
|
|
|
+ var priceSubTypeDatas = _sqlSugar.Queryable<Sys_SetData>().Where(s => s.IsDel == 0 && typeIds.Contains(s.STid)).ToList();
|
|
|
+ var priceSubTypeIds = priceSubTypeDatas.Select(x => x.Id).ToList();
|
|
|
+ var dailyFeeDatass = _sqlSugar
|
|
|
+ .Queryable<Fin_DailyFeePayment>()
|
|
|
+ .Where(x => x.IsDel == 0 && x.CreateTime >= beginDt && x.CreateTime <= endDt && priceSubTypeIds.Contains(x.PriceTypeId) && x.IsPay == 1)
|
|
|
+ .ToList();
|
|
|
+
|
|
|
+ //人员费用
|
|
|
+ var staffCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 48).Select(x => x.Id).ToList();
|
|
|
+ decimal staffCost = dailyFeeDatass.Where(x => staffCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+
|
|
|
+ //办公费用
|
|
|
+ var officeCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 49).Select(x => x.Id).ToList();
|
|
|
+ decimal officeCost = dailyFeeDatass.Where(x => officeCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+
|
|
|
+ //销售费用
|
|
|
+ var marketingCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 50).Select(x => x.Id).ToList();
|
|
|
+ decimal marketingCost = dailyFeeDatass.Where(x => marketingCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+
|
|
|
+ //其他费用
|
|
|
+ var bg_otherCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 51).Select(x => x.Id).ToList();
|
|
|
+ decimal bg_otherCost = dailyFeeDatass.Where(x => bg_otherCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+
|
|
|
+ //大运会
|
|
|
+ var universityGamesCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 55).Select(x => x.Id).ToList();
|
|
|
+ decimal universityGamesCost = dailyFeeDatass.Where(x => universityGamesCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+
|
|
|
+ //各部门基础固定费用明细
|
|
|
+ var basicCostTypeIds = priceSubTypeDatas.Where(x => x.STid == 90).Select(x => x.Id).ToList();
|
|
|
+ decimal basicGamesCost = dailyFeeDatass.Where(x => basicCostTypeIds.Contains(x.PriceTypeId)).Sum(x => x.SumPrice);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ totalCost = costDatas.Sum(x => x.PayMoney * x.DayRate) + groupRoyaltyDatas.Sum(x => x.Price);
|
|
|
+ totalIncomes = receivedDatas.Sum(x => x.Price);
|
|
|
+
|
|
|
+ #region 填充值
|
|
|
+
|
|
|
+ #region 本年累计
|
|
|
+
|
|
|
+ decimal totalInterestRate = 0.00M,
|
|
|
+ totalGrossProfit = 0.00M;
|
|
|
+ if (totalIncomes > 0)
|
|
|
+ {
|
|
|
+ totalGrossProfit = totalIncomes - totalCost;
|
|
|
+ totalInterestRate = totalGrossProfit / totalIncomes * 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ //业务数量
|
|
|
+ dic.Add("TotalQuantity", groupDatas.Count);
|
|
|
+ //应收金额
|
|
|
+ dic.Add("TotalMoney", totalIncomes);
|
|
|
+ //成本
|
|
|
+ dic.Add("TotalCost", totalCost);
|
|
|
+ //毛利润
|
|
|
+ dic.Add("TotalGrossProfit", totalGrossProfit);
|
|
|
+ //利率
|
|
|
+ dic.Add("TotalInterestRate", totalInterestRate);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 团组
|
|
|
+ decimal groupInterestRate = 0.00M,
|
|
|
+ groupGrossProfit = 0.00M;
|
|
|
+ if (groupIncome > 0)
|
|
|
+ {
|
|
|
+ groupGrossProfit = groupIncome - groupCost;
|
|
|
+ groupInterestRate = groupGrossProfit / groupIncome * 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ dic.Add("GroupQuantity", groupIncomIds.Count);
|
|
|
+ //收入
|
|
|
+ dic.Add("GroupIncome", groupIncome);
|
|
|
+ //成本
|
|
|
+ dic.Add("GroupCost", groupCost);
|
|
|
+ //毛利润
|
|
|
+ dic.Add("GroupGrossProfit", groupGrossProfit);
|
|
|
+ //利率
|
|
|
+ dic.Add("GroupInterestRate", groupInterestRate);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 会务
|
|
|
+
|
|
|
+ decimal activityInterestRate = 0.00M,
|
|
|
+ activityGrossProfit = 0.00M;
|
|
|
+ if (activityIncome > 0)
|
|
|
+ {
|
|
|
+ activityGrossProfit = activityIncome - activityCost;
|
|
|
+ activityInterestRate = activityGrossProfit / activityIncome * 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ dic.Add("ActivityQuantity", activityIncomIds.Count);
|
|
|
+ //收入
|
|
|
+ dic.Add("ActivityIncome", activityIncome);
|
|
|
+ //成本
|
|
|
+ dic.Add("ActivityCost", activityCost);
|
|
|
+ //毛利润
|
|
|
+ dic.Add("ActivityGrossProfit", activityGrossProfit);
|
|
|
+ //利率
|
|
|
+ dic.Add("ActivityInterestRate", activityInterestRate);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 赛事项目
|
|
|
+ decimal competitionInterestRate = 0.00M,
|
|
|
+ competitionGrossProfit = 0.00M;
|
|
|
+ if (competitionIncome > 0)
|
|
|
+ {
|
|
|
+ competitionGrossProfit = competitionIncome - competitionCost;
|
|
|
+ activityInterestRate = competitionGrossProfit / competitionIncome * 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ dic.Add("CompetitionQuantity", competitionIncomIds.Count);
|
|
|
+ //收入
|
|
|
+ dic.Add("CompetitionIncome", competitionIncome);
|
|
|
+ //成本
|
|
|
+ dic.Add("CompetitionCost", competitionCost);
|
|
|
+ //毛利润
|
|
|
+ dic.Add("CompetitionGrossProfit", competitionGrossProfit);
|
|
|
+ //毛利率
|
|
|
+ dic.Add("CompetitionInterestRate", competitionInterestRate);
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 其他非团组
|
|
|
+ decimal otherInterestRate = 0.00M,
|
|
|
+ otherGrossProfit = 0.00M;
|
|
|
+ if (otherIncome > 0)
|
|
|
+ {
|
|
|
+ otherGrossProfit = otherIncome - otherCost;
|
|
|
+ otherInterestRate = otherGrossProfit / otherIncome * 100;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数量
|
|
|
+ dic.Add("OtherQuantity", otherIncomIds.Count);
|
|
|
+ //收入
|
|
|
+ dic.Add("OtherIncome", otherIncome);
|
|
|
+ //成本
|
|
|
+ dic.Add("OtherCost", otherCost);
|
|
|
+ //毛利润
|
|
|
+ dic.Add("OtherGrossProfit", otherGrossProfit);
|
|
|
+ //毛利率
|
|
|
+ dic.Add("OtherInterestRate", otherInterestRate);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 办公费用
|
|
|
+
|
|
|
+ decimal officeTotalCost = dailyFeeDatass.Sum(x => x.SumPrice);
|
|
|
+ dic.Add("OfficeTotalCost", officeTotalCost);
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ return dic;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
}
|
|
|
}
|