|
@@ -120,20 +120,23 @@ namespace VitalService.Service
|
|
|
{
|
|
|
statisticsDetail.SignQualifiedArchivesNum = 0;
|
|
|
}
|
|
|
- var contractedPatients = contractRecords.Where(x => x.ServiceStartDate <= DateTime.Now && x.ServiceEndDate > DateTime.Now).GroupBy(x => x.ContractedPatient);
|
|
|
statisticsDetail.RenewalsNum = 0;// 续约人数
|
|
|
- foreach (var item in contractedPatients)
|
|
|
+ var contractedPatients = contractRecords.Where(x => x.ServiceStartDate <= DateTime.Now && x.ServiceEndDate > DateTime.Now).GroupBy(x => x.ContractedPatient);
|
|
|
+ if (contractedPatients != null && contractedPatients.Count() > 0)
|
|
|
{
|
|
|
- var tempList = contractRecords.Where(x => x.ContractedPatient == item.Key);
|
|
|
- if (tempList != null && tempList.Count() > 1)
|
|
|
+ foreach (var item in contractedPatients)
|
|
|
{
|
|
|
- var count = tempList.GroupBy(x => x.ServiceStartDate).Count();
|
|
|
- if (count > 1)
|
|
|
+ var tempList = contractRecords.Where(x => x.ContractedPatient == item.Key);
|
|
|
+ if (tempList != null && tempList.Count() > 1)
|
|
|
{
|
|
|
- statisticsDetail.RenewalsNum++;
|
|
|
+ var count = tempList.GroupBy(x => x.ServiceStartDate.Date).Count();
|
|
|
+ if (count > 1)
|
|
|
+ {
|
|
|
+ statisticsDetail.RenewalsNum++;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
statisticsDetail.KeyPeopleNum = userKeyPatients.Count();
|
|
|
if (userKeyPatientCodes.Count() > 0)
|
|
|
{
|