예제 #1
0
 public virtual async Task LeaveHuman(LeaveInfoRequest info, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (info == null)
     {
         throw new ArgumentNullException(nameof(info));
     }
     await _Store.LeaveHuman(_mapper.Map <LeaveInfo>(info), info.ID, cancellationToken);
 }
예제 #2
0
        public virtual async Task PreLeaveHuman(UserInfo userinfo, string modifyid, LeaveInfoRequest info, string checkaction, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (userinfo == null)
            {
                throw new ArgumentNullException(nameof(userinfo));
            }

            await _Store.PreLeaveHuman(_mapper.Map <SimpleUser>(userinfo), modifyid, info.ID, JsonHelper.ToJson(_mapper.Map <LeaveInfo>(info)), info.IDCard, checkaction, cancellationToken);
        }
예제 #3
0
        public async Task <ResponseMessage> LeaveHumanInfo(UserInfo User, [FromBody] LeaveInfoRequest condition)
        {
            var pagingResponse = new ResponseMessage();

            if (!ModelState.IsValid)
            {
                pagingResponse.Code = ResponseCodeDefines.ModelStateInvalid;
                Logger.Warn($"用户{User?.UserName ?? ""}({User?.Id ?? ""})人事离职条件(PostCustomerListSaleMan)模型验证失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (condition != null ? JsonHelper.ToJson(condition) : ""));
                return(pagingResponse);
            }

            try
            {
                string modifyid = Guid.NewGuid().ToString();

                GatewayInterface.Dto.ExamineSubmitRequest exarequest = new GatewayInterface.Dto.ExamineSubmitRequest();
                exarequest.ContentId      = condition.ID;
                exarequest.ContentType    = "HumanCommit";
                exarequest.ContentName    = $"leavehuman {condition.IDCard}";
                exarequest.SubmitDefineId = modifyid;
                exarequest.Source         = "";
                //exarequest.CallbackUrl = ApplicationContext.Current.UpdateExamineCallbackUrl;
                exarequest.Action   = "TEST" /*exarequest.ContentType*/;
                exarequest.TaskName = $"{User.UserName}提交离职请求{exarequest.ContentName}的动态{exarequest.ContentType}";;
                GatewayInterface.Dto.UserInfo userinfo = new GatewayInterface.Dto.UserInfo()
                {
                    Id               = User.Id,
                    KeyWord          = User.KeyWord,
                    OrganizationId   = User.OrganizationId,
                    OrganizationName = User.OrganizationName,
                    UserName         = User.UserName
                };

                var examineInterface = ApplicationContext.Current.Provider.GetRequiredService <IExamineInterface>();
                var reponse          = await examineInterface.Submit(userinfo, exarequest);

                if (reponse.Code != ResponseCodeDefines.SuccessCode)
                {
                    pagingResponse.Code    = ResponseCodeDefines.ServiceError;
                    pagingResponse.Message = "向审核中心发起审核请求失败:" + reponse.Message;
                    return(pagingResponse);
                }

                await _humanManage.PreLeaveHuman(User, modifyid, condition, "TEST", HttpContext.RequestAborted);

                //await _humanManage.LeaveHuman(condition, HttpContext.RequestAborted);
            }
            catch (Exception e)
            {
                pagingResponse.Code    = ResponseCodeDefines.ServiceError;
                pagingResponse.Message = "服务器错误:" + e.ToString();
                Logger.Error($"用户{User?.UserName ?? ""}({User?.Id ?? ""})员工离职条件(PostCustomerListSaleMan)请求失败:\r\n{pagingResponse.Message ?? ""},\r\n请求参数为:\r\n" + (condition != null ? JsonHelper.ToJson(condition) : ""));
            }
            return(pagingResponse);
        }