ForeignReceivablesRepository.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. using AutoMapper;
  2. using MathNet.Numerics.Statistics.Mcmc;
  3. using NPOI.SS.Formula.Functions;
  4. using OASystem.Domain;
  5. using OASystem.Domain.Dtos.Financial;
  6. using OASystem.Domain.Dtos.Groups;
  7. using OASystem.Domain.Entities.Financial;
  8. using OASystem.Domain.Entities.Groups;
  9. using OASystem.Domain.ViewModels.Financial;
  10. using OASystem.Domain.ViewModels.Groups;
  11. using OASystem.Infrastructure.Repositories.Groups;
  12. using OASystem.Infrastructure.Repositories.System;
  13. using SqlSugar;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. namespace OASystem.Infrastructure.Repositories.Financial
  20. {
  21. /// <summary>
  22. /// 财务 - 团组应收款项 仓库
  23. /// 雷怡 2023.08.16 15:03
  24. /// </summary>
  25. public class ForeignReceivablesRepository : BaseRepository<Fin_ForeignReceivables, Fin_ForeignReceivablesView>
  26. {
  27. private readonly IMapper _mapper;
  28. private readonly DelegationInfoRepository _delegationRep;
  29. private readonly SetDataRepository _setDataRep;
  30. public ForeignReceivablesRepository(SqlSugarClient sqlSugar, IMapper mapper, DelegationInfoRepository delegationRep, SetDataRepository setDataRep)
  31. : base(sqlSugar)
  32. {
  33. _mapper = mapper;
  34. _delegationRep = delegationRep;
  35. _setDataRep = setDataRep;
  36. }
  37. #region 关联已收款项
  38. /// <summary>
  39. /// 收款账单 数据源
  40. /// </summary>
  41. /// <returns></returns>
  42. public async Task<JsonView> GetDataSource(ForeignReceivablesDataSourcesDto dto)
  43. {
  44. JsonView result = new() { Code = StatusCodes.Status204NoContent };
  45. //已收款项 判断如果是市场部的人员进来的话 只显示自己的 其他的都显示全部的
  46. var userInfos = await _sqlSugar.Queryable<Sys_Users>()
  47. .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
  48. .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
  49. .ToListAsync();
  50. string sqlWhere = "";
  51. if (userInfos.Count > 0) sqlWhere = string.Format(@$" And JietuanOperator={dto.CurrUserId} ");
  52. string sql = string.Format(@$"Select Id,TeamName GroupName From Grp_DelegationInfo
  53. Where TeamName != '' And IsDel = 0 {sqlWhere}
  54. Order By Id Desc");
  55. var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
  56. //var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
  57. var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种
  58. var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
  59. result.Code = StatusCodes.Status200OK;
  60. result.Msg = "成功!";
  61. result.Data = new
  62. {
  63. GroupNameData = _groupNameList,
  64. CurrencyData = currencyData.Data,
  65. RemittanceMethodData = remittanceMethodData.Data
  66. };
  67. return result;
  68. }
  69. /// <summary>
  70. /// 根据diid查询团组应收款项
  71. /// </summary>
  72. /// <param name="diid"></param>
  73. /// <returns></returns>
  74. public async Task<Result> GetGroupReceivablesInfoByDiId(ForForeignReceivablesInfoDto dto)
  75. {
  76. Result result = new() { Code = -2 };
  77. var groupInfoData = await _delegationRep.GetGroupInfo(new GroupInfoDto() { Id = dto.DiId });
  78. //应收款项
  79. string groupReceivedSql = string.Format(@"Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0}", dto.DiId);
  80. var groupReceivedList = await _sqlSugar.SqlQueryable<ForeignReceivablesView>(groupReceivedSql).ToListAsync();
  81. //已收款项
  82. string groupProceedsReceivedSql = string.Format(@"Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0}", dto.DiId);
  83. var groupProceedsReceivedList = await _sqlSugar.SqlQueryable<ProceedsReceivedView>(groupProceedsReceivedSql).ToListAsync();
  84. List<ProceedsReceivedView> NotFIDData = new List<ProceedsReceivedView>();
  85. if (dto.PortType == 1)
  86. {
  87. foreach (var item in groupReceivedList)
  88. {
  89. item._ProceedsReceivedDatas = groupProceedsReceivedList.Where(s => s.FID == item.Id).ToList();
  90. }
  91. NotFIDData = groupProceedsReceivedList.Where(s => !groupReceivedList.Any(e => s.FID == e.Id)).ToList();
  92. }
  93. result.Code = 0;
  94. result.Msg = "查询成功!";
  95. result.Data = new
  96. {
  97. GroupInfo = groupInfoData.Data,
  98. GroupCollectionStatementData = new
  99. {
  100. ReceivedData = groupReceivedList,
  101. UnallocatedData = NotFIDData
  102. }
  103. };
  104. return result;
  105. }
  106. /// <summary>
  107. /// 应收款项 删除
  108. /// </summary>
  109. /// <param name="dto"></param>
  110. /// <returns></returns>
  111. public async Task<Result> _Del(DelForForeignReceivablesInfoDto dto)
  112. {
  113. Result result = new Result() { Code = -1, Msg = "程序错误!" };
  114. _sqlSugar.BeginTran();
  115. try
  116. {
  117. var res = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
  118. .Where(it => it.Id == dto.Id)
  119. .SetColumns(it => new Fin_ForeignReceivables()
  120. {
  121. IsDel = 1,
  122. DeleteUserId = dto.UserId,
  123. DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
  124. }
  125. ).ExecuteCommandAsync();
  126. if (res > 0)
  127. {
  128. await _sqlSugar.Updateable<Fin_ProceedsReceived>()
  129. .Where(a => a.FID == dto.Id)
  130. .SetColumns(a => new Fin_ProceedsReceived
  131. {
  132. IsDel = 1,
  133. DeleteUserId = dto.UserId,
  134. DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  135. }).ExecuteCommandAsync();
  136. _sqlSugar.CommitTran();
  137. result.Msg = "删除成功!";
  138. result.Code = 0;
  139. }
  140. else
  141. {
  142. _sqlSugar.RollbackTran();
  143. result.Msg = "删除失败!";
  144. return result;
  145. }
  146. }
  147. catch (Exception ex)
  148. {
  149. _sqlSugar.RollbackTran();
  150. result.Msg = ex.Message;
  151. return result;
  152. }
  153. return result;
  154. }
  155. /// <summary>
  156. /// 财务模块
  157. /// 收款账单 Add And Update
  158. /// </summary>
  159. /// <param name="diid"></param>
  160. /// <returns></returns>
  161. public async Task<Result> PostReceivablesOperate(ForeignReceivablesAddAndUpdateDto dto)
  162. {
  163. Result result = new() { Code = -2 };
  164. if (dto.foreignReceivablesInfos.Count <= 0)
  165. {
  166. result.Msg = "收款账单没有信息,不能进行,添加或修改操作!!!";
  167. return result;
  168. }
  169. int addCount = 0, updateCount = 0;
  170. if (dto.PortType == 1)
  171. {
  172. List<Fin_ForeignReceivables> _ForeignReceivables = new List<Fin_ForeignReceivables>();
  173. foreach (var item in dto.foreignReceivablesInfos)
  174. {
  175. _ForeignReceivables.Add(new Fin_ForeignReceivables()
  176. {
  177. Diid = dto.DiId,
  178. Id = item.Id,
  179. PriceName = item.PriceName,
  180. Price = item.Price,
  181. Count = item.Count,
  182. Unit = item.Unit,
  183. ItemSumPrice = item.ItemSumPrice,
  184. Rate = item.Rate,
  185. Currency = item.Currency,
  186. AddingWay = item.AddingWay,
  187. CreateUserId = dto.UserId,
  188. CreateTime = DateTime.Now,
  189. Remark = item.Remark
  190. });
  191. }
  192. if (_ForeignReceivables.Count > 0)
  193. {
  194. var x = _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
  195. addCount = x.AsInsertable.ExecuteCommand(); //不存在插入
  196. updateCount = x.AsUpdateable.ExecuteCommand(); //存在更新
  197. }
  198. result.Code = 0;
  199. result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);
  200. }
  201. return result;
  202. }
  203. /// <summary>
  204. /// 根据diid查询团组应收款项
  205. /// </summary>
  206. /// <param name="diid"></param>
  207. /// <returns></returns>
  208. public async Task<Result> GetGroupReceivablesByDiid(int diid)
  209. {
  210. Result result = new() { Code = -2 };
  211. string sql = string.Format(@"Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0}", diid);
  212. var groupReceivedList = await _sqlSugar.SqlQueryable<Fin_ForeignReceivables>(sql).ToListAsync();
  213. result.Code = 0;
  214. result.Msg = "查询成功!";
  215. result.Data = groupReceivedList;
  216. return result;
  217. }
  218. /// <summary>
  219. /// 根据diid 数组 查询团组应收款项
  220. /// </summary>
  221. /// <param name="diid"></param>
  222. /// <returns></returns>
  223. public async Task<Result> GetGroupReceivablesByDiids(int[] diids)
  224. {
  225. Result result = new() { Code = -2 };
  226. //string sql = string.Format(@"Select * From Fin_ProceedsReceived Where IsDel=0 And Diid={0}", diids);
  227. var groupReceivedList = await _sqlSugar.Queryable<Fin_ForeignReceivables>()
  228. .Where(pr => pr.IsDel == 0 && diids.Contains(pr.Diid)).ToListAsync();
  229. result.Code = 0;
  230. result.Msg = "查询成功!";
  231. result.Data = groupReceivedList;
  232. return result;
  233. }
  234. #endregion
  235. #region 未关联已收款项
  236. /// <summary>
  237. /// 收款账单 数据源
  238. /// </summary>
  239. /// <returns></returns>
  240. public async Task<JsonView> PostDataSource(ForeignReceivablesDataSourcesDto dto)
  241. {
  242. JsonView result = new() { Code = StatusCodes.Status204NoContent };
  243. //已收款项 判断如果是市场部的人员进来的话 只显示自己的 其他的都显示全部的
  244. var userInfos = await _sqlSugar.Queryable<Sys_Users>()
  245. .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
  246. .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
  247. .ToListAsync();
  248. string sqlWhere = "";
  249. if (userInfos.Count > 0) sqlWhere = string.Format(@$" And JietuanOperator={dto.CurrUserId} ");
  250. string sql = string.Format(@$"Select Id,TeamName GroupName From Grp_DelegationInfo
  251. Where TeamName != '' And IsDel = 0 {sqlWhere}
  252. Order By Id Desc");
  253. var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
  254. //var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
  255. var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种
  256. var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
  257. result.Code = StatusCodes.Status200OK;
  258. result.Msg = "成功!";
  259. result.Data = new
  260. {
  261. GroupNameData = _groupNameList,
  262. CurrencyData = currencyData.Data,
  263. RemittanceMethodData = remittanceMethodData.Data
  264. };
  265. return result;
  266. }
  267. /// <summary>
  268. /// 根据diid查询团组应收款项
  269. /// </summary>
  270. /// <param name="diid"></param>
  271. /// <returns></returns>
  272. public async Task<JsonView> PostGroupReceivablesInfoByDiId(ForForeignReceivablesNewDto dto)
  273. {
  274. JsonView result = new() { Code = 400,Msg="" };
  275. var groupInfoData = await _delegationRep.GetGroupInfo(new GroupInfoDto() { Id = dto.DiId });
  276. //应收款项
  277. string groupReceivedSql = string.Format(@"Select *,su.CnName As AuditorName From Fin_ForeignReceivables ffr
  278. Left Join Sys_Users su On ffr.Auditor = su.Id
  279. Where ffr.IsDel=0 And ffr.Diid={0}", dto.DiId);
  280. var groupReceivedList = await _sqlSugar.SqlQueryable<ProceedsReceivedNewView>(groupReceivedSql).ToListAsync();
  281. result.Code = 200;
  282. result.Msg = "查询成功!";
  283. result.Data = new
  284. {
  285. GroupInfo = groupInfoData.Data,
  286. GroupCollectionStatementData = groupReceivedList
  287. };
  288. return result;
  289. }
  290. /// <summary>
  291. /// 财务模块
  292. /// 收款账单 Add And Update
  293. /// </summary>
  294. /// <param name="diid"></param>
  295. /// <returns></returns>
  296. public async Task<JsonView> PostReceivablesSave(ForeignReceivablesSaveDto dto)
  297. {
  298. JsonView result = new() { Code = 4002 };
  299. if (dto.foreignReceivablesInfos.Count <= 0)
  300. {
  301. result.Msg = "收款账单没有信息,不能进行,添加或修改操作!!!";
  302. return result;
  303. }
  304. int addCount = 0, updateCount = 0;
  305. if (dto.PortType == 1)
  306. {
  307. //查询值是否更改
  308. var selectInfos = await _sqlSugar.Queryable<Fin_ForeignReceivables>().Where(it => it.Diid == dto.DiId && it.Status == 1).ToListAsync();
  309. List <Fin_ForeignReceivables> _ForeignReceivables = new List<Fin_ForeignReceivables>();
  310. foreach (var item in dto.foreignReceivablesInfos)
  311. {
  312. int status = 0, auditor = 0;
  313. string auditTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
  314. var info = selectInfos.Find(x => x.Id == item.Id);
  315. if (info != null)
  316. {
  317. if (info.ItemSumPrice == item.ItemSumPrice)
  318. {
  319. status = info.Status;
  320. auditor = info.Auditor;
  321. auditTime = info.AuditTime;
  322. }
  323. }
  324. _ForeignReceivables.Add(new Fin_ForeignReceivables()
  325. {
  326. Diid = dto.DiId,
  327. Id = item.Id,
  328. PriceName = item.PriceName,
  329. Price = item.Price,
  330. Count = item.Count,
  331. Unit = item.Unit,
  332. ItemSumPrice = item.ItemSumPrice,
  333. Rate = item.Rate,
  334. Currency = item.Currency,
  335. AddingWay = item.AddingWay,
  336. CreateUserId = dto.UserId,
  337. CreateTime = DateTime.Now,
  338. Remark = item.Remark,
  339. Status = status,
  340. Auditor = auditor,
  341. AuditTime = auditTime
  342. });
  343. }
  344. if (_ForeignReceivables.Count > 0)
  345. {
  346. var x = _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
  347. addCount = x.AsInsertable.ExecuteCommand(); //不存在插入
  348. updateCount = x.AsUpdateable.IgnoreColumns(it => new
  349. {
  350. //it.Status,
  351. //it.Auditor,
  352. //it.AuditTime,
  353. it.CreateUserId,
  354. it.CreateTime
  355. }).ExecuteCommand(); //存在更新
  356. }
  357. result.Code = 200;
  358. result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);
  359. }
  360. return result;
  361. }
  362. /// <summary>
  363. /// 财务模块
  364. /// 收款账单
  365. /// Audit
  366. /// </summary>
  367. /// <param name="diid"></param>
  368. /// <returns></returns>
  369. public async Task<JsonView> FeeAudit(FeeAuditDto dto)
  370. {
  371. JsonView result = new() { Code = 400 };
  372. //验证
  373. var info = await _sqlSugar.Queryable<Fin_ForeignReceivables>().FirstAsync(x => x.Id == dto.Id);
  374. if (info == null)
  375. {
  376. result.Msg = "数据不存在";
  377. return result;
  378. }
  379. if (info.AddingWay != 2)
  380. {
  381. result.Msg = "该条数据类型不是“实际报价”类型不可审核!";
  382. return result;
  383. }
  384. var AuditStatus = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
  385. .SetColumns(a => new Fin_ForeignReceivables
  386. {
  387. Status = dto.Status,
  388. Auditor = dto.UserId,
  389. AuditTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  390. })
  391. .Where(a => a.Id == dto.Id)
  392. .ExecuteCommandAsync();
  393. if (AuditStatus > 0)
  394. {
  395. result.Msg = "操作成功!";
  396. result.Code = 200;
  397. }
  398. else
  399. {
  400. result.Msg = "操作失败!";
  401. }
  402. return result;
  403. }
  404. /// <summary>
  405. /// 财务模块
  406. /// 收款账单
  407. /// Del
  408. /// </summary>
  409. /// <param name="diid"></param>
  410. /// <returns></returns>
  411. public async Task<Result> PostReceivablesDel(ForeignReceivablesDelDto dto)
  412. {
  413. Result result = new() { Code = -2 };
  414. var delStatus = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
  415. .SetColumns(a => new Fin_ForeignReceivables
  416. {
  417. IsDel = 1,
  418. DeleteUserId = dto.UserId,
  419. DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
  420. })
  421. .Where(a => a.Id == dto.Id)
  422. .ExecuteCommandAsync();
  423. if (delStatus > 0)
  424. {
  425. result.Msg = "操作成功!";
  426. result.Code = 0;
  427. }
  428. else
  429. {
  430. result.Msg = "操作成功!";
  431. }
  432. return result;
  433. }
  434. public void OverSpSeteceivables(OverSpSeteceivablesDto dto)
  435. {
  436. var querySaveReceivables = _sqlSugar.Queryable<Fin_ForeignReceivables>()
  437. .First(x => x.Diid == dto.DiId && x.AddingWay == 3 && x.IsDel == 0);
  438. //获取所有超支数据
  439. //整理超支数据
  440. //币种不同则计算rmb值
  441. var overspList = _sqlSugar.Queryable<Fin_GroupExtraCost, Grp_CreditCardPayment>
  442. ((e, c) => c.CTable == 1015 && c.CId == e.Id && c.IsDel == 0).
  443. Where((e, c) => e.IsDel == 0 && e.DiId == dto.DiId && (e.SupervisorConfirm == 1 || e.ManagerConfirm == 1)).
  444. Select((e, c) => new
  445. {
  446. e.Price,
  447. e.PriceCount,
  448. e.Coefficient,
  449. e.PriceSum,
  450. c.RMBPrice,
  451. c.DayRate,
  452. e.PriceCurrency,
  453. e.Remark,
  454. })
  455. .ToList();
  456. var overspListGroup = overspList.GroupBy(x => x.PriceCurrency).ToList();
  457. string foreignReceivablesRemake = string.Empty;
  458. int count = 1;
  459. overspList.ForEach(x =>
  460. {
  461. foreignReceivablesRemake += $"{count}.{x.Remark}";
  462. count++;
  463. });
  464. if (querySaveReceivables != null)
  465. {
  466. if (overspList.Count() > 0)
  467. {
  468. if (overspListGroup.Count() > 1)
  469. {
  470. querySaveReceivables.Currency = 836; //人民币
  471. querySaveReceivables.Rate = 1;
  472. querySaveReceivables.Price = overspListGroup.Sum(x => x.Sum(y => y.PriceSum * y.Coefficient * y.DayRate));
  473. querySaveReceivables.ItemSumPrice = overspListGroup.Sum(x => x.Sum(y => y.PriceSum * y.Coefficient * y.DayRate));
  474. querySaveReceivables.Remark = foreignReceivablesRemake;
  475. querySaveReceivables.CreateTime = DateTime.Now;
  476. }
  477. else
  478. {
  479. querySaveReceivables.Currency = overspList[0].PriceCurrency;
  480. querySaveReceivables.Rate = overspList[0].DayRate;
  481. querySaveReceivables.Price = overspListGroup[0].Sum(x => x.PriceSum * x.Coefficient);
  482. querySaveReceivables.ItemSumPrice = overspListGroup[0].Sum(x => x.PriceSum * x.Coefficient);
  483. querySaveReceivables.Remark = foreignReceivablesRemake;
  484. querySaveReceivables.AddingWay = 3;
  485. querySaveReceivables.CreateTime = DateTime.Now;
  486. }
  487. }
  488. else
  489. {
  490. querySaveReceivables.Currency = 836; //人民币
  491. querySaveReceivables.Rate = 1;
  492. querySaveReceivables.Price = 0;
  493. querySaveReceivables.ItemSumPrice = 0;
  494. querySaveReceivables.Remark = "";
  495. querySaveReceivables.CreateTime = DateTime.Now;
  496. querySaveReceivables.Count = 1;
  497. }
  498. _sqlSugar.Updateable(querySaveReceivables).ExecuteCommand();
  499. }
  500. else
  501. {
  502. if (overspList.Count() > 0)
  503. {
  504. if (overspListGroup.Count() > 1)
  505. {
  506. querySaveReceivables = new Fin_ForeignReceivables
  507. {
  508. CreateTime = DateTime.Now,
  509. CreateUserId = dto.CreateUserId,
  510. Diid = dto.DiId,
  511. PriceName = "超支费用",
  512. AddingWay = 3,
  513. Count = 1,
  514. Currency = 836,
  515. ItemSumPrice = overspList.Sum(x => x.PriceSum * x.Coefficient * x.DayRate),
  516. Price = overspList.Sum(x => x.PriceSum * x.Coefficient * x.DayRate),
  517. Rate = 1,
  518. IsDel = 0,
  519. Remark = foreignReceivablesRemake,
  520. Unit = "团",
  521. };
  522. }
  523. else
  524. {
  525. querySaveReceivables = new Fin_ForeignReceivables
  526. {
  527. CreateTime = DateTime.Now,
  528. CreateUserId = dto.CreateUserId,
  529. Diid = dto.DiId,
  530. PriceName = "超支费用",
  531. AddingWay = 3,
  532. Count = 1,
  533. Currency = overspList[0].PriceCurrency,
  534. ItemSumPrice = overspList.Sum(x => x.PriceSum * x.Coefficient),
  535. Price = overspList.Sum(x => x.PriceSum * x.Coefficient),
  536. Rate = overspList[0].DayRate,
  537. IsDel = 0,
  538. Remark = foreignReceivablesRemake,
  539. Unit = "团",
  540. };
  541. }
  542. }
  543. _sqlSugar.Insertable(querySaveReceivables).ExecuteCommand();
  544. }
  545. }
  546. #endregion
  547. }
  548. }