Browse Source

Merge branch 'develop' of http://132.232.92.186:3000/XinXiBu/OA2023 into develop

yuanrf 7 months ago
parent
commit
d9611f3c6f

+ 8 - 6
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -1711,7 +1711,7 @@ namespace OASystem.API.Controllers
             //List<string> templist = new List<string>() { 234.ToString() };
             //await AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(14090, templist, QiyeWeChatEnum.TestChat);
 
-            await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(_dto.DiId); ;
+            //await AppNoticeLibrary.SendUserMsg_GroupShare_ToJob(_dto.DiId); ;
 
 
             //DeleReminderMessage.PostMessageByWebhook();
@@ -1719,18 +1719,19 @@ namespace OASystem.API.Controllers
 
             //创建群聊
 
-            //List<string> userList1 = new List<string>() {  "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin" };
+            //List<string> userList1 = new List<string>() { "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin" };
             //List<string> userList2 = new List<string>() {  "Feint", "ZhaoYaQi", "LiaoWenYa" };
             //List<string> userList3 = new List<string>() {  "Feint", "amy.zhu@pan-american-intl.com", "judy.zeng@pan-american-intl.com", "FuHongJin", "ZhaoYaQi", "LiaoWenYa" };
 
-            //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-财务部", "Feint", userList1, "CaiWuChat01");
+            //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组通知", "Feint", userList1, "CaiWuChat01");
             //GroupStatus_CreateChatView rst2 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-国交部", "Feint", userList2, "GuoJiaoLeader01");
             //GroupStatus_CreateChatView rst3 = await _qiYeWeChatApiService.GroupStatus_CreateChat("OA通知-团组(公司客户)", "Feint", userList3, "CompanyCRMChat01");
 
             //推送消息(模板)
 
             //List<string> userList = new List<string>() { "Feint", "huaju.liu", "johnny.yang@pan-american-intl.com" };
-            List<string> userList = new List<string>() { "Feint", "johnny.yang@pan-american-intl.com" };
+            //List<string> userList = new List<string>() { "Feint", "johnny.yang@pan-american-intl.com", "huaju.liu" };
+            //GroupStatus_CreateChatView rst1 = await _qiYeWeChatApiService.GroupStatus_CreateChat("团组出行通知", "Feint", userList, "CaiWuChat02");
 
             //团组出发
             //AppNoticeLibrary.SendUserMsg_GroupStatus_Create(2358, userList);
@@ -1739,7 +1740,8 @@ namespace OASystem.API.Controllers
             //AppNoticeLibrary.SendChatMsg_GroupStatus_ApplyFee(_dto.DiId, QiyeWeChatEnum.TestChat);
 
             //费用审核结果通知(通过情况下发送财务群)
-            //AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(_dto.DiId, userList, QiyeWeChatEnum.TestChat);
+            List<string> userList = new List<string>() { "234" };
+            AppNoticeLibrary.SendUserMsg_GroupStatus_AuditFee(_dto.DiId, userList, QiyeWeChatEnum.CaiWuChat02);
 
             //4、财务付款时:(1)对应版块人员【单独发,状态为已付款才发】
             //AppNoticeLibrary.SendUserMsg_GroupStatus_PayResult(_dto.DiId, userList);
@@ -1754,7 +1756,7 @@ namespace OASystem.API.Controllers
 
 
             //日付申请提醒财务群
-            //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(_dto.DiId, QiyeWeChatEnum.TestChat);
+            //AppNoticeLibrary.DailyPayReminders_Create_ToCaiwuChat(_dto.DiId, QiyeWeChatEnum.CaiWuChat02);
             //日付申请结果推送用户、成功通知财务群
             //AppNoticeLibrary.DailyPayReminder_Audit_ToUser(_dto.DiId, userList, QiyeWeChatEnum.TestChat);
             //AppNoticeLibrary.DailyPayReminder_Pay_ToUser(_dto.DiId, userList);

+ 30 - 2
OASystem/OASystem.Api/Controllers/SystemController.cs

@@ -1156,12 +1156,14 @@ namespace OASystem.API.Controllers
                                            x.Email,
                                            x.Address,
                                            x.Edate,
-                                           x.Seniority,
+                                           //x.Seniority,
                                            x.Birthday,
                                            x.IDCard,
                                            x.StartWorkDate,
                                            x.GraduateInstitutions,
                                            x.Professional,
+                                           x.Education,
+                                           x.TheOrAdultEducation,
                                            x.MaritalStatus,
                                            x.HomeAddress,
                                            x.UsePeriod,
@@ -1180,8 +1182,34 @@ namespace OASystem.API.Controllers
         /// <returns></returns>
         [HttpPost]
         [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
-        public async Task<IActionResult> EditUserInfo()
+        public async Task<IActionResult> EditUserInfo(EditUserInfoDto _dto)
         {
+            EditUserInfoDtoValidator validator = new EditUserInfoDtoValidator();
+            var validatorRes = await validator.ValidateAsync(_dto);
+            if (!validatorRes.IsValid)
+            {
+                var errors = new StringBuilder();
+                foreach (var error in validatorRes.Errors) errors.AppendLine(error.ErrorMessage);
+
+                return Ok(JsonView(false, errors.ToString()));
+            }
+
+            var userInfo = _mapper.Map<Sys_Users>(_dto);
+            var res = await _sqlSugar.Updateable(userInfo)
+                                     .IgnoreColumns(x => new
+                                     {
+                                         x.Rdate,
+                                         x.Seniority,
+                                         x.HrAudit,
+                                         x.CreateUserId,
+                                         x.CreateTime,
+                                         x.DeleteUserId,
+                                         x.DeleteTime,
+                                         x.IsDel
+                                     })
+                                     .Where(x => x.Id == _dto.Id)
+                                     .ExecuteCommandAsync();
+            if (res > 0) return Ok(JsonView(true, "操作成功!"));
 
             return Ok(JsonView(false,"操作失败!"));
         }

+ 22 - 2
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Config.cs

@@ -30,6 +30,12 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         [Description("CaiWuChat01")]
         CaiWuChat,
 
+        /// <summary>
+        /// 团组通知-财务群(财务部全员),发送条件(团组出访时间出发-7 天,结束-3 天,第二天,通知财务三人签合同、收尾款)
+        /// </summary>
+        [Description("CaiWuChat02")]
+        CaiWuChat02,
+
         /// <summary>
         /// 团组通知-国交管理群(国交部经理、主管),发送条件(1.费用审核-提交)
         /// </summary>
@@ -165,10 +171,11 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
         /// 团组出发前一周提醒财务检查合同、尾款
         /// </summary>
         /// <returns></returns>
-        public static string GroupRemindersToCaiwuChat(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day)
+        public static string GroupRemindersToCaiwuChat(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, List<Grp_DelegationInfo> list_minus1day)
         {
             string teamNames1 = "><font color='comment'>暂无</font>";
             string teamNames2 = "><font color='comment'>暂无</font>";
+            string teamNames3 = "><font color='comment'>暂无</font>";
 
             if (list_7day.Count > 0)
             {
@@ -193,6 +200,16 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
                 //list_3day.ForEach(s => teamNames2 += ">" + s.TeamName + "\n\n");
             }
 
+            if (list_minus1day.Count > 0)
+            {
+                teamNames3 = "";
+                foreach (var item in list_minus1day)
+                {
+                    string endDt = item.VisitEndDate.ToString("yyyy-MM-dd");
+                    teamNames2 += ">(" + endDt + ")" + item.TeamName + " \n\n";
+                }
+            }
+
 
             string result = string.Format(@" `团组状态提醒`  
 
@@ -202,9 +219,12 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 ><font color='warning'> - 下列团组将于3天内结束:</font>
 {1}
 
+><font color='warning'> - 下列团组已于昨日结束行程:</font>
+{2}
+
 <font color='info'>请注意检查合同、尾款状态</font>
 
-[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames1, teamNames2);
+[详细信息请前往OA系统查看](http://oa.pan-american-intl.com:4399/)  ", teamNames1, teamNames2, teamNames3);
 
             return result;
         }

+ 2 - 2
OASystem/OASystem.Api/OAMethodLib/QiYeWeChatAPI/AppNotice/Library.cs

@@ -614,11 +614,11 @@ namespace OASystem.API.OAMethodLib.QiYeWeChatAPI.AppNotice
 
         #region 团组出发、结束提醒(财务群)
 
-        public static async Task<bool> SendChatMsg_GroupRemindersToCaiwu(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, QiyeWeChatEnum qwEnum)
+        public static async Task<bool> SendChatMsg_GroupRemindersToCaiwu(List<Grp_DelegationInfo> list_7day, List<Grp_DelegationInfo> list_3day, List<Grp_DelegationInfo> list_minus1day, QiyeWeChatEnum qwEnum)
         {
             string chatId = qwEnum.GetEnumDescription();
 
-            ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendChatMsg_Markdown(chatId, MarkdownLib.GroupRemindersToCaiwuChat(list_7day, list_3day));
+            ResponseBase result = await _qiYeWeChatApiService.GroupStatus_SendChatMsg_Markdown(chatId, MarkdownLib.GroupRemindersToCaiwuChat(list_7day, list_3day, list_minus1day));
             if (result.errcode != 0)
             {
                 //抄送日志 

+ 5 - 1
OASystem/OASystem.Api/OAMethodLib/Quartz/Business/DeleReminderMessage.cs

@@ -95,6 +95,7 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
             string now = dtNow.ToString("yyyy-MM-dd");
             string add3day = dtNow.AddDays(2).ToString("yyyy-MM-dd"); //结束出访前3天(含今天)
             string add7day = dtNow.AddDays(6).ToString("yyyy-MM-dd"); //开始出访7天内(含今天)
+            string minus1day = dtNow.AddDays(-1).ToString("yyyy-MM-dd"); //于昨日结束
 
             //string sql = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) Where IsDel=0 And VisitEndDate ='{0}' Or VisitStartDate='{1}' ", add3day, add7day);
             //List<Grp_DelegationInfo> list_source = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql).ToList();
@@ -103,11 +104,14 @@ namespace OASystem.API.OAMethodLib.Quartz.Business
 
             string sql7day = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) where IsDel = 0 And VisitStartDate Between '{0} 00:00:00' And  '{1} 23:59:59' Order By VisitStartDate Asc ", now, add7day);
             string sql3day = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) where IsDel = 0 And VisitEndDate Between '{0} 00:00:00' And  '{1} 23:59:59' Order By VisitEndDate Asc ", now, add3day);
+            string sqlm1day = string.Format(@" Select * From Grp_DelegationInfo With(Nolock) where IsDel = 0 And VisitEndDate Between '{0} 00:00:00' And  '{1} 23:59:59' Order By VisitEndDate Asc ", minus1day, minus1day);
+
 
             List<Grp_DelegationInfo> listAdd7day = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql7day).ToList();
             List<Grp_DelegationInfo> listAdd3day = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sql3day).ToList();
+            List<Grp_DelegationInfo> listMinus1day = _grpDeleRep._sqlSugar.SqlQueryable<Grp_DelegationInfo>(sqlm1day).ToList();
 
-            await AppNoticeLibrary.SendChatMsg_GroupRemindersToCaiwu(listAdd7day, listAdd3day, QiyeWeChatEnum.CaiWuChat);
+            await AppNoticeLibrary.SendChatMsg_GroupRemindersToCaiwu(listAdd7day, listAdd3day, listMinus1day, QiyeWeChatEnum.CaiWuChat02);
 
         }
     }

+ 1 - 0
OASystem/OASystem.Domain/AutoMappers/_baseMappingProfile.cs

@@ -71,6 +71,7 @@ namespace OASystem.Domain.AutoMappers
             CreateMap<UserDto, Sys_Users>();
             CreateMap<Sys_Users, UserInfo>();
             CreateMap<UserInfo, UserInfoWebView>();
+            CreateMap<EditUserInfoDto, Sys_Users>();
 
             #endregion
 

+ 20 - 13
OASystem/OASystem.Domain/Dtos/System/UserDto.cs

@@ -252,7 +252,7 @@ namespace OASystem.Domain.Dtos.System
 
     public class EditUserInfoDto
     {
-        public int CurrUserId { get; set; }
+        //public int CurrUserId { get; set; }
 
         public int Id { get; set; }
 
@@ -316,19 +316,19 @@ namespace OASystem.Domain.Dtos.System
         /// <summary>
         /// 入职时间
         /// </summary>
-        public DateTime Edate { get; set; }
-        /// <summary>
-        /// 离职时间
-        /// </summary>
-        public DateTime Rdate { get; set; }
-        /// <summary>
-        /// 工龄
-        /// </summary>
-        public int Seniority { get; set; }
+        public string Edate { get; set; }
+        ///// <summary>
+        ///// 离职时间
+        ///// </summary>
+        //public DateTime Rdate { get; set; }
+        ///// <summary>
+        ///// 工龄
+        ///// </summary>
+        //public int Seniority { get; set; }
         /// <summary>
         /// 生日
         /// </summary> 
-        public DateTime? Birthday { get; set; }
+        public string Birthday { get; set; }
         /// <summary>
         /// 身份证号码
         /// </summary>
@@ -397,9 +397,16 @@ namespace OASystem.Domain.Dtos.System
                                     .Length(6, 20).WithMessage("密码长度必须在6到20个字符之间!");
             RuleFor(x => x.ComfirmPassword).NotEmpty().WithMessage("确认密码不能为空!")
                                            .Equal(x => x.Password).WithMessage("两次密码输入不一致!");
-
             RuleFor(x => x.Sex).InclusiveBetween(0,2).WithMessage("性别:0 男;1 女;2 未设置;");
-
+            RuleFor(x => x.Phone).NotEmpty().WithMessage("手机号不能为空!");
+            RuleFor(x => x.UrgentPhone).NotEmpty().WithMessage("手机号不能为空!");
+            RuleFor(x => x.Email).NotEmpty().WithMessage("邮箱不能为空!");
+            RuleFor(x => x.Address).NotEmpty().WithMessage("住址不能为空!");
+            RuleFor(x => x.Edate).NotEmpty().WithMessage("入职时间不能为空!");
+            RuleFor(x => x.Birthday).NotEmpty().WithMessage("生日不能为空!");
+            RuleFor(x => x.IDCard).NotEmpty().WithMessage("身份证号码不能为空!");
+            RuleFor(x => x.TheOrAdultEducation).InclusiveBetween(0, 3).WithMessage("学历类型 0 未设置 1 成教 2 统招 3 留学");
+            RuleFor(x => x.Education).InclusiveBetween(0, 6).WithMessage("学历 0 未设置 1 小学、2 初中、3 高中、4 专科、5 本科、6 研究生");
         }
     }
 }