FeeAuditRepository.cs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. using EyeSoft.Extensions;
  2. using EyeSoft.Logging;
  3. using NPOI.SS.Formula.Functions;
  4. using OASystem.Domain;
  5. using OASystem.Domain.Entities.Groups;
  6. using OASystem.Domain.Entities.Resource;
  7. using OASystem.Domain.ViewModels.Groups;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace OASystem.Infrastructure.Repositories.Groups
  14. {
  15. /// <summary>
  16. /// 费用审核仓储
  17. /// </summary>
  18. public class FeeAuditRepository:BaseRepository<EntityBase,ViewBase>
  19. {
  20. public FeeAuditRepository(SqlSugarClient sqlSugar) : base(sqlSugar)
  21. {
  22. }
  23. /// <summary>
  24. /// 费用自动审核
  25. /// </summary>
  26. /// <param name="feeType">
  27. /// 1.酒店 76
  28. /// 2.op 79
  29. /// 3.其他费用-出行物资 98
  30. /// 4.保险 82
  31. /// </param>
  32. /// <param name="diId">团组Id</param>
  33. /// <param name="dataId">数据Id(模块类型主表Id)</param>
  34. /// <returns></returns>
  35. public async Task<JsonView> FeeAutomaticAudit(int feeType, int diId, int dataId)
  36. {
  37. var _view = new JsonView() { Code = 201, Msg = "自动审核操作失败" };
  38. if (diId < 1) { _view.Msg = MsgTips.DiId; return _view; }
  39. if (dataId < 1) { _view.Msg = MsgTips.Id; return _view; }
  40. var stids = new List<int>() { 17, 66, 91 };
  41. var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
  42. string _teamCurrency = string.Empty;
  43. decimal _teamRate = 0.00M;
  44. var costContents = new List<GroupCostAuditView>();
  45. if (feeType != 4)
  46. {
  47. var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
  48. if (groupInfo == null) { _view.Msg = $"团组成本信息未填写!"; return _view; }
  49. _teamCurrency = groupInfo.Currency;
  50. _teamRate = groupInfo.Rate;
  51. //币种验证 统一为currencycode三字码
  52. if (int.TryParse(_teamCurrency, out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
  53. string costContentSql = $"Select * From Grp_GroupCost";
  54. costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
  55. if (costContents.Count < 1) { _view.Msg = $"团组成本信息未填写!"; return _view; }
  56. //处理 成本详细信息 日期为空
  57. for (int i = 0; i < costContents.Count; i++)
  58. {
  59. if (string.IsNullOrEmpty(costContents[i].Date))
  60. {
  61. int index = i - 1;
  62. if (index >= 0)
  63. {
  64. costContents[i].Date = costContents[index].Date;
  65. var dtBool = DateTime.TryParse(costContents[i].Date, out DateTime _dateTime);
  66. if (dtBool)
  67. {
  68. costContents[i].CurrTime = _dateTime;
  69. }
  70. }
  71. }
  72. else
  73. {
  74. var dtBool = DateTime.TryParse(costContents[i].Date, out DateTime _dateTime);
  75. if (dtBool)
  76. {
  77. costContents[i].CurrTime = _dateTime;
  78. }
  79. }
  80. }
  81. }
  82. if (feeType == 1)
  83. {
  84. //1089 对冲账或其他 不在审核范围
  85. var hotelCostInfo = _sqlSugar.Queryable<Grp_HotelReservations>().Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId && x.CheckType != 1089).First();
  86. var hotelCostDetails = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(x => x.IsDel == 0 && x.DiId == diId && x.HrId == dataId).ToList();
  87. if (hotelCostInfo == null)
  88. {
  89. _view.Msg = $"酒店费用数据未填写";
  90. QuashAudit(76, diId, dataId);
  91. return _view;
  92. }
  93. //酒店费用金额 == 0 不自动审核
  94. if (hotelCostInfo.CardPrice == 0.0000M)
  95. {
  96. _view.Msg = $"酒店费用金额 == 0 不自动审核";
  97. QuashAudit(76, diId, dataId);
  98. return _view;
  99. }
  100. //获取C表汇率
  101. decimal _rate = 1.0000M;
  102. var roomFeeInfo = hotelCostDetails.Where(x => x.PriceType == 1).First();
  103. if (roomFeeInfo == null)
  104. {
  105. _view.Msg = $"酒店房间费用付款数据未填写";
  106. return _view;
  107. }
  108. _rate = roomFeeInfo.Rate == 0.0000M ? 1.0000M : roomFeeInfo.Rate;
  109. bool isAutoAudit = true; //是否自动审核
  110. DateTime checkIn = Convert.ToDateTime(hotelCostInfo.CheckInDate),
  111. checkOut = Convert.ToDateTime(hotelCostInfo.CheckOutDate);
  112. if (checkOut > checkIn) checkOut = checkOut.AddDays(-1); //房费计算,结束日期为前一天
  113. var hotelCostInfos = costContents.Where(x => x.CurrTime >= checkIn && x.CurrTime <= checkOut).ToList();
  114. if (hotelCostInfos.Count < 1) isAutoAudit = false;
  115. decimal otherFee = hotelCostDetails.Where(x => x.PriceType != 1).Sum(x => x.Price * (x.Rate == 0.0000M ? 1.0000M : x.Rate));
  116. if (otherFee > 0) { otherFee /= (checkOut - checkIn).Days; }
  117. var hotelCostInfosGroup = hotelCostInfos.GroupBy(x => x.Date);
  118. foreach (var item in hotelCostInfosGroup)
  119. {
  120. var hotelSingleRoomFee = item.Sum(x => x.HotelSingleRoomFee) * _teamRate; //成本单间费用
  121. var hotelDoubleRoomFee = item.Sum(x => x.HotelDoubleRoomFee) * _teamRate; //成本双人间费用
  122. var hotelSuiteFee = item.Sum(x => x.HotelSuiteFee) * _teamRate; //成本套房费用
  123. var hotelSuiteRoomFee = item.Sum(x => x.HotelSuiteRoomFee) * _teamRate; //成本其他房型间费用
  124. //1.判断费用是否 <= 成本费用
  125. //1.1 判断单间费用
  126. decimal singleRoomPrice = (hotelCostInfo.SingleRoomPrice + otherFee) * _rate; //酒店录入费用
  127. if (singleRoomPrice > 0) if (singleRoomPrice > hotelSingleRoomFee) isAutoAudit = false;
  128. //1.2 判断双人间费用
  129. decimal doubleRoomPrice = (hotelCostInfo.DoubleRoomPrice + otherFee) * _rate;//酒店录入费用
  130. if (doubleRoomPrice > 0) if (doubleRoomPrice > hotelDoubleRoomFee) isAutoAudit = false;
  131. //1.3 判断套房费用
  132. decimal suiteRoomPrice = (hotelCostInfo.SuiteRoomPrice + otherFee) * _rate;//酒店录入费用
  133. if (suiteRoomPrice > 0) if (suiteRoomPrice > hotelSuiteFee) isAutoAudit = false;
  134. //1.4 判断其他房型费用
  135. decimal otherRoomPrice = (hotelCostInfo.OtherRoomPrice + otherFee) * _rate;//酒店录入费用
  136. if (otherRoomPrice > 0) if (otherRoomPrice > hotelSuiteRoomFee) isAutoAudit = false;
  137. }
  138. //2.判断是否自动审核
  139. if (isAutoAudit)
  140. {
  141. var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  142. .SetColumns(it => it.IsAuditGM == 3)
  143. .SetColumns(it => it.AuditGMOperate == 4)
  144. .SetColumns(it => it.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
  145. .Where(s => s.DIId == diId && s.CTable == 76 && s.CId == dataId)
  146. .ExecuteCommand();
  147. if (ccpUpdate > 0)
  148. {
  149. _view.Code = 200;
  150. _view.Msg = "自动审核执行成功";
  151. return _view;
  152. }
  153. }
  154. else
  155. {
  156. //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核 3 --> 0
  157. var quashStatus = QuashAudit(76, diId, dataId);
  158. if (quashStatus)
  159. {
  160. _view.Code = 200;
  161. _view.Msg = "费用超团组成本,自动审核撤销成功!";
  162. return _view;
  163. }
  164. }
  165. }
  166. else if (feeType == 2)
  167. {
  168. //1.基础数据参数验证
  169. var priceType = new List<int>() {
  170. 1062 //1062 尾款
  171. };
  172. var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
  173. .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId && !priceType.Contains(x.PriceType))
  174. .First();
  175. //var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
  176. // .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId )
  177. // .First();
  178. if (opinfos == null)
  179. {
  180. _view.Msg = $"OP费用费用类型属于“尾款”或者 内容未填写";
  181. return _view;
  182. }
  183. //1.含超时费用/超支费用 手动审核
  184. if (opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支") || opinfos.SelectCheck.Contains("尾款"))
  185. {
  186. _view.Msg = @$"OP费用含尾款/超支/超时费用,请手动审核";
  187. return _view;
  188. }
  189. //1.参数验证
  190. var opCheckPriceTyeps = opinfos.SelectCheck.Split(',');
  191. var opCheckPriceTyepIds = setData.Where(x => opinfos.SelectCheck.Split(',').Contains(x.Name)).Select(x => x.Id).ToList();
  192. var opContents = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
  193. .Where(x => x.IsDel == 0 && x.DiId == diId && x.CTGGRId == dataId && opCheckPriceTyepIds.Contains(x.SId))
  194. .OrderBy(x => x.DatePrice, OrderByType.Asc)
  195. .ToList();
  196. if (opContents.Count < 1)
  197. {
  198. _view.Msg = $"OP费用费用内容未填写";
  199. return _view;
  200. }
  201. //获取C表汇率
  202. decimal _opRate = 1.0000M;
  203. decimal _opPayPercentage = 1.0000M;
  204. var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.CId == dataId).First();
  205. if (payInfo == null)
  206. {
  207. _view.Msg = $"OP费用付款数据未填写";
  208. return _view;
  209. }
  210. _opRate = payInfo.DayRate;
  211. _opPayPercentage = payInfo.PayPercentage / 100.00M;
  212. string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
  213. //团组、OP币种 验证是否一致(一致:只比较金额,不计算汇率(2024-04-18))
  214. if (opCurrencyName.Equals(_teamCurrency))
  215. {
  216. _opRate = payInfo.DayRate;
  217. _teamRate = payInfo.DayRate;
  218. }
  219. var opBasicDatas = setData.Where(x => x.STid == 17).ToList(); //费用类型基础数据
  220. bool isAutoAudit = true;
  221. if (!DateTime.TryParse(opinfos.ServiceStartTime, out DateTime startDt1) || !DateTime.TryParse(opinfos.ServiceEndTime, out DateTime endDt1))
  222. {
  223. _view.Msg = $"OP费用服务起止日期格式不正确!";
  224. return _view;
  225. }
  226. DateTime startDt = startDt1;
  227. DateTime endDt = endDt1;
  228. var opCostDatas = costContents.Where(it => Convert.ToDateTime(it.Date) >= startDt && Convert.ToDateTime(it.Date) <= endDt).ToList();
  229. if (opCostDatas.Count < 1)
  230. {
  231. _view.Msg = $"该时间段内团组成本未填写!";
  232. return _view;
  233. }
  234. var noAuditFeeTypeIds = new List<int> {
  235. 982 ,//982 车超时费 -- 暂无
  236. 96 ,//96 接送机费 -- 暂无
  237. 97 ,//97 其他费用 -- 暂无
  238. 992 ,//992 住补费用 -- 暂无
  239. 1059,//1059 导游超时费用 -- 暂无
  240. 1070,//1070 尾款金额 -- 暂无
  241. 1071,//1071 其他额外费用 -- 暂无
  242. 1073,//1073 翻译超时费 -- 暂无
  243. 1074,//1074 早餐超支费用 -- 暂无
  244. 1075,//1075 午餐超支费用 -- 暂无
  245. 1076,//1076 晚餐超支费用 -- 暂无
  246. };
  247. //费用类型筛选 包含 feeTypeIds && 包含这些类型费用大于0
  248. var noAuditFeeContents = opContents.Where(x => x.Price > 0 && noAuditFeeTypeIds.Contains(x.SId)).ToList();
  249. if (noAuditFeeContents.Count > 0)
  250. {
  251. _view.Msg = @$"OP费用含尾款/超支/超时费用,请手动审核";
  252. return _view;
  253. }
  254. //2.按天按项 检查费用是否超过预算
  255. var opDayContent = opContents.GroupBy(x => x.DatePrice);
  256. foreach (var item in opDayContent)
  257. {
  258. var opCostInfo = opCostDatas.Where(x => Convert.ToDateTime(x.Date) == item.Key).ToList();
  259. if (opCostInfo.Count < 1) continue;
  260. //车费 91
  261. var opCarCost = item.FirstOrDefault(x => x.SId == 91);
  262. if (opCarCost != null)
  263. if (opCarCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.CarFee) * _opPayPercentage) isAutoAudit = false;
  264. //982 车超时费 -- 暂无
  265. //92 导游费
  266. var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
  267. if (opGuideCost != null)
  268. if (opGuideCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideFee) * _opPayPercentage) isAutoAudit = false;
  269. //94 导游景点费
  270. var opGuideScenicCost = item.FirstOrDefault(x => x.SId == 94);
  271. if (opGuideScenicCost != null)
  272. if (opGuideScenicCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideScenicFee) * _opPayPercentage) isAutoAudit = false;
  273. //95 导游小费
  274. var opGuideTipCost = item.FirstOrDefault(x => x.SId == 95);
  275. if (opGuideTipCost != null)
  276. if (opGuideTipCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideTipFee) * _opPayPercentage) isAutoAudit = false;
  277. //983 导游餐补
  278. var opGuideMealCost = item.FirstOrDefault(x => x.SId == 983);
  279. if (opGuideMealCost != null)
  280. if (opGuideMealCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideMealFee) * _opPayPercentage) isAutoAudit = false;
  281. //984 导游房补
  282. var opGuideRoomCost = item.FirstOrDefault(x => x.SId == 984);
  283. if (opGuideRoomCost != null)
  284. if (opGuideRoomCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideRoomFee) * _opPayPercentage) isAutoAudit = false;
  285. //985 导游交通
  286. var opGuideTrafficCost = item.FirstOrDefault(x => x.SId == 985);
  287. if (opGuideTrafficCost != null)
  288. if (opGuideTrafficCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.GuideTrafficFee) * _opPayPercentage) isAutoAudit = false;
  289. //96 接送机费 -- 暂无
  290. //97 其他费用 -- 暂无
  291. //979 司机工资
  292. var opDriverCost = item.FirstOrDefault(x => x.SId == 979);
  293. if (opDriverCost != null)
  294. if (opDriverCost.Price * _opRate > _teamRate * _opPayPercentage * opCostInfo.Sum(x => x.DriverFee) * _opPayPercentage) isAutoAudit = false;
  295. //980 司机小费
  296. var opDriverTipCost = item.FirstOrDefault(x => x.SId == 980);
  297. if (opDriverTipCost != null)
  298. if (opDriverTipCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.DriverTipFee) * _opPayPercentage) isAutoAudit = false;
  299. //981 司机餐补
  300. var opDriverMealCost = item.FirstOrDefault(x => x.SId == 981);
  301. if (opDriverMealCost != null)
  302. if (opDriverMealCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.DriverMealFee) * _opPayPercentage) isAutoAudit = false;
  303. //988 客户早餐费用
  304. var opClientBreakfastCost = item.FirstOrDefault(x => x.SId == 988);
  305. if (opClientBreakfastCost != null)
  306. if (opClientBreakfastCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.ClientBreakfastFee) * _opPayPercentage) isAutoAudit = false;
  307. //93 客户午餐费用
  308. var opClientLunchCost = item.FirstOrDefault(x => x.SId == 93);
  309. if (opClientLunchCost != null)
  310. if (opClientLunchCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.ClientLunchFee) * _opPayPercentage) isAutoAudit = false;
  311. //989 客户晚餐费用
  312. var opClientDinnerCost = item.FirstOrDefault(x => x.SId == 989);
  313. if (opClientDinnerCost != null)
  314. if (opClientDinnerCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.ClientDinnerFee) * _opPayPercentage) isAutoAudit = false;
  315. //990 景点门票费
  316. var opScenicTicketCost = item.FirstOrDefault(x => x.SId == 990);
  317. if (opScenicTicketCost != null)
  318. if (opScenicTicketCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.ScenicTicketFee) * _opPayPercentage) isAutoAudit = false;
  319. //991 饮料/零食/水果
  320. var opDrinkSnackFruitCost = item.FirstOrDefault(x => x.SId == 991);
  321. if (opDrinkSnackFruitCost != null)
  322. if (opDrinkSnackFruitCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.DrinkSnackFruitFee) * _opPayPercentage) isAutoAudit = false;
  323. //992 住补费用 -- 暂无
  324. //994 翻译费
  325. var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
  326. if (opTranslatorCost != null)
  327. if (opTranslatorCost.Price * _opRate * _opPayPercentage > _teamRate * opCostInfo.Sum(x => x.TranslatorFee) * _opPayPercentage) isAutoAudit = false;
  328. //1059 导游超时费用 -- 暂无
  329. //1070 尾款金额 -- 暂无
  330. //1071 其他额外费用 -- 暂无
  331. //1073 翻译超时费 -- 暂无
  332. //1074 早餐超支费用 -- 暂无
  333. //1075 午餐超支费用 -- 暂无
  334. //1076 晚餐超支费用 -- 暂无
  335. }
  336. //更改审核状态
  337. if (isAutoAudit)
  338. {
  339. var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  340. .SetColumns(it => it.IsAuditGM == 3)
  341. .SetColumns(it => it.AuditGMOperate == 4)
  342. .SetColumns(it => it.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
  343. .Where(s => s.DIId == diId && s.CTable == 79 && s.CId == dataId)
  344. .ExecuteCommand();
  345. if (ccpUpdate > 0)
  346. {
  347. _view.Code = 200;
  348. _view.Msg = "自动审核执行成功!";
  349. return _view;
  350. }
  351. }
  352. else
  353. {
  354. //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核 3 --> 0
  355. if (QuashAudit(79, diId, dataId))
  356. {
  357. _view.Code = 200;
  358. _view.Msg = "费用超团组成本,自动审核撤销成功!";
  359. return _view;
  360. }
  361. }
  362. }
  363. else if (feeType == 3)
  364. {
  365. #region 出行物资的功能及相关费用自动审核
  366. var isAutoAudit = false;
  367. var currModule = 98; //其他款项
  368. int groupSize = 0; // 团组人数
  369. var groupDetails = await _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == diId).FirstAsync();
  370. if (groupDetails != null) groupSize = groupDetails.VisitPNumber;
  371. decimal otherSubTotal = costContents.Sum(x => x.TeFee);
  372. decimal groupCostCNYTotal = costContents.Sum(x => x.TeFee) * _teamRate * groupSize; //团组成本出行物资总金额
  373. if (groupCostCNYTotal <= 0.00M)
  374. {
  375. _view.Msg = $"团组成本出行物资费用数据未填写";
  376. QuashAudit(currModule, diId, dataId);
  377. return _view;
  378. }
  379. var teNames = setData.Where(x => x.STid == 91).Select(x => x.Name).ToList();
  380. var otherFeeDatas = _sqlSugar.Queryable<Grp_DecreasePayments>()
  381. .InnerJoin<Grp_CreditCardPayment>((dp, ccp) => dp.Id == ccp.CId && ccp.CTable == 98 && ccp.IsDel == 0)
  382. .Where((dp, ccp) => dp.IsDel == 0 && ccp.IsDel == 0 && dp.DiId == diId)
  383. .ToList();
  384. var ids = new List<int>();
  385. foreach (var item in otherFeeDatas)
  386. {
  387. if (item.PriceName.Contains("、"))
  388. {
  389. var priceNames = item.PriceName.Split('、');
  390. foreach (var priceName in priceNames)
  391. {
  392. if (teNames.Contains(priceName))
  393. {
  394. ids.Add(item.Id);
  395. continue;
  396. }
  397. }
  398. }
  399. else if (teNames.Contains(item.PriceName))
  400. {
  401. ids.Add(item.Id);
  402. }
  403. }
  404. ids = ids.Distinct().ToList();
  405. //验证该费用是不是出行物资费用 是:审核 不是:不审核
  406. if (!ids.Contains(dataId))
  407. {
  408. _view.Msg = $"该费用不属于出行物资,不执行自动审核!";
  409. QuashAudit(currModule, diId, dataId);
  410. return _view;
  411. }
  412. decimal otherFeeCNYTotal = otherFeeDatas.Where(x => ids.Contains(x.Id)).Sum(x => x.FeeTotal); //其他费用出行物资总金额
  413. if (otherFeeCNYTotal <= 0.00M)
  414. {
  415. _view.Msg = $"其他款项出行物资费用数据未填写";
  416. QuashAudit(currModule, diId, dataId);
  417. return _view;
  418. }
  419. if (otherFeeCNYTotal > groupCostCNYTotal)
  420. {
  421. _view.Msg = $"其他款项出行物资费用超出团组成本物资费用";
  422. QuashAudit(currModule, diId, dataId);
  423. return _view;
  424. }
  425. isAutoAudit = true;
  426. //2.判断是否自动审核
  427. if (isAutoAudit)
  428. {
  429. var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  430. .SetColumns(it => it.IsAuditGM == 3)
  431. .SetColumns(it => it.AuditGMOperate == 4)
  432. .SetColumns(it => it.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
  433. .Where(s => s.DIId == diId && s.CTable == currModule && s.CId == dataId)
  434. .ExecuteCommand();
  435. if (ccpUpdate > 0)
  436. {
  437. _view.Code = 200;
  438. _view.Msg = "自动审核执行成功";
  439. return _view;
  440. }
  441. }
  442. else
  443. {
  444. //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核 3 --> 0
  445. var quashStatus = QuashAudit(currModule, diId, dataId);
  446. if (quashStatus)
  447. {
  448. _view.Code = 200;
  449. _view.Msg = "费用超团组成本,自动审核撤销成功!";
  450. return _view;
  451. }
  452. }
  453. #endregion
  454. }
  455. else if (feeType == 4)
  456. {
  457. #region 保险费用录入自动审核
  458. var currModule = 82;
  459. var groupDetails = _sqlSugar.Queryable<Grp_DelegationInfo>().Where(x => x.IsDel == 0 && x.Id == diId).First();
  460. if (groupDetails == null)
  461. {
  462. _view.Msg = $"团组信息为空,不可自动审核!";
  463. return _view;
  464. }
  465. var insuranceCountryCostData = _sqlSugar.Queryable<Res_BasicInsuranceCost>().Where(x => x.IsDel == 0).ToList();
  466. if (!insuranceCountryCostData.Any())
  467. {
  468. _view.Msg = $"保险国家费用信息为空,不可自动审核!";
  469. return _view;
  470. }
  471. var insuranceType = _sqlSugar.Queryable<Grp_InsuranceCost>().Where(x => x.IsDel == 0 && x.Id != 2).Select(x => x.Id).ToList();
  472. var insuranceCostData1 = _sqlSugar.Queryable<Grp_Customers>()
  473. .LeftJoin<Grp_CreditCardPayment>((c, ccp) => c.Id == ccp.CId && ccp.CTable == 82)
  474. .Where((c, ccp) => c.IsDel == 0 && c.DiId == diId)
  475. .Select((c, ccp) => new
  476. {
  477. c.Id,
  478. c.Iid,
  479. ccpId = ccp.Id,
  480. CNYPrice = ccp.PayMoney * ccp.DayRate
  481. })
  482. .ToList();
  483. if (!insuranceCostData1.Any())
  484. {
  485. _view.Msg = $"暂无保险数据,不可自动审核!";
  486. return _view;
  487. }
  488. if (insuranceCostData1.Where(x => x.Iid == 2).ToList().Any())
  489. {
  490. _view.Msg = $"保险数据为类型为“新数据请不要选此项”,不可自动审核!";
  491. return _view;
  492. }
  493. #region 处理已审核通过的 “新数据请不要选此项” 数据
  494. var insuranceCostData2 = insuranceCostData1.Where(x => x.Iid == 2).ToList();
  495. if (insuranceCostData2.Any())
  496. {
  497. //_view.Msg = $"保险数据为类型为“新数据请不要选此项”,不可自动审核!";
  498. //return _view;
  499. var ccpIds = insuranceCostData2.Select(x => x.ccpId).ToList();
  500. var auditCcpIds = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && ccpIds.Contains(x.Id) && x.IsAuditGM == 3).Select(x => x.Id).ToList();
  501. if (auditCcpIds.Any())
  502. {
  503. var ccpUpd = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  504. .SetColumns(it => it.IsAuditGM == 0)
  505. .SetColumns(it => it.AuditGMOperate == 0)
  506. .SetColumns(it => it.AuditGMDate == string.Empty)
  507. .Where(s => auditCcpIds.Contains(s.Id))
  508. .ExecuteCommand();
  509. }
  510. }
  511. #endregion
  512. //var insuranceCostData = insuranceCostData1.Where(x => insuranceType.Contains(x.Iid)).ToList();
  513. var insuranceCostData = insuranceCostData1.ToList();
  514. var currInsuranceInfo = insuranceCostData.Where(x => x.Id == dataId).FirstOrDefault();
  515. if (!insuranceCostData.Any() && currInsuranceInfo == null)
  516. {
  517. _view.Msg = $"暂无保险数据,不可自动审核!";
  518. return _view;
  519. }
  520. if (currInsuranceInfo.CNYPrice == 0.00M)
  521. {
  522. _view.Msg = $"保险数据未录入费用信息,不可自动审核!";
  523. QuashAudit(currModule, diId, dataId);
  524. return _view;
  525. }
  526. var groupPeopleNum = groupDetails.VisitPNumber;
  527. var visitCountrys = groupDetails.VisitCountry.Split("|").ToList();
  528. if (!visitCountrys.Any())
  529. {
  530. _view.Msg = $"出访国家为空,不可自动审核!";
  531. return _view;
  532. }
  533. var basicCountrys = insuranceCountryCostData.Select(x => x.CountryName).ToList();
  534. var schengenCountry = visitCountrys.Intersect(basicCountrys); //申根国
  535. var unSchengenCountry = visitCountrys.Except(basicCountrys); //非申根国
  536. var schengenCost = insuranceCountryCostData.Where(x => schengenCountry.Contains(x.CountryName)).Sum(x => x.Cost); // 申根国费用
  537. var unSchengenCost = unSchengenCountry.Count() * 35; // 非申根国费用
  538. var groupBudgetCost = (schengenCost + unSchengenCost) * groupPeopleNum;
  539. var groupActialCost = insuranceCostData.Sum(x => x.CNYPrice);
  540. if (groupActialCost > groupBudgetCost)
  541. {
  542. _view.Msg = $"保险费用超出团组成本费用";
  543. QuashAudit(currModule, diId, dataId);
  544. return _view;
  545. }
  546. //自动审核
  547. var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  548. .SetColumns(it => it.IsAuditGM == 3)
  549. .SetColumns(it => it.AuditGMOperate == 4)
  550. .SetColumns(it => it.AuditGMDate == DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
  551. .Where(s => s.DIId == diId && s.CTable == currModule && s.CId == dataId)
  552. .ExecuteCommand();
  553. if (ccpUpdate > 0)
  554. {
  555. _view.Code = 200;
  556. _view.Msg = "自动审核执行成功";
  557. }
  558. else _view.Msg = "自动审核执行失败";
  559. return _view;
  560. #endregion
  561. }
  562. else _view.Msg = $"请传入有效的feeType参数";
  563. return _view;
  564. }
  565. /// <summary>
  566. /// hotel、op 撤销自动审核的数据
  567. /// </summary>
  568. /// <param name="type">
  569. /// 酒店 76
  570. /// op 79
  571. /// </param>
  572. /// <param name="diId"></param>
  573. /// <param name="dataId"></param>
  574. /// <returns></returns>
  575. private bool QuashAudit(int type, int diId, int dataId)
  576. {
  577. //撤销该条数据的自动审核 --> 该条数据的审核状态是自动审核 3 --> 0
  578. var ccpInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>()
  579. .Where(s => s.DIId == diId && s.CTable == type && s.CId == dataId && s.IsAuditGM == 3)
  580. .First();
  581. if (ccpInfo != null)
  582. {
  583. var ccpUpdate = _sqlSugar.Updateable<Grp_CreditCardPayment>()
  584. .SetColumns(it => it.IsAuditGM == 0)
  585. .SetColumns(it => it.AuditGMOperate == 0)
  586. .SetColumns(it => it.AuditGMDate == string.Empty)
  587. .Where(s => s.Id == ccpInfo.Id)
  588. .ExecuteCommand();
  589. if (ccpUpdate > 0)
  590. {
  591. return true;
  592. }
  593. }
  594. return false;
  595. }
  596. //
  597. /// <summary>
  598. /// 费用自动审核
  599. /// </summary>
  600. /// <param name="feeType">
  601. /// 1.酒店 76
  602. /// 2.op 79
  603. /// </param>
  604. /// <param name="diId">团组Id</param>
  605. /// <param name="dataId">数据Id(模块类型主表Id)</param>
  606. /// <returns></returns>
  607. public string IsOverBudget(int feeType, int diId, int dataId)
  608. {
  609. string _view ="-";
  610. if (diId < 1) { return _view; }
  611. if (dataId < 1) { return _view; }
  612. List<int> stids = new List<int>() { 17, 66 };
  613. var setData = _sqlSugar.Queryable<Sys_SetData>().Where(x => x.IsDel == 0 && stids.Contains(x.STid)).ToList();
  614. string _teamCurrency = string.Empty;
  615. var groupInfo = _sqlSugar.Queryable<Grp_GroupCostParameter>().Where(x => x.IsDel == 0 && x.DiId == diId).First();
  616. if (groupInfo == null) { return _view; }
  617. _teamCurrency = groupInfo.Currency;
  618. //币种验证 统一为currencycode三字码
  619. if (int.TryParse(_teamCurrency, out int currency)) _teamCurrency = setData.Find(x => x.Id == currency)?.Name ?? "";
  620. string costContentSql = $"Select * From Grp_GroupCost";
  621. var costContents = _sqlSugar.SqlQueryable<GroupCostAuditView>(costContentSql).Where(x => x.IsDel == 0 && x.Diid == diId).ToList();
  622. if (costContents.Count < 1) { return _view; }
  623. //处理 成本详细信息 日期为空
  624. for (int i = 0; i < costContents.Count; i++)
  625. {
  626. if (string.IsNullOrEmpty(costContents[i].Date))
  627. {
  628. int index = i - 1;
  629. if (index >= 0)
  630. {
  631. costContents[i].Date = costContents[index].Date;
  632. }
  633. }
  634. }
  635. if (feeType == 1)
  636. {
  637. var hotelCostInfo = _sqlSugar.Queryable<Grp_HotelReservations>().Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId).First();
  638. var hotelCostDetails = _sqlSugar.Queryable<Grp_HotelReservationsContent>().Where(x => x.IsDel == 0 && x.DiId == diId && x.HrId == dataId).ToList();
  639. if (hotelCostInfo == null) return _view;
  640. //获取C表汇率
  641. decimal _rate = 1.0000M;
  642. var roomFeeInfo = hotelCostDetails.Where(x => x.PriceType == 1).First();
  643. if (roomFeeInfo == null) return _view;
  644. _rate = roomFeeInfo.Rate == 0.0000M ? 1.0000M : roomFeeInfo.Rate;
  645. bool isAutoAudit = true; //是否自动审核
  646. DateTime checkIn = Convert.ToDateTime(hotelCostInfo.CheckInDate),
  647. checkOut = Convert.ToDateTime(hotelCostInfo.CheckOutDate);
  648. if (checkOut > checkIn) checkOut = checkOut.AddDays(-1); //房费计算,结束日期为前一天
  649. var hotelCostInfos = costContents.Where(x => Convert.ToDateTime(x.Date) >= checkIn && Convert.ToDateTime(x.Date) <= checkOut).ToList();
  650. if (hotelCostInfos.Count < 1) isAutoAudit = false;
  651. decimal otherFee = hotelCostDetails.Where(x => x.PriceType != 1).Sum(x => x.Price * (x.Rate == 0.0000M ? 1.0000M : x.Rate));
  652. if (otherFee > 0) { otherFee /= (checkOut - checkIn).Days; }
  653. var hotelCostInfosGroup = hotelCostInfos.GroupBy(x => x.Date);
  654. foreach (var item in hotelCostInfosGroup)
  655. {
  656. decimal hotelSingleRoomFee = item.Sum(x => x.HotelSingleRoomFee);
  657. decimal hotelDoubleRoomFee = item.Sum(x => x.HotelDoubleRoomFee);
  658. decimal hotelSuiteFee = item.Sum(x => x.HotelSuiteFee);
  659. decimal hotelSuiteRoomFee = item.Sum(x => x.HotelSuiteRoomFee);
  660. //1.判断费用是否 <= 成本费用
  661. //1.1 判断单间费用
  662. decimal singleRoomPrice = (hotelCostInfo.SingleRoomPrice + otherFee) * _rate;
  663. if (singleRoomPrice > 0) if (singleRoomPrice > hotelSingleRoomFee * _rate) isAutoAudit = false;
  664. //1.2 判断双人间费用
  665. decimal doubleRoomPrice = (hotelCostInfo.DoubleRoomPrice + otherFee) * _rate;
  666. if (doubleRoomPrice > 0) if (doubleRoomPrice > hotelDoubleRoomFee * _rate) isAutoAudit = false;
  667. //1.3 判断套房费用
  668. decimal suiteRoomPrice = (hotelCostInfo.SuiteRoomPrice + otherFee) * _rate;
  669. if (suiteRoomPrice > 0) if (suiteRoomPrice > hotelSuiteFee * _rate) isAutoAudit = false;
  670. //1.4 判断其他房型费用
  671. decimal otherRoomPrice = (hotelCostInfo.OtherRoomPrice + otherFee) * _rate;
  672. if (otherRoomPrice > 0) if (otherRoomPrice > hotelSuiteRoomFee * _rate) isAutoAudit = false;
  673. }
  674. //2.判断是否自动审核
  675. if (isAutoAudit)
  676. {
  677. return $"未超预算";
  678. }
  679. }
  680. else if (feeType == 2)
  681. {
  682. //1.基础数据参数验证
  683. var priceType = new List<int>() { 1062 };
  684. var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
  685. .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId && !priceType.Contains(x.PriceType))
  686. .First();
  687. //var opinfos = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservations>()
  688. // .Where(x => x.IsDel == 0 && x.DiId == diId && x.Id == dataId )
  689. // .First();
  690. if (opinfos == null) return _view;
  691. //1.含超时费用/超支费用 手动审核
  692. if (opinfos.SelectCheck.Contains("超时") || opinfos.SelectCheck.Contains("超支") || opinfos.SelectCheck.Contains("尾款")) return _view;
  693. //1.参数验证
  694. var opCheckPriceTyeps = opinfos.SelectCheck.Split(',');
  695. var opCheckPriceTyepIds = setData.Where(x => opinfos.SelectCheck.Split(',').Contains(x.Name)).Select(x => x.Id).ToList();
  696. var opContents = _sqlSugar.Queryable<Grp_CarTouristGuideGroundReservationsContent>()
  697. .Where(x => x.IsDel == 0 && x.DiId == diId && x.CTGGRId == dataId && opCheckPriceTyepIds.Contains(x.SId))
  698. .OrderBy(x => x.DatePrice, OrderByType.Asc)
  699. .ToList();
  700. if (opContents.Count < 1) return _view;
  701. //获取C表汇率
  702. decimal _rate = 1.0000M;
  703. var payInfo = _sqlSugar.Queryable<Grp_CreditCardPayment>().Where(x => x.IsDel == 0 && x.DIId == diId && x.CTable == 79 && x.Id == dataId).First();
  704. if (payInfo == null) return _view;
  705. _rate = payInfo.DayRate;
  706. string opCurrencyName = setData.Find(x => x.Id == opContents[0].Currency)?.Name ?? "";
  707. var opBasicDatas = setData.Where(x => x.STid == 17).ToList(); //费用类型基础数据
  708. bool isAutoAudit = true;
  709. if (!DateTime.TryParse(opinfos.ServiceStartTime, out DateTime startDt1) || !DateTime.TryParse(opinfos.ServiceEndTime, out DateTime endDt1)) return _view;
  710. DateTime startDt = startDt1;
  711. DateTime endDt = endDt1;
  712. var opCostDatas = costContents.Where(it => Convert.ToDateTime(it.Date) >= startDt && Convert.ToDateTime(it.Date) <= endDt).ToList();
  713. if (opCostDatas.Count < 1) return _view;
  714. var noAuditFeeTypeIds = new List<int> {
  715. 982 ,//982 车超时费 -- 暂无
  716. 96 ,//96 接送机费 -- 暂无
  717. 97 ,//97 其他费用 -- 暂无
  718. 992 ,//992 住补费用 -- 暂无
  719. 1059,//1059 导游超时费用 -- 暂无
  720. 1070,//1070 尾款金额 -- 暂无
  721. 1071,//1071 其他额外费用 -- 暂无
  722. 1073,//1073 翻译超时费 -- 暂无
  723. 1074,//1074 早餐超支费用 -- 暂无
  724. 1075,//1075 午餐超支费用 -- 暂无
  725. 1076,//1076 晚餐超支费用 -- 暂无
  726. };
  727. //费用类型筛选 包含 feeTypeIds && 包含这些类型费用大于0
  728. var noAuditFeeContents = opContents.Where(x => x.Price > 0 && noAuditFeeTypeIds.Contains(x.SId)).ToList();
  729. if (noAuditFeeContents.Count > 0) return _view;
  730. //2.按天按项 检查费用是否超过预算
  731. var opDayContent = opContents.GroupBy(x => x.DatePrice);
  732. foreach (var item in opDayContent)
  733. {
  734. var opCostInfo = opCostDatas.Where(x => Convert.ToDateTime(x.Date) == item.Key).ToList();
  735. if (opCostInfo.Count < 1) continue;
  736. //车费 91
  737. var opCarCost = item.FirstOrDefault(x => x.SId == 91);
  738. if (opCarCost != null) if (opCarCost.Price * _rate > _rate * opCostInfo.Sum(x => x.CarFee)) isAutoAudit = false;
  739. //982 车超时费 -- 暂无
  740. //92 导游费
  741. var opGuideCost = item.FirstOrDefault(x => x.SId == 92);
  742. if (opGuideCost != null) if (opGuideCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideFee)) isAutoAudit = false;
  743. //94 导游景点费
  744. var opGuideScenicCost = item.FirstOrDefault(x => x.SId == 94);
  745. if (opGuideScenicCost != null) if (opGuideScenicCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideScenicFee)) isAutoAudit = false;
  746. //95 导游小费
  747. var opGuideTipCost = item.FirstOrDefault(x => x.SId == 95);
  748. if (opGuideTipCost != null) if (opGuideTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTipFee)) isAutoAudit = false;
  749. //983 导游餐补
  750. var opGuideMealCost = item.FirstOrDefault(x => x.SId == 983);
  751. if (opGuideMealCost != null) if (opGuideMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideMealFee)) isAutoAudit = false;
  752. //984 导游房补
  753. var opGuideRoomCost = item.FirstOrDefault(x => x.SId == 984);
  754. if (opGuideRoomCost != null) if (opGuideRoomCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideRoomFee)) isAutoAudit = false;
  755. //985 导游交通
  756. var opGuideTrafficCost = item.FirstOrDefault(x => x.SId == 985);
  757. if (opGuideTrafficCost != null) if (opGuideTrafficCost.Price * _rate > _rate * opCostInfo.Sum(x => x.GuideTrafficFee)) isAutoAudit = false;
  758. //96 接送机费 -- 暂无
  759. //97 其他费用 -- 暂无
  760. //979 司机工资
  761. var opDriverCost = item.FirstOrDefault(x => x.SId == 979);
  762. if (opDriverCost != null) if (opDriverCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverFee)) isAutoAudit = false;
  763. //980 司机小费
  764. var opDriverTipCost = item.FirstOrDefault(x => x.SId == 980);
  765. if (opDriverTipCost != null) if (opDriverTipCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverTipFee)) isAutoAudit = false;
  766. //981 司机餐补
  767. var opDriverMealCost = item.FirstOrDefault(x => x.SId == 981);
  768. if (opDriverMealCost != null) if (opDriverMealCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DriverMealFee)) isAutoAudit = false;
  769. //988 客户早餐费用
  770. var opClientBreakfastCost = item.FirstOrDefault(x => x.SId == 988);
  771. if (opClientBreakfastCost != null) if (opClientBreakfastCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientBreakfastFee)) isAutoAudit = false;
  772. //93 客户午餐费用
  773. var opClientLunchCost = item.FirstOrDefault(x => x.SId == 93);
  774. if (opClientLunchCost != null) if (opClientLunchCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientLunchFee)) isAutoAudit = false;
  775. //989 客户晚餐费用
  776. var opClientDinnerCost = item.FirstOrDefault(x => x.SId == 989);
  777. if (opClientDinnerCost != null) if (opClientDinnerCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ClientDinnerFee)) isAutoAudit = false;
  778. //990 景点门票费
  779. var opScenicTicketCost = item.FirstOrDefault(x => x.SId == 990);
  780. if (opScenicTicketCost != null) if (opScenicTicketCost.Price * _rate > _rate * opCostInfo.Sum(x => x.ScenicTicketFee)) isAutoAudit = false;
  781. //991 饮料/零食/水果
  782. var opDrinkSnackFruitCost = item.FirstOrDefault(x => x.SId == 991);
  783. if (opDrinkSnackFruitCost != null) if (opDrinkSnackFruitCost.Price * _rate > _rate * opCostInfo.Sum(x => x.DrinkSnackFruitFee)) isAutoAudit = false;
  784. //992 住补费用 -- 暂无
  785. //994 翻译费
  786. var opTranslatorCost = item.FirstOrDefault(x => x.SId == 994);
  787. if (opTranslatorCost != null) if (opTranslatorCost.Price * _rate > _rate * opCostInfo.Sum(x => x.TranslatorFee)) isAutoAudit = false;
  788. //1059 导游超时费用 -- 暂无
  789. //1070 尾款金额 -- 暂无
  790. //1071 其他额外费用 -- 暂无
  791. //1073 翻译超时费 -- 暂无
  792. //1074 早餐超支费用 -- 暂无
  793. //1075 午餐超支费用 -- 暂无
  794. //1076 晚餐超支费用 -- 暂无
  795. }
  796. //更改审核状态
  797. if (isAutoAudit) return _view;
  798. }
  799. else return _view;
  800. return _view;
  801. }
  802. }
  803. }