Ejemplo n.º 1
0
        public async Task <ResponseMessage> SetSalaryInfo(UserInfo User, [FromBody] SalaryInfoRequest position)
        {
            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" + (position != null ? JsonHelper.ToJson(position) : ""));
                return(pagingResponse);
            }

            try
            {
                await _salaryManage.SetSalary(position, HttpContext.RequestAborted);

                pagingResponse.Message = "setstation 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" + (position != null ? JsonHelper.ToJson(position) : ""));
            }
            return(pagingResponse);
        }
Ejemplo n.º 2
0
 public virtual async Task DeleteSalary(SalaryInfoRequest salary, CancellationToken cancellationToken = default(CancellationToken))
 {
     if (string.IsNullOrEmpty(salary.ID))
     {
         throw new ArgumentNullException(nameof(salary));
     }
     await _Store.DeleteSalaryAsync(_mapper.Map <SalaryInfo>(salary), cancellationToken);
 }
Ejemplo n.º 3
0
        public virtual async Task SetSalary(SalaryInfoRequest salary, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (salary == null)
            {
                throw new ArgumentNullException(nameof(salary));
            }
            if (string.IsNullOrEmpty(salary.ID))
            {
                salary.ID = Guid.NewGuid().ToString();
            }

            await _Store.SetSalaryAsync(_mapper.Map <SalaryInfo>(salary), cancellationToken);
        }