| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- namespace OASystem.Domain.Entities.Groups
- {
- /// <summary>
- /// 团组成本预算表
- /// </summary>
- [SugarTable("Grp_GroupCostParameter")]
- public class Grp_GroupCostParameter : EntityBase
- {
- /// <summary>
- /// 团组ID
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int DiId { get; set; }
- /// <summary>
- /// 币种
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
- public string Currency { get; set; }
- /// <summary>
- /// 汇率
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal Rate { get; set; }
- /// <summary>
- /// 税率
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal Tax { get; set; }
- /// <summary>
- /// 房费预算
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal FFYS { get; set; }
- /// <summary>
- /// 酒店系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal HotelXS { get; set; }
- /// <summary>
- /// 经济舱成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal JJCCB { get; set; }
- /// <summary>
- /// 经济舱系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal JJCXS { get; set; }
- /// <summary>
- /// 经济舱人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int JJCRS { get; set; }
- /// <summary>
- /// 公务舱成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal GWCCB { get; set; }
- /// <summary>
- /// 公务舱系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal GWCXS { get; set; }
- /// <summary>
- /// 公务舱人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int GWCRS { get; set; }
- /// <summary>
- /// 火车票成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal HCPCB { get; set; }
- /// <summary>
- /// 火车票系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal HCPXS { get; set; }
- /// <summary>
- /// 火车票人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int HCPRS { get; set; }
- /// <summary>
- /// 船票成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal CPCB { get; set; }
- /// <summary>
- /// 船票系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal CPXS { get; set; }
- /// <summary>
- /// 船票人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int CPRS { get; set; }
- /// <summary>
- /// 保险成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal BXCB { get; set; }
- /// <summary>
- /// 保险系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal BXXS { get; set; }
- /// <summary>
- /// 保险人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int BXRS { get; set; }
- /// <summary>
- /// 核酸检测成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal HSCB { get; set; }
- /// <summary>
- /// 核酸检测系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal HSXS { get; set; }
- /// <summary>
- /// 核酸检测人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int HSRS { get; set; }
- /// <summary>
- /// 签证成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal VisaCB { get; set; }
- /// <summary>
- /// 签证系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal VisaXS { get; set; }
- /// <summary>
- /// 签证人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int VisaRS { get; set; }
- /// <summary>
- /// 公务成本 : 公杂费
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal GWCB { get; set; }
- /// <summary>
- /// 公务系数: 公杂费
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal GWXS { get; set; }
- /// <summary>
- /// 公务人数 : 公杂费
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int GWRS { get; set; }
- /// <summary>
- /// 地接成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal DJCB { get; set; }
- /// <summary>
- /// 地接人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int DJRS { get; set; }
- /// <summary>
- /// 地接系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal DJXS { get; set; }
- /// <summary>
- /// 单间 单人成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal SGRCB { get; set; }
- /// <summary>
- /// 单间数量(人数)
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int SGRNumber { get; set; }
- /// <summary>
- /// 单间 系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal SGRXS { get; set; }
- /// <summary>
- /// 1/2标间 单人成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal TBRCB { get; set; }
- /// <summary>
- /// 1/2标间数量(人数)
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int TBRNumber { get; set; }
- /// <summary>
- /// 1/2标间 系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal TBRXS { get; set; }
- /// <summary>
- /// 小套房/豪华套房 单人成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal JSESCB { get; set; }
- /// <summary>
- /// 小套房/豪华套房数量(人数)
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int JSESNumber { get; set; }
- /// <summary>
- /// 小套房/豪华套房 系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal JSESXS { get; set; }
- /// <summary>
- /// 套房 单人成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal SUITECB { get; set; }
- /// <summary>
- /// 套房数量(人数)
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int SUITENumber { get; set; }
- /// <summary>
- /// 套房 系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal SUITEXS { get; set; }
- /// <summary>
- /// 零用金成本
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal LYJCB { get; set; }
- /// <summary>
- /// 零用金系数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "decimal(10,2)")]
- public decimal LYJXS { get; set; }
- /// <summary>
- /// 零用金人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int LYJRS { get; set; }
- /// <summary>
- /// 成本完成标识 0:未完成 1:完成
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int IsShare { get; set; }
- /// <summary>
- /// 分段类型 A B
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "varchar(50)")]
- public string CostType { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
- public string CostTypeStartTime { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "DateTime")]
- public string CostTypeendTime { get; set; }
- /// <summary>
- /// 此段人数
- /// </summary>
- [SugarColumn(IsNullable = true, ColumnDataType = "int")]
- public int CostTypenumber { get; set; }
- /// <summary>
- /// 头等舱成本
- /// </summary>
- public decimal TDCCB { get; set; }
- /// <summary>
- /// 头等舱系数
- /// </summary>
- public decimal TDCXS { get; set; }
- /// <summary>
- /// 头等舱人数
- /// </summary>
- public int TDCRS { get; set; }
- }
- 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;
- }
- }
-
- }
|