Fin_DailyFeePaymentView.cs 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665
  1. using Dm;
  2. using Google.Protobuf.WellKnownTypes;
  3. using Npgsql.Replication.PgOutput;
  4. using OASystem.Domain.Entities.Financial;
  5. using OASystem.Domain.ViewModels.System;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Globalization;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Xml.Linq;
  13. namespace OASystem.Domain.ViewModels.Financial
  14. {
  15. /// <summary>
  16. /// 日付申请 View
  17. /// </summary>
  18. public class Fin_DailyFeePaymentView : Fin_DailyFeePayment
  19. { }
  20. public class Fin_DailyFeePaymentPageCount
  21. {
  22. /// <summary>
  23. /// 总条数
  24. /// </summary>
  25. public int Count { get; set; }
  26. }
  27. /// <summary>
  28. /// 日付申请 分页查询View
  29. /// </summary>
  30. public class Fin_DailyFeePaymentPageListView
  31. {
  32. /// <summary>
  33. /// 是否选中
  34. /// </summary>
  35. public bool IsChecked { get; set; }
  36. /// <summary>
  37. /// 行号
  38. /// </summary>
  39. public int RowNumber { get; set; }
  40. /// <summary>
  41. /// Id
  42. /// </summary>
  43. public int Id { get; set; }
  44. /// <summary>
  45. /// 公司Id
  46. /// </summary>
  47. public int CompanyId { get; set; }
  48. /// <summary>
  49. /// 公司名称
  50. /// </summary>
  51. public string? CompanyName { get; set; }
  52. /// <summary>
  53. /// 费用描述
  54. /// </summary>
  55. public string? Instructions { get; set; }
  56. /// <summary>
  57. /// 费用总计
  58. /// </summary>
  59. public decimal? SumPrice { get; set; }
  60. /// <summary>
  61. /// 申请人Id
  62. /// </summary>
  63. public int CreateUserId { get; set; }
  64. /// <summary>
  65. /// 申请人姓名
  66. /// </summary>
  67. public string? CreateUser { get; set; }
  68. /// <summary>
  69. /// 申请时间
  70. /// </summary>
  71. public DateTime CreateTime { get; set; }
  72. /// <summary>
  73. /// 财务审核
  74. /// </summary>
  75. public int FAudit { get; set; }
  76. /// <summary>
  77. /// 财务 审核状态
  78. /// </summary>
  79. public string? FAuditDesc
  80. {
  81. get
  82. {
  83. string str = "未审核";
  84. if (FAudit == 0) str = "未审核";
  85. else if (FAudit == 1)
  86. {
  87. str = "已通过";
  88. FAuditName = "朱成梅";
  89. }
  90. else if (FAudit == 2)
  91. {
  92. str = "未通过";
  93. FAuditName = "朱成梅";
  94. }
  95. return str;
  96. }
  97. }
  98. /// <summary>
  99. /// 财务审核人姓名
  100. /// </summary>
  101. public string? FAuditName { get; set; } = "无";
  102. /// <summary>
  103. /// 总经理审核
  104. /// </summary>
  105. public int MAudit { get; set; }
  106. /// <summary>
  107. /// 总经理 审核状态
  108. /// </summary>
  109. public string? MAuditDesc
  110. {
  111. get
  112. {
  113. string str = "未审核";
  114. if (MAudit == 0) str = "未审核";
  115. else if (MAudit == 1) { str = "已通过"; MAuditName = "张海麟"; }
  116. else if (MAudit == 2) { str = "未通过"; MAuditName = "张海麟"; }
  117. return str;
  118. }
  119. }
  120. /// <summary>
  121. /// 总经理审核姓名
  122. /// </summary>
  123. public string? MAuditName { get; set; } = "无";
  124. /// <summary>
  125. /// 费用类型
  126. /// </summary>
  127. public int PriceTypeId { get; set; }
  128. /// <summary>
  129. /// 支付标识 0,1
  130. /// </summary>
  131. public int IsPay { get; set; }
  132. }
  133. /// <summary>
  134. /// 日服申请 分页
  135. /// </summary>
  136. public class Fin_DailyFeePaymentPage
  137. {
  138. /// <summary>
  139. /// 总条数
  140. /// </summary>
  141. public int? Rows { get; set; }
  142. public List<Fin_DailyFeePaymentPageListView> Data { get; set; }
  143. }
  144. /// <summary>
  145. /// 日付申请费用明细
  146. /// </summary>
  147. public class Fin_DailyFeePaymentContentInfolView
  148. {
  149. public int Id { get; set; }
  150. /// <summary>
  151. /// 费用名称
  152. /// </summary>
  153. public string PriceName { get; set; }
  154. /// <summary>
  155. /// 数量单价
  156. /// </summary>
  157. public decimal Quantity { get; set; }
  158. /// <summary>
  159. /// 费用单价
  160. /// </summary>
  161. public decimal Price { get; set; }
  162. /// <summary>
  163. /// 当前总计
  164. /// </summary>
  165. public decimal ItemTotal { get; set; }
  166. /// <summary>
  167. /// 备注
  168. /// </summary>
  169. public string Remark { get; set; }
  170. /// <summary>
  171. /// 备注描述
  172. /// </summary>
  173. public string RemaksDescription { get; set; }
  174. /// <summary>
  175. /// Excel备注描述
  176. /// </summary>
  177. public string ExcelRemaksDescription { get; set; }
  178. }
  179. public class Fin_DailyFeePaymentInfolView
  180. {
  181. public int Id { get; set; }
  182. public int CompanyId { get; set; }
  183. public int TransferTypeId { get; set; }
  184. public int PriceTypeId { get; set; }
  185. public string Instructions { get; set; }
  186. public decimal SumPrice { get; set; }
  187. public int GroupId { get; set; }
  188. public int CreateUserId { get; set; }
  189. /// <summary>
  190. /// 财务审核
  191. /// </summary>
  192. public int FAudit { get; set; }
  193. public string FAuditDesc
  194. {
  195. get
  196. {
  197. string str = "未审核";
  198. if (FAudit == 0) str = "未审核";
  199. else if (FAudit == 1) str = "已通过";
  200. else if (FAudit == 2) str = "未通过";
  201. return str;
  202. }
  203. }
  204. /// <summary>
  205. /// 总经理审核
  206. /// </summary>
  207. public int MAudit { get; set; }
  208. public string MAuditDesc
  209. {
  210. get
  211. {
  212. string str = "未审核";
  213. if (MAudit == 0) str = "未审核";
  214. else if (MAudit == 1) str = "已通过";
  215. else if (MAudit == 2) str = "未通过";
  216. return str;
  217. }
  218. }
  219. public DateTime CreateTime { get; set; }
  220. public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
  221. }
  222. /// <summary>
  223. /// android 详情
  224. /// </summary>
  225. public class Fin_DailyFeePaymentInfoAndroidlView
  226. {
  227. public int Id { get; set; }
  228. public int CompanyId { get; set; }
  229. public int TransferTypeId { get; set; }
  230. public int PriceTypeId { get; set; }
  231. public string Instructions { get; set; }
  232. public decimal SumPrice { get; set; }
  233. public int GroupId { get; set; }
  234. public int CreateUserId { get; set; }
  235. public List<Fin_DailyFeePaymentContentInfolView> FeeContents { get; set; }
  236. }
  237. /// <summary>
  238. /// 费用类型
  239. /// </summary>
  240. public class Fin_DailyFeePaymentPagePriceTypeView
  241. {
  242. /// <summary>
  243. /// 类型Id
  244. /// </summary>
  245. public int Id { get; set; }
  246. /// <summary>
  247. /// 名称
  248. /// </summary>
  249. public string Name { get; set; }
  250. }
  251. /// <summary>
  252. /// 费用子类型
  253. /// </summary>
  254. public class Fin_DailyFeePaymentPagePriceSubTypeView
  255. {
  256. /// <summary>
  257. /// 费用类型Id
  258. /// </summary>
  259. public int STid { get; set; }
  260. /// <summary>
  261. /// 子类型Id
  262. /// </summary>
  263. public int Id { get; set; }
  264. /// <summary>
  265. /// 子类型名称
  266. /// </summary>
  267. public string Name { get; set; }
  268. }
  269. /// <summary>
  270. /// 费用类型数据源
  271. /// </summary>
  272. public class Fin_DailyFeePaymentPagePriceTypeDataView
  273. {
  274. /// <summary>
  275. /// 费用类型
  276. /// </summary>
  277. public List<Fin_DailyFeePaymentPagePriceTypeView>? FeeTypeData { get; set; }
  278. /// <summary>
  279. /// 费用子类型
  280. /// </summary>
  281. public List<Fin_DailyFeePaymentPagePriceSubTypeView>? FeeSubTypeData { get; set; }
  282. /// <summary>
  283. /// 用户名称
  284. /// </summary>
  285. public List<UserNameView>? UserNameData { get; set; }
  286. /// <summary>
  287. /// 费用标识类型
  288. /// </summary>
  289. public List<Fin_DailyFeePaymentPagePriceTypeView>? FeeMarkTypeData { get; set; }
  290. /// <summary>
  291. /// 费用子类型
  292. /// </summary>
  293. public List<Fin_DailyFeePaymentPagePriceSubTypeView>? FeeMarkSubTypeData { get; set; }
  294. /// <summary>
  295. /// 公司名称
  296. /// </summary>
  297. public List<CompanyNameView>? CompanyNameData { get; set; }
  298. }
  299. /// <summary>
  300. /// 类型数据源
  301. /// </summary>
  302. public class DailyFeePaymentDataSourceView : Fin_DailyFeePaymentPagePriceTypeView
  303. {
  304. public List<Fin_DailyFeePaymentPagePriceSubTypeView> SubDatas { get; set; }
  305. }
  306. public class tree_Fin_DailyFeePaymentPageListView : Fin_DailyFeePaymentPageListView
  307. {
  308. public List<Fin_DailyFeePaymentContentInfolView> childList { get; set; }
  309. public string priceTypeStr { get; set; }
  310. public int transferTypeId { get; set; }
  311. public string transferTypeIdStr { get; set; }
  312. /// <summary>
  313. /// 公转:62,私转:63 --2024年4月9日 16:49:46 0,1
  314. /// </summary>
  315. public int transferParentId { get; set; }
  316. public string transferParentIdStr { get; set; }
  317. }
  318. public class tree_Fin_DailyFeePaymentResult : tree_Fin_DailyFeePaymentPageListView
  319. {
  320. public decimal gz { get; set; } = 0M;
  321. public decimal sz { get; set; } = 0M;
  322. public List<tree_Fin_DailyFeePaymentPageListView> dataList { get; set; }
  323. }
  324. /// <summary>
  325. /// 团组相关费用
  326. /// </summary>
  327. public class tree_Group_DailyFeePaymentResult
  328. {
  329. public decimal gz { get; set; } = 0M;
  330. public decimal sz { get; set; } = 0M;
  331. public List<tree_Group_DailyFeePaymentPageListView> dataList { get; set; }
  332. }
  333. /// <summary>
  334. /// 团组相关费用 List
  335. /// </summary>
  336. public class tree_Group_DailyFeePaymentPageListView
  337. {
  338. public string Id { get; set; }
  339. public string GroupName { get; set; }
  340. /// <summary>
  341. /// 费用所属公司Id
  342. /// </summary>
  343. public int CompanyId { get; set; }
  344. /// <summary>
  345. /// 费用所属公司
  346. /// </summary>
  347. public string ConpanyName { get; set; }
  348. /// <summary>
  349. /// 团组总计金额
  350. /// </summary>
  351. public decimal CNYTotalAmount { get; set; }
  352. public List<Group_DailyFeePaymentContentInfolView> ChildList { get; set; }
  353. }
  354. public class CompanyInfo
  355. {
  356. public int Id { get; set; }
  357. public string ConpanyName { get; set; }
  358. }
  359. public class Group_DailyFeePaymentContentInfolView
  360. {
  361. /// <summary>
  362. /// 是否选中
  363. /// </summary>
  364. public bool IsChecked { get; set; }
  365. public int Id { get; set; }
  366. /// <summary>
  367. /// 酒店费用子类 Id
  368. /// </summary>
  369. public int HotelSubId { get; set; } = -1;
  370. /// <summary>
  371. /// 支付方式
  372. /// </summary>
  373. public string PayType { get; set; }
  374. /// <summary>
  375. /// 转账标识
  376. /// </summary>
  377. public string TransferMark { get; set; }
  378. /// <summary>
  379. /// 序号
  380. /// </summary>
  381. public int RowNumber { get; set; }
  382. /// <summary>
  383. /// 申请人
  384. /// </summary>
  385. public string Applicant { get; set; }
  386. /// <summary>
  387. /// 申请时间
  388. /// </summary>
  389. public string ApplicantDt { get; set; }
  390. /// <summary>
  391. /// 收款方
  392. /// </summary>
  393. public string Payee { get; set; }
  394. /// <summary>
  395. /// 费用名称
  396. /// </summary>
  397. public string PriceName { get; set; }
  398. /// <summary>
  399. /// 费用所属模块
  400. /// </summary>
  401. public string ModuleName { get; set; }
  402. /// <summary>
  403. /// 付款币种
  404. /// </summary>
  405. public string PayCurrCode { get; set; }
  406. /// <summary>
  407. /// 付款金额
  408. /// </summary>
  409. public decimal PaymentAmount { get; set; }
  410. /// <summary>
  411. /// 付款汇率
  412. /// </summary>
  413. public decimal PayRate { get; set; }
  414. /// <summary>
  415. /// 小计人民币金额
  416. /// </summary>
  417. public decimal CNYSubTotalAmount { get; set; }
  418. /// <summary>
  419. /// 费用描述
  420. /// </summary>
  421. public string RemaksDescription { get; set; }
  422. /// <summary>
  423. /// 审核状态
  424. /// 0 未审核 1已通过 2未通过 3 自动审核
  425. /// </summary>
  426. public int AuditStatus { get; set; }
  427. }
  428. public class PaymentRequestCheckedView
  429. {
  430. public List<int> GroupIds { get; set; }
  431. public List<int> DailyPaymentIds { get; set; }
  432. public List<int> HotelSubIds { get; set; }
  433. }
  434. #region 日付报表
  435. [SqlSugar.SugarTable("Fin_DailyFeePayment")]
  436. public class DailyFeePaymentRangeView
  437. {
  438. //public string ViewStr
  439. //{
  440. // get
  441. // {
  442. // return $"{RowIndex}、【{CompanyName}】【{TransferType}】【{FeeType}】【{Instructions}】【{SumPrice.ToString("#0.00")}】【申请人:{Applicant} 申请时间:{ApplicantDt.ToString("yyyy-MM-dd HH:mm:ss")}】";
  443. // }
  444. //}
  445. public string ViewStr
  446. {
  447. get
  448. {
  449. return $"【{CompanyName}】【{TransferType}】【{FeeType}】【{Instructions}】【{SumPrice.ToString("#0.00")}】【申请人:{Applicant} 申请时间:{ApplicantDt.ToString("yyyy-MM-dd HH:mm:ss")}】";
  450. }
  451. }
  452. [SugarColumn(IsIgnore = true)]//需要加上
  453. public int RowIndex { get; set; } //行号 序号
  454. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  455. public int Id { get; set; }
  456. public string Instructions { get; set; }
  457. public int PriceTypeId { get; set; }
  458. public string FeeType { get; set; }
  459. public int TransferTypeId { get; set; }
  460. public string TransferType { get; set; }
  461. public decimal SumPrice { get; set; }
  462. public DateTime FAuditDate { get; set; }
  463. public DateTime MAuditDate { get; set; }
  464. public int CompanyId { get; set; }
  465. public string CompanyName { get; set; }
  466. public int ApplicantId { get; set; }
  467. public string Applicant { get; set; }
  468. public DateTime ApplicantDt { get; set; }
  469. [Navigate(NavigateType.OneToMany, nameof(DailyFeePaymentContentView.DFPId))]//BookA表中的studenId
  470. public List<DailyFeePaymentContentView> Contents { get; set; }
  471. //public string ContentStr { get; set; }
  472. }
  473. [SqlSugar.SugarTable("Fin_DailyFeePaymentContent")]
  474. public class DailyFeePaymentContentView
  475. {
  476. //[SugarColumn(IsIgnore = true)]//需要加上
  477. //public int RowIndex { get; set; } //行号 序号
  478. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  479. public int Id { get; set; }
  480. public int DFPId { get; set; }
  481. public string PriceName { get; set; }
  482. public int Quantity { get; set; }
  483. public decimal Price { get; set; }
  484. public decimal ItemTotal { get; set; }
  485. public string Remark { get; set; }
  486. //public int IsDel { get; set; }
  487. ///// <summary>
  488. ///// 示例:费用名称:[2024.07.11招商信用卡还款] 单价:[20000.00] 数量:[1.00] 小计:[20000.00] 备注:[]
  489. ///// </summary>
  490. //public string ViewStr
  491. //{
  492. // get
  493. // {
  494. // return $"费用名称:[{PriceName}] 单价:[{Price.ToString("#0.00")}] 数量:[{Quantity.ToString("#0.00")}] 小计:[{ItemTotal.ToString("#0.00")}] 备注:[{Remark}]";
  495. // }
  496. //}
  497. //public string ViewSubStr { get; set; }
  498. }
  499. public class ExcelView : DailyFeePaymentRangeView
  500. {
  501. public string ContentStr { get; set; }
  502. }
  503. #endregion
  504. #region 统计模块
  505. #region YOY
  506. public class StatisticsYOYView
  507. {
  508. public int Id { get; set; }
  509. public DateTime VisitDate { get; set; }
  510. public int Year { get; set; }
  511. public int Month { get; set; }
  512. /// <summary>
  513. /// 销售额金额
  514. /// </summary>
  515. public decimal SaleAmount { get; set; }
  516. /// <summary>
  517. /// 机票金额
  518. /// </summary>
  519. public decimal AirTicketAmount { get; set; }
  520. /// <summary>
  521. /// op金额
  522. /// </summary>
  523. public decimal OPAmount { get; set; }
  524. /// <summary>
  525. /// 其他费用金额
  526. /// </summary>
  527. public decimal OtherCostAmount { get; set; }
  528. /// <summary>
  529. /// 签证金额
  530. /// </summary>
  531. public decimal VisaAmount { get; set; }
  532. /// <summary>
  533. /// 邀请公务金额
  534. /// </summary>
  535. public decimal OAAmount { get; set; }
  536. /// <summary>
  537. /// 保险金额
  538. /// </summary>
  539. public decimal InsureAmount { get; set; }
  540. /// <summary>
  541. /// 酒店金额
  542. /// </summary>
  543. public decimal HotelAmount { get; set; }
  544. /// <summary>
  545. /// 超支金额
  546. /// </summary>
  547. public decimal ExcessAmount { get; set; }
  548. /// <summary>
  549. /// 收款退还金额
  550. /// </summary>
  551. public decimal SKTHAmount { get; set; }
  552. /// <summary>
  553. /// 成本金额
  554. /// </summary>
  555. public decimal CostAmount
  556. {
  557. get
  558. {
  559. return AirTicketAmount + HotelAmount + InsureAmount + OAAmount + VisaAmount + OtherCostAmount + OPAmount + ExcessAmount;
  560. }
  561. }
  562. /// <summary>
  563. /// 毛利润
  564. /// </summary>
  565. public decimal GrossProfitAmount
  566. {
  567. get
  568. {
  569. return SaleAmount - SKTHAmount - CostAmount;
  570. }
  571. }
  572. }
  573. public class YOYReturnView
  574. {
  575. public int Year { get; set; }
  576. public int Month { get; set; }
  577. public decimal ThisAmount { get; set; }
  578. public decimal LastAmount { get; set; }
  579. public string Yoy { get; set; }
  580. public List<int> ThisIds { get; set; }
  581. public List<int> LastIds { get; set; }
  582. /// <summary>
  583. /// 构造函数
  584. /// </summary>
  585. /// <param name="year"></param>
  586. /// <param name="month"></param>
  587. /// <param name="thisAmount"></param>
  588. /// <param name="lastAmount"></param>
  589. /// <param name="thisIds"></param>
  590. /// <param name="lastIds"></param>
  591. public YOYReturnView(int year, int month, decimal thisAmount, decimal lastAmount, List<int> thisIds, List<int> lastIds)
  592. {
  593. this.Year = year;
  594. this.Month = month;
  595. this.ThisAmount = thisAmount;
  596. this.LastAmount = lastAmount;
  597. string _yoy = "0.00%";
  598. if (lastAmount != 0)
  599. {
  600. _yoy = ((thisAmount - lastAmount) / lastAmount).ToString("#0.00") + "%";
  601. }
  602. this.Yoy = _yoy;
  603. this.ThisIds = thisIds;
  604. this.LastIds = lastIds;
  605. }
  606. }
  607. #endregion
  608. #region 国交数据统计 - 机票
  609. public class StatisticsAirTicketView
  610. {
  611. public int DIId { get; set; }
  612. public DmDateTime FlightsDate { get; set; }
  613. public int Year { get; set; }
  614. public int Month { get; set; }
  615. public int CType { get; set; }
  616. public string CTypeName { get; set; }
  617. public string FlightsCity { get; set; }
  618. public string FlightsCityName { get; set; }
  619. public int ClientNum { get; set; }
  620. public string GroupName { get; set; }
  621. public string Platform { get; set; }
  622. }
  623. public class AirTicketReturnView
  624. {
  625. public int Year { get; set; }
  626. public int Month { get; set; }
  627. /// <summary>
  628. /// 票数
  629. /// </summary>
  630. public int Quantity { get; set; }
  631. public List<AitTicketInfo> AitTicketInfos { get; set; }
  632. public List<int> LinkGroupIds { get; set; }
  633. /// <summary>
  634. /// 构造函数
  635. /// </summary>
  636. /// <param name="year"></param>
  637. /// <param name="month"></param>
  638. /// <param name="quantity"></param>
  639. /// <param name="aitTicketInfos"></param>
  640. /// <param name="linkGroupIds"></param>
  641. public AirTicketReturnView(int year, int month, int quantity, List<AitTicketInfo> aitTicketInfos, List<int> linkGroupIds)
  642. {
  643. this.Year = year;
  644. this.Month = month;
  645. this.Quantity = quantity;
  646. this.AitTicketInfos = aitTicketInfos;
  647. this.LinkGroupIds = linkGroupIds;
  648. }
  649. /// <summary>
  650. /// 构造函数
  651. /// </summary>
  652. /// <param name="year"></param>
  653. /// <param name="month"></param>
  654. /// <param name="quantity"></param>
  655. /// <param name="linkGroupIds"></param>
  656. public AirTicketReturnView(int year, int month, int quantity, List<int> linkGroupIds)
  657. {
  658. this.Year = year;
  659. this.Month = month;
  660. this.Quantity = quantity;
  661. this.LinkGroupIds = linkGroupIds;
  662. }
  663. }
  664. public class AirTicketCityReturnView : AirTicketReturnView
  665. {
  666. public List<AirTicketCityInfo> CityData { get; set; }
  667. /// <summary>
  668. /// 构造函数
  669. /// </summary>
  670. /// <param name="year"></param>
  671. /// <param name="month"></param>
  672. /// <param name="quantity"></param>
  673. /// <param name="cityData"></param>
  674. /// <param name="linkGroupIds"></param>
  675. public AirTicketCityReturnView(int year, int month, int quantity, List<AirTicketCityInfo> cityData, List<int> linkGroupIds)
  676. : base(year, month, quantity, linkGroupIds)
  677. {
  678. this.Year = year;
  679. this.Month = month;
  680. this.Quantity = quantity;
  681. this.CityData = cityData;
  682. this.LinkGroupIds = linkGroupIds;
  683. }
  684. }
  685. public class AitTicketInfo
  686. {
  687. public int Id { get; set; }
  688. public string GroupName { get; set; }
  689. public int Quantity { get; set; }
  690. public AitTicketInfo(int id, string groupName, int quantity)
  691. {
  692. this.Id = id;
  693. this.GroupName = groupName;
  694. this.Quantity = quantity;
  695. }
  696. }
  697. public class AirTicketCityInfo
  698. {
  699. public string City { get; set; }
  700. public int Quantity { get; set; }
  701. public AirTicketCityInfo(string city, int quantity = 0)
  702. {
  703. City = city;
  704. Quantity = quantity;
  705. }
  706. }
  707. #endregion
  708. #region 酒店
  709. public class StatisticsHotelView
  710. {
  711. public int DIId { get; set; }
  712. public string Country { get; set; }
  713. public string City { get; set; }
  714. public string CityStr
  715. {
  716. get
  717. {
  718. return City.Replace(" ", "").ToUpper();
  719. }
  720. }
  721. public string HotelName { get; set; }
  722. public string BookinSite { get; set; }
  723. public string CheckInDate { get; set; }
  724. //public int Year { get; set; }
  725. //public int Month { get; set; }
  726. public string CheckOutDate { get; set; }
  727. public int SingleRoomCount { get; set; }
  728. public int DoubleRoomCount { get; set; }
  729. public int SuiteRoomCount { get; set; }
  730. public int OtherRoomCount { get; set; }
  731. public int RoomNights
  732. {
  733. get
  734. {
  735. int nights = 0;
  736. if (!string.IsNullOrEmpty(CheckInDate) && !string.IsNullOrEmpty(CheckOutDate))
  737. {
  738. DateTime checkin, checkout;
  739. bool checkInBool = DateTime.TryParse(CheckInDate, out checkin);
  740. bool checkOutBool = DateTime.TryParse(CheckOutDate, out checkout);
  741. if (checkInBool && checkOutBool)
  742. {
  743. nights = (checkout - checkin).Days * RoomTotal;
  744. }
  745. }
  746. return nights;
  747. }
  748. }
  749. public int RoomTotal
  750. {
  751. get
  752. {
  753. return SingleRoomCount + DoubleRoomCount + SuiteRoomCount + OtherRoomCount;
  754. }
  755. }
  756. public StatisticsHotelView() { }
  757. public StatisticsHotelView(int diid, string city, string hotelName, string bookingSite, string checkIn, string checkOut, int singleRoom, int doubleRoomCount, int suiteRoomCount, int otherRoomCount)
  758. {
  759. DIId = diid;
  760. City = city;
  761. BookinSite = bookingSite;
  762. CheckInDate = checkIn;
  763. CheckOutDate = checkOut;
  764. SingleRoomCount = singleRoom;
  765. DoubleRoomCount = doubleRoomCount;
  766. SuiteRoomCount = suiteRoomCount;
  767. OtherRoomCount = otherRoomCount;
  768. }
  769. }
  770. public class HotelReturnView
  771. {
  772. }
  773. #endregion
  774. #region 商邀邀请
  775. public class StatisticsInvitation_HW
  776. {
  777. public int DIId { get; set; }
  778. public string GroupName { get; set; }
  779. public string Country { get; set; }
  780. public string City { get; set; }
  781. public string Client { get; set; }
  782. }
  783. public class StatisticsInvitation
  784. {
  785. public int DIId { get; set; }
  786. public string Country { get; set; }
  787. }
  788. #endregion
  789. #region 团组相关
  790. public class StatisticsGroupInfoEntity
  791. {
  792. public int Id { get; set; }
  793. public DateTime VisitDate { get; set; }
  794. public int Month { get; set; }
  795. public string MonthName { get { return VisitDate.ToString("MMM", CultureInfo.GetCultureInfo("zh-CN")); } }
  796. public int Quarter
  797. {
  798. get
  799. {
  800. int quarter = 0;
  801. if (Month < 1 || Month > 12) return quarter;
  802. if (Month >= 1 && Month <= 3) quarter = 1;
  803. else if (Month >= 4 && Month <= 6) quarter = 2;
  804. else if (Month >= 7 && Month <= 9) quarter = 3;
  805. else if (Month >= 10 && Month <= 12) quarter = 4;
  806. return quarter;
  807. }
  808. }
  809. public string QuarterName
  810. {
  811. get
  812. {
  813. string quarterName = "-";
  814. if (Month < 1 || Month > 12) return quarterName;
  815. if (Month >= 1 && Month <= 3) quarterName = "第一季度";
  816. else if (Month >= 4 && Month <= 6) quarterName = "第二季度";
  817. else if (Month >= 7 && Month <= 9) quarterName = "第三季度";
  818. else if (Month >= 10 && Month <= 12) quarterName = "第四季度";
  819. return quarterName;
  820. }
  821. }
  822. public int VisitPNumber { get; set; }
  823. }
  824. #endregion
  825. #region OP
  826. public class StatisticsOP
  827. {
  828. /*
  829. * OP统计图(实际成本同比年/月)
  830. *分块:如车费/导游费/导游交通/接送机费/司机工资/翻译费
  831. *用于判断实际成本是否有增长【真实使用的时候估计是2025年和2024年对比,2023年的数据格式和数据量有问题】
  832. *
  833. * 车费:91 车费 982 车超时费
  834. * 导游费:92 导游费 985 导游交通 1059 导游超时费用
  835. * 司机费:979 司机工资
  836. * 小费:980 司机小费 95 导游小费
  837. * 接送机费:96 接送机费
  838. * 餐费:93 客户午餐费用 981 司机餐补 983 导游餐补 988 客户早餐费用 989 客户晚餐费用
  839. * 1074 早餐超支费用 1075 午餐超支费用 1076 晚餐超支费用
  840. * 住补费:992 住补费用 984 导游房补
  841. * 景点费:94 导游景点费 990 景点门票费 1085 景点门票超支费用
  842. * 翻译费:994 翻译费 1073 翻译超时费
  843. * 饮料/零食/水果费:991 饮料/零食/水果
  844. * 其他费:97 其他费用 1071 其他额外费用
  845. */
  846. //车费
  847. private static int[] _carFeeIds = new int[] {
  848. 91, //车费
  849. 982, //车超时费
  850. };
  851. //导游费
  852. private static int[] _guideFeeIds = new int[] {
  853. 92, //导游费
  854. 985, //导游交通
  855. 1059, //导游超时费用
  856. };
  857. //司机费
  858. private static int[] _driverFeeIds = new int[]{
  859. 979, //司机工资
  860. };
  861. //小费
  862. private static int[] _tipsFeeIds = new int[] {
  863. 980, //司机小费
  864. 95, //导游小费
  865. };
  866. //接送机费
  867. private static int[] _airportTransferFeeIds = new int[] {
  868. 96, //接送机费
  869. };
  870. //餐费
  871. private static int[] _mealFeeIds = new[] {
  872. 93, //客户午餐费用
  873. 981, //司机餐补
  874. 983, //导游餐补
  875. 988, //客户早餐费用
  876. 989, //客户晚餐费用
  877. 1074,//早餐超支费用
  878. 1075,//午餐超支费用
  879. 1076,//晚餐超支费用
  880. };
  881. //住补费
  882. private static int[] _sububoFeeIds = new[] {
  883. 992, //住补费用
  884. 984, //导游房补
  885. };
  886. //景点费
  887. private static int[] _scenicSpotFeeIds = new[] {
  888. 94, //导游景点费
  889. 990, //景点门票费
  890. 1085,//景点门票超支费用
  891. };
  892. //翻译费
  893. private static int[] _translationFeeIds = new[] {
  894. 994, //翻译费
  895. 1073, //翻译超时费
  896. };
  897. //饮料/零食/水果费
  898. private static int[] _DSFFeeIds = new int[] {
  899. 991, //饮料/零食/水果
  900. };
  901. //其他费
  902. private static int[] _otherFeeIds = new int[] {
  903. 97, //其他费用
  904. 1071,//其他额外费用
  905. };
  906. public int Id { get; set; }
  907. public int DiId { get; set; }
  908. public DateTime PaymentTime { get; set; }
  909. public int Year { get; set; }
  910. public int Quarter { get; set; }
  911. public int Month { get; set; }
  912. public string Area { get; set; }
  913. public string Country { get; set; }
  914. public string City { get; set; }
  915. public int ParentFeeId {
  916. get
  917. {
  918. return int.TryParse(GetFeeParentInfo(FeeSubType, 1), out int id) ? id : 0;
  919. }
  920. }
  921. public string ParentFeeName
  922. {
  923. get
  924. {
  925. return GetFeeParentInfo(FeeSubType, 2);
  926. }
  927. }
  928. public string ParentFeeRemark { get; set; }
  929. public int FeeType { get; set; }
  930. public string FeeTypeName { get; set; }
  931. public int FeeSubType { get; set; }
  932. public string FeeSubTypeName { get; set; }
  933. public decimal Price { get; set; }
  934. /// <summary>
  935. ///
  936. /// </summary>
  937. /// <param name="subFee"></param>
  938. /// <param name="type">1 id 2 name 3 备注 </param>
  939. /// <returns></returns>
  940. private string GetFeeParentInfo(int subFee,int type)
  941. {
  942. int id = -1;
  943. string name =string.Empty;
  944. string remark = string.Empty;
  945. // 车费:91 车费 982 车超时费
  946. if (_carFeeIds.Contains(subFee))
  947. {
  948. id = 1;
  949. name = "车费";
  950. remark = "费用组成:车费、车超时费";
  951. }
  952. // 导游费:92 导游费 985 导游交通 1059 导游超时费用
  953. if (_guideFeeIds.Contains(subFee))
  954. {
  955. id = 2;
  956. remark = "费用组成:导游费、导游交通、导游超时费用";
  957. name = "导游费";
  958. }
  959. // 司机费:979 司机工资
  960. if (_driverFeeIds.Contains(subFee))
  961. {
  962. id = 3;
  963. remark = "费用组成:司机工资";
  964. name = "司机费";
  965. }
  966. // 小费:980 司机小费 95 导游小费
  967. if (_tipsFeeIds.Contains(subFee))
  968. {
  969. id = 4;
  970. remark = "费用组成:司机小费、导游小费";
  971. name = "小费";
  972. }
  973. // 接送机费:96 接送机费
  974. if (_airportTransferFeeIds.Contains(subFee))
  975. {
  976. id = 5;
  977. remark = "费用组成:接送机费";
  978. name = "接送机费";
  979. }
  980. // 餐费:93 客户午餐费用 981 司机餐补 983 导游餐补 988 客户早餐费用 989 客户晚餐费用
  981. // 1074 早餐超支费用 1075 午餐超支费用 1076 晚餐超支费用
  982. if (_mealFeeIds.Contains(subFee))
  983. {
  984. id = 6;
  985. remark = "费用组成:客户早餐费用、客户午餐费用、客户晚餐费用、司机餐补、导游餐补、早餐超支费用、午餐超支费用、晚餐超支费用";
  986. name = "餐费";
  987. }
  988. // 住补费:992 住补费用 984 导游房补
  989. if (_sububoFeeIds.Contains(subFee))
  990. {
  991. id = 7;
  992. remark = "费用组成:住补费用、导游房补";
  993. name = "住补费";
  994. }
  995. // 景点费:94 导游景点费 990 景点门票费 1085 景点门票超支费用
  996. if (_scenicSpotFeeIds.Contains(subFee))
  997. {
  998. id = 8;
  999. remark = "费用组成:导游景点费、景点门票费、景点门票超支费用";
  1000. name = "景点费";
  1001. }
  1002. // 翻译费:994 翻译费 1073 翻译超时费
  1003. if (_translationFeeIds.Contains(subFee))
  1004. {
  1005. id = 9;
  1006. remark = "费用组成:翻译费、翻译超时费";
  1007. name = "翻译费";
  1008. }
  1009. // 饮料/ 零食 / 水果费:991 饮料 / 零食 / 水果
  1010. if (_DSFFeeIds.Contains(subFee))
  1011. {
  1012. id = 10;
  1013. remark = "费用组成:饮料/零食/水果费";
  1014. name = "饮料/零食/水果费";
  1015. }
  1016. // 其他费用:97 其他费用 1071 其他额外费用
  1017. if (_otherFeeIds.Contains(subFee))
  1018. {
  1019. id = 11;
  1020. remark = "费用组成:其他费用、其他额外费用";
  1021. name = "其他费用";
  1022. }
  1023. string returnStr = string.Empty;
  1024. if (type == 1) returnStr = id.ToString();
  1025. else if (type == 2) returnStr = name;
  1026. else if (type == 3) returnStr = remark;
  1027. return returnStr;
  1028. }
  1029. /// <summary>
  1030. ///
  1031. /// </summary>
  1032. public OPParentFeeInfo[] _OPParentFeeInfo = new OPParentFeeInfo[] {
  1033. new OPParentFeeInfo(1,"车费","费用组成:车费、车超时费"),
  1034. new OPParentFeeInfo(2,"导游费","费用组成:导游费、导游交通、导游超时费用"),
  1035. new OPParentFeeInfo(3,"司机费","费用组成:司机工资"),
  1036. new OPParentFeeInfo(4,"小费","费用组成:司机小费、导游小费"),
  1037. new OPParentFeeInfo(5,"接送机费","费用组成:客户早餐费用、客户午餐费用、客户晚餐费用、司机餐补、导游餐补、早餐超支费用、午餐超支费用、晚餐超支费用"),
  1038. new OPParentFeeInfo(6,"餐费","费用组成:车费、车超时费"),
  1039. new OPParentFeeInfo(7,"住补费","费用组成:住补费用、导游房补"),
  1040. new OPParentFeeInfo(8,"景点费","费用组成:导游景点费、景点门票费、景点门票超支费用"),
  1041. new OPParentFeeInfo(9,"翻译费","费用组成:翻译费、翻译超时费"),
  1042. new OPParentFeeInfo(10,"饮料/零食/水果费","费用组成:饮料/零食/水果费"),
  1043. new OPParentFeeInfo(11,"其他费用","费用组成:其他费用、其他额外费用"),
  1044. };
  1045. }
  1046. public class OPParentFeeInfo
  1047. {
  1048. public int Id { get; set; }
  1049. public string Name { get; set; }
  1050. public string Remark { get; set; }
  1051. public OPParentFeeInfo() { }
  1052. public OPParentFeeInfo(int id,string name ,string remark)
  1053. {
  1054. this.Id = id;
  1055. this.Name = name;
  1056. this.Remark = remark;
  1057. }
  1058. }
  1059. public class StatisticsOPYOY
  1060. {
  1061. public int FeeId { get; set; }
  1062. public string FeeName { get; set; }
  1063. /// <summary>
  1064. /// 本期
  1065. /// </summary>
  1066. public decimal CurrPeriodFee { get; set; }
  1067. /// <summary>
  1068. /// 同期
  1069. /// </summary>
  1070. public decimal SamePeriodFee { get; set; }
  1071. public decimal Yoy { get; set; }
  1072. public int CurrPeriodGroupTotal { get; set; }
  1073. public int SamePeriodGroupTotal { get; set; }
  1074. public StatisticsOPSubFeeYOY[] SubFeeData { get; set; }
  1075. public StatisticsOPYOY() { }
  1076. /// <summary>
  1077. /// 构造函数
  1078. /// </summary>
  1079. /// <param name="feeId"></param>
  1080. /// <param name="feeName"></param>
  1081. /// <param name="currPeriodFee"></param>
  1082. /// <param name="samePeriodFee"></param>
  1083. /// <param name="currPeriodGroupTotal"></param>
  1084. /// <param name="samePeriodGroupTotal"></param>
  1085. /// <param name="subFeeData"></param>
  1086. public StatisticsOPYOY(int feeId, string feeName, decimal currPeriodFee, decimal samePeriodFee,
  1087. int currPeriodGroupTotal ,int samePeriodGroupTotal, StatisticsOPSubFeeYOY[] subFeeData)
  1088. {
  1089. this.FeeId = feeId;
  1090. this.FeeName = feeName;
  1091. this.CurrPeriodFee = currPeriodFee;
  1092. this.SamePeriodFee = samePeriodFee;
  1093. decimal _yoy = 0.00M;
  1094. if (samePeriodFee != 0.00M)
  1095. {
  1096. _yoy = (currPeriodFee - samePeriodFee) / samePeriodFee;
  1097. }
  1098. this.Yoy = decimal.Parse(_yoy.ToString("0.##"));
  1099. this.CurrPeriodGroupTotal = currPeriodGroupTotal;
  1100. this.SamePeriodGroupTotal = samePeriodGroupTotal;
  1101. this.SubFeeData = subFeeData;
  1102. }
  1103. }
  1104. public class StatisticsOPSubFeeYOY : StatisticsOPYOY
  1105. {
  1106. public StatisticsOPCityYOY[] CityData { get; set; }
  1107. public StatisticsOPSubFeeYOY() { }
  1108. /// <summary>
  1109. /// 构造函数
  1110. /// </summary>
  1111. /// <param name="feeId"></param>
  1112. /// <param name="feeName"></param>
  1113. /// <param name="currPeriodFee"></param>
  1114. /// <param name="samePeriodFee"></param>
  1115. /// <param name="currPeriodGroupTotal"></param>
  1116. /// <param name="samePeriodGroupTotal"></param>
  1117. /// <param name="cityData"></param>
  1118. public StatisticsOPSubFeeYOY(int feeId, string feeName, decimal currPeriodFee, decimal samePeriodFee,
  1119. int currPeriodGroupTotal, int samePeriodGroupTotal, StatisticsOPCityYOY[] cityData)
  1120. {
  1121. this.FeeId = feeId;
  1122. this.FeeName = feeName;
  1123. this.CurrPeriodFee = currPeriodFee;
  1124. this.SamePeriodFee = samePeriodFee;
  1125. decimal _yoy = 0.00M;
  1126. if (samePeriodFee != 0.00M)
  1127. {
  1128. _yoy = (currPeriodFee - samePeriodFee) / samePeriodFee;
  1129. }
  1130. this.Yoy = decimal.Parse(_yoy.ToString("0.##"));
  1131. this.CurrPeriodGroupTotal = currPeriodGroupTotal;
  1132. this.SamePeriodGroupTotal = samePeriodGroupTotal;
  1133. this.CityData = cityData;
  1134. }
  1135. }
  1136. public class StatisticsOPCityYOY
  1137. {
  1138. public string CityName { get; set; }
  1139. public int CurrPeriodGroupTotal { get; set; }
  1140. public int SamePeriodGroupTotal { get; set; }
  1141. /// <summary>
  1142. /// 本期
  1143. /// </summary>
  1144. public decimal CurrPeriodFee { get; set; }
  1145. /// <summary>
  1146. /// 同期
  1147. /// </summary>
  1148. public decimal SamePeriodFee { get; set; }
  1149. public decimal Yoy { get; set; }
  1150. public StatisticsOPCityYOY() { }
  1151. public StatisticsOPCityYOY(string cityName, decimal currPeriodFee, decimal samePeriodFee,
  1152. int currPeriodGroupTotal,int samePeriodGroupTotal)
  1153. {
  1154. this.CityName = cityName;
  1155. this.CurrPeriodGroupTotal = currPeriodGroupTotal;
  1156. this.SamePeriodGroupTotal = samePeriodGroupTotal;
  1157. this.CurrPeriodFee = currPeriodFee;
  1158. this.SamePeriodFee = samePeriodFee;
  1159. string _yoy = "0.00";
  1160. if (samePeriodFee != 0)
  1161. {
  1162. _yoy = ((currPeriodFee - samePeriodFee) / samePeriodFee).ToString("0.##");
  1163. }
  1164. this.Yoy = decimal.TryParse(_yoy, out decimal yoy1) ? yoy1 : 0.00M;
  1165. }
  1166. }
  1167. public class StatisticsOPMonthYOY
  1168. {
  1169. public int MonthId { get; set; }
  1170. public string MonthName { get; set; }
  1171. public StatisticsOPYOY[] FeeDatas { get; set; }
  1172. public StatisticsOPMonthYOY() { }
  1173. public StatisticsOPMonthYOY(int monthId, string monthName, StatisticsOPYOY[] feeDatas)
  1174. {
  1175. MonthId = monthId;
  1176. MonthName = monthName;
  1177. FeeDatas = feeDatas;
  1178. }
  1179. }
  1180. #endregion
  1181. #region 团组预算/实际成本
  1182. public class StatisticsBRCostBasicData
  1183. {
  1184. /// <summary>
  1185. /// 预算币种
  1186. /// </summary>
  1187. public string Budget_CurrencyCode { get; set; }
  1188. /// <summary>
  1189. /// 预算币种汇率
  1190. /// </summary>
  1191. public decimal Budget_Rate { get; set; }
  1192. /// <summary>
  1193. /// 预算签证成本
  1194. /// </summary>
  1195. public decimal Budget_VisaAmount { get; set; }
  1196. /// <summary>
  1197. /// 实际签证成本
  1198. /// </summary>
  1199. public decimal Reality_VisaAmount { get; set; }
  1200. /// <summary>
  1201. /// 实际签证成本描述
  1202. /// </summary>
  1203. public string Reality_VisaAmountDesc { get; set; }
  1204. /// <summary>
  1205. /// 预算机票成本
  1206. /// </summary>
  1207. public decimal Budget_AirTicketAmount { get; set; }
  1208. /// <summary>
  1209. /// 实际机票
  1210. /// </summary>
  1211. public decimal Reality_AirTicketAmount { get; set; }
  1212. /// <summary>
  1213. /// 实际机票描述
  1214. /// </summary>
  1215. public string Reality_AirTicketAmountDesc { get; set; }
  1216. /// <summary>
  1217. /// 预算酒店成本
  1218. /// </summary>
  1219. public decimal Budget_HotelAmount { get; set; }
  1220. /// <summary>
  1221. /// 实际酒店成本
  1222. /// </summary>
  1223. public decimal Reality_HotelAmount { get; set; }
  1224. /// <summary>
  1225. /// 实际酒店成本描述
  1226. /// </summary>
  1227. public string Reality_HotelAmountDesc { get; set; }
  1228. /// <summary>
  1229. /// 预算 OP
  1230. /// </summary>
  1231. public decimal Budget_OPAmount { get; set; }
  1232. /// <summary>
  1233. /// 实际 OP
  1234. /// </summary>
  1235. public decimal Reality_OPAmount { get; set; }
  1236. /// <summary>
  1237. /// 实际 OP成本描述
  1238. /// </summary>
  1239. public string Reality_OPAmountDesc { get; set; }
  1240. /// <summary>
  1241. /// 预算 商邀
  1242. /// </summary>
  1243. public decimal Budget_OAAmount { get; set; }
  1244. /// <summary>
  1245. /// 实际 商邀
  1246. /// </summary>
  1247. public decimal Reality_OAAmount { get; set; }
  1248. /// <summary>
  1249. /// 实际 商邀成本描述
  1250. /// </summary>
  1251. public string Reality_OAAmountDesc { get; set; }
  1252. /// <summary>
  1253. /// 预算其他成本
  1254. /// </summary>
  1255. public decimal Budget_OtherAmount { get; set; }
  1256. /// <summary>
  1257. /// 实际其他成本 - 保险
  1258. /// </summary>
  1259. public decimal Reality_InsureAmount { get; set; }
  1260. /// <summary>
  1261. /// 实际其他成本 - 其他款项
  1262. /// </summary>
  1263. public decimal Reality_OtherCostAmount { get; set; }
  1264. /// <summary>
  1265. /// 实际其他成本 - 其他款项、保险描述
  1266. /// </summary>
  1267. public string Reality_OtherCostAmountDesc { get; set; }
  1268. }
  1269. public class StatisticsBRCostView : StatisticsBRCostBasicData
  1270. {
  1271. public int RowNumber { get; set; }
  1272. public int Id { get; set; }
  1273. public string GroupName { get; set; }
  1274. public string ClientUnit { get; set; }
  1275. public DateTime VisitDate { get; set; }
  1276. public int VisitDays { get; set; }
  1277. public int VisitPNumber { get; set; }
  1278. public decimal BudgetAmount
  1279. {
  1280. get
  1281. {
  1282. return Budget_VisaAmount + Budget_AirTicketAmount + Budget_HotelAmount + Budget_OPAmount + Budget_OAAmount + Budget_OtherAmount;
  1283. }
  1284. }
  1285. public decimal RealityAmount
  1286. {
  1287. get
  1288. {
  1289. return Reality_VisaAmount + Reality_AirTicketAmount + Reality_HotelAmount + Reality_OPAmount + Reality_OAAmount + Reality_InsureAmount + Reality_OtherCostAmount;
  1290. }
  1291. }
  1292. public decimal ExcessAmount
  1293. {
  1294. get
  1295. {
  1296. return RealityAmount - BudgetAmount;
  1297. }
  1298. }
  1299. public string ExcessPercentage
  1300. {
  1301. get
  1302. {
  1303. if (BudgetAmount == 0) return $"0%";
  1304. //if (ExcessAmount<=0) return $"0%";
  1305. var percentage = (ExcessAmount / BudgetAmount) * 100;
  1306. return $"{percentage.ToString("0.00")}%";
  1307. }
  1308. }
  1309. public GroupTypeInfo[] Details
  1310. {
  1311. get
  1312. {
  1313. var rateStr = $"汇率:{Budget_Rate.ToString("#0.0000")};" ;
  1314. var currencyCode = Budget_CurrencyCode;
  1315. decimal original_budget_airTicketAmount = 0.00M,
  1316. original_budget_HotelAmount = 0.00M,
  1317. original_budget_VisaAmount = 0.00M,
  1318. original_budget_OPAmount = 0.00M,
  1319. original_budget_OAAmount = 0.00M,
  1320. original_budget_OtherAmount = 0.00M;
  1321. if (Budget_Rate != 0) {
  1322. original_budget_airTicketAmount = Budget_AirTicketAmount / Budget_Rate;
  1323. original_budget_HotelAmount = Budget_HotelAmount / Budget_Rate;
  1324. original_budget_VisaAmount = Budget_VisaAmount / Budget_Rate;
  1325. original_budget_OPAmount = Budget_OPAmount / Budget_Rate;
  1326. original_budget_OAAmount = Budget_OAAmount / Budget_Rate;
  1327. original_budget_OtherAmount = Budget_OtherAmount / Budget_Rate;
  1328. }
  1329. var budget_AirTicketAmountStr = Budget_AirTicketAmount == 0 ? "-" :
  1330. $"{Budget_AirTicketAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_airTicketAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1331. var budget_HotelAmountStr = Budget_HotelAmount == 0 ? "-" :
  1332. $"{Budget_HotelAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_HotelAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1333. var budget_VisaAmountStr = Budget_VisaAmount == 0 ? "-" :
  1334. $"{Budget_VisaAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_VisaAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1335. var budget_OPAmountStr = Budget_OPAmount == 0 ? "-" :
  1336. $"{Budget_OPAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_OPAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1337. var budget_OAAmountStr = Budget_OAAmount == 0 ? "-" :
  1338. $"{Budget_OAAmount.ToString("#0.00")} CNY(实际币种金额:{original_budget_OAAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1339. var budget_OtherAmountStr = Budget_OtherAmount == 0 ? "-" :
  1340. $"{Budget_OtherAmount.ToString("#0.00")}CNY(实际币种金额:{original_budget_OtherAmount.ToString("#0.00")} {currencyCode} {rateStr})";
  1341. var reality_AirTicketAmountStr = Reality_AirTicketAmount == 0 ? "-" : $"{Reality_AirTicketAmount.ToString("#0.00")} CNY({Reality_AirTicketAmountDesc})";
  1342. var reality_HotelAmountStr = Reality_HotelAmount == 0 ? "-" : $"{Reality_HotelAmount.ToString("#0.00")} CNY({Reality_HotelAmountDesc})";
  1343. var reality_VisaAmountStr = Reality_VisaAmount == 0 ? "-" : $"{Reality_VisaAmount.ToString("#0.00")} CNY({Reality_VisaAmountDesc})";
  1344. var reality_OPAmountStr = Reality_OPAmount == 0 ? "-" : $"{Reality_OPAmount.ToString("#0.00")} CNY({Reality_OPAmountDesc})";
  1345. var reality_OAAmountStr = Reality_OAAmount == 0 ? "-" : $"{Reality_OAAmount.ToString("#0.00")} CNY({Reality_OAAmountDesc})";
  1346. var reality_otherAmount = (Reality_InsureAmount + Reality_OtherCostAmount);
  1347. var reality_OtherAmountStr = reality_otherAmount == 0 ? "-" : $"{reality_otherAmount.ToString("#0.00")} CNY({Reality_OtherCostAmountDesc})";
  1348. return new GroupTypeInfo[] {
  1349. new GroupTypeInfo(1,"机票",budget_AirTicketAmountStr,reality_AirTicketAmountStr),
  1350. new GroupTypeInfo(2,"酒店",budget_HotelAmountStr,reality_HotelAmountStr),
  1351. new GroupTypeInfo(3,"签证",budget_VisaAmountStr,reality_VisaAmountStr),
  1352. new GroupTypeInfo(4,"OP",budget_OPAmountStr,reality_OPAmountStr),
  1353. new GroupTypeInfo(5,"商邀",budget_OAAmountStr,reality_OAAmountStr),
  1354. new GroupTypeInfo(6,"其他",budget_OtherAmountStr,reality_OtherAmountStr)
  1355. };
  1356. }
  1357. }
  1358. }
  1359. public class GroupTypeInfo
  1360. {
  1361. public int No { get; set; }
  1362. public string Module { get; set; }
  1363. public string BudgetAmountDesc { get; set; }
  1364. public string RealityAmountDesc { get; set; }
  1365. public GroupTypeInfo(int no, string module, string budgetAmount, string realityAmount)
  1366. {
  1367. No = no;
  1368. Module = module;
  1369. BudgetAmountDesc = budgetAmount;
  1370. RealityAmountDesc = realityAmount;
  1371. }
  1372. }
  1373. public class StatisticsBRCostBriefView
  1374. {
  1375. public int RowNumber { get; set; }
  1376. public int Id { get; set; }
  1377. public string GroupName { get; set; }
  1378. public string ClientUnit { get; set; }
  1379. public DateTime VisitDate { get; set; }
  1380. public int VisitDays { get; set; }
  1381. public int VisitPNumber { get; set; }
  1382. public decimal BudgetAmount { get; set; }
  1383. public decimal RealityAmount { get; set; }
  1384. public decimal ExcessAmount { get; set; }
  1385. public string ExcessPercentage { get; set; }
  1386. public GroupTypeInfo[] Details { get; set; }
  1387. }
  1388. #endregion
  1389. #region 团组数据统计-当前时间团组所在城市
  1390. public class StatisticsNowCityOfGroupView
  1391. {
  1392. public string CurrDate { get; set; }
  1393. public string GroupName { get; set; }
  1394. public string FlightNo { get; set; }
  1395. public string DepartAirportCode { get; set; }
  1396. public string DepartCountryName { get; set; }
  1397. public string DepartCityName { get; set; }
  1398. public string ArriveAirportCode { get; set; }
  1399. public string ArriveCountryName { get; set; }
  1400. public string ArriveCityName { get; set; }
  1401. }
  1402. #endregion
  1403. #region
  1404. /// <summary>
  1405. /// 当前时间团组所在城市 View
  1406. /// </summary>
  1407. public class StatisticsNowCityOfGroupResultView
  1408. {
  1409. /// <summary>
  1410. /// 团组名称
  1411. /// </summary>
  1412. public string GroupName { get; set; }
  1413. /// <summary>
  1414. /// 单位
  1415. /// </summary>
  1416. public string Client { get; set; }
  1417. /// <summary>
  1418. /// 当前状态
  1419. /// </summary>
  1420. public string StatusText { get; set; }
  1421. public string Address { get; set; }
  1422. }
  1423. #endregion
  1424. #endregion
  1425. }