Fin_DailyFeePaymentView.cs 52 KB

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