Fin_DailyFeePaymentView.cs 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670
  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. }