Beispiel #1
0
        public async Task <ResponseMessage> AddRPInfo(UserInfo User, [FromBody] RewardPunishmentRequest item)
        {
            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" + (item != null ? JsonHelper.ToJson(item) : ""));
                return(pagingResponse);
            }

            try
            {
                await _rpManage.AddRPInfo(item, HttpContext.RequestAborted);

                pagingResponse.Message = "importattendenceLst ok";
            }
            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" + (item != null ? JsonHelper.ToJson(item) : ""));
            }
            return(pagingResponse);
        }
Beispiel #2
0
        public virtual async Task AddRPInfo(RewardPunishmentRequest itm, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (itm == null)
            {
                throw new ArgumentNullException(nameof(itm));
            }

            await _Store.AddRPInfoeAsync(_mapper.Map <RewardPunishmentInfo>(itm), cancellationToken);
        }