Fin_DailyFeePaymentView.cs 53 KB

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