コード例 #1
0
 public virtual async Task UpdateAsync(ContractInfoRequest buildingBaseInfoRequest, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (buildingBaseInfoRequest == null)
     {
         throw new ArgumentNullException(nameof(buildingBaseInfoRequest));
     }
     await Store.UpdateAsync(_mapper.Map <ContractInfo>(buildingBaseInfoRequest), cancellationToken);
 }
コード例 #2
0
        public virtual async Task SaveAsync(UserInfo user, ContractInfoRequest buildingBaseInfoRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            if (buildingBaseInfoRequest == null)
            {
                throw new ArgumentNullException(nameof(buildingBaseInfoRequest));
            }


            await Store.SaveAsync(_mapper.Map <SimpleUser>(user), _mapper.Map <ContractInfo>(buildingBaseInfoRequest), cancellationToken);
        }
コード例 #3
0
        public async Task <ResponseMessage <bool> > AddContract(UserInfo User, [FromBody] ContractInfoRequest request)
        {
            Logger.Trace($"用户{User?.UserName ?? ""}({User?.Id ?? ""})保存合同基础信息(PutBuildingBaseInfo):\r\n请求参数为:\r\n" + (request != null ? JsonHelper.ToJson(request) : ""));

            if (User.Id == null)
            {
                {
                    User.Id             = "66df64cb-67c5-4645-904f-704ff92b3e81";
                    User.UserName       = "******";
                    User.KeyWord        = "";
                    User.OrganizationId = "270";
                    User.PhoneNumber    = "18122132334";
                };
            }

            var response = new ResponseMessage <bool>();

            if (!ModelState.IsValid)
            {
                response.Code    = ResponseCodeDefines.ModelStateInvalid;
                response.Message = ModelState.GetAllErrors();
                return(response);
            }

            try
            {
                GatewayInterface.Dto.ExamineSubmitRequest exarequest = new GatewayInterface.Dto.ExamineSubmitRequest();
                exarequest.ContentId      = request.ID;
                exarequest.ContentType    = "ContractCommit";
                exarequest.ContentName    = request.Name;
                exarequest.SubmitDefineId = Guid.NewGuid().ToString();
                exarequest.Source         = "";
                exarequest.CallbackUrl    = "";
                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)
                {
                    response.Code    = ResponseCodeDefines.ServiceError;
                    response.Message = "向审核中心发起审核请求失败:" + reponse.Message;
                    return(response);
                }

                //写发送成功后的表
                await _contractInfoManager.CreateAsync(User, request, exarequest.SubmitDefineId, "TEST", HttpContext.RequestAborted);
            }
            catch (Exception e)
            {
                response.Code    = ResponseCodeDefines.ServiceError;
                response.Message = e.ToString();
                Logger.Error($"用户{User?.UserName ?? ""}({User?.Id ?? ""})合同动态提交审核(UpdateRecordSubmit)报错:\r\n{e.ToString()},\r\n请求参数为:\r\n" + (request != null ? JsonHelper.ToJson(request) : ""));
            }

            return(response);
        }
コード例 #4
0
        public virtual async Task <ContractInfoResponse> CreateAsync(UserInfo userinfo, ContractInfoRequest buildingBaseInfoRequest, string modifyid, string checkaction, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (buildingBaseInfoRequest == null)
            {
                throw new ArgumentNullException(nameof(buildingBaseInfoRequest));
            }
            var baseinfo = await Store.CreateAsync(_mapper.Map <SimpleUser>(userinfo), _mapper.Map <ContractInfo>(buildingBaseInfoRequest), modifyid, checkaction, cancellationToken);

            return(_mapper.Map <ContractInfoResponse>(baseinfo));
        }