public async Task <ComplaintAnnex> AddAsync(ComplaintAnnexDto dto, CancellationToken token = default) { using (var db = new GuoGuoCommunityContext()) { if (!Guid.TryParse(dto.ComplaintId, out var complaintId)) { throw new NotImplementedException("投诉id信息不正确!"); } var entity = db.ComplaintAnnices.Add(new ComplaintAnnex { // ComplaintId = complaintId, CreateOperationTime = dto.OperationTime, CreateOperationUserId = dto.OperationUserId }); if (!string.IsNullOrWhiteSpace(dto.ComplaintFollowUpId)) { if (!Guid.TryParse(dto.ComplaintFollowUpId, out var complaintFollowUpId)) { throw new NotImplementedException("投诉跟进id信息不正确!"); } entity.ComplaintFollowUpId = complaintFollowUpId; } if (!Guid.TryParse(dto.AnnexContent, out var annexContent)) { throw new NotImplementedException("投诉附件id信息不正确!"); } var upload = db.Uploads.Where(x => x.Id == annexContent).FirstOrDefault(); entity.AnnexId = annexContent; entity.AnnexContent = upload.Agreement + upload.Host + upload.Domain + upload.Directory + upload.File; await db.SaveChangesAsync(token); return(entity); } }
public Task <List <ComplaintAnnex> > GetAllIncludeAsync(ComplaintAnnexDto dto, CancellationToken token = default) { throw new NotImplementedException(); }
public Task DeleteAsync(ComplaintAnnexDto dto, CancellationToken token = default) { throw new NotImplementedException(); }