|
@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 健康教育业务层代码
|
|
* 健康教育业务层代码
|
|
@ -41,11 +38,19 @@ public class HealthEduService {
|
|
|
|
|
|
Map<String,String> orgcodemap = new HashMap<>();
|
|
Map<String,String> orgcodemap = new HashMap<>();
|
|
|
|
|
|
|
|
Set<String> patientcodesets = new HashSet<>();
|
|
|
|
|
|
String sql = "SELECT patientCode FROM "+esType+" where createTime >='"+beginDate+"T00:00:00+0800' and createTime <='"+endDate+"T23:59:59+0800' group by patientCode limit 0,1000000";
|
|
String sql = "SELECT patientCode FROM "+esType+" where createTime >='"+beginDate+"T00:00:00+0800' and createTime <='"+endDate+"T23:59:59+0800' group by patientCode limit 0,1000000";
|
|
|
|
|
|
List<HealthEduPatientCode> patientCodes = elasticsearchUtil.excute(sql, HealthEduPatientCode.class, esIndex, esType);
|
|
List<HealthEduPatientCode> patientCodes = elasticsearchUtil.excute(sql, HealthEduPatientCode.class, esIndex, esType);
|
|
|
|
|
|
for (HealthEduPatientCode es: patientCodes) {
|
|
for (HealthEduPatientCode es: patientCodes) {
|
|
|
|
System.out.println(patientcodesets.size());
|
|
|
|
if(patientcodesets.contains(es.getPatientCode())){
|
|
|
|
continue;
|
|
|
|
}else{
|
|
|
|
patientcodesets.add(es.getPatientCode());
|
|
|
|
}
|
|
SignFamily obj = familyContractService.findSignByPatient(es.getPatientCode());
|
|
SignFamily obj = familyContractService.findSignByPatient(es.getPatientCode());
|
|
if( obj == null){
|
|
if( obj == null){
|
|
continue;
|
|
continue;
|
|
@ -53,6 +58,9 @@ public class HealthEduService {
|
|
String jworgcode = "";
|
|
String jworgcode = "";
|
|
if(orgcodemap.isEmpty() || !orgcodemap.keySet().contains(obj.getHospital())){
|
|
if(orgcodemap.isEmpty() || !orgcodemap.keySet().contains(obj.getHospital())){
|
|
HospitalMapping hospitalMapping = hospitalMappingDao.findByCode(obj.getHospital());
|
|
HospitalMapping hospitalMapping = hospitalMappingDao.findByCode(obj.getHospital());
|
|
|
|
if(hospitalMapping == null){
|
|
|
|
continue;
|
|
|
|
}
|
|
jworgcode = hospitalMapping.getMappingCode();
|
|
jworgcode = hospitalMapping.getMappingCode();
|
|
orgcodemap.put(obj.getHospital(),jworgcode);
|
|
orgcodemap.put(obj.getHospital(),jworgcode);
|
|
}else{
|
|
}else{
|