/// <summary> /// 添加一个Employees_Sign /// </summary> /// <param name="input">实体</param> /// <returns></returns> public async Task Create(CreateEmployees_SignInput input) { if (_repository.GetAll().Any(x => x.UserId == input.UserId)) { throw new UserFriendlyException((int)ErrorCode.DataAccessErr, "员工已存在签名。"); } var newmodel = new Employees_Sign() { Id = Guid.NewGuid(), UserId = input.UserId, SignType = input.SignType, Status = input.Status }; if (input.FileList != null) { var fileList = new List <AbpFileListInput>(); foreach (var item in input.FileList) { fileList.Add(new AbpFileListInput() { Id = item.Id, Sort = item.Sort }); } await _abpFileRelationAppService.CreateAsync(new CreateFileRelationsInput() { BusinessId = newmodel.Id.ToString(), BusinessType = (int)AbpFileBusinessType.员工签名图片, Files = fileList }); } await _repository.InsertAsync(newmodel); }
private Employees_SignChangeDto GetChangeModel(Employees_Sign model) { /// 如果有外键数据 在这里转换 var ret = new Employees_SignChangeDto(); ret.Id = model.Id; var usermodel = UserManager.Users.FirstOrDefault(x => x.Id == model.UserId); ret.Name = usermodel.Name; ret.SignType_Name = model.SignType.ToString(); ret.Status_Title = model.Status.ToString(); return(ret); }