|
@@ -6,6 +6,7 @@ using OASystem.Domain.Dtos.Financial;
|
|
|
using OASystem.Domain.Dtos.Groups;
|
|
|
using OASystem.Domain.Entities.Financial;
|
|
|
using OASystem.Domain.ViewModels.Financial;
|
|
|
+using OASystem.Domain.ViewModels.Groups;
|
|
|
using OASystem.Infrastructure.Repositories.Groups;
|
|
|
using OASystem.Infrastructure.Repositories.System;
|
|
|
using SqlSugar;
|
|
@@ -42,19 +43,34 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
/// 收款账单 数据源
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> GetDataSource()
|
|
|
+ public async Task<JsonView> GetDataSource(ForeignReceivablesDataSourcesDto dto)
|
|
|
{
|
|
|
- Result result = new() { Code = -2 };
|
|
|
+ JsonView result = new() { Code = StatusCodes.Status204NoContent };
|
|
|
+
|
|
|
+ //已收款项 判断如果是市场部的人员进来的话 只显示自己的 其他的都显示全部的
|
|
|
+ var userInfos = await _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
|
|
|
+ .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ string sqlWhere = "";
|
|
|
+ if (userInfos.Count > 0) sqlWhere = string.Format(@$" And JietuanOperator={dto.CurrUserId} ");
|
|
|
|
|
|
- var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
|
|
|
+ string sql = string.Format(@$"Select Id,TeamName GroupName From Grp_DelegationInfo
|
|
|
+ Where TeamName != '' And IsDel = 0 {sqlWhere}
|
|
|
+ Order By Id Desc");
|
|
|
+
|
|
|
+ var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
|
|
|
+
|
|
|
+ //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.Code = StatusCodes.Status200OK;
|
|
|
result.Msg = "成功!";
|
|
|
result.Data = new
|
|
|
{
|
|
|
- GroupNameData = groupNameData.Data,
|
|
|
+ GroupNameData = _groupNameList,
|
|
|
CurrencyData = currencyData.Data,
|
|
|
RemittanceMethodData = remittanceMethodData.Data
|
|
|
};
|
|
@@ -274,19 +290,34 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
/// 收款账单 数据源
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> PostDataSource()
|
|
|
+ public async Task<JsonView> PostDataSource(ForeignReceivablesDataSourcesDto dto)
|
|
|
{
|
|
|
- Result result = new() { Code = -2 };
|
|
|
+ JsonView result = new() { Code = StatusCodes.Status204NoContent };
|
|
|
+
|
|
|
+ //已收款项 判断如果是市场部的人员进来的话 只显示自己的 其他的都显示全部的
|
|
|
+ var userInfos = await _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .InnerJoin<Sys_Department>((u, d) => u.DepId == d.Id)
|
|
|
+ .Where((u, d) => u.IsDel == 0 && d.DepName.Contains("市场部") && u.Id == dto.CurrUserId)
|
|
|
+ .ToListAsync();
|
|
|
+
|
|
|
+ string sqlWhere = "";
|
|
|
+ if (userInfos.Count > 0) sqlWhere = string.Format(@$" And JietuanOperator={dto.CurrUserId} ");
|
|
|
|
|
|
- var groupNameData = await _delegationRep.GetGroupNameList(new GroupNameDto());
|
|
|
+ string sql = string.Format(@$"Select Id,TeamName GroupName From Grp_DelegationInfo
|
|
|
+ Where TeamName != '' And IsDel = 0 {sqlWhere}
|
|
|
+ Order By Id Desc");
|
|
|
+
|
|
|
+ var _groupNameList = await _sqlSugar.SqlQueryable<GroupNameView>(sql).ToListAsync();
|
|
|
+
|
|
|
+ //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.Code = StatusCodes.Status200OK;
|
|
|
result.Msg = "成功!";
|
|
|
result.Data = new
|
|
|
{
|
|
|
- GroupNameData = groupNameData.Data,
|
|
|
+ GroupNameData = _groupNameList,
|
|
|
CurrencyData = currencyData.Data,
|
|
|
RemittanceMethodData = remittanceMethodData.Data
|
|
|
};
|