|
@@ -8,6 +8,7 @@ using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Xml.Linq;
|
|
|
|
|
|
namespace OASystem.Domain.ViewModels.Financial
|
|
|
{
|
|
@@ -926,10 +927,10 @@ namespace OASystem.Domain.ViewModels.Financial
|
|
|
public class StatisticsInvitation
|
|
|
{
|
|
|
public int DIId { get; set; }
|
|
|
- public string Country { get; set; } }
|
|
|
+ public string Country { get; set; }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
-
|
|
|
#region 团组相关
|
|
|
|
|
|
public class StatisticsGroupInfoEntity
|
|
@@ -970,6 +971,346 @@ namespace OASystem.Domain.ViewModels.Financial
|
|
|
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; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="subFee"></param>
|
|
|
+ /// <param name="type">1 id 2 name 3 备注 </param>
|
|
|
+ /// <returns></returns>
|
|
|
+ private static 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 class StatisticsOPYOY
|
|
|
+ {
|
|
|
+ public int FeeId { get; set; }
|
|
|
+ public string FeeName { get; set; }
|
|
|
+ /// <summary>
|
|
|
+ /// 本期
|
|
|
+ /// </summary>
|
|
|
+ public decimal CurrPeriodFee { get; set; }
|
|
|
+ /// <summary>
|
|
|
+ /// 同期
|
|
|
+ /// </summary>
|
|
|
+ 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() { }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 构造函数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="year"></param>
|
|
|
+ /// <param name="month"></param>
|
|
|
+ /// <param name="thisAmount"></param>
|
|
|
+ /// <param name="lastAmount"></param>
|
|
|
+ /// <param name="thisIds"></param>
|
|
|
+ /// <param name="lastIds"></param>
|
|
|
+ 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; }
|
|
|
+ /// <summary>
|
|
|
+ /// 构造函数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="year"></param>
|
|
|
+ /// <param name="month"></param>
|
|
|
+ /// <param name="thisAmount"></param>
|
|
|
+ /// <param name="lastAmount"></param>
|
|
|
+ /// <param name="thisIds"></param>
|
|
|
+ /// <param name="lastIds"></param>
|
|
|
+ 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; }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 本期
|
|
|
+ /// </summary>
|
|
|
+ public decimal CurrPeriodFee { get; set; }
|
|
|
+ /// <summary>
|
|
|
+ /// 同期
|
|
|
+ /// </summary>
|
|
|
+ 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.Parse(_yoy);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
#endregion
|
|
|
}
|