Fin_DailyFeePaymentView.cs 53 KB

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