Fin_DailyFeePaymentView.cs 42 KB

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