|
@@ -41,7 +41,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
/// </summary>
|
|
|
/// <param name="dto"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<Result> GetPagePriceTypeData(PortDtoBase dto)
|
|
|
+ public async Task<Result> GetPagePriceTypeData(PortDtoBase dto, int currUserId = 0)
|
|
|
{
|
|
|
Result result = new Result() { Code = -2 };
|
|
|
|
|
@@ -53,8 +53,47 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
//48人员费用 49办公费用 50 销售费用 51 其他费用 55 大运会
|
|
|
var priceTypeData = setTypeData.Where(s => s.Id == 48 || s.Id == 49 || s.Id == 50 || s.Id == 51 || s.Id == 55).ToList();
|
|
|
var priceSubTypeData = setData.Where(s => s.STid == 48 || s.STid == 49 || s.STid == 50 || s.STid == 51 || s.STid == 55).ToList();
|
|
|
+
|
|
|
+ var isEnable = false;
|
|
|
//员工姓名列表
|
|
|
- var userNameData = await _UsersRep.GetUserNameList(dto.PortType);
|
|
|
+ var userData = _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .Where(x => x.IsDel == 0)
|
|
|
+ .Select(x => new { x.Id, x.DepId, x.CnName })
|
|
|
+ .ToList();
|
|
|
+ //1 经理职位 查看该部门下所有人员
|
|
|
+ if (currUserId > 0)
|
|
|
+ {
|
|
|
+ //42
|
|
|
+ var auditUserIds = _sqlSugar.Queryable<Sys_UserAuthority>().Where(x => x.IsDel == 0 && x.SmId == 42 && x.FId == 12).Select(x => x.UId).ToList();
|
|
|
+ if (!auditUserIds.Contains(currUserId))
|
|
|
+ {
|
|
|
+ var screenWheres = new List<string>() { "经理", "主管" };
|
|
|
+ var userInfo = _sqlSugar.Queryable<Sys_Users>()
|
|
|
+ .LeftJoin<Sys_Department>((u, d) => u.DepId == d.Id)
|
|
|
+ .LeftJoin<Sys_JobPost>((u, d, jp) => u.JobPostId == jp.Id)
|
|
|
+ .Where((u, d, jp) => u.IsDel == 0 && u.Id == currUserId && screenWheres.Contains(jp.JobName))
|
|
|
+ .Select((u, d, jp) => new
|
|
|
+ {
|
|
|
+ u.Id,
|
|
|
+ u.CnName,
|
|
|
+ u.DepId,
|
|
|
+ d.DepName,
|
|
|
+ u.JobPostId,
|
|
|
+ jp.JobName
|
|
|
+ })
|
|
|
+ .First();
|
|
|
+ if (userInfo != null)
|
|
|
+ {
|
|
|
+ userData = userData.Where(x => x.DepId == userInfo.DepId).ToList();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ userData = userData.Where(x => x.Id == currUserId).ToList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ var userData1 = userData.Select(x => new { x.Id, x.CnName }).ToList();
|
|
|
//62 公转 63 私转
|
|
|
var feeMarkTypeData = setTypeData.Where(s => s.Id == 62 || s.Id == 63).ToList();
|
|
|
var feeMarkSubTypeData = setData.Where(s => s.STid == 62 || s.STid == 63).ToList();
|
|
@@ -62,11 +101,11 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
|
|
|
if (dto.PortType == 1) //web
|
|
|
{
|
|
|
- DailyFeePaymentList = new Fin_DailyFeePaymentPagePriceTypeDataView
|
|
|
+ DailyFeePaymentList = new
|
|
|
{
|
|
|
FeeTypeData = priceTypeData,
|
|
|
FeeSubTypeData = priceSubTypeData,
|
|
|
- UserNameData = userNameData.Data,
|
|
|
+ UserNameData = userData1,
|
|
|
FeeMarkTypeData = feeMarkTypeData,
|
|
|
FeeMarkSubTypeData = feeMarkSubTypeData,
|
|
|
CompanyNameData = companyNameData.Data
|
|
@@ -77,7 +116,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
|
|
|
|
|
|
DailyFeePaymentList = new
|
|
|
{
|
|
|
- UserNameData = userNameData.Data,
|
|
|
+ UserNameData = userData1,
|
|
|
FeeTypeData = priceTypeData,
|
|
|
FeeTypeSubData = priceSubTypeData
|
|
|
};
|