using Dm; using Google.Protobuf.WellKnownTypes; using Npgsql.Replication.PgOutput; using OASystem.Domain.Entities.Financial; using OASystem.Domain.ViewModels.System; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace OASystem.Domain.ViewModels.Financial { /// /// 日付申请 View /// public class Fin_DailyFeePaymentView : Fin_DailyFeePayment { } public class Fin_DailyFeePaymentPageCount { /// /// 总条数 /// public int Count { get; set; } } /// /// 日付申请 分页查询View /// public class Fin_DailyFeePaymentPageListView { /// /// 是否选中 /// public bool IsChecked { get; set; } /// /// 行号 /// public int RowNumber { get; set; } /// /// Id /// public int Id { get; set; } /// /// 公司Id /// public int CompanyId { get; set; } /// /// 公司名称 /// public string? CompanyName { get; set; } /// /// 费用描述 /// public string? Instructions { get; set; } /// /// 费用总计 /// public decimal? SumPrice { get; set; } /// /// 申请人Id /// public int CreateUserId { get; set; } /// /// 申请人姓名 /// public string? CreateUser { get; set; } /// /// 申请时间 /// public DateTime CreateTime { get; set; } /// /// 财务审核 /// public int FAudit { get; set; } /// /// 财务 审核状态 /// public string? FAuditDesc { get { string str = "未审核"; if (FAudit == 0) str = "未审核"; else if (FAudit == 1) { str = "已通过"; FAuditName = "朱成梅"; } else if (FAudit == 2) { str = "未通过"; FAuditName = "朱成梅"; } return str; } } /// /// 财务审核人姓名 /// public string? FAuditName { get; set; } = "无"; /// /// 总经理审核 /// public int MAudit { get; set; } /// /// 总经理 审核状态 /// public string? MAuditDesc { get { string str = "未审核"; if (MAudit == 0) str = "未审核"; else if (MAudit == 1) { str = "已通过"; MAuditName = "张海麟"; } else if (MAudit == 2) { str = "未通过"; MAuditName = "张海麟"; } return str; } } /// /// 总经理审核姓名 /// public string? MAuditName { get; set; } = "无"; /// /// 费用类型 /// public int PriceTypeId { get; set; } /// /// 支付标识 0,1 /// public int IsPay { get; set; } } /// /// 日服申请 分页 /// public class Fin_DailyFeePaymentPage { /// /// 总条数 /// public int? Rows { get; set; } public List Data { get; set; } } /// /// 日付申请费用明细 /// public class Fin_DailyFeePaymentContentInfolView { public int Id { get; set; } /// /// 费用名称 /// public string PriceName { get; set; } /// /// 数量单价 /// public decimal Quantity { get; set; } /// /// 费用单价 /// public decimal Price { get; set; } /// /// 当前总计 /// public decimal ItemTotal { get; set; } /// /// 备注 /// public string Remark { get; set; } /// /// 备注描述 /// public string RemaksDescription { get; set; } /// /// Excel备注描述 /// public string ExcelRemaksDescription { get; set; } } public class Fin_DailyFeePaymentInfolView { public int Id { get; set; } public int CompanyId { get; set; } public int TransferTypeId { get; set; } public int PriceTypeId { get; set; } public string Instructions { get; set; } public decimal SumPrice { get; set; } public int CreateUserId { get; set; } /// /// 财务审核 /// public int FAudit { get; set; } public string FAuditDesc { get { string str = "未审核"; if (FAudit == 0) str = "未审核"; else if (FAudit == 1) str = "已通过"; else if (FAudit == 2) str = "未通过"; return str; } } /// /// 总经理审核 /// public int MAudit { get; set; } public string MAuditDesc { get { string str = "未审核"; if (MAudit == 0) str = "未审核"; else if (MAudit == 1) str = "已通过"; else if (MAudit == 2) str = "未通过"; return str; } } public DateTime CreateTime { get; set; } public List FeeContents { get; set; } } /// /// android 详情 /// public class Fin_DailyFeePaymentInfoAndroidlView { public int Id { get; set; } public int CompanyId { get; set; } public int TransferTypeId { get; set; } public int PriceTypeId { get; set; } public string Instructions { get; set; } public decimal SumPrice { get; set; } public int CreateUserId { get; set; } public List FeeContents { get; set; } } /// /// 费用类型 /// public class Fin_DailyFeePaymentPagePriceTypeView { /// /// 类型Id /// public int Id { get; set; } /// /// 名称 /// public string Name { get; set; } } /// /// 费用子类型 /// public class Fin_DailyFeePaymentPagePriceSubTypeView { /// /// 费用类型Id /// public int STid { get; set; } /// /// 子类型Id /// public int Id { get; set; } /// /// 子类型名称 /// public string Name { get; set; } } /// /// 费用类型数据源 /// public class Fin_DailyFeePaymentPagePriceTypeDataView { /// /// 费用类型 /// public List? FeeTypeData { get; set; } /// /// 费用子类型 /// public List? FeeSubTypeData { get; set; } /// /// 用户名称 /// public List? UserNameData { get; set; } /// /// 费用标识类型 /// public List? FeeMarkTypeData { get; set; } /// /// 费用子类型 /// public List? FeeMarkSubTypeData { get; set; } /// /// 公司名称 /// public List? CompanyNameData { get; set; } } /// /// 类型数据源 /// public class DailyFeePaymentDataSourceView : Fin_DailyFeePaymentPagePriceTypeView { public List SubDatas { get; set; } } public class tree_Fin_DailyFeePaymentPageListView : Fin_DailyFeePaymentPageListView { public List childList { get; set; } public string priceTypeStr { get; set; } public int transferTypeId { get; set; } public string transferTypeIdStr { get; set; } /// /// 公转:62,私转:63 --2024年4月9日 16:49:46 0,1 /// public int transferParentId { get; set; } public string transferParentIdStr { get; set; } } public class tree_Fin_DailyFeePaymentResult : tree_Fin_DailyFeePaymentPageListView { public decimal gz { get; set; } = 0M; public decimal sz { get; set; } = 0M; public List dataList { get; set; } } /// /// 团组相关费用 /// public class tree_Group_DailyFeePaymentResult { public decimal gz { get; set; } = 0M; public decimal sz { get; set; } = 0M; public List dataList { get; set; } } /// /// 团组相关费用 List /// public class tree_Group_DailyFeePaymentPageListView { public string Id { get; set; } public string GroupName { get; set; } /// /// 费用所属公司Id /// public int CompanyId { get; set; } /// /// 费用所属公司 /// public string ConpanyName { get; set; } /// /// 团组总计金额 /// public decimal CNYTotalAmount { get; set; } public List ChildList { get; set; } } public class CompanyInfo { public int Id { get; set; } public string ConpanyName { get; set; } } public class Group_DailyFeePaymentContentInfolView { /// /// 是否选中 /// public bool IsChecked { get; set; } public int Id { get; set; } /// /// 酒店费用子类 Id /// public int HotelSubId { get; set; } = -1; /// /// 支付方式 /// public string PayType { get; set; } /// /// 转账标识 /// public string TransferMark { get; set; } /// /// 序号 /// public int RowNumber { get; set; } /// /// 申请人 /// public string Applicant { get; set; } /// /// 申请时间 /// public string ApplicantDt { get; set; } /// /// 收款方 /// public string Payee { get; set; } /// /// 费用名称 /// public string PriceName { get; set; } /// /// 费用所属模块 /// public string ModuleName { get; set; } /// /// 付款币种 /// public string PayCurrCode { get; set; } /// /// 付款金额 /// public decimal PaymentAmount { get; set; } /// /// 付款汇率 /// public decimal PayRate { get; set; } /// /// 小计人民币金额 /// public decimal CNYSubTotalAmount { get; set; } /// /// 费用描述 /// public string RemaksDescription { get; set; } /// /// 审核状态 /// 0 未审核 1已通过 2未通过 3 自动审核 /// public int AuditStatus { get; set; } } public class PaymentRequestCheckedView { public List GroupIds { get; set; } public List DailyPaymentIds { get; set; } public List HotelSubIds { get; set; } } #region 日付报表 [SqlSugar.SugarTable("Fin_DailyFeePayment")] public class DailyFeePaymentRangeView { //public string ViewStr //{ // get // { // return $"{RowIndex}、【{CompanyName}】【{TransferType}】【{FeeType}】【{Instructions}】【{SumPrice.ToString("#0.00")}】【申请人:{Applicant} 申请时间:{ApplicantDt.ToString("yyyy-MM-dd HH:mm:ss")}】"; // } //} public string ViewStr { get { return $"【{CompanyName}】【{TransferType}】【{FeeType}】【{Instructions}】【{SumPrice.ToString("#0.00")}】【申请人:{Applicant} 申请时间:{ApplicantDt.ToString("yyyy-MM-dd HH:mm:ss")}】"; } } [SugarColumn(IsIgnore = true)]//需要加上 public int RowIndex { get; set; } //行号 序号 [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } public string Instructions { get; set; } public int PriceTypeId { get; set; } public string FeeType { get; set; } public int TransferTypeId { get; set; } public string TransferType { get; set; } public decimal SumPrice { get; set; } public DateTime FAuditDate { get; set; } public DateTime MAuditDate { get; set; } public int CompanyId { get; set; } public string CompanyName { get; set; } public int ApplicantId { get; set; } public string Applicant { get; set; } public DateTime ApplicantDt { get; set; } [Navigate(NavigateType.OneToMany, nameof(DailyFeePaymentContentView.DFPId))]//BookA表中的studenId public List Contents { get; set; } //public string ContentStr { get; set; } } [SqlSugar.SugarTable("Fin_DailyFeePaymentContent")] public class DailyFeePaymentContentView { //[SugarColumn(IsIgnore = true)]//需要加上 //public int RowIndex { get; set; } //行号 序号 [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } public int DFPId { get; set; } public string PriceName { get; set; } public int Quantity { get; set; } public decimal Price { get; set; } public decimal ItemTotal { get; set; } public string Remark { get; set; } //public int IsDel { get; set; } ///// ///// 示例:费用名称:[2024.07.11招商信用卡还款] 单价:[20000.00] 数量:[1.00] 小计:[20000.00] 备注:[] ///// //public string ViewStr //{ // get // { // return $"费用名称:[{PriceName}] 单价:[{Price.ToString("#0.00")}] 数量:[{Quantity.ToString("#0.00")}] 小计:[{ItemTotal.ToString("#0.00")}] 备注:[{Remark}]"; // } //} //public string ViewSubStr { get; set; } } public class ExcelView : DailyFeePaymentRangeView { public string ContentStr { get; set; } } #endregion #region 统计模块 #region YOY public class StatisticsYOYView { public int Id { get; set; } public DateTime VisitDate { get; set; } public int Year { get; set; } public int Month { get; set; } /// /// 销售额金额 /// public decimal SaleAmount { get; set; } /// /// 机票金额 /// public decimal AirTicketAmount { get; set; } /// /// op金额 /// public decimal OPAmount { get; set; } /// /// 其他费用金额 /// public decimal OtherCostAmount { get; set; } /// /// 签证金额 /// public decimal VisaAmount { get; set; } /// /// 邀请公务金额 /// public decimal OAAmount { get; set; } /// /// 保险金额 /// public decimal InsureAmount { get; set; } /// /// 酒店金额 /// public decimal HotelAmount { get; set; } /// /// 超支金额 /// public decimal ExcessAmount { get; set; } /// /// 收款退还金额 /// public decimal SKTHAmount { get; set; } /// /// 成本金额 /// public decimal CostAmount { get { return AirTicketAmount + HotelAmount + InsureAmount + OAAmount + VisaAmount + OtherCostAmount + OPAmount + ExcessAmount; } } /// /// 毛利润 /// public decimal GrossProfitAmount { get { return SaleAmount - SKTHAmount - CostAmount; } } } public class YOYReturnView { public int Year { get; set; } public int Month { get; set; } public decimal ThisAmount { get; set; } public decimal LastAmount { get; set; } public string Yoy { get; set; } public List ThisIds { get; set; } public List LastIds { get; set; } /// /// 构造函数 /// /// /// /// /// /// /// public YOYReturnView(int year, int month, decimal thisAmount, decimal lastAmount, List thisIds, List lastIds) { this.Year = year; this.Month = month; this.ThisAmount = thisAmount; this.LastAmount = lastAmount; string _yoy = "0.00%"; if (lastAmount != 0) { _yoy = ((thisAmount - lastAmount) / lastAmount).ToString("#0.00") + "%"; } this.Yoy = _yoy; this.ThisIds = thisIds; this.LastIds = lastIds; } } #endregion #region 国交数据统计 - 机票 public class StatisticsAirTicketView { public int DIId { get; set; } public DmDateTime FlightsDate { get; set; } public int Year { get; set; } public int Month { get; set; } public int CType { get; set; } public string CTypeName { get; set; } public string FlightsCity { get; set; } public string FlightsCityName { get; set; } public int ClientNum { get; set; } public string GroupName { get; set; } public string Platform { get; set; } } public class AirTicketReturnView { public int Year { get; set; } public int Month { get; set; } /// /// 票数 /// public int Quantity { get; set; } public List AitTicketInfos { get; set; } public List LinkGroupIds { get; set; } /// /// 构造函数 /// /// /// /// /// /// public AirTicketReturnView(int year, int month, int quantity, List aitTicketInfos, List linkGroupIds) { this.Year = year; this.Month = month; this.Quantity = quantity; this.AitTicketInfos = aitTicketInfos; this.LinkGroupIds = linkGroupIds; } /// /// 构造函数 /// /// /// /// /// public AirTicketReturnView(int year, int month, int quantity, List linkGroupIds) { this.Year = year; this.Month = month; this.Quantity = quantity; this.LinkGroupIds = linkGroupIds; } } public class AirTicketCityReturnView : AirTicketReturnView { public List CityData { get; set; } /// /// 构造函数 /// /// /// /// /// /// public AirTicketCityReturnView(int year, int month, int quantity, List cityData, List linkGroupIds) : base(year, month, quantity, linkGroupIds) { this.Year = year; this.Month = month; this.Quantity = quantity; this.CityData = cityData; this.LinkGroupIds = linkGroupIds; } } public class AitTicketInfo { public int Id { get; set; } public string GroupName { get; set; } public int Quantity { get; set; } public AitTicketInfo(int id, string groupName, int quantity) { this.Id = id; this.GroupName = groupName; this.Quantity = quantity; } } public class AirTicketCityInfo { public string City { get; set; } public int Quantity { get; set; } public AirTicketCityInfo(string city, int quantity = 0) { City = city; Quantity = quantity; } } #endregion #region 酒店 public class StatisticsHotelView { public int DIId { get; set; } public string Country { get; set; } public string City { get; set; } public string CityStr { get { return City.Replace(" ", "").ToUpper(); } } public string HotelName { get; set; } public string BookinSite { get; set; } public string CheckInDate { get; set; } //public int Year { get; set; } //public int Month { get; set; } public string CheckOutDate { get; set; } public int SingleRoomCount { get; set; } public int DoubleRoomCount { get; set; } public int SuiteRoomCount { get; set; } public int OtherRoomCount { get; set; } public int RoomNights { get { int nights = 0; if (!string.IsNullOrEmpty(CheckInDate) && !string.IsNullOrEmpty(CheckOutDate)) { DateTime checkin, checkout; bool checkInBool = DateTime.TryParse(CheckInDate, out checkin); bool checkOutBool = DateTime.TryParse(CheckOutDate, out checkout); if (checkInBool && checkOutBool) { nights = (checkout - checkin).Days * RoomTotal; } } return nights; } } public int RoomTotal { get { return SingleRoomCount + DoubleRoomCount + SuiteRoomCount + OtherRoomCount; } } public StatisticsHotelView() { } public StatisticsHotelView(int diid, string city, string hotelName, string bookingSite, string checkIn, string checkOut, int singleRoom, int doubleRoomCount, int suiteRoomCount, int otherRoomCount) { DIId = diid; City = city; BookinSite = bookingSite; CheckInDate = checkIn; CheckOutDate = checkOut; SingleRoomCount = singleRoom; DoubleRoomCount = doubleRoomCount; SuiteRoomCount = suiteRoomCount; OtherRoomCount = otherRoomCount; } } public class HotelReturnView { } #endregion #region 商邀邀请 public class StatisticsInvitation_HW { public int DIId { get; set; } public string GroupName { get; set; } public string Country { get; set; } public string City { get; set; } public string Client { get; set; } } public class StatisticsInvitation { public int DIId { get; set; } public string Country { get; set; } } #endregion #region 团组相关 public class StatisticsGroupInfoEntity { public int Id { get; set; } public DateTime VisitDate { get; set; } public int Month { get; set; } public string MonthName { get { return VisitDate.ToString("MMM", CultureInfo.GetCultureInfo("zh-CN")); } } public int Quarter { get { int quarter = 0; if (Month < 1 || Month > 12) return quarter; if (Month >= 1 && Month <= 3) quarter = 1; else if (Month >= 4 && Month <= 6) quarter = 2; else if (Month >= 7 && Month <= 9) quarter = 3; else if (Month >= 10 && Month <= 12) quarter = 4; return quarter; } } public string QuarterName { get { string quarterName = "-"; if (Month < 1 || Month > 12) return quarterName; if (Month >= 1 && Month <= 3) quarterName = "第一季度"; else if (Month >= 4 && Month <= 6) quarterName = "第二季度"; else if (Month >= 7 && Month <= 9) quarterName = "第三季度"; else if (Month >= 10 && Month <= 12) quarterName = "第四季度"; return quarterName; } } public int VisitPNumber { get; set; } } #endregion #region OP public class StatisticsOP { /* * OP统计图(实际成本同比年/月) *分块:如车费/导游费/导游交通/接送机费/司机工资/翻译费 *用于判断实际成本是否有增长【真实使用的时候估计是2025年和2024年对比,2023年的数据格式和数据量有问题】 * * 车费:91 车费 982 车超时费 * 导游费:92 导游费 985 导游交通 1059 导游超时费用 * 司机费:979 司机工资 * 小费:980 司机小费 95 导游小费 * 接送机费:96 接送机费 * 餐费:93 客户午餐费用 981 司机餐补 983 导游餐补 988 客户早餐费用 989 客户晚餐费用 * 1074 早餐超支费用 1075 午餐超支费用 1076 晚餐超支费用 * 住补费:992 住补费用 984 导游房补 * 景点费:94 导游景点费 990 景点门票费 1085 景点门票超支费用 * 翻译费:994 翻译费 1073 翻译超时费 * 饮料/零食/水果费:991 饮料/零食/水果 * 其他费:97 其他费用 1071 其他额外费用 */ //车费 private static int[] _carFeeIds = new int[] { 91, //车费 982, //车超时费 }; //导游费 private static int[] _guideFeeIds = new int[] { 92, //导游费 985, //导游交通 1059, //导游超时费用 }; //司机费 private static int[] _driverFeeIds = new int[]{ 979, //司机工资 }; //小费 private static int[] _tipsFeeIds = new int[] { 980, //司机小费 95, //导游小费 }; //接送机费 private static int[] _airportTransferFeeIds = new int[] { 96, //接送机费 }; //餐费 private static int[] _mealFeeIds = new[] { 93, //客户午餐费用 981, //司机餐补 983, //导游餐补 988, //客户早餐费用 989, //客户晚餐费用 1074,//早餐超支费用 1075,//午餐超支费用 1076,//晚餐超支费用 }; //住补费 private static int[] _sububoFeeIds = new[] { 992, //住补费用 984, //导游房补 }; //景点费 private static int[] _scenicSpotFeeIds = new[] { 94, //导游景点费 990, //景点门票费 1085,//景点门票超支费用 }; //翻译费 private static int[] _translationFeeIds = new[] { 994, //翻译费 1073, //翻译超时费 }; //饮料/零食/水果费 private static int[] _DSFFeeIds = new int[] { 991, //饮料/零食/水果 }; //其他费 private static int[] _otherFeeIds = new int[] { 97, //其他费用 1071,//其他额外费用 }; public int Id { get; set; } public int DiId { get; set; } public DateTime PaymentTime { get; set; } public int Year { get; set; } public int Quarter { get; set; } public int Month { get; set; } public string Area { get; set; } public string Country { get; set; } public string City { get; set; } public int ParentFeeId { get { return int.TryParse(GetFeeParentInfo(FeeSubType, 1), out int id) ? id : 0; } } public string ParentFeeName { get { return GetFeeParentInfo(FeeSubType, 2); } } public string ParentFeeRemark { get; set; } public int FeeType { get; set; } public string FeeTypeName { get; set; } public int FeeSubType { get; set; } public string FeeSubTypeName { get; set; } public decimal Price { get; set; } /// /// /// /// /// 1 id 2 name 3 备注 /// private string GetFeeParentInfo(int subFee,int type) { int id = -1; string name =string.Empty; string remark = string.Empty; // 车费:91 车费 982 车超时费 if (_carFeeIds.Contains(subFee)) { id = 1; name = "车费"; remark = "费用组成:车费、车超时费"; } // 导游费:92 导游费 985 导游交通 1059 导游超时费用 if (_guideFeeIds.Contains(subFee)) { id = 2; remark = "费用组成:导游费、导游交通、导游超时费用"; name = "导游费"; } // 司机费:979 司机工资 if (_driverFeeIds.Contains(subFee)) { id = 3; remark = "费用组成:司机工资"; name = "司机费"; } // 小费:980 司机小费 95 导游小费 if (_tipsFeeIds.Contains(subFee)) { id = 4; remark = "费用组成:司机小费、导游小费"; name = "小费"; } // 接送机费:96 接送机费 if (_airportTransferFeeIds.Contains(subFee)) { id = 5; remark = "费用组成:接送机费"; name = "接送机费"; } // 餐费:93 客户午餐费用 981 司机餐补 983 导游餐补 988 客户早餐费用 989 客户晚餐费用 // 1074 早餐超支费用 1075 午餐超支费用 1076 晚餐超支费用 if (_mealFeeIds.Contains(subFee)) { id = 6; remark = "费用组成:客户早餐费用、客户午餐费用、客户晚餐费用、司机餐补、导游餐补、早餐超支费用、午餐超支费用、晚餐超支费用"; name = "餐费"; } // 住补费:992 住补费用 984 导游房补 if (_sububoFeeIds.Contains(subFee)) { id = 7; remark = "费用组成:住补费用、导游房补"; name = "住补费"; } // 景点费:94 导游景点费 990 景点门票费 1085 景点门票超支费用 if (_scenicSpotFeeIds.Contains(subFee)) { id = 8; remark = "费用组成:导游景点费、景点门票费、景点门票超支费用"; name = "景点费"; } // 翻译费:994 翻译费 1073 翻译超时费 if (_translationFeeIds.Contains(subFee)) { id = 9; remark = "费用组成:翻译费、翻译超时费"; name = "翻译费"; } // 饮料/ 零食 / 水果费:991 饮料 / 零食 / 水果 if (_DSFFeeIds.Contains(subFee)) { id = 10; remark = "费用组成:饮料/零食/水果费"; name = "饮料/零食/水果费"; } // 其他费用:97 其他费用 1071 其他额外费用 if (_otherFeeIds.Contains(subFee)) { id = 11; remark = "费用组成:其他费用、其他额外费用"; name = "其他费用"; } string returnStr = string.Empty; if (type == 1) returnStr = id.ToString(); else if (type == 2) returnStr = name; else if (type == 3) returnStr = remark; return returnStr; } /// /// /// public OPParentFeeInfo[] _OPParentFeeInfo = new OPParentFeeInfo[] { new OPParentFeeInfo(1,"车费","费用组成:车费、车超时费"), new OPParentFeeInfo(2,"导游费","费用组成:导游费、导游交通、导游超时费用"), new OPParentFeeInfo(3,"司机费","费用组成:司机工资"), new OPParentFeeInfo(4,"小费","费用组成:司机小费、导游小费"), new OPParentFeeInfo(5,"接送机费","费用组成:客户早餐费用、客户午餐费用、客户晚餐费用、司机餐补、导游餐补、早餐超支费用、午餐超支费用、晚餐超支费用"), new OPParentFeeInfo(6,"餐费","费用组成:车费、车超时费"), new OPParentFeeInfo(7,"住补费","费用组成:住补费用、导游房补"), new OPParentFeeInfo(8,"景点费","费用组成:导游景点费、景点门票费、景点门票超支费用"), new OPParentFeeInfo(9,"翻译费","费用组成:翻译费、翻译超时费"), new OPParentFeeInfo(10,"饮料/零食/水果费","费用组成:饮料/零食/水果费"), new OPParentFeeInfo(11,"其他费用","费用组成:其他费用、其他额外费用"), }; } public class OPParentFeeInfo { public int Id { get; set; } public string Name { get; set; } public string Remark { get; set; } public OPParentFeeInfo() { } public OPParentFeeInfo(int id,string name ,string remark) { this.Id = id; this.Name = name; this.Remark = remark; } } public class StatisticsOPYOY { public int FeeId { get; set; } public string FeeName { get; set; } /// /// 本期 /// public decimal CurrPeriodFee { get; set; } /// /// 同期 /// public decimal SamePeriodFee { get; set; } public decimal Yoy { get; set; } public int CurrPeriodGroupTotal { get; set; } public int SamePeriodGroupTotal { get; set; } public StatisticsOPSubFeeYOY[] SubFeeData { get; set; } public StatisticsOPYOY() { } /// /// 构造函数 /// /// /// /// /// /// /// /// public StatisticsOPYOY(int feeId, string feeName, decimal currPeriodFee, decimal samePeriodFee, int currPeriodGroupTotal ,int samePeriodGroupTotal, StatisticsOPSubFeeYOY[] subFeeData) { this.FeeId = feeId; this.FeeName = feeName; this.CurrPeriodFee = currPeriodFee; this.SamePeriodFee = samePeriodFee; decimal _yoy = 0.00M; if (samePeriodFee != 0.00M) { _yoy = (currPeriodFee - samePeriodFee) / samePeriodFee; } this.Yoy = decimal.Parse(_yoy.ToString("0.##")); this.CurrPeriodGroupTotal = currPeriodGroupTotal; this.SamePeriodGroupTotal = samePeriodGroupTotal; this.SubFeeData = subFeeData; } } public class StatisticsOPSubFeeYOY : StatisticsOPYOY { public StatisticsOPCityYOY[] CityData { get; set; } public StatisticsOPSubFeeYOY() { } /// /// 构造函数 /// /// /// /// /// /// /// /// public StatisticsOPSubFeeYOY(int feeId, string feeName, decimal currPeriodFee, decimal samePeriodFee, int currPeriodGroupTotal, int samePeriodGroupTotal, StatisticsOPCityYOY[] cityData) { this.FeeId = feeId; this.FeeName = feeName; this.CurrPeriodFee = currPeriodFee; this.SamePeriodFee = samePeriodFee; decimal _yoy = 0.00M; if (samePeriodFee != 0.00M) { _yoy = (currPeriodFee - samePeriodFee) / samePeriodFee; } this.Yoy = decimal.Parse(_yoy.ToString("0.##")); this.CurrPeriodGroupTotal = currPeriodGroupTotal; this.SamePeriodGroupTotal = samePeriodGroupTotal; this.CityData = cityData; } } public class StatisticsOPCityYOY { public string CityName { get; set; } public int CurrPeriodGroupTotal { get; set; } public int SamePeriodGroupTotal { get; set; } /// /// 本期 /// public decimal CurrPeriodFee { get; set; } /// /// 同期 /// public decimal SamePeriodFee { get; set; } public decimal Yoy { get; set; } public StatisticsOPCityYOY() { } public StatisticsOPCityYOY(string cityName, decimal currPeriodFee, decimal samePeriodFee, int currPeriodGroupTotal,int samePeriodGroupTotal) { this.CityName = cityName; this.CurrPeriodGroupTotal = currPeriodGroupTotal; this.SamePeriodGroupTotal = samePeriodGroupTotal; this.CurrPeriodFee = currPeriodFee; this.SamePeriodFee = samePeriodFee; string _yoy = "0.00"; if (samePeriodFee != 0) { _yoy = ((currPeriodFee - samePeriodFee) / samePeriodFee).ToString("0.##"); } this.Yoy = decimal.TryParse(_yoy, out decimal yoy1) ? yoy1 : 0.00M; } } public class StatisticsOPMonthYOY { public int MonthId { get; set; } public string MonthName { get; set; } public StatisticsOPYOY[] FeeDatas { get; set; } public StatisticsOPMonthYOY() { } public StatisticsOPMonthYOY(int monthId, string monthName, StatisticsOPYOY[] feeDatas) { MonthId = monthId; MonthName = monthName; FeeDatas = feeDatas; } } #endregion #region 团组预算/实际成本 public class StatisticsBRCostBasicData { /// /// 预算币种 /// public string Budget_CurrencyCode { get; set; } /// /// 预算币种汇率 /// public decimal Budget_Rate { get; set; } /// /// 预算签证成本 /// public decimal Budget_VisaAmount { get; set; } /// /// 实际签证成本 /// public decimal Reality_VisaAmount { get; set; } /// /// 实际签证成本描述 /// public string Reality_VisaAmountDesc { get; set; } /// /// 预算机票成本 /// public decimal Budget_AirTicketAmount { get; set; } /// /// 实际机票 /// public decimal Reality_AirTicketAmount { get; set; } /// /// 实际机票描述 /// public string Reality_AirTicketAmountDesc { get; set; } /// /// 预算酒店成本 /// public decimal Budget_HotelAmount { get; set; } /// /// 实际酒店成本 /// public decimal Reality_HotelAmount { get; set; } /// /// 实际酒店成本描述 /// public string Reality_HotelAmountDesc { get; set; } /// /// 预算 OP /// public decimal Budget_OPAmount { get; set; } /// /// 实际 OP /// public decimal Reality_OPAmount { get; set; } /// /// 实际 OP成本描述 /// public string Reality_OPAmountDesc { get; set; } /// /// 预算 商邀 /// public decimal Budget_OAAmount { get; set; } /// /// 实际 商邀 /// public decimal Reality_OAAmount { get; set; } /// /// 实际 商邀成本描述 /// public string Reality_OAAmountDesc { get; set; } /// /// 预算其他成本 /// public decimal Budget_OtherAmount { get; set; } /// /// 实际其他成本 - 保险 /// public decimal Reality_InsureAmount { get; set; } /// /// 实际其他成本 - 其他款项 /// public decimal Reality_OtherCostAmount { get; set; } /// /// 实际其他成本 - 其他款项、保险描述 /// public string Reality_OtherCostAmountDesc { get; set; } } public class StatisticsBRCostView : StatisticsBRCostBasicData { public int RowNumber { get; set; } public int Id { get; set; } public string GroupName { get; set; } public string ClientUnit { get; set; } public DateTime VisitDate { get; set; } public int VisitDays { get; set; } public int VisitPNumber { get; set; } public decimal BudgetAmount { get { return Budget_VisaAmount + Budget_AirTicketAmount + Budget_HotelAmount + Budget_OPAmount + Budget_OAAmount + Budget_OtherAmount; } } public decimal RealityAmount { get { return Reality_VisaAmount + Reality_AirTicketAmount + Reality_HotelAmount + Reality_OPAmount + Reality_OAAmount + Reality_InsureAmount + Reality_OtherCostAmount; } } public decimal ExcessAmount { get { return RealityAmount - BudgetAmount; } } public string ExcessPercentage { get { if (BudgetAmount == 0) return $"0%"; //if (ExcessAmount<=0) return $"0%"; var percentage = (ExcessAmount / BudgetAmount) * 100; return $"{percentage.ToString("0.00")}%"; } } public GroupTypeInfo[] Details { get { var rateStr = $"汇率:{Budget_Rate.ToString("#0.0000")};" ; var currencyCode = Budget_CurrencyCode; decimal original_budget_airTicketAmount = 0.00M, original_budget_HotelAmount = 0.00M, original_budget_VisaAmount = 0.00M, original_budget_OPAmount = 0.00M, original_budget_OAAmount = 0.00M, original_budget_OtherAmount = 0.00M; if (Budget_Rate != 0) { original_budget_airTicketAmount = Budget_AirTicketAmount / Budget_Rate; original_budget_HotelAmount = Budget_HotelAmount / Budget_Rate; original_budget_VisaAmount = Budget_VisaAmount / Budget_Rate; original_budget_OPAmount = Budget_OPAmount / Budget_Rate; original_budget_OAAmount = Budget_OAAmount / Budget_Rate; original_budget_OtherAmount = Budget_OtherAmount / Budget_Rate; } var budget_AirTicketAmountStr = Budget_AirTicketAmount == 0 ? "-" : $"{Budget_AirTicketAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_airTicketAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var budget_HotelAmountStr = Budget_HotelAmount == 0 ? "-" : $"{Budget_HotelAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_HotelAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var budget_VisaAmountStr = Budget_VisaAmount == 0 ? "-" : $"{Budget_VisaAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_VisaAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var budget_OPAmountStr = Budget_OPAmount == 0 ? "-" : $"{Budget_OPAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_OPAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var budget_OAAmountStr = Budget_OAAmount == 0 ? "-" : $"{Budget_OAAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_OAAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var budget_OtherAmountStr = Budget_OtherAmount == 0 ? "-" : $"{Budget_OtherAmount.ToString("#0.00")}CNY(实际币种金额:{original_budget_OtherAmount.ToString("#0.00")} {currencyCode} {rateStr})"; var reality_AirTicketAmountStr = Reality_AirTicketAmount == 0 ? "-" : $"{Reality_AirTicketAmount.ToString("#0.00")} CNY({Reality_AirTicketAmountDesc})"; var reality_HotelAmountStr = Reality_HotelAmount == 0 ? "-" : $"{Reality_HotelAmount.ToString("#0.00")} CNY({Reality_HotelAmountDesc})"; var reality_VisaAmountStr = Reality_VisaAmount == 0 ? "-" : $"{Reality_VisaAmount.ToString("#0.00")} CNY({Reality_VisaAmountDesc})"; var reality_OPAmountStr = Reality_OPAmount == 0 ? "-" : $"{Reality_OPAmount.ToString("#0.00")} CNY({Reality_OPAmountDesc})"; var reality_OAAmountStr = Reality_OAAmount == 0 ? "-" : $"{Reality_OAAmount.ToString("#0.00")} CNY({Reality_OAAmountDesc})"; var reality_otherAmount = (Reality_InsureAmount + Reality_OtherCostAmount); var reality_OtherAmountStr = reality_otherAmount == 0 ? "-" : $"{reality_otherAmount.ToString("#0.00")} CNY({Reality_OtherCostAmountDesc})"; return new GroupTypeInfo[] { new GroupTypeInfo(1,"机票",budget_AirTicketAmountStr,reality_AirTicketAmountStr), new GroupTypeInfo(2,"酒店",budget_HotelAmountStr,reality_HotelAmountStr), new GroupTypeInfo(3,"签证",budget_VisaAmountStr,reality_VisaAmountStr), new GroupTypeInfo(4,"OP",budget_OPAmountStr,reality_OPAmountStr), new GroupTypeInfo(5,"商邀",budget_OAAmountStr,reality_OAAmountStr), new GroupTypeInfo(6,"其他",budget_OtherAmountStr,reality_OtherAmountStr) }; } } } public class GroupTypeInfo { public int No { get; set; } public string Module { get; set; } public string BudgetAmountDesc { get; set; } public string RealityAmountDesc { get; set; } public GroupTypeInfo(int no, string module, string budgetAmount, string realityAmount) { No = no; Module = module; BudgetAmountDesc = budgetAmount; RealityAmountDesc = realityAmount; } } public class StatisticsBRCostBriefView { public int RowNumber { get; set; } public int Id { get; set; } public string GroupName { get; set; } public string ClientUnit { get; set; } public DateTime VisitDate { get; set; } public int VisitDays { get; set; } public int VisitPNumber { get; set; } public decimal BudgetAmount { get; set; } public decimal RealityAmount { get; set; } public decimal ExcessAmount { get; set; } public string ExcessPercentage { get; set; } public GroupTypeInfo[] Details { get; set; } } #endregion #region 团组数据统计-当前时间团组所在城市 public class StatisticsNowCityOfGroupView { public string CurrDate { get; set; } public string GroupName { get; set; } public string FlightNo { get; set; } public string DepartAirportCode { get; set; } public string DepartCountryName { get; set; } public string DepartCityName { get; set; } public string ArriveAirportCode { get; set; } public string ArriveCountryName { get; set; } public string ArriveCityName { get; set; } } #endregion #region /// /// 当前时间团组所在城市 View /// public class StatisticsNowCityOfGroupResultView { /// /// 团组名称 /// public string GroupName { get; set; } /// /// 单位 /// public string Client { get; set; } /// /// 当前状态 /// public string StatusText { get; set; } public string Address { get; set; } } #endregion #endregion }