Browse Source

DepartmentHomePageMessagePrompts 新增国交部首页提示消息 按岗位分类 代码编写

LEIYI 2 months ago
parent
commit
aa3390266a
1 changed files with 270 additions and 8 deletions
  1. 270 8
      OASystem/OASystem.Api/Controllers/SystemController.cs

+ 270 - 8
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -2671,9 +2671,9 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                             Data = groupNotFilledFeeDataAll,
                         };
 
-                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
-
                         #endregion
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
                     }
                     else if (currUserInfo.Role.Equals("计调"))//计调
                     {
@@ -2686,8 +2686,47 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                     {
                         #region 机票
                         //机票(myself) --> 日付(-:未审核提示)、机票费用(-:未录入提示)
-                        return Ok(JsonView(false, "国交部-->机票岗位消息提示正在开发中......"));
+                        var airTicket_unAuditDailyFeeData = unAuditDailyFeeData.Where(x => x.CreateUserId == currUserInfo.UserId).ToList();
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{airTicket_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{airTicket_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                userTourGuideData = airTicket_unAuditDailyFeeData,
+                                Count = airTicket_unAuditDailyFeeData.Count()
+                            }
+                        };
+
+                        var airTicket_groupNotFilledData = groupNotFilledFeeData
+                            .Where(x => x.groupType == 85)
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                airTicketFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{airTicket_groupNotFilledData.Count()}个团组费用未填写",
+                            Data = airTicket_groupNotFilledData,
+                        };
+
                         #endregion
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
                     }
                     else if (currUserInfo.Role.Equals("酒店"))//酒店
                     {
@@ -2703,7 +2742,7 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                                 uId = currUserInfo.UserId,
                                 name = currUserInfo.UserName,
                                 msgTips = $"本年有{hotle_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
-                                userTourGuideData = hotle_unAuditDailyFeeData,
+                                hotelFeeData = hotle_unAuditDailyFeeData,
                                 Count = hotle_unAuditDailyFeeData.Count()
                             }
                         };
@@ -2731,29 +2770,252 @@ And u.UId = {0} And u.FId = 1 ", dto.UserId);
                             Data = hotel_groupNotFilledData,
                         };
 
-                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
                         #endregion
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
                     }
                     else if (currUserInfo.Role.Equals("签证"))//签证
                     {
                         #region 签证
                         //签证(myself) --> 日付(-:未审核提示)、签证费用(-:未录入提示)
-                        return Ok(JsonView(false, "国交部-->签证岗位消息提示正在开发中......"));
+                        var visa_unAuditDailyFeeData = unAuditDailyFeeData.Where(x => x.CreateUserId == currUserInfo.UserId).ToList();
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{visa_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{visa_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                visaFeeData = visa_unAuditDailyFeeData,
+                                Count = visa_unAuditDailyFeeData.Count()
+                            }
+                        };
+
+                        var visa_groupNotFilledData = groupNotFilledFeeData
+                            .Where(x => x.groupType == 80)
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                airTicketFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{visa_groupNotFilledData.Count()}个团组费用未填写",
+                            Data = visa_groupNotFilledData,
+                        };
                         #endregion
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData }));
                     }
                     else if (currUserInfo.Role.Equals("商邀"))//商邀
                     {
                         #region 商邀
                         //商邀(myself) --> 日付(-:未审核提示)、商邀费用(-:未录入提示)、(公务、翻译人)(-:新增提示)
-                        return Ok(JsonView(false, "国交部-->商邀岗位消息提示正在开发中......"));
+                        //日付
+                        var in_unAuditDailyFeeData = unAuditDailyFeeData.Where(x => x.CreateUserId == currUserInfo.UserId).ToList();
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{in_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{in_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                visaFeeData = in_unAuditDailyFeeData,
+                                Count = in_unAuditDailyFeeData.Count()
+                            }
+                        };
+
+                        //团组未录入费用
+                        var in_groupNotFilledData = groupNotFilledFeeData
+                            .Where(x => x.groupType == 81)
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                airTicketFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{in_groupNotFilledData.Count()}个团组费用未填写",
+                            Data = in_groupNotFilledData,
+                        };
+
+                        //商邀 - 基础数据
+                        var invitationData = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>()
+                        .LeftJoin<Sys_Users>((ioa, u) => ioa.CreateUserId == u.Id)
+                        .Where((ioa, u) => ioa.IsDel == 0 && ioa.CreateTime >= startDateTime && ioa.CreateTime <= endDateTime)
+                        .Select((ioa, u) => new
+                        {
+                            //Area = string.Format("{0}{1}", ioa.Country, !string.IsNullOrEmpty(ioa.City) ? "" : "-" + ioa.City),
+                            Area = string.Format("{0}{1}", ioa.Country, ioa.City),
+                            Client = ioa.UnitName,
+                            ioa.Contact,
+                            ioa.Job,
+                            ioa.Tel,
+                            ioa.CreateUserId,
+                            CreatleUserName = u.CnName,
+                            ioa.CreateTime,
+                        })
+                        .ToListAsync();
+                        var invitationGroups = invitationData.GroupBy(x => x.CreateUserId)
+                            .Select(g => new {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
+                                msgTips = $"上月新增商邀资源共{g.Count()}条",
+                                userTourGuideData = g.ToList(),
+                                Count = g.Count()
+                            });
+                        var invitationData1 = new
+                        {
+                            msgTips = $"上月新增商邀资源共{invitationData.Count}条",
+                            Data = invitationGroups,
+                        };
+
                         #endregion
+
+                        return Ok(JsonView(new { groupNotFillEdFeeData = groupNotFillEdFeeData1, dailyPaymentData = dailyPaymentData, invitationData = invitationData }));
                     }
                     else if (currUserInfo.Role.Equals("OP"))//OP
                     {
                         #region OP
                         //OP(myself) --> 日付(-:未审核提示)、OP费用(-:未录入提示)、(导游、车)资源信息(-:新增提示)
-                        return Ok(JsonView(false, "国交部-->OP岗位消息提示正在开发中......"));
+                        //日付
+                        var in_unAuditDailyFeeData = unAuditDailyFeeData.Where(x => x.CreateUserId == currUserInfo.UserId).ToList();
+
+                        var dailyPaymentData = new
+                        {
+                            msgTips = $"本年有{in_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                            Data = new
+                            {
+                                uId = currUserInfo.UserId,
+                                name = currUserInfo.UserName,
+                                msgTips = $"本年有{in_unAuditDailyFeeData.Count()}条未审核日常付款申请条",
+                                visaFeeData = in_unAuditDailyFeeData,
+                                Count = in_unAuditDailyFeeData.Count()
+                            }
+                        };
+
+                        //OP - 团组未录入费用
+                        var in_groupNotFilledData = groupNotFilledFeeData
+                            .Where(x => x.groupType == 79)
+                            .GroupBy(x => x.diId)
+                            .Select(g => new
+                            {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.groupName ?? "-",
+                                msgTips = $"-",
+                                airTicketFeeData = g.Select(x1 => new
+                                {
+                                    x1.groupType,
+                                    x1.groupTypeName
+                                }).ToList(),
+                                Count = g.Count()
+                            })
+                            .ToList();
+
+                        var groupNotFillEdFeeData1 = new
+                        {
+                            msgTips = $"今天有{in_groupNotFilledData.Count()}个团组费用未填写",
+                            Data = in_groupNotFilledData,
+                        };
+
+                        #region op地接导游
+                        //1.2 op地接导游 
+                        var opTourGuideData = await _sqlSugar.Queryable<Res_LocalGuideData>()
+                            .LeftJoin<Sys_Users>((lgd, u) => lgd.CreateUserId == u.Id)
+                            .Where((lgd, u) => lgd.IsDel == 0 && lgd.CreateTime >= startDateTime && lgd.CreateTime <= endDateTime)
+                            .Select((lgd, u) => new
+                            {
+                                Area = lgd.UnitArea,
+                                Client = lgd.UnitName,
+                                lgd.Contact,
+                                Job = "",
+                                Tel = lgd.ContactTel,
+                                lgd.CreateUserId,
+                                CreatleUserName = u.CnName,
+                                lgd.CreateTime,
+                            })
+                            .ToListAsync();
+                        var opTourGuideDataGroups = opTourGuideData.GroupBy(x => x.CreateUserId)
+                            .Select(g => new {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
+                                msgTips = $"上月新增OP地接导游资源共{g.Count()}条",
+                                userTourGuideData = g.ToList(),
+                                Count = g.Count()
+                            });
+
+                        var opTourGuideData1 = new
+                        {
+                            msgTips = $"上月新增OP地接导游资源共{opTourGuideData.Count}条",
+                            Data = opTourGuideDataGroups,
+                        };
+                        #endregion
+
+                        #region op车数据
+                        //1.3 op车数据 
+                        var opCarData = await _sqlSugar.Queryable<Res_CarData>()
+                            .LeftJoin<Sys_Users>((cd, u) => cd.CreateUserId == u.Id)
+                            .Where((cd, u) => cd.IsDel == 0 && cd.CreateTime >= startDateTime && cd.CreateTime <= endDateTime)
+                            .Select((cd, u) => new
+                            {
+                                Area = cd.UnitArea,
+                                Client = cd.UnitName,
+                                cd.Contact,
+                                Job = "",
+                                Tel = cd.ContactTel,
+                                cd.CreateUserId,
+                                CreatleUserName = u.CnName,
+                                cd.CreateTime,
+                            })
+                            .ToListAsync();
+                        var opCarDataGroups = opCarData.GroupBy(x => x.CreateUserId)
+                            .Select(g => new {
+                                uId = g.Key,
+                                name = g.ToList().FirstOrDefault()?.CreatleUserName ?? "-",
+                                msgTips = $"上月新增OP地接车资源共{g.Count()}条",
+                                userTourGuideData = g.ToList(),
+                                Count = g.Count()
+                            });
+                        var opCarData1 = new
+                        {
+                            msgTips = $"上月新增OP地接车资源共{opCarData.Count}条",
+                            Data = opCarDataGroups,
+                        };
+                        #endregion
+
                         #endregion
+
+                        return Ok(JsonView(new
+                        {
+                            groupNotFillEdFeeData = groupNotFillEdFeeData1,
+                            dailyPaymentData = dailyPaymentData,
+                            CarData = opCarData1,
+                            TourGuideData = opTourGuideData
+                        }));
                     }
 
                     return Ok(JsonView(false, "国交部消息提示正在开发中......"));