Browse Source

日付申请 基础数据取消注释 typeId=90

LEIYI 2 months ago
parent
commit
e7c0e3356e

+ 203 - 15
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -13,6 +13,8 @@ using static OpenAI.GPT3.ObjectModels.SharedModels.IOpenAiModels;
 using static QRCoder.PayloadGenerator;
 using static Quartz.Logging.OperationName;
 using static OASystem.API.OAMethodLib.JWTHelper;
+using System.Runtime.Intrinsics.Arm;
+using OASystem.Domain.Dtos.Statistics;
 
 namespace OASystem.API.Controllers
 {
@@ -2524,6 +2526,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                 }
                 else if (department.Equals("国交部"))//国交部
                 {
+                    #region 团组费用录入提示
                     /*
                      * 名称:团组费用录入提示
                      * 描述:团组费用录入提醒(根据团组结束时间 - 3天 如果对应的数据表里没有这个团组的费用信息)
@@ -2541,34 +2544,219 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                         //1015,//超支费用
                     };
                     var crrDate = DateTime.Now.ToString("yyyy-MM-dd");
-                    var groupFeeData = await _sqlSugar.Queryable<Grp_DelegationInfo>()
-                        .LeftJoin< Grp_CreditCardPayment>((di, ccp) => di.Id == ccp.DIId)
-                        .LeftJoin<Sys_SetData>((di, ccp,  sd) => ccp.CTable == sd.Id)
-                        .Where((di, ccp, sd) => ccp.IsDel == 0 && 
+                    var groupModlueData = await _sqlSugar.Queryable<Sys_SetData>().Where(x => groupModlue.Contains(x.Id)).ToListAsync();
+
+                    var groupFeeData = await _sqlSugar.Queryable<Sys_SetData>()
+                        .LeftJoin<Grp_CreditCardPayment>((sd, ccp) => sd.Id == ccp.CTable)
+                        .LeftJoin<Grp_DelegationInfo>((sd, ccp, di) => ccp.DIId == di.Id)
+                        .Where((sd, ccp, di) => ccp.IsDel == 0 &&
                                                 di.IsDel == 0 &&
-                                                groupModlue.Contains(ccp.CTable) && 
+                                                groupModlue.Contains(ccp.CTable) &&
                                                 di.VisitEndDate.AddDays(-3).ToString("yyyy-MM-dd").Equals(crrDate)
                          )
-                        .Select((di, ccp, sd) => new { 
+                        .GroupBy((sd, ccp, di) => new { di.Id, di.TeamName, ccp.CTable, sd.Name }) //可以多字段
+                        .Select((sd, ccp, di) => new {
                             diId = di.Id,
                             groupName = di.TeamName,
                             groupType = ccp.CTable,
-                            groupTypeName = sd.Name
+                            groupTypeName = sd.Name,
+                            //userId = ccp.CreateUserId,
+                            count = SqlFunc.AggregateCount(ccp.CTable),
                         })
                         .ToListAsync();
+                    var groupFeeData1 = groupFeeData.GroupBy(x => x.diId);
+                    var groupNotFilledFeeData = new List<dynamic>();
+                    foreach (var groupFee in groupFeeData1)
+                    {
+                        var diId = groupFee.Key;
+                        var addData = groupFeeData.Where(x => x.diId == diId).Select(x => x.groupType).ToList();
+                        if (addData.Count < 1) continue;
+                        var unAddData = groupModlue.Except(addData).ToList();
+                        if (unAddData.Count < 1) continue;
 
+                        foreach (var typeId in unAddData)
+                        {
+                            groupNotFilledFeeData.Add(new
+                            {
+                                diId = diId,
+                                groupName = groupFee.FirstOrDefault()?.groupName ?? "-",
+                                groupType = typeId,
+                                groupTypeName = groupModlueData.Find(x => x.Id == typeId)?.Name ?? "-",
+                                count = 0
+                            });
+                        }
+                    }
+                    #endregion
 
+                    #region 日付申请 -- 未审核数据
 
-                    //经理、主管(部门下所有人员) --> 日付(-:未审核提示)、团组费用录入提醒(根据团组结束时间-3天 如果对应的数据表里没有这个团组的费用信息)、团组相关费用(-:未审核提示)
-                    //计调(myself) --> 暂定
-                    //机票(myself) --> 日付(-:未审核提示)、机票费用(-:未审核提示)
-                    //酒店(myself) --> 日付(-:未审核提示)、酒店费用(-:未审核提示)、酒店资源信息(-:新增提示)
-                    //签证(myself) --> 日付(-:未审核提示)、签证费用(-:未审核提示)、签证资源信息(-:新增提示)
-                    //商邀(myself) --> 日付(-:未审核提示)、商邀费用(-:未审核提示)、(公务、翻译人)(-:新增提示)
-                    //OP(myself) --> 日付(-:未审核提示)、OP费用(-:未审核提示)、(导游、车)资源信息(-:新增提示)
+                    var depUserData = await _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 && d.DepName.Contains("国交部"))
+                        .Select((u, d, jp) => new
+                        {
+                            u.Id,
+                            u.CnName,
+                            u.DepId,
+                            d.DepName,
+                            u.JobPostId,
+                            jp.JobName
+                        })
+                        .ToListAsync();
+                    var depUserData1 = depUserData.Select(x => x.Id).ToList();
+
+                    var unAuditDailyFeeData = await _sqlSugar.Queryable<Fin_DailyFeePayment>()
+                        .LeftJoin<Sys_Users>((dfp, u) => dfp.CreateUserId == u.Id)
+                        .Where((dfp, u) => dfp.IsDel == 0 &&
+                                           depUserData1.Contains(dfp.CreateUserId) &&
+                                           dfp.MAudit == 0 &&
+                                           dfp.CreateTime >= currStartDate &&
+                                           dfp.CreateTime <= currEntDate
+                         )
+                        .Select((dfp, u) => new
+                        {
+                            id = dfp.Id,
+                            amountName = dfp.Instructions,
+                            amount = dfp.SumPrice,
+                            fAuditStatus = dfp.FAudit == 1 ? "审核通过" :
+                                           dfp.FAudit == 2 ? "审核未通过" : "未审核",
+                            fAuditDate = dfp.FAuditDate,
+                            dfp.CreateUserId,
+                            CreateUserName = u.CnName,
+                            dfp.CreateTime
+                        })
+                        .ToArrayAsync();
+
+                    #endregion
+
+                    var jobs = new List<string>() { "经理", "主管" };
+                    if (jobs.Contains( currUserInfo.Role)) //经理、主管
+                    {
+                        #region 经理、主管
+                        //经理、主管(部门下所有人员) --> 日付(-:未审核提示)、团组费用录入提醒(根据团组结束时间-3天 如果对应的数据表里没有这个团组的费用信息)
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                userTourGuideData = unAuditDailyFeeData,
+                                Count = unAuditDailyFeeData.Count()
+                            }
+                        };
 
+                        var groupNotFilledFeeDataAll = groupNotFilledFeeData
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                hotelFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{groupNotFilledFeeDataAll.Count()}个团组费用未填写",
+                            Data = groupNotFilledFeeDataAll,
+                        };
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
+
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("计调"))//计调
+                    {
+                        #region 计调
+                        //计调(myself) --> 暂定
+                        return Ok(JsonView(false, "国交部-->计调岗位消息提示正在开发中......"));
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("机票"))//机票
+                    {
+                        #region 机票
+                        //机票(myself) --> 日付(-:未审核提示)、机票费用(-:未录入提示)
+                        return Ok(JsonView(false, "国交部-->机票岗位消息提示正在开发中......"));
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("酒店"))//酒店
+                    {
+                        #region 酒店
+                        //酒店(myself) --> 日付(-:未审核提示)、酒店费用(-:未录入提示)
+                        var hotle_unAuditDailyFeeData = unAuditDailyFeeData.Where(x => x.CreateUserId == currUserInfo.UserId).ToList();
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{hotle_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{hotle_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                userTourGuideData = hotle_unAuditDailyFeeData,
+                                Count = hotle_unAuditDailyFeeData.Count()
+                            }
+                        };
+
+                        var hotel_groupNotFilledData = groupNotFilledFeeData
+                            .Where(x => x.groupType == 76)
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                hotelFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{hotel_groupNotFilledData.Count()}个团组费用未填写",
+                            Data = hotel_groupNotFilledData,
+                        };
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("签证"))//签证
+                    {
+                        #region 签证
+                        //签证(myself) --> 日付(-:未审核提示)、签证费用(-:未录入提示)
+                        return Ok(JsonView(false, "国交部-->签证岗位消息提示正在开发中......"));
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("商邀"))//商邀
+                    {
+                        #region 商邀
+                        //商邀(myself) --> 日付(-:未审核提示)、商邀费用(-:未录入提示)、(公务、翻译人)(-:新增提示)
+                        return Ok(JsonView(false, "国交部-->商邀岗位消息提示正在开发中......"));
+                        #endregion
+                    }
+                    else if (currUserInfo.Role.Equals("OP"))//OP
+                    {
+                        #region OP
+                        //OP(myself) --> 日付(-:未审核提示)、OP费用(-:未录入提示)、(导游、车)资源信息(-:新增提示)
+                        return Ok(JsonView(false, "国交部-->OP岗位消息提示正在开发中......"));
+                        #endregion
+                    }
 
-                    return Ok(JsonView(false, "国交部消息提示正在开发者中......"));
+                    return Ok(JsonView(false, "国交部消息提示正在开发中......"));
                 }
                 else if (department.Equals("财务部"))//总经办
                 {

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Financial/DailyFeePaymentRepository.cs

@@ -57,7 +57,7 @@ namespace OASystem.Infrastructure.Repositories.Financial
                 50, //销售费用
                 51, //其他费用
                 55, //大运会
-                //90, //各部门基础固定费用明细
+                90, //各部门基础固定费用明细
             };
             var priceTypeData = setTypeData.Where(s => typeIds.Contains(s.Id)).ToList();
             var priceSubTypeData = setData.Where(s => typeIds.Contains(s.STid)).ToList();