|
@ -157,6 +157,8 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
|
|
|
private void computequota_12() throws Exception{
|
|
|
StringBuffer errorContent=new StringBuffer();
|
|
|
|
|
|
String now = getDayString(0);
|
|
|
String tomorrow = getDayString(1);
|
|
|
//找出今天的签约信息 yesterday,now
|
|
@ -181,13 +183,73 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
|
|
|
Map<String, Map<String, Map>> townAgeMap = new HashMap<String, Map<String, Map>>();//key是区行政代码
|
|
|
Map<String, Map<String, Map>> orgAgeMap = new HashMap<String, Map<String, Map>>();//key是机构代码
|
|
|
Long cityCount = new Long(0L); //统计到市的数目
|
|
|
Long townCount = new Long(0L); //统计到所有区的数目
|
|
|
Long orgCount =new Long(0L);//统计到所有机构的数目
|
|
|
Long adminCount = new Long(0L);//统计到所有团队的数目
|
|
|
Long errorCount=new Long(0L);//脏数据
|
|
|
Boolean isAll=true;//是否统计失败
|
|
|
//统计有签约的
|
|
|
for (SignFamily signFamily : signFamilys) {
|
|
|
Hospital hospital = hospitalsMap.get(getOrg(signFamily.getHospital()));//得到患者签约的机构
|
|
|
String orgCode = signFamily.getHospital();
|
|
|
if(StringUtils.isEmpty(orgCode)) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String orgCodeTemp="";
|
|
|
if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
|
|
|
//站
|
|
|
orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
|
}else{
|
|
|
//社区
|
|
|
orgCodeTemp=orgCode;
|
|
|
}
|
|
|
//判断社区有没有值
|
|
|
Hospital hospital=hospitalsMap.get(orgCodeTemp);
|
|
|
if(hospital == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Long adminId=signFamily.getAdminTeamId();
|
|
|
if(adminId == null||adminId<=0) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String town = hospital.getTown();
|
|
|
AdminTeam adminTeam=adminTeamMap.get(signFamily.getAdminTeamId()+"");
|
|
|
if(adminTeam == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String idCard=signFamily.getIdcard();
|
|
|
if(idCard == null||((idCard.length()!=18&&idCard.length()!=15))) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的idCard数据异常");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String town =hospital.getTown();
|
|
|
if(StringUtils.isEmpty(town)) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",机构表的中的town为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Town townObj =townsMap.get(town);
|
|
|
if(townObj==null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",机构表的中的town不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
town = hospital.getTown();
|
|
|
int age = IdCardUtil.getAgeForIdcard(signFamily.getIdcard());//根据card解析年龄
|
|
|
String ageCode = getAgeCode(age);//得到年龄的code
|
|
|
|
|
@ -237,15 +299,21 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
compute(townAgeMap, town, ageCode, diseaseType);
|
|
|
//统计机构
|
|
|
//统计站
|
|
|
String orgCode=hospital.getCode();
|
|
|
orgCode=hospital.getCode();
|
|
|
if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
|
|
|
//统计站
|
|
|
String orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
|
orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
|
//统计机构
|
|
|
compute(orgAgeMap, orgCodeTemp, ageCode, diseaseType);
|
|
|
} else {
|
|
|
compute(orgAgeMap, hospital.getCode(), ageCode, diseaseType);
|
|
|
}
|
|
|
|
|
|
//统计数目+1
|
|
|
cityCount++;
|
|
|
townCount++;
|
|
|
orgCount++;
|
|
|
adminCount++;
|
|
|
}
|
|
|
//保存市级数据
|
|
|
for (Map.Entry<String, Map<String, Map>> entry : cityAgeMap.entrySet()) {
|
|
@ -326,6 +394,10 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
saveContent("12",signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("-----------12----------");
|
|
|
}
|
|
|
private void compute(Map<String, Map<String, Map>> rootMap, String rootKey, String ageCode, String diseaseType) {
|
|
|
if (rootMap.containsKey(rootKey)) {
|
|
@ -378,7 +450,14 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String orgCodeTemp=getOrg(orgCode);
|
|
|
String orgCodeTemp="";
|
|
|
if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
|
|
|
//站
|
|
|
orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
|
}else{
|
|
|
//社区
|
|
|
orgCodeTemp=orgCode;
|
|
|
}
|
|
|
//判断社区有没有值
|
|
|
Hospital hospital=hospitalsMap.get(orgCodeTemp);
|
|
|
if(hospital == null) {
|
|
@ -402,7 +481,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
continue;
|
|
|
}
|
|
|
String idCard=signFamily.getIdcard();
|
|
|
if(idCard == null||(idCard.length()!=18&&idCard.length()!=15)) {
|
|
|
if(idCard == null||((idCard.length()!=18&&idCard.length()!=15))) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的idCard数据异常");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
@ -445,7 +524,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent("1",signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("-----------1----------");
|
|
|
}
|
|
|
|
|
|
|
|
@ -547,7 +626,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("----------2-----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_3() {
|
|
@ -636,7 +715,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent(quotaId,consultTeams.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("----------3-----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_4() {
|
|
@ -740,7 +819,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
|
|
|
saveContent(quotaId,plans.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("-----------4----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_5() {
|
|
@ -837,7 +916,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
|
|
|
saveContent(quotaId,patientHealthGuidances.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("-----------5----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_6() throws Exception {
|
|
@ -880,8 +959,22 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Long adminId=signFamily.getAdminTeamId();
|
|
|
if(adminId == null||adminId<=0) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
AdminTeam adminTeam=adminTeamMap.get(signFamily.getAdminTeamId()+"");
|
|
|
if(adminTeam == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String idCard=signFamily.getIdcard();
|
|
|
if(idCard == null||(idCard.length()!=18&&idCard.length()!=15)) {
|
|
|
if(idCard == null||((idCard.length()!=18&&idCard.length()!=15))) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的idCard数据异常");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
@ -925,12 +1018,12 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("-----------6----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_7() {
|
|
|
StringBuffer errorContent=new StringBuffer();
|
|
|
errorContent.append("computequota_7---start,");
|
|
|
String quotaId="7";
|
|
|
String now = getDayString(0);
|
|
|
String tomorrow = getDayString(1);
|
|
|
List<SignFamily> signFamilys = signFamilyDao.findByJiatingSignYesterday(now, tomorrow);
|
|
@ -952,17 +1045,76 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
for (DoctorPatientGroupInfo doctorPatientGroupInfo : doctorPatientGroupInfos) {
|
|
|
groupMap.put(doctorPatientGroupInfo.getPatient(), doctorPatientGroupInfo.getGroup());
|
|
|
}
|
|
|
|
|
|
Long cityCount = new Long(0L); //统计到市的数目
|
|
|
Long townCount = new Long(0L); //统计到所有区的数目
|
|
|
Long orgCount =new Long(0L);//统计到所有机构的数目
|
|
|
Long adminCount = new Long(0L);//统计到所有团队的数目
|
|
|
Long errorCount=new Long(0L);//脏数据
|
|
|
Boolean isAll=true;//是否统计失败
|
|
|
//统计有签约的
|
|
|
for (SignFamily signFamily : signFamilys) {
|
|
|
String patient=signFamily.getPatient();
|
|
|
String group = groupMap.get(patient);//得到该签约病人的所在分组 1 普通 2 慢病 3是 65岁以上人群
|
|
|
Hospital hospital = hospitalsMap.get(getOrg(signFamily.getHospital()));//得到患者签约的机构
|
|
|
String orgCode = signFamily.getHospital();
|
|
|
if(StringUtils.isEmpty(orgCode)) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String orgCodeTemp="";
|
|
|
if(!"00".equals(orgCode.substring(orgCode.length()-2,orgCode.length()))){
|
|
|
//站
|
|
|
orgCodeTemp=orgCode.substring(0,orgCode.length()-2)+"00";
|
|
|
}else{
|
|
|
//社区
|
|
|
orgCodeTemp=orgCode;
|
|
|
}
|
|
|
//判断社区有没有值
|
|
|
hospital=hospitalsMap.get(orgCodeTemp);
|
|
|
if(hospital == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据异常。");
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Long adminId=signFamily.getAdminTeamId();
|
|
|
if(adminId == null||adminId<=0) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String town = hospital.getTown();
|
|
|
AdminTeam adminTeam=adminTeamMap.get(signFamily.getAdminTeamId()+"");
|
|
|
if(adminTeam == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String idCard=signFamily.getIdcard();
|
|
|
if(idCard == null||((idCard.length()!=18&&idCard.length()!=15))) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的idCard数据异常");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String town =hospital.getTown();
|
|
|
if(StringUtils.isEmpty(town)) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",机构表的中的town为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Town townObj =townsMap.get(town);
|
|
|
if(townObj==null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",机构表的中的town不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
town = hospital.getTown();
|
|
|
//统计市 现在只有厦门市 默认先写死 后面再改
|
|
|
if (cityGroupMap.containsKey(Constant.city)) {
|
|
|
Map<String, Long> groupMapTemp = cityGroupMap.get(Constant.city);
|
|
@ -1054,7 +1206,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
//统计站
|
|
|
String org=hospital.getCode();
|
|
|
if (!"00".equals(org.substring(org.length()-2,org.length()))) {
|
|
|
String orgCodeTemp =org.substring(0,org.length()-2)+"00";
|
|
|
orgCodeTemp =org.substring(0,org.length()-2)+"00";
|
|
|
//统计机构
|
|
|
if (orgGroupMap.containsKey(orgCodeTemp)) {
|
|
|
Map<String, Long> groupMapTemp = orgGroupMap.get(orgCodeTemp);
|
|
@ -1079,6 +1231,11 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
//统计数目+1
|
|
|
cityCount++;
|
|
|
townCount++;
|
|
|
orgCount++;
|
|
|
adminCount++;
|
|
|
}
|
|
|
//保存统计数据
|
|
|
//保存市的统计数据
|
|
@ -1285,7 +1442,10 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
redisTemplate.opsForValue().set(new StringBuffer("quota:7:2:6:"+hospitalEntry.getKey()).toString(),jsonObject.toString());
|
|
|
}
|
|
|
|
|
|
errorContent.append("computequota_7---end!!");
|
|
|
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("----------7-----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_8()throws Exception {
|
|
@ -1327,8 +1487,22 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
Long adminId=signFamily.getAdminTeamId();
|
|
|
if(adminId == null||adminId<=0) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据为空");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
AdminTeam adminTeam=adminTeamMap.get(signFamily.getAdminTeamId()+"");
|
|
|
if(adminTeam == null) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的Admin_Team_Id数据不存在");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
|
continue;
|
|
|
}
|
|
|
String idCard=signFamily.getIdcard();
|
|
|
if(idCard == null||(idCard.length()!=18&&idCard.length()!=15)) {
|
|
|
if(idCard == null||((idCard.length()!=18&&idCard.length()!=15))) {
|
|
|
errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的idCard数据异常");
|
|
|
isAll=false;
|
|
|
errorCount++;
|
|
@ -1371,7 +1545,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("----------8-----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_9() {
|
|
@ -1472,7 +1646,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("----------9-----------");
|
|
|
}
|
|
|
|
|
|
private void computequota_10() {
|
|
@ -1591,7 +1765,7 @@ public class CurrentDayAllQuotaJob implements Job {
|
|
|
}
|
|
|
saveContent(quotaId,signFamilys.size(),adminCount,orgCount,townCount,cityCount,isAll,errorContent,errorCount);
|
|
|
allContent.append(errorContent);
|
|
|
allContent.append("---------------------");
|
|
|
allContent.append("-----------10----------");
|
|
|
}
|
|
|
|
|
|
public Properties getSystemProperties() {
|