StatisticsController.cs 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. using Microsoft.AspNetCore.Mvc;
  2. using NPOI.POIFS.Properties;
  3. using NPOI.SS.Formula.Functions;
  4. using OASystem.API.OAMethodLib;
  5. using OASystem.Domain.Dtos.Groups;
  6. using OASystem.Domain.Dtos.Statistics;
  7. using OASystem.Domain.Entities.Financial;
  8. using OASystem.Domain.ViewModels.Financial;
  9. using OASystem.Domain.ViewModels.Groups;
  10. using OASystem.Domain.ViewModels.Statistics;
  11. using OASystem.Infrastructure.Repositories.Groups;
  12. using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
  13. using System;
  14. using OASystem.Domain.Entities.Customer;
  15. using System.Collections.Generic;
  16. using Microsoft.AspNetCore.Mvc.RazorPages;
  17. using Microsoft.VisualBasic;
  18. using OASystem.Domain.Entities.Groups;
  19. using Microsoft.Extensions.DependencyInjection;
  20. namespace OASystem.API.Controllers
  21. {
  22. /// <summary>
  23. /// 统计模块
  24. /// </summary>
  25. [Route("api/[controller]")]
  26. [ApiController]
  27. public class StatisticsController : ControllerBase
  28. {
  29. private readonly int _decimalPlaces;
  30. private readonly IMapper _mapper;
  31. private readonly SqlSugarClient _sqlSugar;
  32. private readonly DelegationInfoRepository _groupRep;
  33. private readonly SetDataRepository _setDataRep;
  34. private readonly TeamRateRepository _teamRateRep;
  35. /// <summary>
  36. /// Init
  37. /// </summary>
  38. /// <param name="mapper"></param>
  39. /// <param name="sqlSugar"></param>
  40. /// <param name="groupRep"></param>
  41. /// <param name="setDataRep"></param>
  42. public StatisticsController(IMapper mapper, SqlSugarClient sqlSugar, DelegationInfoRepository groupRep, SetDataRepository setDataRep, TeamRateRepository teamRate)
  43. {
  44. _mapper = mapper;
  45. _groupRep = groupRep;
  46. _setDataRep = setDataRep;
  47. _sqlSugar = sqlSugar;
  48. _teamRateRep = teamRate;
  49. }
  50. #region 团组报表
  51. /// <summary>
  52. /// 团组报表
  53. /// Items
  54. /// </summary>
  55. /// <param name="_dto">团组列表请求dto</param>
  56. /// <returns></returns>
  57. [HttpPost("PostGroupStatementItems")]
  58. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  59. public async Task<IActionResult> PostGroupStatementItems(GroupStatementItemsDto _dto)
  60. {
  61. #region 参数验证
  62. if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
  63. if (_dto.PageId < 1) return Ok(JsonView(false, "页面Id为空"));
  64. PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
  65. #region 页面操作权限验证
  66. pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
  67. if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
  68. #endregion
  69. #endregion
  70. if (_dto.PortType == 1 || _dto.PortType == 2 || _dto.PortType == 3) // web/Android/IOS
  71. {
  72. string sqlWhere = string.Empty;
  73. if (_dto.IsSure == 0) //未完成
  74. {
  75. sqlWhere += string.Format(@" And IsSure = 0");
  76. }
  77. else if (_dto.IsSure == 1) //已完成
  78. {
  79. sqlWhere += string.Format(@" And IsSure = 1");
  80. }
  81. if (!string.IsNullOrEmpty(_dto.SearchCriteria))
  82. {
  83. string tj = _dto.SearchCriteria;
  84. sqlWhere += string.Format(@"And (ssd.Name Like '%{0}%' Or TeamName Like '%{1}%' Or ClientName Like '%{2}%' Or ClientName Like '%{3}%' Or su.CnName Like '%{4}%')",
  85. tj, tj, tj, tj, tj);
  86. }
  87. string sql = string.Format(@"Select row_number() over(order by gdi.VisitDate Desc) as Row_Number,
  88. gdi.Id,TourCode,ssd1.Id TeamLevId,ssd1.Name TeamLev,TeamName,
  89. ClientName,ClientUnit,VisitDate,ssd.Id TeamTypeId, ssd.Name TeamType,
  90. VisitDays,VisitPNumber,su.CnName JietuanOperator,IsSure,gdi.CreateTime,
  91. pr.LastCollectionTime
  92. From Grp_DelegationInfo gdi
  93. Left Join Sys_SetData ssd On gdi.TeamDid = ssd.Id
  94. Left Join Sys_SetData ssd1 On gdi.TeamLevSId = ssd1.Id
  95. Left Join Sys_Users su On gdi.JietuanOperator = su.Id
  96. Left Join (
  97. SELECT Diid, MAX(CreateTime) LastCollectionTime
  98. FROM Fin_ProceedsReceived
  99. Where IsDel = 0
  100. GROUP BY Diid
  101. ) pr On gdi.Id = pr.Diid
  102. Where gdi.IsDel = 0 {0} ", sqlWhere);
  103. RefAsync<int> total = 0;//REF和OUT不支持异步,想要真的异步这是最优解
  104. var _DelegationList = await _sqlSugar.SqlQueryable<GroupStatementItemView>(sql).ToPageListAsync(_dto.PageIndex, _dto.PageSize, total);//ToPageAsync
  105. var _view = new
  106. {
  107. PageFuncAuth = pageFunAuthView,
  108. Data = _DelegationList
  109. };
  110. return Ok(JsonView(true, "查询成功!", _view, total));
  111. }
  112. else
  113. {
  114. return Ok(JsonView(false, "查询失败"));
  115. }
  116. }
  117. /// <summary>
  118. /// 团组报表
  119. /// Details
  120. /// </summary>
  121. /// <param name="_dto">团组列表请求dto</param>
  122. /// <returns></returns>
  123. [HttpPost("PostGroupStatementDetails")]
  124. //[JsonConverter(typeof(DecimalConverter), 2)]
  125. [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
  126. public async Task<IActionResult> PostGroupStatementDetails(GroupStatementDetailsDto _dto)
  127. {
  128. #region 参数验证
  129. if (_dto.UserId < 1) return Ok(JsonView(false, "员工Id为空"));
  130. if (_dto.PageId < 1) _dto.PageId = 38; //团组报表页面Id
  131. if (_dto.DiId < 1) return Ok(JsonView(false, "团组Id为空"));
  132. PageFunAuthViewBase pageFunAuthView = new PageFunAuthViewBase();
  133. #region 页面操作权限验证
  134. pageFunAuthView = await GeneralMethod.PostUserPageFuncDatas(_dto.UserId, _dto.PageId);
  135. if (pageFunAuthView.CheckAuth == 0) return Ok(JsonView(false, "您没有查看权限"));
  136. #endregion
  137. #endregion
  138. if (_dto.PortType == 1 || _dto.PortType == 2 || _dto.PortType == 3) // web/Android/IOS
  139. {
  140. GroupStatementDetailsView _view = new GroupStatementDetailsView();
  141. #region 费用类型 币种,转账,客户信息
  142. List<Sys_SetData> _setDatas = await _sqlSugar.Queryable<Sys_SetData>().Where(it => it.IsDel == 0).ToListAsync();
  143. var _clientDatas = await _sqlSugar.Queryable<Crm_DeleClient>().Where(it => it.IsDel == 0).ToListAsync();
  144. #endregion
  145. #region 团组收入
  146. GroupIncomeView _giView = new GroupIncomeView();
  147. /*
  148. * 应收报表
  149. */
  150. decimal frTotalAmount = 0.00M;//应收总金额
  151. string _frSql = string.Format(@"Select fr.Id,fr.Diid,fr.PriceName,fr.Price,fr.Count,fr.Unit,fr.Currency,
  152. sd.Name As CurrencyCode,sd.Remark As CurrencyName,fr.Rate,fr.ItemSumPrice
  153. From Fin_ForeignReceivables fr
  154. Left Join Sys_SetData sd On fr.Currency = sd.Id
  155. Where fr.IsDel = 0 And fr.Diid = {0}",_dto.DiId);
  156. List<Gsd_ForeignReceivablesView> _frViews = await _sqlSugar.SqlQueryable<Gsd_ForeignReceivablesView>(_frSql).ToListAsync();
  157. frTotalAmount = _frViews.Sum(it => it.ItemSumPrice);
  158. _giView.Receivables = _frViews;
  159. _giView.ReceivableStr = string.Format(@"应收款合计:{0} CNY(人名币)", frTotalAmount.ConvertToDecimal1().ToString("#0.00"));
  160. /*
  161. * 已收报表
  162. */
  163. decimal prTotalAmount = 0.00M;//已收总金额
  164. string _prSql = string.Format(@"Select pr.Id,pr.Diid,pr.SectionTime,pr.Price,pr.Currency,
  165. sd1.Name As CurrencyCode,sd1.Remark As CurrencyName,pr.Client,
  166. pr.ReceivablesType,sd2.Name As ReceivablesTypeName,pr.Remark
  167. From Fin_ProceedsReceived pr
  168. Left Join Sys_SetData sd1 On pr.Currency = sd1.Id
  169. Left Join Sys_SetData sd2 On pr.ReceivablesType = sd2.Id
  170. Where pr.IsDel = 0 and pr.Diid = {0}", _dto.DiId);
  171. List<Gsd_ProceedsReceivedView> _prViews = await _sqlSugar.SqlQueryable<Gsd_ProceedsReceivedView>(_prSql).ToListAsync();
  172. prTotalAmount = _prViews.Sum(it => it.Price);
  173. _giView.ProceedsReceivedViews = _prViews;
  174. _giView.ProceedsReceivedStr = string.Format(@"已收款合计:{0} CNY(人名币)", prTotalAmount.ConvertToDecimal1().ToString("#0.00"));
  175. /*
  176. * 超支费用
  177. */
  178. decimal exTotalAmount = 0.00M;
  179. string _ecSql = string.Format(@"Select gec.Id As GECId,gec.DiId As GECDiId,gec.PriceName,ccp.PayMoney,sd1.Name As PaymentCurrency,
  180. ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,
  181. sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant
  182. From Fin_GroupExtraCost gec
  183. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 81 And gec.Id = ccp.CId
  184. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  185. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  186. Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
  187. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  188. Where gec.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And gec.DiId = {0}",_dto.DiId);
  189. List<Gsd_ExtraCostsView> _ExtraCostsViews = await _sqlSugar.SqlQueryable<Gsd_ExtraCostsView>(_ecSql).ToListAsync();
  190. //模拟数据
  191. if (_ExtraCostsViews.Count < 1)
  192. {
  193. _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
  194. {
  195. GECId = 0,
  196. GECDiId = 2334,
  197. PriceName = "模拟数据-超支费用名称",
  198. PayMoney = 1000.00M,
  199. PaymentCurrency = "CNY",
  200. DayRate = 1.0000M,
  201. CNYPrice = 1000.00M,
  202. Payee = "模拟数据-超支费用收款方",
  203. OrbitalPrivateTransfer = 1,
  204. PayWay = "刷卡",
  205. CardType = "招行卡",
  206. IsPay = 1,
  207. Applicant = "刘华举"
  208. });
  209. _ExtraCostsViews.Add(new Gsd_ExtraCostsView()
  210. {
  211. GECId = 0,
  212. GECDiId = 2334,
  213. PriceName = "模拟数据-超支费用名称",
  214. PayMoney = 1000.00M,
  215. PaymentCurrency = "CNY",
  216. DayRate = 1.0000M,
  217. CNYPrice = 1000.00M,
  218. Payee = "模拟数据-超支费用收款方",
  219. OrbitalPrivateTransfer = 1,
  220. PayWay = "刷卡",
  221. CardType = "招行卡",
  222. IsPay = 1,
  223. Applicant = "刘华举"
  224. });
  225. }
  226. exTotalAmount = _ExtraCostsViews.Sum(it => it.CNYPrice);
  227. _giView.ExtraCostsViews = _ExtraCostsViews;
  228. _giView.ExtraCostsStr = string.Format(@"人名币总费用:{0} CNY", exTotalAmount.ConvertToDecimal1().ToString("#0.00"));
  229. /*
  230. * 收款退还
  231. */
  232. decimal promTotalAmount = 0.00M;// 收款退还总金额
  233. List<Gsd_PaymentRefundAndOtherMoneyView> _promView = new List<Gsd_PaymentRefundAndOtherMoneyView>();
  234. string _ropSql = string.Format(@"Select u.CnName As Appliction,prom.Id As PrId,prom.DiId As PrDiId,prom.Price As PrPrice,
  235. prom.PriceName AS PrPriceName,prom.CurrencyId As PrCurrencyId,
  236. prom.PayType As PrPayType,prom.PriceType As PrPriceType,ccp.*
  237. From Fin_PaymentRefundAndOtherMoney prom
  238. Left Join Grp_CreditCardPayment ccp On prom.DiId = ccp.DIId And prom.Id = ccp.CId
  239. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  240. Where prom.IsDel = 0 And prom.PayType = 1 And prom.PriceType = 1 And ccp.CTable = 285
  241. And ccp.IsAuditGM = 1 And ccp.IsPay = 1
  242. And prom.DiId = {0}", _dto.DiId);
  243. var _promDatas = await _sqlSugar.SqlQueryable<Gsd_PaymentRefundAndOtherMoneyDataSource1View>(_ropSql).ToListAsync();
  244. foreach (var ropItem in _promDatas)
  245. {
  246. string thisCueencyCode = "Unknown";
  247. string thisCueencyName = "Unknown";
  248. var currency = _setDatas.Where(it => it.Id == ropItem.PaymentCurrency).FirstOrDefault();
  249. if (currency != null)
  250. {
  251. thisCueencyCode = currency.Name;
  252. thisCueencyName = currency.Remark;
  253. }
  254. string orbitalPrivateTransferStr = "Unknown";
  255. var orbitalPrivateTransfer = _setDatas.Where(it => it.Id == ropItem.OrbitalPrivateTransfer).FirstOrDefault();
  256. if (orbitalPrivateTransfer != null)
  257. {
  258. orbitalPrivateTransferStr = orbitalPrivateTransfer.Name;
  259. }
  260. string payStr = "Unknown";
  261. var pay = _setDatas.Where(it => it.Id == ropItem.PayDId).FirstOrDefault();
  262. if (pay != null)
  263. {
  264. payStr = pay.Name;
  265. }
  266. Gsd_PaymentRefundAndOtherMoneyView gsd_PaymentRefund = new Gsd_PaymentRefundAndOtherMoneyView()
  267. {
  268. Id = ropItem.Id,
  269. DiId = ropItem.DIId,
  270. PriceName = ropItem.PrPriceName,
  271. PayCurrencyCode = thisCueencyCode,
  272. PayCurrencyName = thisCueencyName,
  273. Price = ropItem.PrPrice,
  274. CNYPrice = ropItem.RMBPrice,
  275. ThisRate = ropItem.DayRate,
  276. Payee = ropItem.Payee,
  277. PayTime = ropItem.AuditGMDate,
  278. OrbitalPrivateTransfer = ropItem.OrbitalPrivateTransfer,
  279. PayType = payStr,
  280. IsPay = ropItem.IsPay,
  281. Applicant = ropItem.Appliction
  282. };
  283. _promView.Add(gsd_PaymentRefund);
  284. }
  285. //模拟数据
  286. if (_promView.Count < 1)
  287. {
  288. _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView() {
  289. Id = 0,
  290. DiId = 2334,
  291. PriceName = "模拟数据-费用名称",
  292. PayCurrencyCode ="CNY",
  293. PayCurrencyName = "人名币",
  294. Price = 1000.00M,
  295. CNYPrice = 1000.00M,
  296. ThisRate = 1.00M,
  297. Payee="模拟数据-收款方",
  298. PayTime = "2023-01-01 15:20:01",
  299. OrbitalPrivateTransfer = 1,
  300. PayType = "刷卡",
  301. IsPay = 1,
  302. Applicant = "刘华举"
  303. });
  304. _promView.Add(new Gsd_PaymentRefundAndOtherMoneyView()
  305. {
  306. Id = 0,
  307. DiId = 2334,
  308. PriceName = "模拟数据-费用名称",
  309. PayCurrencyCode = "CNY",
  310. PayCurrencyName = "人名币",
  311. Price = 1000.00M,
  312. CNYPrice = 1000.00M,
  313. ThisRate = 1.00M,
  314. Payee = "模拟数据-收款方",
  315. PayTime = "2023-01-01 15:20:01",
  316. OrbitalPrivateTransfer = 1,
  317. PayType = "刷卡",
  318. IsPay = 1,
  319. Applicant = "刘华举"
  320. });
  321. }
  322. promTotalAmount = _promView.Sum(it => it.CNYPrice);
  323. _giView.PaymentRefundAndOtherMoneyViews = _promView;
  324. _giView.PaymentRefundAndOtherMoneyStr = string.Format(@"人名币总费用:{0} CNY", promTotalAmount.ConvertToDecimal1().ToString("#0.00"));
  325. decimal BalancePayment = frTotalAmount - prTotalAmount + promTotalAmount;
  326. _view.GroupIncome = _giView;
  327. _view.GroupIncomeStr = string.Format(@"<span style='color:red;'>剩余尾款:{0} CNY(包含了收款退还费用数据)</span>", BalancePayment.ConvertToDecimal1().ToString("#0.00"));
  328. #endregion
  329. #region 团组支出
  330. GroupExpenditureView _geView = new GroupExpenditureView();
  331. #region 酒店预定费用
  332. List<GroupHotelFeeView> groupHotelFeeViews = new List<GroupHotelFeeView>();
  333. string hotelFeeSql = string.Format(@"Select hr.Id As HrId,hr.DiId As HrDiId,hr.City,hr.HotelName,hr.CheckInDate,hr.CheckOutDate,
  334. sd1.Name As PaymentCurrency,hr.SingleRoomPrice,hr.SingleRoomCount,hr.DoubleRoomPrice,
  335. hr.DoubleRoomCount,hr.SuiteRoomPrice,hr.SuiteRoomCount,hr.OtherRoomPrice,hr.OtherRoomCount,
  336. hr.BreakfastPrice,sd4.Name As BreakfastCurrency,hr.Isoppay,hr.GovernmentRent,
  337. sd5.Name As GovernmentRentCurrency,hr.CityTax,sd6.Name As CityTaxCurrency,
  338. ccp.PayMoney,ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.OrbitalPrivateTransfer,
  339. sd2.Name As PayWay,sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant
  340. From Grp_HotelReservations hr
  341. Left Join Grp_CreditCardPayment ccp On hr.Id = ccp.CId
  342. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  343. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  344. Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
  345. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  346. Left Join Sys_SetData sd4 On hr.BreakfastCurrency = sd4.Id
  347. Left Join Sys_SetData sd5 On hr.GovernmentRentCurrency = sd5.Id
  348. Left Join Sys_SetData sd6 On hr.CityTaxCurrency = sd6.Id
  349. Where hr.IsDel = 0 And ccp.IsDel = 0 And ccp.CTable = 76 And ccp.IsAuditGM = 1 And ccp.IsPay = 1
  350. And hr.DiId = {0}", _dto.DiId);
  351. groupHotelFeeViews = await _sqlSugar.SqlQueryable<GroupHotelFeeView>(hotelFeeSql).ToListAsync();
  352. decimal HotelCNYTotalPrice = 0.00M;
  353. var teamRateData = await _teamRateRep.PostGroupRateInfoByDiId(_dto.DiId);
  354. foreach (var item in groupHotelFeeViews)
  355. {
  356. HotelCNYTotalPrice += item.CNYPrice;
  357. item.PayMoney = item.PayMoney.ConvertToDecimal1();
  358. item.CNYPrice = item.CNYPrice.ConvertToDecimal1();
  359. string currencyRateStr = "";
  360. List<string> currencys = new List<string>();
  361. if (!string.IsNullOrEmpty(item.BreakfastCurrency)) currencys.Add(item.BreakfastCurrency);
  362. if (!string.IsNullOrEmpty(item.GovernmentRentCurrency)) currencys.Add(item.GovernmentRentCurrency);
  363. if (!string.IsNullOrEmpty(item.CityTaxCurrency)) currencys.Add(item.CityTaxCurrency);
  364. if (!string.IsNullOrEmpty(item.PaymentCurrency)) currencys.Add(item.PaymentCurrency);
  365. currencyRateStr = await GeneralMethod.PostGroupRateByCTableAndCurrency(teamRateData, 76, currencys);
  366. item.CurrencyRateStr = currencyRateStr;
  367. }
  368. _geView.GroupHotelFeeViews = groupHotelFeeViews;
  369. _geView.GroupHotelFeeStr = string.Format(@"人名币总费用:{0} CNY", HotelCNYTotalPrice.ToString("#0.00"));
  370. #endregion
  371. #region 地接费用
  372. List<GroupCTGGRFeeView> groupCTGGRFeeViews = new List<GroupCTGGRFeeView>();
  373. string CTGGRFeeSql = string.Format(@"Select ctggr.Id As CTGGRId,ctggr.DiId As CTGGRDiId,ctggr.Area,ctggrc.*,ccp.PayMoney,
  374. sd2.name As PaymentCurrency,ccp.PayPercentage,(ccp.PayMoney * ccp.PayPercentage / 100) As AmountPaid,
  375. (ccp.PayMoney -(ccp.PayMoney * ccp.PayPercentage / 100)) As BalancePayment,ccp.DayRate,
  376. ccp.RMBPrice As CNYPrice,ccp.Payee,ccp.AuditGMDate,
  377. ccp.OrbitalPrivateTransfer,sd1.Name As PayWay,ccp.IsPay,u.CnName As Applicant
  378. From Grp_CarTouristGuideGroundReservations ctggr
  379. Left Join ( Select cggrc.CTGGRId,sd1.Name As PriceName,cggrc.Price,sd2.Name As PriceCurrency,
  380. cggrc.PriceContent
  381. From Grp_CarTouristGuideGroundReservationsContent cggrc
  382. Left Join Sys_SetData sd1 On cggrc.SId = sd1.Id
  383. Left Join Sys_SetData sd2 On cggrc.Currency = sd2.Id
  384. Where cggrc.ISdel = 0 And cggrc.Price != 0.00
  385. ) ctggrc On ctggr.Id = ctggrc.CTGGRId
  386. Left Join Grp_CreditCardPayment ccp On ccp.IsDel = 0 And ccp.CTable = 79 And ctggr.Id = ccp.CId
  387. Left Join Sys_SetData sd1 On ccp.PayDId = sd1.Id
  388. Left Join Sys_SetData sd2 On ccp.PaymentCurrency = sd2.Id
  389. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  390. Where ctggr.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ctggr.DiId = {0} ",_dto.DiId);
  391. groupCTGGRFeeViews = await _sqlSugar.SqlQueryable<GroupCTGGRFeeView>(CTGGRFeeSql).ToListAsync();
  392. string CTGGRFeeStr = "";
  393. decimal CTGGRCNYTotalPrice = 0.00M;
  394. foreach (var item in groupCTGGRFeeViews)
  395. {
  396. if (!string.IsNullOrEmpty(item.AuditGMDate))
  397. {
  398. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  399. }
  400. CTGGRFeeStr += string.Format(@"{0}总费用:{1} {2}(人名币:{3} CNY 当时支付汇率:{4})\r\n",
  401. item.Area, item.AmountPaid.ConvertToDecimal1(), item.PaymentCurrency, item.CNYPrice, item.DayRate);
  402. CTGGRCNYTotalPrice += item.CNYPrice;
  403. }
  404. _geView.GroupCTGGRFeeViews = groupCTGGRFeeViews;
  405. _geView.GroupCTGGRFeeStr = string.Format(@"{0}人名币总费用:{1} CNY", CTGGRFeeStr,CTGGRCNYTotalPrice);
  406. #endregion
  407. #region 机票预订费用
  408. List<GroupAirFeeView> groupAirFeeViews = new List<GroupAirFeeView>();
  409. string groupAirFeeSql = string.Format(@"Select atr.Id As AirId,atr.DIId As AirDiId,atr.FlightsCode,atr.FlightsCity,sd4.Name As AirTypeName,
  410. atr.FlightsDate,atr.FlightsTime,atr.ClientName,atr.ClientNum,ccp.PayMoney,
  411. sd1.Name As PayMoneyCurrency,ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.AuditGMDate,
  412. ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,sd3.Name As CardType,ccp.IsPay,u.CnName As Applicant
  413. From Grp_AirTicketReservations atr
  414. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 85 And atr.Id = ccp.CId
  415. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  416. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  417. Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
  418. Left Join Sys_SetData sd4 On atr.CType = sd4.Id
  419. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  420. Where atr.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And atr.DiId = {0} ", _dto.DiId);
  421. groupAirFeeViews = await _sqlSugar.SqlQueryable<GroupAirFeeView>(groupAirFeeSql).ToListAsync();
  422. string str = "";
  423. decimal AirCNYTotalPrice = 0.00M;
  424. decimal JJCCNYTotalPrice = 0.00M, JJCPeopleNum = 0.00M, JJCAveragePrice = 0.00M;
  425. decimal GWCCNYTotalPrice = 0.00M, GWCPeopleNum = 0.00M, GWCAveragePrice = 0.00M;
  426. if (groupAirFeeViews.Count > 0)
  427. {
  428. JJCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.CNYPrice);
  429. JJCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("经济舱")).Sum(it => it.ClientNum);
  430. JJCAveragePrice = (JJCCNYTotalPrice / JJCPeopleNum).ConvertToDecimal1();
  431. GWCCNYTotalPrice = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.CNYPrice);
  432. GWCPeopleNum = groupAirFeeViews.Where(it => it.AirTypeName.Equals("公务舱")).Sum(it => it.ClientNum);
  433. GWCAveragePrice = (GWCCNYTotalPrice / GWCPeopleNum).ConvertToDecimal1();
  434. }
  435. int Index = 0;
  436. foreach (var item in groupAirFeeViews)
  437. {
  438. if (item.AirId > 2924)
  439. {
  440. string itemClientName = "";
  441. if (!string.IsNullOrEmpty(item.ClientName))
  442. {
  443. string[] clientIds = new string[] { };
  444. if (item.ClientName.Contains(','))
  445. {
  446. clientIds = item.ClientName.Split(',');
  447. }
  448. else
  449. {
  450. clientIds = new string[] { item.ClientName };
  451. }
  452. if (clientIds.Length > 0)
  453. {
  454. int[] output = Array.ConvertAll<string, int>(clientIds, delegate (string s) { return int.Parse(s); });
  455. var clients = _clientDatas.Where(it => output.Contains(it.Id)).ToList();
  456. string clientPinYinName = "";
  457. decimal unitCost = 0.00M;
  458. unitCost = (item.PayMoney / item.ClientNum).ConvertToDecimal1();
  459. int clienIndex = 1;
  460. foreach (var client in clients)
  461. {
  462. Index += 1;
  463. string six = "";
  464. if (client.Sex == 0) six = "Mr";
  465. else if (client.Sex == 1) six = "Ms";
  466. itemClientName += string.Format(@"{0}.{1} {2};", clienIndex, client.LastName + client.FirstName, six);
  467. clientPinYinName += string.Format(@"{0}.{1}出票价为:{2} CNY;", Index, client.Pinyin, unitCost);
  468. clienIndex++;
  469. }
  470. }
  471. }
  472. item.ClientName = itemClientName;
  473. }
  474. else
  475. {
  476. string clientPinYinName = "";
  477. decimal unitCost = 0.00M;
  478. unitCost = (item.PayMoney / item.ClientNum).ConvertToDecimal1();
  479. string[] clientNames = item.ClientName.Split('.');
  480. for (int i = 0; i < item.ClientNum; i++)
  481. {
  482. string name = "";
  483. if (clientNames.Length > 0)
  484. {
  485. int index = i + 1;
  486. if (index < clientNames.Length)
  487. {
  488. name = clientNames[index].Replace("MR","").Replace("MS","");
  489. }
  490. }
  491. clientPinYinName += string.Format(@"{0}.{1}出票价为:{2} CNY;", Index, name, unitCost);
  492. }
  493. }
  494. if (!string.IsNullOrEmpty(item.AuditGMDate))
  495. {
  496. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  497. }
  498. }
  499. _geView.GroupAirFeeViews = groupAirFeeViews;
  500. if (!string.IsNullOrEmpty(str))
  501. {
  502. str = string.Format(@"其中:{0}", str);
  503. }
  504. _geView.GroupAirFeeStr = string.Format(@"人名币总费用:{0} CNY\r\n{1}\r\n经济舱均价为:{2}CNY/人;公务舱均价为:{3}CNY/人;", AirCNYTotalPrice, str, JJCAveragePrice, GWCAveragePrice);
  505. #endregion
  506. #region 签证费用
  507. List<GroupVisaFeeView> groupVisaFeeViews = new List<GroupVisaFeeView>();
  508. string groupVisaFeeSql = string.Format(@"Select vi.Id As VisaId,vi.DIId As VisaDiId,vi.VisaClient,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
  509. ccp.DayRate,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,
  510. sd3.Name As CardTypeName,ccp.IsPay,u.CnName As Applicant
  511. From Grp_VisaInfo vi
  512. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 80 And vi.Id = ccp.CId
  513. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  514. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  515. Left Join Sys_SetData sd3 On ccp.CTDId = sd3.Id
  516. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  517. Where vi.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And vi.DIId = {0}",_dto.DiId);
  518. groupVisaFeeViews = await _sqlSugar.SqlQueryable<GroupVisaFeeView>(groupVisaFeeSql).ToListAsync();
  519. decimal VisaCNYTotalPirce = 0.00M;
  520. foreach (var item in groupVisaFeeViews)
  521. {
  522. string itemClientName = "";
  523. string visaClients = item.VisaClient;
  524. if (!string.IsNullOrEmpty(visaClients))
  525. {
  526. string[] clientIds = new string[] { };
  527. if (visaClients.Contains(','))
  528. {
  529. clientIds = visaClients.Split(',');
  530. }
  531. else
  532. {
  533. clientIds = new string[] { visaClients };
  534. }
  535. if (clientIds.Length > 0)
  536. {
  537. int[] output = Array.ConvertAll<string, int>(clientIds, delegate (string s) { return int.Parse(s); });
  538. var clients = _clientDatas.Where(it => output.Contains(it.Id)).ToList();
  539. foreach (var client in clients)
  540. {
  541. itemClientName += $"{client.LastName + client.FirstName},";
  542. }
  543. }
  544. }
  545. if (itemClientName.Length > 0 )
  546. {
  547. itemClientName = itemClientName.Substring(0, itemClientName.Length - 1);
  548. }
  549. item.VisaClient = itemClientName;
  550. VisaCNYTotalPirce += item.PayMoney;
  551. if (!string.IsNullOrEmpty(item.AuditGMDate))
  552. {
  553. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  554. }
  555. }
  556. _geView.GroupVisaFeeViews = groupVisaFeeViews;
  557. _geView.GroupVisaFeeStr = string.Format(@"人名币总费用:{0} CNY", VisaCNYTotalPirce.ConvertToDecimal1());
  558. #endregion
  559. #region 邀请/公务活动费用 CTable = 81
  560. List<GroupInvitationalFeeView> groupInvitationalFeeViews = new List<GroupInvitationalFeeView>();
  561. string groupInvitationalFeeSql = string.Format(@"Select ioa.Id As IOAId,ioa.DiId As IOADiId,ioa.InviterArea,ioa.Inviter,ioa.InviteTime,
  562. ioa.InviteCost,sd3.Name As InviteCurrency,ioa.SendCost,sd4.Name As SendCurrency,ioa.EventsCost,
  563. sd5.Name As EventsCurrency,ioa.TranslateCost,sd6.Name As TranslateCurrency,ccp.PayMoney,
  564. sd7.Name As PaymentCurrency,ccp.RMBPrice As CNYPrice,ccp.Payee,ccp.AuditGMDate,
  565. ccp.OrbitalPrivateTransfer,sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
  566. From Grp_InvitationOfficialActivities ioa
  567. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 81 And ioa.Id = ccp.CId
  568. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  569. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  570. Left Join Sys_SetData sd3 On ioa.InviteCurrency = sd3.Id
  571. Left Join Sys_SetData sd4 On ioa.SendCurrency = sd4.Id
  572. Left Join Sys_SetData sd5 On ioa.EventsCurrency = sd5.Id
  573. Left Join Sys_SetData sd6 On ioa.TranslateCurrency = sd6.Id
  574. Left Join Sys_SetData sd7 On ccp.PaymentCurrency = sd7.Id
  575. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  576. Where ioa.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ioa.Diid = {0}",_dto.DiId);
  577. groupInvitationalFeeViews = await _sqlSugar.SqlQueryable<GroupInvitationalFeeView>(groupInvitationalFeeSql).ToListAsync();
  578. //模拟数据
  579. if (groupInvitationalFeeViews.Count < 1)
  580. {
  581. groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
  582. {
  583. IOAId = 0,
  584. IOADiId = 2334,
  585. InviterArea = "模拟数据-邀请方地区",
  586. Inviter = "模拟数据-邀请方",
  587. InviteTime = "2023-10-10",
  588. InviteCost = 100.00M,
  589. InviteCurrency = "EUR",
  590. SendCost = 100.00M,
  591. SendCurrency = "EUR",
  592. EventsCost = 10000.00M,
  593. EventsCurrency = "EUR",
  594. TranslateCost = 300.00M,
  595. TranslateCurrency = "EUR",
  596. PayMoney = 10500.00M,
  597. PaymentCurrency = "EUR",
  598. CNYPrice = 76765.50M,
  599. Payee = "模拟数据-收款方",
  600. AuditGMDate = "2023-12-05",
  601. OrbitalPrivateTransfer = 1,
  602. PayWay = "刷卡",
  603. IsPay = 1,
  604. Applicant = "刘华举"
  605. });
  606. groupInvitationalFeeViews.Add(new GroupInvitationalFeeView()
  607. {
  608. IOAId = 0,
  609. IOADiId = 2334,
  610. InviterArea = "模拟数据-邀请方地区",
  611. Inviter = "模拟数据-邀请方",
  612. InviteTime = "2023-10-10",
  613. InviteCost = 100.00M,
  614. InviteCurrency = "EUR",
  615. SendCost = 100.00M,
  616. SendCurrency = "EUR",
  617. EventsCost = 10000.00M,
  618. EventsCurrency = "EUR",
  619. TranslateCost = 300.00M,
  620. TranslateCurrency = "EUR",
  621. PayMoney = 10500.00M,
  622. PaymentCurrency = "EUR",
  623. CNYPrice = 76765.50M,
  624. Payee = "模拟数据-收款方",
  625. AuditGMDate = "2023-12-05",
  626. OrbitalPrivateTransfer = 1,
  627. PayWay = "刷卡",
  628. IsPay = 1,
  629. Applicant = "刘华举"
  630. });
  631. }
  632. decimal InvitationalCNYTotalPrice = 0.00M;
  633. foreach (var item in groupInvitationalFeeViews)
  634. {
  635. InvitationalCNYTotalPrice += item.CNYPrice;
  636. if (!string.IsNullOrEmpty(item.AuditGMDate))
  637. {
  638. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  639. }
  640. string currencyRateStr = "";
  641. List<string> currencys = new List<string>();
  642. if (!string.IsNullOrEmpty(item.InviteCurrency)) currencys.Add(item.InviteCurrency);
  643. if (!string.IsNullOrEmpty(item.SendCurrency)) currencys.Add(item.SendCurrency);
  644. if (!string.IsNullOrEmpty(item.EventsCurrency)) currencys.Add(item.EventsCurrency);
  645. if (!string.IsNullOrEmpty(item.TranslateCurrency)) currencys.Add(item.TranslateCurrency);
  646. if (!string.IsNullOrEmpty(item.PaymentCurrency)) currencys.Add(item.PaymentCurrency);
  647. currencyRateStr = await GeneralMethod.PostGroupRateByCTableAndCurrency(teamRateData, 81, currencys);
  648. item.CurrencyRateStr = currencyRateStr;
  649. }
  650. _geView.GroupInvitationalFeeViews = groupInvitationalFeeViews;
  651. _geView.GroupInvitationalFeeStr = string.Format(@"人民币总费用:{0} CNY", InvitationalCNYTotalPrice);
  652. #endregion
  653. #region 保险费用
  654. List<GroupInsuranceFeeView> groupInsuranceFeeViews = new List<GroupInsuranceFeeView>();
  655. string groupInsuranceFeeSql = string.Format(@"Select ic.Id As InsuranceId,ic.Diid As InsuranceDiId,ClientName,ccp.PayMoney,ccp.RMBPrice As CNYPrice,
  656. sd1.Name As PayMoneyCurrency,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
  657. sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
  658. From Grp_Customers ic
  659. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 82 And ic.Id = ccp.CId
  660. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  661. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  662. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  663. Where ic.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And ic.DiId = {0}", _dto.DiId);
  664. groupInsuranceFeeViews = await _sqlSugar.SqlQueryable<GroupInsuranceFeeView>(groupInsuranceFeeSql).ToListAsync();
  665. decimal InsuranceCNYTotalPrice = 0.00M;
  666. foreach (var item in groupInsuranceFeeViews)
  667. {
  668. InsuranceCNYTotalPrice += item.CNYPrice;
  669. if (!string.IsNullOrEmpty(item.AuditGMDate))
  670. {
  671. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  672. }
  673. }
  674. _geView.GroupInsuranceFeeViews = groupInsuranceFeeViews;
  675. _geView.GroupInsuranceFeeStr = string.Format(@"人名币总费用:{0} CNY", InsuranceCNYTotalPrice);
  676. #endregion
  677. #region 其他款项费用
  678. List<GroupDecreaseFeeView> groupDecreaseFeeViews = new List<GroupDecreaseFeeView>();
  679. string groupDecreaseFeeSql = string.Format(@"Select dp.Id As DPId,dp.DiId As DPDiId,dp.PriceName,ccp.PayMoney,sd1.Name As PayMoneyCurrency,
  680. ccp.RMBPrice As CNYPrice,ccp.DayRate,ccp.Payee,ccp.AuditGMDate,ccp.OrbitalPrivateTransfer,
  681. sd2.Name As PayWay,ccp.IsPay,u.CnName As Applicant
  682. From Grp_DecreasePayments dp
  683. Left Join Grp_CreditCardPayment ccp On ccp.isdel = 0 And ccp.CTable = 98 And dp.Id = ccp.CId
  684. Left Join Sys_SetData sd1 On ccp.PaymentCurrency = sd1.Id
  685. Left Join Sys_SetData sd2 On ccp.PayDId = sd2.Id
  686. Left Join Sys_Users u On ccp.CreateUserId = u.Id
  687. Where dp.IsDel = 0 And ccp.IsAuditGM = 1 And ccp.IsPay = 1 And dp.Diid = {0}",_dto.DiId);
  688. groupDecreaseFeeViews = await _sqlSugar.SqlQueryable<GroupDecreaseFeeView>(groupDecreaseFeeSql).ToListAsync();
  689. //模拟数据
  690. if (groupDecreaseFeeViews.Count < 1)
  691. {
  692. groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
  693. {
  694. DPId = 0,
  695. DPDiId = 2334,
  696. PriceName = "模拟数据-费用名称",
  697. PayMoney = 1000.00M,
  698. PayMoneyCurrency = "CNY",
  699. DayRate = 1.0000M,
  700. CNYPrice = 1.0000M,
  701. AuditGMDate = "2023-12-10 12:13:00",
  702. Payee = "模拟数据-付款方",
  703. OrbitalPrivateTransfer = 1,
  704. PayWay = "现金",
  705. IsPay = 1,
  706. Applicant = "刘华举"
  707. });
  708. groupDecreaseFeeViews.Add(new GroupDecreaseFeeView()
  709. {
  710. DPId = 0,
  711. DPDiId = 2334,
  712. PriceName = "模拟数据-费用名称",
  713. PayMoney = 1000.00M,
  714. PayMoneyCurrency = "CNY",
  715. DayRate = 1.0000M,
  716. CNYPrice = 1.0000M,
  717. AuditGMDate = "2023-12-10 12:13:00",
  718. Payee = "模拟数据-付款方",
  719. OrbitalPrivateTransfer = 1,
  720. PayWay = "现金",
  721. IsPay = 1,
  722. Applicant = "刘华举"
  723. });
  724. }
  725. decimal DecreaseCNYTotalPrice = 0.00M;
  726. foreach (var item in groupDecreaseFeeViews)
  727. {
  728. DecreaseCNYTotalPrice += item.CNYPrice;
  729. if (!string.IsNullOrEmpty(item.AuditGMDate))
  730. {
  731. item.AuditGMDate = Convert.ToDateTime(item.AuditGMDate).ToString("yyyy-MM-dd HH:mm:ss");
  732. }
  733. }
  734. _geView.GroupDecreaseFeeViews = groupDecreaseFeeViews;
  735. _geView.GroupDecreaseFeeStr = string.Format(@"人名币总费用:{0} CNY", DecreaseCNYTotalPrice);
  736. #endregion
  737. _view.GroupExpenditure = _geView;
  738. #endregion
  739. decimal _totalExpenditure = 0.00M; //总支出
  740. decimal _amountReceivable = 0.00M; //应收金额
  741. decimal _amountReceived = 0.00M; //已收金额
  742. decimal _profit = 0.00M; //利润
  743. _totalExpenditure = HotelCNYTotalPrice + CTGGRCNYTotalPrice + AirCNYTotalPrice + VisaCNYTotalPirce + InvitationalCNYTotalPrice +
  744. InsuranceCNYTotalPrice + DecreaseCNYTotalPrice + exTotalAmount;
  745. _amountReceivable = frTotalAmount;
  746. _amountReceived = prTotalAmount;
  747. _profit = _amountReceived - _totalExpenditure;
  748. _view.FeeTotalStr = string.Format(@"<span>
  749. <span>当前总支出:{0} CNY</span>
  750. <span style='padding-left:10px;color: Green;'>应收金额:{1} CNY</span>
  751. <span style='padding-left:10px;color: Green;'>已收金额:{2} CNY</span>
  752. <span style='padding-left:10px;color: Green;'>利润(收入-支出):{3} CNY</span>
  753. </span>", _totalExpenditure, _amountReceivable, _amountReceived, _profit);
  754. return Ok(JsonView(true, "查询成功!", _view));
  755. }
  756. else
  757. {
  758. return Ok(JsonView(false, "查询成功"));
  759. }
  760. }
  761. #endregion
  762. }
  763. }