|
@@ -109,7 +109,6 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/// <summary>
|
|
|
/// 应收款项 删除
|
|
|
/// </summary>
|
|
@@ -269,7 +268,144 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ #region 未关联已收款项
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 收款账单 数据源
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> PostDataSource()
|
|
|
+ {
|
|
|
+ Result result = new() { Code = -2 };
|
|
|
+
|
|
|
+ var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
|
|
|
+ var currencyData = await _setDataRep.GetSetDataBySTId(_setDataRep, 66); //币种
|
|
|
+ var remittanceMethodData = await _setDataRep.GetSetDataBySTId(_setDataRep, 14); //汇款方式
|
|
|
+
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = "成功!";
|
|
|
+ result.Data = new
|
|
|
+ {
|
|
|
+ GroupNameData = groupNameData.Data,
|
|
|
+ CurrencyData = currencyData.Data,
|
|
|
+ RemittanceMethodData = remittanceMethodData.Data
|
|
|
+ };
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据diid查询团组应收款项
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="diid"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> PostGroupReceivablesInfoByDiId(ForForeignReceivablesNewDto dto)
|
|
|
+ {
|
|
|
+ Result result = new() { Code = -2 };
|
|
|
+
|
|
|
+ var groupInfoData = await _delegationRep.GetGroupInfo(new GroupInfoDto() { Id = dto.DiId });
|
|
|
+
|
|
|
+ //应收款项
|
|
|
+ string groupReceivedSql = string.Format(@"Select * From Fin_ForeignReceivables Where IsDel=0 And Diid={0}", dto.DiId);
|
|
|
+ var groupReceivedList = await _sqlSugar.SqlQueryable<ProceedsReceivedNewView>(groupReceivedSql).ToListAsync();
|
|
|
+
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = "查询成功!";
|
|
|
+ result.Data = new
|
|
|
+ {
|
|
|
+ GroupInfo = groupInfoData.Data,
|
|
|
+ GroupCollectionStatementData = groupReceivedList
|
|
|
+ };
|
|
|
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 财务模块
|
|
|
+ /// 收款账单 Add And Update
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="diid"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> PostReceivablesSave(ForeignReceivablesSaveDto dto)
|
|
|
+ {
|
|
|
+ Result result = new() { Code = -2 };
|
|
|
+
|
|
|
+ if (dto.foreignReceivablesInfos.Count <= 0)
|
|
|
+ {
|
|
|
+ result.Msg = "收款账单没有信息,不能进行,添加或修改操作!!!";
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ int addCount = 0, updateCount = 0;
|
|
|
+ if (dto.PortType == 1)
|
|
|
+ {
|
|
|
+ List<Fin_ForeignReceivables> _ForeignReceivables = new List<Fin_ForeignReceivables>();
|
|
|
+ foreach (var item in dto.foreignReceivablesInfos)
|
|
|
+ {
|
|
|
+ _ForeignReceivables.Add(new Fin_ForeignReceivables()
|
|
|
+ {
|
|
|
+ Diid = dto.DiId,
|
|
|
+ Id = item.Id,
|
|
|
+ PriceName = item.PriceName,
|
|
|
+ Price = item.Price,
|
|
|
+ Count = item.Count,
|
|
|
+ Unit = item.Unit,
|
|
|
+ ItemSumPrice = item.ItemSumPrice,
|
|
|
+ Rate = item.Rate,
|
|
|
+ Currency = item.Currency,
|
|
|
+ AddingWay = item.AddingWay,
|
|
|
+ CreateUserId = dto.UserId,
|
|
|
+ CreateTime = DateTime.Now,
|
|
|
+ Remark = item.Remark
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (_ForeignReceivables.Count > 0)
|
|
|
+ {
|
|
|
+ var x = _sqlSugar.Storageable(_ForeignReceivables).ToStorage();
|
|
|
+ addCount = x.AsInsertable.ExecuteCommand(); //不存在插入
|
|
|
+ updateCount = x.AsUpdateable.ExecuteCommand(); //存在更新
|
|
|
+ }
|
|
|
+ result.Code = 0;
|
|
|
+ result.Msg = string.Format(@"操作成功!添加:{0}条;更新:{1};", addCount, updateCount);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 财务模块
|
|
|
+ /// 收款账单
|
|
|
+ /// Del
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="diid"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<Result> PostReceivablesDel(ForeignReceivablesDelDto dto)
|
|
|
+ {
|
|
|
+ Result result = new() { Code = -2 };
|
|
|
+ var delStatus = await _sqlSugar.Updateable<Fin_ForeignReceivables>()
|
|
|
+ .SetColumns(a => new Fin_ForeignReceivables
|
|
|
+ {
|
|
|
+ IsDel = 1,
|
|
|
+ DeleteUserId = dto.UserId,
|
|
|
+ DeleteTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ })
|
|
|
+ .Where(a => a.Id == dto.Id)
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+
|
|
|
+ if (delStatus > 0)
|
|
|
+ {
|
|
|
+ result.Msg = "操作成功!";
|
|
|
+ result.Code = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Msg = "操作成功!";
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
|
|
|
}
|
|
|
}
|