|
@@ -1,45 +1,15 @@
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-using System;
|
|
|
|
|
-using System.Collections.Generic;
|
|
|
|
|
-using System.Linq;
|
|
|
|
|
-using System.Text;
|
|
|
|
|
-using System.Threading.Tasks;
|
|
|
|
|
-
|
|
|
|
|
-namespace OASystem.Domain.Entities.Groups
|
|
|
|
|
|
|
+namespace OASystem.Domain.Entities.Groups
|
|
|
{
|
|
{
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 团组成本预算表
|
|
/// 团组成本预算表
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
[SugarTable("Grp_GroupCostParameter")]
|
|
[SugarTable("Grp_GroupCostParameter")]
|
|
|
- public class Grp_GroupCostParameter:EntityBase
|
|
|
|
|
|
|
+ public class Grp_GroupCostParameter : EntityBase
|
|
|
{
|
|
{
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 团组ID
|
|
/// 团组ID
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
- [SugarColumn(IsNullable =true,ColumnDataType ="int")]
|
|
|
|
|
|
|
+ [SugarColumn(IsNullable = true, ColumnDataType = "int")]
|
|
|
public int DiId { get; set; }
|
|
public int DiId { get; set; }
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// 币种
|
|
/// 币种
|
|
@@ -322,8 +292,212 @@ namespace OASystem.Domain.Entities.Groups
|
|
|
public int TDCRS { get; set; }
|
|
public int TDCRS { get; set; }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public class Grp_GroupCostParameterView: Grp_GroupCostParameter
|
|
|
|
|
|
|
+ public class Grp_GroupCostParameterView : Grp_GroupCostParameter
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 费用计算
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public class GroupCostCalculate : Grp_GroupCostParameter
|
|
|
|
|
+ {
|
|
|
|
|
+ #region 各项费用计算 单人报价、总报价
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 签证单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal VisaSinglePrice { get { return VisaCB * VisaXS; } }
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 保险单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal PolicySinglePrice { get { return BXCB * BXXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 火车票单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal TicketSinglePrice { get { return HCPCB * HCPXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 机票经济舱单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal EconomySinglePrice { get { return JJCCB * JJCXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 机票公务舱单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal BusinessSinglePrice { get { return GWCCB * GWCXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 机票头等舱单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal FirstClassSinglePrice { get { return TDCCB * TDCXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 船票单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal FerryTicketSinglePrice { get { return CPCB * CPXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 核酸检测单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal NucleicAcidTesSinglePrice { get { return HSCB * HSXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 酒店TBR 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal HotelTBRSinglePrice { get { return TBRCB * TBRXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 酒店SGR 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal HotelSGRSinglePrice { get { return SGRCB * SGRXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 酒店JSES 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal HotelJSESSinglePrice { get { return JSESCB * JSESXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 酒店Suite 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal HotelSuiteSinglePrice { get { return SUITECB * SUITEXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 地接 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal GroundSinglePrice { get { return DJCB * DJXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 公务 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal BusinessActivitySinglePrice { get { return GWCB * GWXS; } }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 零用金 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal PettyCashSinglePrice { get { return LYJCB * LYJXS; } }
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ #region 费用组合计算 单人报价、总报价
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 费用集合
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public List<ChildFeeInfo> ChildFeeInfos
|
|
|
|
|
+ {
|
|
|
|
|
+ get
|
|
|
|
|
+ {
|
|
|
|
|
+ var list = new List<ChildFeeInfo>();
|
|
|
|
|
+ var otherSinglePrice = VisaSinglePrice + PolicySinglePrice + TicketSinglePrice + FerryTicketSinglePrice + NucleicAcidTesSinglePrice + GroundSinglePrice + BusinessActivitySinglePrice + PettyCashSinglePrice;
|
|
|
|
|
+ //经济舱 TBR、经济舱 SGR、经济舱 JS/ES、经济舱 SUITE、公务舱 TBR、公务舱 SGR、公务舱 JS/ES、公务舱 SUITE、头等舱 JS/ES、头等舱 SUITE
|
|
|
|
|
+ if (JJCRS > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (TBRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("经济舱 TBR", EconomySinglePrice + HotelTBRSinglePrice + otherSinglePrice, JJCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if (SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("经济舱 SGR", EconomySinglePrice + HotelSGRSinglePrice + otherSinglePrice, JJCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("经济舱 JS/ES", EconomySinglePrice + HotelJSESSinglePrice + otherSinglePrice, JJCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("经济舱 SUITE", EconomySinglePrice + HotelSuiteSinglePrice + otherSinglePrice, JJCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (GWCRS > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (TBRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("公务舱 TBR", BusinessSinglePrice + HotelTBRSinglePrice + otherSinglePrice, GWCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("公务舱 SGR", BusinessSinglePrice + HotelSGRSinglePrice + otherSinglePrice, GWCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("公务舱 JS/ES", BusinessSinglePrice + HotelJSESSinglePrice + otherSinglePrice, GWCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("公务舱 SUITE", BusinessSinglePrice + HotelSuiteSinglePrice + otherSinglePrice, GWCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (TDCRS > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("头等舱 JS/ES", FirstClassSinglePrice + HotelJSESSinglePrice + otherSinglePrice, TDCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ else if(SGRNumber > 0)
|
|
|
|
|
+ {
|
|
|
|
|
+ list.Add(new ChildFeeInfo("头等舱 SUITE", FirstClassSinglePrice + HotelSuiteSinglePrice + otherSinglePrice, TDCRS));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ #endregion
|
|
|
|
|
+
|
|
|
|
|
+ public decimal GroupTotalPrice { get { return ChildFeeInfos.Sum(x => x.TotalPrice); } }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public class ChildFeeInfo
|
|
|
{
|
|
{
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 费用类型名称
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public string TypeName { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 单人报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal SinglePrice { get; set; }
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 总人数
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public int TotalPeople { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 总报价
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal TotalPrice { get; set; }
|
|
|
|
|
+
|
|
|
|
|
+ public ChildFeeInfo() { }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 重构
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="typeName">类型名称</param>
|
|
|
|
|
+ /// <param name="singlePrice">单人报价</param>
|
|
|
|
|
+ /// <param name="totalPeople">人数</param>
|
|
|
|
|
+ public ChildFeeInfo(string typeName, decimal singlePrice, int totalPeople)
|
|
|
|
|
+ {
|
|
|
|
|
+ TypeName = typeName;
|
|
|
|
|
+ SinglePrice = TruncateTo(singlePrice, 2);
|
|
|
|
|
+ TotalPeople = totalPeople;
|
|
|
|
|
+ TotalPrice = TruncateTo(SinglePrice * totalPeople, 2);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// 截断保留指定位数小数(不四舍五入)
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ public decimal TruncateTo(decimal value, int decimals)
|
|
|
|
|
+ {
|
|
|
|
|
+ decimal factor = (decimal)Math.Pow(10, decimals);
|
|
|
|
|
+ return Math.Truncate(value * factor) / factor;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|