Browse Source

出入境费用 --> 第一项费用增加备注

LEIYI 2 weeks ago
parent
commit
c13a2f6614

+ 40 - 0
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -122,6 +122,46 @@ namespace OASystem.API.Controllers
         private readonly List<int> _portTypeData;
         private readonly TableOperationRecordRepository _tableorRep;
 
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="logger"></param>
+        /// <param name="mapper"></param>
+        /// <param name="hubContext"></param>
+        /// <param name="sqlSugar"></param>
+        /// <param name="grpScheduleRep"></param>
+        /// <param name="groupRepository"></param>
+        /// <param name="taskAssignmentRep"></param>
+        /// <param name="airTicketResRep"></param>
+        /// <param name="decreasePaymentsRep"></param>
+        /// <param name="InvitationOfficialActivitiesRep"></param>
+        /// <param name="delegationEnDataRep"></param>
+        /// <param name="enterExitCostRep"></param>
+        /// <param name="delegationVisaRep"></param>
+        /// <param name="message"></param>
+        /// <param name="visaPriceRep"></param>
+        /// <param name="carTouristGuideGroundRep"></param>
+        /// <param name="checkBoxs"></param>
+        /// <param name="GroupCostRepository"></param>
+        /// <param name="CostTypeHotelNumberRepository"></param>
+        /// <param name="GroupCostParameterRepository"></param>
+        /// <param name="hotelPriceRep"></param>
+        /// <param name="customersRep"></param>
+        /// <param name="setDataRep"></param>
+        /// <param name="tourClientListRep"></param>
+        /// <param name="teamRateRep"></param>
+        /// <param name="usersRep"></param>
+        /// <param name="juHeApi"></param>
+        /// <param name="invertedListRep"></param>
+        /// <param name="visaFeeInfoRep"></param>
+        /// <param name="ticketBlackCodeRep"></param>
+        /// <param name="hotelInquiryRep"></param>
+        /// <param name="threeCodeRepository"></param>
+        /// <param name="feeAuditRep"></param>
+        /// <param name="visaCommissionRep"></param>
+        /// <param name="ffrRep"></param>
+        /// <param name="opinionaireRep"></param>
+        /// <param name="tableorRep"></param>
         public GroupsController(
             ILogger<GroupsController> logger,
             IMapper mapper,

+ 4 - 3
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2021,14 +2021,16 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
             dynamic groupInfos = null;
             if (_groupData.Code == 0) groupInfos = _groupData.Data;
 
-            var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0 && a.STid == 38).ToList();
+            var data = _sqlSugar.Queryable<Sys_SetData>().Where(a => a.IsDel == 0).ToList();
+            var data1 = data.Where(a => a.STid == 38).ToList();
+            var data2 = data.Where(a => a.STid == 101).ToList();
 
             var _DeleFile = _sqlSugar.Queryable<Grp_DeleFile>().Where(a => a.Diid == dto.DiId && a.IsDel == 0 && a.Category == 970).ToList();
 
             var translatorData = _sqlSugar.Queryable<Res_TranslatorLibrary>().Where(a => a.IsDel == 0).Select(x => new TranslatorLibraryNameView() { Id = x.Id, Name = x.Name }).ToList();
             foreach (var item in translatorData) EncryptionProcessor.DecryptProperties(item);
 
-            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data, DeleFile = _DeleFile , TranslatorData = translatorData }));
+            return Ok(JsonView(true, "查询成功!", new { Delegation = groupInfos, SetData = data1,DataSource = data2, DeleFile = _DeleFile , TranslatorData = translatorData }));
         }
 
         /// <summary>
@@ -2069,7 +2071,6 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
         public async Task<IActionResult> OpOfficialActivities(OpOfficialActivitiesDto dto)
         {
-
             Result groupData = await _officialActivitiesRep.OpOfficialActivities(dto);
             if (groupData.Code != 0)
             {

+ 387 - 1
OASystem/OASystem.Api/Controllers/StatisticsController.cs

@@ -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
+
     }
 }

+ 1 - 0
OASystem/OASystem.Api/appsettings.json

@@ -238,6 +238,7 @@
         {
           "PostId": -1,
           "PageIds": [
+            191, //物资进销存页面
             42 //Page: 日常费用付款申请
             //16 //Page: 员工资料列表
           ]

+ 1 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -191,6 +191,7 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<Grp_Opinionaire, OpinionaireUserListView>();
             CreateMap<OpinionaireUserSaveInfo, Grp_Opinionaire>();
             CreateMap<Res_TranslatorLibrary, TranslatorLibraryInfoView>();
+            CreateMap<Res_TranslatorLibrary, TranslatorView>();
             #endregion
             #endregion
 

+ 2 - 0
OASystem/OASystem.Domain/Dtos/Groups/EnterExitCostDto.cs

@@ -97,6 +97,8 @@ namespace OASystem.Domain.Dtos.Groups
         /// </summary>
         public decimal Safe { get; set; }
 
+        public string FirstItemRemark { get; set; } 
+
         #endregion
 
         #endregion

+ 6 - 1
OASystem/OASystem.Domain/Dtos/Resource/OfficialActivitiesDto.cs

@@ -1,4 +1,5 @@
 using Microsoft.AspNetCore.Http;
+using OASystem.Domain.ViewModels.Resource;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
@@ -114,7 +115,6 @@ namespace OASystem.Domain.Dtos.Resource
         /// </summary>
         public int IsPay { get; set; }
 
-
         /// <summary>
         /// 国家
         /// </summary>
@@ -148,6 +148,11 @@ namespace OASystem.Domain.Dtos.Resource
         /// </summary>
         public string Nature { get; set; }
 
+        /// <summary>
+        /// 翻译人员Info
+        /// </summary>
+        public TranslatorView TranslatorInfo { get; set; }
+
 
     }
 

+ 48 - 0
OASystem/OASystem.Domain/Dtos/Statistics/CorporateProfitDtos.cs

@@ -0,0 +1,48 @@
+using FluentValidation;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace OASystem.Domain.Dtos.Statistics
+{
+    /// <summary>
+    /// 企业利润dtos
+    /// </summary>
+    public class CorporateProfitDtos : UserPageFuncDtoBase
+    {
+    }
+
+    public class CorporateProfitDtosDtoBaseFoalidator : AbstractValidator<CorporateProfitDtos>
+    {
+        public CorporateProfitDtosDtoBaseFoalidator()
+        {
+            RuleFor(it => it.PortType).InclusiveBetween(1, 3).WithMessage(MsgTips.Port);
+            RuleFor(it => it.UserId).GreaterThan(1).WithMessage(MsgTips.UserId);
+            RuleFor(it => it.PageId).GreaterThan(1).WithMessage(MsgTips.PageId);
+        }
+    }
+
+    public class CorporateProfitExcelDownloadDto : CorporateProfitDtos
+    {
+        public string BeginDt { get; set; }
+        public string EndDt { get; set; }
+    }
+    public class CorporateProfitExcelDownloadDtoFoalidator : AbstractValidator<CorporateProfitExcelDownloadDto>
+    {
+        public CorporateProfitExcelDownloadDtoFoalidator()
+        {
+            Include(new CorporateProfitDtosDtoBaseFoalidator());
+            RuleFor(it => it.BeginDt)
+                .Must(dateString => DateTime.TryParse(dateString, out _))
+                .WithMessage("请输入有效开始的日期");
+            RuleFor(it => it.EndDt)
+                .Must(dateString => DateTime.TryParse(dateString, out _))
+                .WithMessage("请输入有效结束的日期");
+
+        }
+    }
+
+
+}

+ 5 - 0
OASystem/OASystem.Domain/Entities/Resource/Res_OfficialActivities.cs

@@ -16,6 +16,11 @@ namespace OASystem.Domain.Entities.Resource
          /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "int")]
         public int DiId { get; set; }
+        /// <summary>
+        /// 公务数据来源
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "int")]
+        public int DataSource { get; set; }
 
         /// <summary>
         /// 0带公务 1不带公务 2纯公务

+ 1 - 1
OASystem/OASystem.Domain/Entities/Resource/Res_TranslatorLibrary.cs

@@ -84,7 +84,7 @@ namespace OASystem.Domain.Entities.Resource
         /// <summary>
         /// 币种
         /// </summary>
-        [SugarColumn(ColumnDescription = "种", IsNullable = true, ColumnDataType = "int")]
+        [SugarColumn(ColumnDescription = "种", IsNullable = true, ColumnDataType = "int")]
         public int Currency { get; set; }
 
         /// <summary>

+ 2 - 0
OASystem/OASystem.Domain/ViewModels/Groups/EnterExitCostView.cs

@@ -301,6 +301,8 @@ namespace OASystem.Domain.ViewModels.Groups
         /// </summary>
         public decimal Safe { get; set; }
 
+        public string FirstItemRemark { get; set; }
+
         #endregion
 
         /// <summary>

+ 58 - 0
OASystem/OASystem.Domain/ViewModels/Resource/OfficialActivitiesView.cs

@@ -1,4 +1,5 @@
 using Newtonsoft.Json;
+using OASystem.Domain.Attributes;
 using OASystem.Domain.Entities.Resource;
 using System;
 using System.Collections.Generic;
@@ -43,6 +44,63 @@ namespace OASystem.Domain.ViewModels.Resource
                 return this.ConfirmTheInvitation == 0 ? "未确认" : "已确认";
             }
         }
+
+        public TranslatorView TranslatorInfo { get; set; }
+    }
+
+    public class TranslatorView
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 所在地区
+        /// </summary>
+        public string Area { get; set; }
+
+        /// <summary>
+        /// 姓名
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 性别(0:未设置 1:男 2:女)
+        /// </summary>
+        public int Sex { get; set; }
+
+        /// <summary>
+        /// 联系电话
+        /// </summary>
+        public string Tel { get; set; }
+
+        /// <summary>
+        /// 邮箱号
+        /// </summary>
+        public string Email { get; set; }
+
+        /// <summary>
+        /// 微信号
+        /// </summary>
+        public string WechatNo { get; set; }
+
+        /// <summary>
+        /// 其他社交账号
+        /// </summary>
+        public string OtherSocialAccounts { get; set; }
+
+        /// <summary>
+        /// 语种
+        /// </summary>
+        public string Language { get; set; }
+
+        /// <summary>
+        /// 费用
+        /// </summary>
+        public decimal Price { get; set; }
+
+        /// <summary>
+        /// 币种
+        /// </summary>
+        public int Currency { get; set; }
     }
 
     /// <summary>

+ 2 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -83,7 +83,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
                 if (enterExitCostData != null)
                 {
                     enterExitCostInfoView = _mapper.Map<EnterExitCostInfoView>(enterExitCostData);
-
+                    enterExitCostInfoView.FirstItemRemark = enterExitCostData.Remark;
                     var dayAndCostSql = string.Format(@"Select ntf.Country,ntf.City,ssd.Name CurremcyCode,ssd.Remark CurrencyName,gdac.* From Grp_DayAndCost gdac
                                                         Left Join Grp_NationalTravelFee ntf On ntf.Id = gdac.NationalTravelFeeId
                                                         Left Join Sys_SetData ssd On ssd.STid = 66 And gdac.Currency = ssd.Id
@@ -235,6 +235,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
             if (dto.SumTDC == 0) dto.OutsideTDPay = 0;
 
             var enterExitCost = _mapper.Map<Grp_EnterExitCost>(dto);
+            enterExitCost.Remark = dto.FirstItemRemark;
             //enterExitCost.InsidePay = enterExitCost.Visa + enterExitCost.YiMiao + enterExitCost.HeSuan + enterExitCost.Service + enterExitCost.Safe + enterExitCost.Ticket;
 
             List<Grp_DayAndCost> subData = new List<Grp_DayAndCost>();

+ 22 - 4
OASystem/OASystem.Infrastructure/Repositories/Resource/OfficialActivitiesRepository.cs

@@ -160,15 +160,27 @@ FROM
   LEFT JOIN Sys_Users u ON oa.CreateUserId = u.Id
   LEFT JOIN Sys_SetData sd ON oa.OfficialForm = sd.Id
 {0}", sqlWhere);
-                var OfficialActivities = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql)
+                var oa = await _sqlSugar.SqlQueryable<OfficialActivitiesView>(sql)
                     .FirstAsync();
                 //OfficialActivities.ScreenshotOfMailUrls.ForEach(url => { url = AppSettingsHelper.Get("GrpFileBaseUrl") + url; });
 
-                OfficialActivities.TranslatorIdItem = _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
+                oa.TranslatorIdItem = _sqlSugar.Queryable<Grp_OfficialDutyLinkTranslator>()
                     .Where(x => x.IsDel == 0 && x.OfficialDutyId == dto.Id)
                     .Select(x => x.TranslatorId)
                     .ToArray();
-                result = new Result() { Code = 0, Msg = "查询成功!", Data = OfficialActivities };
+
+                if (oa.TranslatorIdItem.Any())
+                {
+                    var translatorInfo = await _sqlSugar.Queryable<Res_TranslatorLibrary>()
+                   .Where(x => x.IsDel == 0 && oa.TranslatorIdItem[0] == dto.Id)
+                   .FirstAsync();
+
+                    EncryptionProcessor.DecryptProperties(translatorInfo);
+
+                    oa.TranslatorInfo = _mapper.Map<TranslatorView>(translatorInfo);
+                }
+
+                result = new Result() { Code = 0, Msg = "查询成功!", Data = oa };
 
             }
             catch (Exception ex)
@@ -195,7 +207,7 @@ FROM
             _sqlSugar.BeginTran();
 
             //添加到资料库
-            Res_InvitationOfficialActivityData res_InvitationData = new Res_InvitationOfficialActivityData();
+            var res_InvitationData = new Res_InvitationOfficialActivityData();
             res_InvitationData.Country = dto.Country;
             res_InvitationData.City = dto.Area;
             res_InvitationData.UnitName = dto.Client;
@@ -208,6 +220,12 @@ FROM
             res_InvitationData.Field = dto.Field;
             EncryptionProcessor.EncryptProperties(res_InvitationData);
 
+            //翻译人员资料
+            var translatorInfo = _mapper.Map<Res_TranslatorLibrary>(dto.TranslatorInfo);
+            translatorInfo.CreateUserId = dto.CreateUserId;
+            //translatorInfo.
+
+
             int DataID = 0;
             if (dto.Status == 1)//添加
             {