|
@ -38,7 +38,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@ -64,12 +63,8 @@ public class SignJob implements Job {
|
|
|
@Autowired
|
|
|
private DoctorPatientGroupInfoDao doctorPatientGroupInfoDao;
|
|
|
@Autowired
|
|
|
private PatientDao patientDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Autowired
|
|
|
private PatientDiseaseService patientDiseaseService;
|
|
|
@Autowired
|
|
|
private StringRedisTemplate redisTemplate;
|
|
|
|
|
|
String yesterday;
|
|
@ -157,249 +152,68 @@ public class SignJob implements Job {
|
|
|
String hospitalCode = hospital.getCode();//得到患者签约的机构号
|
|
|
String sex = IdCardUtil.getSexForIdcard(idcard);//根据身份证得到性别
|
|
|
//统计市 目前只统计厦门市 所以先写死 后期再改造
|
|
|
if (citySexMap.containsKey(Constant.city)) {
|
|
|
Map<String, Long> sexMap = citySexMap.get(Constant.city);
|
|
|
sexMap.put(sex, (sexMap.get(sex) == null ? 0l : sexMap.get(sex)) + 1);
|
|
|
citySexMap.put(Constant.city, sexMap);
|
|
|
} else {
|
|
|
Map<String, Long> sexMap = new HashMap<String, Long>();
|
|
|
sexMap.put(sex, 1L);
|
|
|
citySexMap.put(Constant.city, sexMap);
|
|
|
}
|
|
|
compute_level2_1(citySexMap,Constant.city, sex);
|
|
|
//统计区
|
|
|
if (townSexMap.containsKey(town)) {
|
|
|
Map<String, Long> sexMap = townSexMap.get(town);
|
|
|
sexMap.put(sex, (sexMap.get(sex) == null ? 0l : sexMap.get(sex)) + 1);
|
|
|
townSexMap.put(town, sexMap);
|
|
|
} else {
|
|
|
Map<String, Long> sexMap = new HashMap<String, Long>();
|
|
|
sexMap.put(sex, 1L);
|
|
|
townSexMap.put(town, sexMap);
|
|
|
}
|
|
|
compute_level2_1(townSexMap,town, sex);
|
|
|
//统计机构
|
|
|
|
|
|
//统计站
|
|
|
if (!"00".equals(hospitalCode.substring(8))) {
|
|
|
String orgCodeTemp = hospitalCode.substring(0, 8) + "00";
|
|
|
if (orgSexMap.containsKey(orgCodeTemp)) {
|
|
|
Map<String, Long> sexMap = orgSexMap.get(orgCodeTemp);
|
|
|
sexMap.put(sex, (sexMap.get(sex) == null ? 0l : sexMap.get(sex)) + 1);
|
|
|
orgSexMap.put(orgCodeTemp, sexMap);
|
|
|
} else {
|
|
|
Map<String, Long> sexMap = new HashMap<String, Long>();
|
|
|
sexMap.put(sex, 1L);
|
|
|
orgSexMap.put(orgCodeTemp, sexMap);
|
|
|
}
|
|
|
compute_level2_1(orgSexMap,orgCodeTemp, sex);
|
|
|
} else {
|
|
|
//统计社区
|
|
|
if (orgSexMap.containsKey(hospitalCode)) {
|
|
|
Map<String, Long> sexMap = orgSexMap.get(hospitalCode);
|
|
|
sexMap.put(sex, (sexMap.get(sex) == null ? 0l : sexMap.get(sex)) + 1);
|
|
|
orgSexMap.put(hospitalCode, sexMap);
|
|
|
} else {
|
|
|
Map<String, Long> sexMap = new HashMap<String, Long>();
|
|
|
sexMap.put(sex, 1L);
|
|
|
orgSexMap.put(hospitalCode, sexMap);
|
|
|
}
|
|
|
compute_level2_1(orgSexMap,hospitalCode, sex);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
//保存统计数据
|
|
|
//保存市统计数据
|
|
|
for (Map.Entry<String, Map<String, Long>> entry : citySexMap.entrySet()) {
|
|
|
//保存女
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(entry.getKey());
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("4");//市级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_1);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_1_name);
|
|
|
if (entry.getValue() != null && entry.getValue().containsKey(Constant.level_sex_1)) {
|
|
|
wlyyQuotaResult.setResult(entry.getValue().get(Constant.level_sex_1) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
for(int i=1;i<4;i++){
|
|
|
String key=i+"";
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town="";
|
|
|
String townName="";
|
|
|
String org="";
|
|
|
String orgName="";
|
|
|
String level="3";
|
|
|
save_level2_1(entry.getValue(), key, city, cityName, town, townName, org, orgName, level);
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存男
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(entry.getKey());
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("4");//市级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_2);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_2_name);
|
|
|
if (entry.getValue() != null && entry.getValue().containsKey(Constant.level_sex_2)) {
|
|
|
wlyyQuotaResult.setResult(entry.getValue().get(Constant.level_sex_2) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存位置
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(entry.getKey());
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("4");//市级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_3);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_3_name);
|
|
|
if (entry.getValue() != null && entry.getValue().containsKey(Constant.level_sex_3)) {
|
|
|
wlyyQuotaResult.setResult(entry.getValue().get(Constant.level_sex_3) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
}
|
|
|
//保存区的统计数据
|
|
|
for (Map.Entry<String, Town> townEntry : townsMap.entrySet()) {
|
|
|
//判断该区是否有统计数据
|
|
|
Map<String, Long> oneTownSexMap = townSexMap.get(townEntry.getKey());//得到当个区的统计数据
|
|
|
Town town = townEntry.getValue();//得到区级信息
|
|
|
//保存女
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(town.getCode());
|
|
|
wlyyQuotaResult.setTownName(town.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("3");//区级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_1);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_1_name);
|
|
|
if (oneTownSexMap != null && oneTownSexMap.containsKey(Constant.level_sex_1)) {
|
|
|
wlyyQuotaResult.setResult(oneTownSexMap.get(Constant.level_sex_1) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存男
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(town.getCode());
|
|
|
wlyyQuotaResult.setTownName(town.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("3");//区级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_2);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_2_name);
|
|
|
if (oneTownSexMap != null && oneTownSexMap.containsKey(Constant.level_sex_2)) {
|
|
|
wlyyQuotaResult.setResult(oneTownSexMap.get(Constant.level_sex_2) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
Town townObj = townEntry.getValue();//得到区级信息
|
|
|
for(int i=1;i<4;i++){
|
|
|
String key=i+"";
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town=townObj.getCode();
|
|
|
String townName=townObj.getName();
|
|
|
String org="";
|
|
|
String orgName="";
|
|
|
String level="3";
|
|
|
save_level2_1(oneTownSexMap, key, city, cityName, town, townName, org, orgName, level);
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存未知的统计信息
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(town.getCode());
|
|
|
wlyyQuotaResult.setTownName(town.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("3");//区级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_3);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_3_name);
|
|
|
if (oneTownSexMap != null && oneTownSexMap.containsKey(Constant.level_sex_3)) {
|
|
|
wlyyQuotaResult.setResult(oneTownSexMap.get(Constant.level_sex_3) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
}
|
|
|
//统计机构
|
|
|
for (Map.Entry<String, Hospital> hospitalEntry : hospitalsMap.entrySet()) {
|
|
|
//判断该机构是否有统计数据
|
|
|
Map<String, Long> oneorgSexMap = orgSexMap.get(hospitalEntry.getKey());//得到当个机构的统计数据
|
|
|
Hospital hospital = hospitalEntry.getValue();//得到区级信息
|
|
|
//保存女
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setTown(hospital.getTown());
|
|
|
wlyyQuotaResult.setTownName(hospital.getTownName());
|
|
|
wlyyQuotaResult.setOrgCode(hospital.getCode());
|
|
|
wlyyQuotaResult.setOrgName(hospital.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("2");//机构级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_1);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_1_name);
|
|
|
if (oneorgSexMap != null && oneorgSexMap.containsKey(Constant.level_sex_1)) {
|
|
|
wlyyQuotaResult.setResult(oneorgSexMap.get(Constant.level_sex_1) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存男
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(hospital.getTown());
|
|
|
wlyyQuotaResult.setTownName(hospital.getTownName());
|
|
|
wlyyQuotaResult.setOrgCode(hospital.getCode());
|
|
|
wlyyQuotaResult.setOrgName(hospital.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("2");//机构级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_2);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_2_name);
|
|
|
if (oneorgSexMap != null && oneorgSexMap.containsKey(Constant.level_sex_2)) {
|
|
|
wlyyQuotaResult.setResult(oneorgSexMap.get(Constant.level_sex_2) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
//保存未知
|
|
|
wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(Constant.city);
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(hospital.getTown());
|
|
|
wlyyQuotaResult.setTownName(hospital.getTownName());
|
|
|
wlyyQuotaResult.setOrgCode(hospital.getCode());
|
|
|
wlyyQuotaResult.setOrgName(hospital.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("2");//机构级
|
|
|
wlyyQuotaResult.setLevel2Type(Constant.level_sex_3);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.level_sex_3_name);
|
|
|
if (oneorgSexMap != null && oneorgSexMap.containsKey(Constant.level_sex_3)) {
|
|
|
wlyyQuotaResult.setResult(oneorgSexMap.get(Constant.level_sex_3) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
for(int i=1;i<4;i++){
|
|
|
String key=i+"";
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town=hospital.getTown();
|
|
|
String townName=hospital.getTownName();
|
|
|
String org=hospital.getCode();
|
|
|
String orgName=hospital.getName();
|
|
|
String level="2";
|
|
|
save_level2_1(oneorgSexMap, key, city, cityName, town, townName, org, orgName, level);
|
|
|
}
|
|
|
}
|
|
|
QuartzJobLog.setJobEndTime(new Date());
|
|
|
QuartzJobLog.setJobContent("统计" + getYesterday() + " 的签约性别数据完成 ");
|
|
@ -410,6 +224,54 @@ public class SignJob implements Job {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 机构维度下患者性别维度计算指标 公用保存方法
|
|
|
* @param oneorgSexMap
|
|
|
* @param key
|
|
|
* @param city
|
|
|
* @param cityName
|
|
|
* @param town
|
|
|
* @param townName
|
|
|
* @param org
|
|
|
* @param orgName
|
|
|
* @param level
|
|
|
*/
|
|
|
private void save_level2_1(Map<String, Long> oneorgSexMap, String key, String city, String cityName, String town, String townName, String org, String orgName, String level) {
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(city);
|
|
|
wlyyQuotaResult.setCityName(cityName);
|
|
|
wlyyQuotaResult.setTown(town);
|
|
|
wlyyQuotaResult.setTownName(townName);
|
|
|
wlyyQuotaResult.setOrgCode(org);
|
|
|
wlyyQuotaResult.setOrgName(orgName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type(level);//机构级
|
|
|
wlyyQuotaResult.setLevel2Type(key);
|
|
|
wlyyQuotaResult.setLevel2TypeName(Constant.getLevelSexName(key));
|
|
|
if (oneorgSexMap != null && oneorgSexMap.containsKey(key)) {
|
|
|
wlyyQuotaResult.setResult(oneorgSexMap.get(key) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
}
|
|
|
|
|
|
private void compute_level2_1(Map<String, Map<String, Long>> citySexMap,String key, String sex) {
|
|
|
if (citySexMap.containsKey(key)) {
|
|
|
Map<String, Long> sexMap = citySexMap.get(key);
|
|
|
sexMap.put(sex, (sexMap.get(sex) == null ? 0l : sexMap.get(sex)) + 1);
|
|
|
citySexMap.put(key, sexMap);
|
|
|
} else {
|
|
|
Map<String, Long> sexMap = new HashMap<String, Long>();
|
|
|
sexMap.put(sex, 1L);
|
|
|
citySexMap.put(key, sexMap);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 机构维度患者分组维度计算指标
|
|
|
*/
|
|
@ -1510,11 +1372,7 @@ public class SignJob implements Job {
|
|
|
for (SignFamily signFamily : signFamilys) {
|
|
|
String doctorCode = signFamily.getDoctor();//得到签约中全科医生的code
|
|
|
//统计团队
|
|
|
if (tjQkdoctorMap.containsKey(doctorCode)) {
|
|
|
tjQkdoctorMap.put(doctorCode, tjQkdoctorMap.get(doctorCode) + 1);
|
|
|
} else {
|
|
|
tjQkdoctorMap.put(doctorCode, 1L);
|
|
|
}
|
|
|
compute_level1(tjQkdoctorMap, doctorCode);
|
|
|
//判断医生属于哪个机构
|
|
|
Doctor doctor = doctorsMap.get(doctorCode);
|
|
|
if (doctor == null) {
|
|
@ -1525,28 +1383,16 @@ public class SignJob implements Job {
|
|
|
//统计站
|
|
|
if (!"00".equals(orgCode.substring(8))) {
|
|
|
String orgCodeTemp = orgCode.substring(0, 8) + "00";
|
|
|
if (tjOrgMap.containsKey(orgCodeTemp)) {
|
|
|
tjOrgMap.put(orgCodeTemp, tjOrgMap.get(orgCodeTemp) + 1);
|
|
|
} else {
|
|
|
tjOrgMap.put(orgCodeTemp, 1L);
|
|
|
}
|
|
|
compute_level1(tjOrgMap, orgCodeTemp);
|
|
|
} else {
|
|
|
//统计社区
|
|
|
if (tjOrgMap.containsKey(orgCode)) {
|
|
|
tjOrgMap.put(orgCode, tjOrgMap.get(orgCode) + 1);
|
|
|
} else {
|
|
|
tjOrgMap.put(orgCode, 1L);
|
|
|
}
|
|
|
compute_level1(tjOrgMap, orgCode);
|
|
|
}
|
|
|
|
|
|
|
|
|
String townCode = doctor.getTown();
|
|
|
//统计区
|
|
|
if (tjTownMap.containsKey(townCode)) {
|
|
|
tjTownMap.put(townCode, tjTownMap.get(townCode) + 1);
|
|
|
} else {
|
|
|
tjTownMap.put(townCode, 1L);
|
|
|
}
|
|
|
compute_level1(tjTownMap, townCode);
|
|
|
//统计市
|
|
|
cityCount++;
|
|
|
}
|
|
@ -1554,75 +1400,50 @@ public class SignJob implements Job {
|
|
|
//保存全科医生的签约统计
|
|
|
for (Map.Entry<String, Doctor> entry : doctorsMap.entrySet()) {
|
|
|
Doctor doctor = doctorsMap.get(entry.getKey());//得到全科医生
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setOrgCode(doctor.getHospital());
|
|
|
wlyyQuotaResult.setOrgName(doctor.getHosptialName());
|
|
|
wlyyQuotaResult.setCity(doctor.getCity());
|
|
|
wlyyQuotaResult.setCityName(doctor.getCityName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setQkdoctorJobName(doctor.getJobName());
|
|
|
wlyyQuotaResult.setQkdoctorName(doctor.getName());
|
|
|
wlyyQuotaResult.setQkdoctorCode(doctor.getCode());
|
|
|
wlyyQuotaResult.setTown(doctor.getTown());
|
|
|
wlyyQuotaResult.setTownName(doctor.getTownName());
|
|
|
wlyyQuotaResult.setLevel1Type("1");
|
|
|
//判断全科医生是否有签约量
|
|
|
if (tjQkdoctorMap.containsKey(doctor.getCode())) {
|
|
|
wlyyQuotaResult.setResult(tjQkdoctorMap.get(doctor.getCode()) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town=doctor.getTown();
|
|
|
String townName=doctor.getTownName();
|
|
|
String org=doctor.getHospital();
|
|
|
String orgName=doctor.getHosptialName();
|
|
|
String doctorCode=doctor.getCode();
|
|
|
String doctorName=doctor.getName();
|
|
|
String doctorJob=doctor.getJob();
|
|
|
String level="1";
|
|
|
String key=doctor.getCode();
|
|
|
save_level1(tjQkdoctorMap, key, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level);
|
|
|
}
|
|
|
//保存机构的签约统计
|
|
|
for (Map.Entry<String, Hospital> entry : hospitalsMap.entrySet()) {
|
|
|
Hospital hospital = hospitalsMap.get(entry.getKey());//得到全科医生
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setOrgCode(hospital.getCode());
|
|
|
wlyyQuotaResult.setOrgName(hospital.getName());
|
|
|
wlyyQuotaResult.setCity(hospital.getCity());
|
|
|
wlyyQuotaResult.setCityName(hospital.getCityName());
|
|
|
wlyyQuotaResult.setTown(hospital.getTown());
|
|
|
wlyyQuotaResult.setTownName(hospital.getTownName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("2");
|
|
|
//判断全科医生是否有签约量
|
|
|
if (tjOrgMap.containsKey(hospital.getCode())) {
|
|
|
wlyyQuotaResult.setResult(tjOrgMap.get(hospital.getCode()) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town=hospital.getTown();
|
|
|
String townName=hospital.getTownName();
|
|
|
String org=hospital.getCode();
|
|
|
String orgName=hospital.getName();
|
|
|
String doctorCode="";
|
|
|
String doctorName="";
|
|
|
String doctorJob="";
|
|
|
String level="2";
|
|
|
String key=hospital.getCode();
|
|
|
save_level1(tjOrgMap, key, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level);
|
|
|
}
|
|
|
//保存区级的签约统计
|
|
|
for (Map.Entry<String, Town> entry : townsMap.entrySet()) {
|
|
|
Town town = townsMap.get(entry.getKey());//得到全科医生
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setCity(town.getCity());
|
|
|
wlyyQuotaResult.setCityName(Constant.cityName);
|
|
|
wlyyQuotaResult.setTown(town.getCode());
|
|
|
wlyyQuotaResult.setTownName(town.getName());
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setLevel1Type("3");
|
|
|
//判断全科医生是否有签约量
|
|
|
if (tjTownMap.containsKey(town.getCode())) {
|
|
|
wlyyQuotaResult.setResult(tjTownMap.get(town.getCode()) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
Town townObj = townsMap.get(entry.getKey());//得到全科医生
|
|
|
String city=Constant.city;
|
|
|
String cityName=Constant.cityName;
|
|
|
String town=townObj.getCode();
|
|
|
String townName=townObj.getName();
|
|
|
String org="";
|
|
|
String orgName="";
|
|
|
String doctorCode="";
|
|
|
String doctorName="";
|
|
|
String doctorJob="";
|
|
|
String level="3";
|
|
|
String key=townObj.getCode();
|
|
|
save_level1(tjTownMap, key, city, cityName, town, townName, org, orgName, doctorCode, doctorName, doctorJob, level);
|
|
|
}
|
|
|
//保存市级的统计
|
|
|
{
|
|
@ -1649,6 +1470,47 @@ public class SignJob implements Job {
|
|
|
QuartzJobLog.setJobType("1");
|
|
|
quartzJobLogDao.save(QuartzJobLog);
|
|
|
}
|
|
|
/**
|
|
|
* 统计签约的公用保存方案
|
|
|
*
|
|
|
*/
|
|
|
private void save_level1(Map<String, Long> countMap, String key, String city, String cityName, String town, String townName, String org, String orgName, String doctorCode, String doctorName, String doctorJob, String level) {
|
|
|
WlyyQuotaResult wlyyQuotaResult = new WlyyQuotaResult();
|
|
|
wlyyQuotaResult.setDel("1");
|
|
|
wlyyQuotaResult.setOrgCode(org);
|
|
|
wlyyQuotaResult.setOrgName(orgName);
|
|
|
wlyyQuotaResult.setCity(city);
|
|
|
wlyyQuotaResult.setCityName(cityName);
|
|
|
wlyyQuotaResult.setQuatoCode(wlyyQuota.getId());
|
|
|
wlyyQuotaResult.setQuatoName(wlyyQuota.getName());
|
|
|
wlyyQuotaResult.setQuotaDate(getYesterday());
|
|
|
wlyyQuotaResult.setCreateTime(new Date());
|
|
|
wlyyQuotaResult.setQkdoctorJobName(doctorJob);
|
|
|
wlyyQuotaResult.setQkdoctorName(doctorName);
|
|
|
wlyyQuotaResult.setQkdoctorCode(doctorCode);
|
|
|
wlyyQuotaResult.setTown(town);
|
|
|
wlyyQuotaResult.setTownName(townName);
|
|
|
wlyyQuotaResult.setLevel1Type(level);
|
|
|
//判断全科医生是否有解约量
|
|
|
if (countMap.containsKey(key)) {
|
|
|
wlyyQuotaResult.setResult(countMap.get(key) + "");
|
|
|
} else {
|
|
|
wlyyQuotaResult.setResult("0");
|
|
|
}
|
|
|
wlyyQuotaResultDao.save(wlyyQuotaResult);
|
|
|
}
|
|
|
/**
|
|
|
* 统计签约的公用统计方案
|
|
|
* @param tjQkdoctorMap
|
|
|
* @param doctorCode
|
|
|
*/
|
|
|
private void compute_level1(Map<String, Long> tjQkdoctorMap, String doctorCode) {
|
|
|
if (tjQkdoctorMap.containsKey(doctorCode)) {
|
|
|
tjQkdoctorMap.put(doctorCode, tjQkdoctorMap.get(doctorCode) + 1);
|
|
|
} else {
|
|
|
tjQkdoctorMap.put(doctorCode, 1L);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
得到昨天的日期字符串 yyyy-MM-dd
|