|
@ -6,11 +6,8 @@ import com.yihu.wlyy.entity.job.QuartzJobLog;
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
import com.yihu.wlyy.entity.patient.SignFamily;
|
|
import com.yihu.wlyy.entity.statistics.WlyyQuotaResult;
|
|
import com.yihu.wlyy.entity.statistics.WlyyQuotaResult;
|
|
import com.yihu.wlyy.repository.address.TownDao;
|
|
import com.yihu.wlyy.repository.address.TownDao;
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorPatientGroupInfoDao;
|
|
|
|
import com.yihu.wlyy.repository.job.QuartzJobLogDao;
|
|
import com.yihu.wlyy.repository.job.QuartzJobLogDao;
|
|
import com.yihu.wlyy.repository.organization.HospitalDao;
|
|
import com.yihu.wlyy.repository.organization.HospitalDao;
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
import com.yihu.wlyy.repository.statistics.WlyyQuotaResultDao;
|
|
import com.yihu.wlyy.repository.statistics.WlyyQuotaResultDao;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
@ -47,16 +44,10 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
@Autowired
|
|
@Autowired
|
|
private SignFamilyDao signFamilyDao;
|
|
private SignFamilyDao signFamilyDao;
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorDao doctorDao;
|
|
|
|
@Autowired
|
|
|
|
private HospitalDao hospitalDao;
|
|
private HospitalDao hospitalDao;
|
|
@Autowired
|
|
@Autowired
|
|
private TownDao townDao;
|
|
private TownDao townDao;
|
|
@Autowired
|
|
@Autowired
|
|
private DoctorPatientGroupInfoDao doctorPatientGroupInfoDao;
|
|
|
|
@Autowired
|
|
|
|
private PatientDao patientDao;
|
|
|
|
@Autowired
|
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
@Autowired
|
|
@Autowired
|
|
private StringRedisTemplate redisTemplate;
|
|
private StringRedisTemplate redisTemplate;
|
|
@ -163,8 +154,10 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
compute(townAgeMap, town, ageCode, diseaseType);
|
|
compute(townAgeMap, town, ageCode, diseaseType);
|
|
//统计机构
|
|
//统计机构
|
|
//统计站
|
|
//统计站
|
|
if (!"00".equals(hospital.getCode().substring(8))) {
|
|
|
|
String orgCodeTemp = hospital.getCode().substring(0, 8) + "00";
|
|
|
|
|
|
String orgCode=hospital.getCode();
|
|
|
|
if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
|
|
|
|
//统计站
|
|
|
|
String orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
//统计机构
|
|
//统计机构
|
|
compute(orgAgeMap, orgCodeTemp, ageCode, diseaseType);
|
|
compute(orgAgeMap, orgCodeTemp, ageCode, diseaseType);
|
|
} else {
|
|
} else {
|
|
@ -177,7 +170,7 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
for (Map.Entry<String, Map<String, Map>> entry : cityAgeMap.entrySet()) {
|
|
for (Map.Entry<String, Map<String, Map>> entry : cityAgeMap.entrySet()) {
|
|
Map<String, Map> oneAgeMap = entry.getValue();
|
|
Map<String, Map> oneAgeMap = entry.getValue();
|
|
for(int i=1;i<7;i++){
|
|
for(int i=1;i<7;i++){
|
|
for(int j=1;j<4;j++){
|
|
|
|
|
|
for(int j=1;j<5;j++){
|
|
String key_2=i+"";
|
|
String key_2=i+"";
|
|
String key_3=j+"";
|
|
String key_3=j+"";
|
|
String city=Constant.city;
|
|
String city=Constant.city;
|
|
@ -196,7 +189,7 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
Map<String, Map> oneAgeMap = townAgeMap.get(entry.getKey());//得到当个区的统计数据
|
|
Map<String, Map> oneAgeMap = townAgeMap.get(entry.getKey());//得到当个区的统计数据
|
|
Town townObj = entry.getValue();//得到区级信息
|
|
Town townObj = entry.getValue();//得到区级信息
|
|
for(int i=1;i<7;i++){
|
|
for(int i=1;i<7;i++){
|
|
for(int j=1;j<4;j++){
|
|
|
|
|
|
for(int j=1;j<5;j++){
|
|
String key_2=i+"";
|
|
String key_2=i+"";
|
|
String key_3=j+"";
|
|
String key_3=j+"";
|
|
String city=Constant.city;
|
|
String city=Constant.city;
|
|
@ -215,7 +208,7 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
Map<String, Map> oneAgeMap = orgAgeMap.get(entry.getKey());//得到当个机构的统计数据
|
|
Map<String, Map> oneAgeMap = orgAgeMap.get(entry.getKey());//得到当个机构的统计数据
|
|
Hospital hospital = entry.getValue();//得到机构信息
|
|
Hospital hospital = entry.getValue();//得到机构信息
|
|
for(int i=1;i<7;i++){
|
|
for(int i=1;i<7;i++){
|
|
for(int j=1;j<4;j++){
|
|
|
|
|
|
for(int j=1;j<5;j++){
|
|
String key_2=i+"";
|
|
String key_2=i+"";
|
|
String key_3=j+"";
|
|
String key_3=j+"";
|
|
String city=Constant.city;
|
|
String city=Constant.city;
|
|
@ -229,7 +222,7 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
wlyyJobLog.setJobEndTime(new Date());
|
|
wlyyJobLog.setJobEndTime(new Date());
|
|
wlyyJobLog.setJobContent("统计" + getYesterday() + " 的签约患者年龄数据完成 ");
|
|
|
|
|
|
wlyyJobLog.setJobContent("统计" + getYesterday() + " 的签约患者年龄数据完成,得到签约数目:"+signFamilies.size());
|
|
wlyyJobLog.setJobType("1");
|
|
wlyyJobLog.setJobType("1");
|
|
quartzJobLogDao.save(wlyyJobLog);
|
|
quartzJobLogDao.save(wlyyJobLog);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@ -268,6 +261,13 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 统计方案
|
|
|
|
* @param rootMap 数据存放的map
|
|
|
|
* @param rootKey 数据的key 机构 区 市
|
|
|
|
* @param ageCode 年龄的key
|
|
|
|
* @param diseaseType 疾病类型 1是高血压 2是糖尿病 3是高血压和糖尿病 4是健康人群
|
|
|
|
*/
|
|
private void compute(Map<String, Map<String, Map>> rootMap, String rootKey, String ageCode, String diseaseType) {
|
|
private void compute(Map<String, Map<String, Map>> rootMap, String rootKey, String ageCode, String diseaseType) {
|
|
if (rootMap.containsKey(rootKey)) {
|
|
if (rootMap.containsKey(rootKey)) {
|
|
//得到市下面的所有的年龄map
|
|
//得到市下面的所有的年龄map
|
|
@ -276,25 +276,25 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
//得到这个年龄下的患者map
|
|
//得到这个年龄下的患者map
|
|
Map<String,Long> mape= groupMapTemp.get(ageCode);
|
|
Map<String,Long> mape= groupMapTemp.get(ageCode);
|
|
if(mape.containsKey(diseaseType)){
|
|
if(mape.containsKey(diseaseType)){
|
|
mape.put(diseaseType,mape.get(diseaseType)+1L);
|
|
|
|
|
|
mape.put(diseaseType,mape.get(diseaseType)+1L); //key是三级维度
|
|
}else{
|
|
}else{
|
|
mape.put(diseaseType,1L);
|
|
|
|
|
|
mape.put(diseaseType,1L); //key是三级维度
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
//新增疾病的统计map
|
|
//新增疾病的统计map
|
|
Map<String, Long> groupMapTemp1 = new HashMap<String, Long>();
|
|
Map<String, Long> groupMapTemp1 = new HashMap<String, Long>();
|
|
groupMapTemp1.put(diseaseType, 1L);
|
|
|
|
groupMapTemp.put(ageCode,groupMapTemp1);
|
|
|
|
|
|
groupMapTemp1.put(diseaseType, 1L);//key是三级维度
|
|
|
|
groupMapTemp.put(ageCode,groupMapTemp1);//key是二级维度
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//没有就新建统计数据 新增疾病的统计map
|
|
//没有就新建统计数据 新增疾病的统计map
|
|
Map<String, Long> groupMapTemp = new HashMap<String, Long>();
|
|
Map<String, Long> groupMapTemp = new HashMap<String, Long>();
|
|
groupMapTemp.put(diseaseType, 1L);
|
|
|
|
|
|
groupMapTemp.put(diseaseType, 1L); //key是三级维度
|
|
//把统计疾病的map放入对应的年龄组map中
|
|
//把统计疾病的map放入对应的年龄组map中
|
|
Map<String, Map> groupMapTemp2 = new HashMap<String, Map>();
|
|
Map<String, Map> groupMapTemp2 = new HashMap<String, Map>();
|
|
groupMapTemp2.put(ageCode,groupMapTemp);
|
|
|
|
|
|
groupMapTemp2.put(ageCode,groupMapTemp); //key是二级维度
|
|
//把年龄组map放入市的map里面
|
|
//把年龄组map放入市的map里面
|
|
rootMap.put(rootKey, groupMapTemp2);
|
|
|
|
|
|
rootMap.put(rootKey, groupMapTemp2); //key是一级维度
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|