|
@ -4,6 +4,7 @@ import com.yihu.wlyy.statistics.dao.*;
|
|
import com.yihu.wlyy.statistics.model.hosptial.Hospital;
|
|
import com.yihu.wlyy.statistics.model.hosptial.Hospital;
|
|
import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
|
|
import com.yihu.wlyy.statistics.model.job.QuartzJobLog;
|
|
import com.yihu.wlyy.statistics.model.job.WlyyQuotaResult;
|
|
import com.yihu.wlyy.statistics.model.job.WlyyQuotaResult;
|
|
|
|
import com.yihu.wlyy.statistics.model.label.SignPatientLabelInfo;
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
|
|
import com.yihu.wlyy.statistics.model.signfamily.SignFamily;
|
|
import com.yihu.wlyy.statistics.model.system.Town;
|
|
import com.yihu.wlyy.statistics.model.system.Town;
|
|
import com.yihu.wlyy.statistics.model.team.AdminTeam;
|
|
import com.yihu.wlyy.statistics.model.team.AdminTeam;
|
|
@ -52,6 +53,8 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
private JdbcTemplate jdbcTemplate;
|
|
private JdbcTemplate jdbcTemplate;
|
|
@Autowired
|
|
@Autowired
|
|
private StringRedisTemplate redisTemplate;
|
|
private StringRedisTemplate redisTemplate;
|
|
|
|
@Autowired
|
|
|
|
private SignPatientLabelInfoDao signPatientLabelInfoDao;
|
|
|
|
|
|
String yesterday;
|
|
String yesterday;
|
|
String daybefore;
|
|
String daybefore;
|
|
@ -187,43 +190,23 @@ public class SignAgeGroupDiseaseJob implements Job {
|
|
boolean hasGXY = false;//有高血压
|
|
boolean hasGXY = false;//有高血压
|
|
boolean hasTNB = false;//有糖尿病
|
|
boolean hasTNB = false;//有糖尿病
|
|
//如果是慢病的 统计高血压的 糖尿病 1高血压,2糖尿病 3 糖尿病和高血压 4健康人群数
|
|
//如果是慢病的 统计高血压的 糖尿病 1高血压,2糖尿病 3 糖尿病和高血压 4健康人群数
|
|
String diseaseType="";
|
|
|
|
String jsonString = redisTemplate.opsForValue().get("disease:" + signFamily.getPatient());
|
|
|
|
if (StringUtils.isEmpty(jsonString)) {
|
|
|
|
diseaseType="4";//健康人群
|
|
|
|
}else{
|
|
|
|
//排除数据 只留下高血压和糖尿病
|
|
|
|
List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
|
|
|
|
JSONArray redisValues = new JSONArray(jsonString);
|
|
|
|
if(redisValues.length()>0){
|
|
|
|
for (Object obj : redisValues) {
|
|
|
|
JSONObject redisValue = (JSONObject)(obj);
|
|
|
|
if(!redisValue.has("signType")){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
//排除掉三师签约
|
|
|
|
if ("1".equals(redisValue.get("signType").toString())) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
String disease = redisValue.getString("disease");
|
|
|
|
if ("1".equals(disease)) {
|
|
|
|
jsonObjects.add(redisValue);
|
|
|
|
hasGXY = true;//设置有高血压
|
|
|
|
diseaseType="1";
|
|
|
|
}
|
|
|
|
if ("2".equals(disease)) {
|
|
|
|
jsonObjects.add(redisValue);
|
|
|
|
hasTNB = true;//设置有糖尿病
|
|
|
|
diseaseType="2";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(hasGXY&&hasTNB){
|
|
|
|
diseaseType="3";//高血压和糖尿病
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
diseaseType="4";//健康人群
|
|
|
|
|
|
String diseaseType="4";
|
|
|
|
//得到患者的疾病标签
|
|
|
|
List<SignPatientLabelInfo> signPatientLabelInfoList= signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(signFamily.getPatient(),"3",1);
|
|
|
|
for (SignPatientLabelInfo signPatientLabelInfo:signPatientLabelInfoList){
|
|
|
|
if("1".equals(signPatientLabelInfo.getLabel())){
|
|
|
|
diseaseType="1";
|
|
|
|
hasGXY=true;
|
|
|
|
}
|
|
|
|
if("2".equals(signPatientLabelInfo.getLabel())){
|
|
|
|
diseaseType="2";
|
|
|
|
hasTNB=true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (hasTNB&&hasGXY){
|
|
|
|
diseaseType="3";
|
|
|
|
}
|
|
|
|
|
|
//统计市
|
|
//统计市
|
|
compute(cityAgeMap, Constant.city, ageCode, diseaseType);
|
|
compute(cityAgeMap, Constant.city, ageCode, diseaseType);
|
|
cityCount++;
|
|
cityCount++;
|