|
|
|
@ -246,6 +246,16 @@ namespace Shentun.Peis.PhoneFollowUps |
|
|
|
query = query.Where(m => m.patientRegister.CustomerOrgGroupId != null && input.CustomerOrgGroupIds.Contains(m.patientRegister.CustomerOrgGroupId.Value)); |
|
|
|
} |
|
|
|
|
|
|
|
if (input.IsSmsComplete != null) |
|
|
|
{ |
|
|
|
query = query.Where(m => m.followUp.IsSmsComplete == input.IsSmsComplete); |
|
|
|
} |
|
|
|
|
|
|
|
if (input.IsPhoneComplete != null) |
|
|
|
{ |
|
|
|
query = query.Where(m => m.followUp.IsPhoneComplete == input.IsPhoneComplete); |
|
|
|
} |
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
@ -301,7 +311,9 @@ namespace Shentun.Peis.PhoneFollowUps |
|
|
|
ItemName = ss.FirstOrDefault().item.DisplayName, |
|
|
|
IsCriticalValue = ss.Key.IsCriticalValue == null ? 'N' : ss.Key.IsCriticalValue.Value, |
|
|
|
IsReview = ss.Key.IsReview == null ? 'N' : ss.Key.IsReview.Value |
|
|
|
}).ToList() |
|
|
|
}).ToList(), |
|
|
|
IsPhoneComplete = s.Key.IsPhoneComplete, |
|
|
|
IsSmsComplete = s.Key.IsSmsComplete |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
return entListDto; |
|
|
|
@ -587,7 +599,21 @@ namespace Shentun.Peis.PhoneFollowUps |
|
|
|
[HttpPost("api/app/PhoneFollowUp/Delete")] |
|
|
|
public async Task DeleteAsync(PhoneFollowUpIdInputDto input) |
|
|
|
{ |
|
|
|
await _phoneFollowUpRepository.DeleteAsync(input.PhoneFollowUpId); |
|
|
|
var phoneFollowUpEnt = await _phoneFollowUpRepository.FirstOrDefaultAsync(f => f.Id == input.PhoneFollowUpId); |
|
|
|
if (phoneFollowUpEnt == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("数据不存在"); |
|
|
|
} |
|
|
|
await _phoneFollowUpRepository.DeleteAsync(input.PhoneFollowUpId, true); |
|
|
|
if ((await _phoneFollowUpRepository.CountAsync(c => c.FollowUpId == phoneFollowUpEnt.FollowUpId)) == 0) |
|
|
|
{ |
|
|
|
var followUpEnt = await _followUpRepository.FirstOrDefaultAsync(f => f.Id == phoneFollowUpEnt.FollowUpId); |
|
|
|
if (followUpEnt != null) |
|
|
|
{ |
|
|
|
followUpEnt.IsPhoneComplete = 'N'; |
|
|
|
await _followUpRepository.UpdateAsync(followUpEnt); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|