|  | @ -4,6 +4,7 @@ import com.yihu.wlyy.statistics.dao.DoctorAdminTeamDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.dao.HospitalDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.dao.SignPatientLabelInfoDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.dao.TownDao;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.etl.cache.CachePool;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.etl.model.ETLModel;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.etl.model.FilterModel;
 | 
	
		
			
				|  |  | import com.yihu.wlyy.statistics.job.business.Constant;
 | 
	
	
		
			
				|  | @ -47,6 +48,8 @@ public class SignDataFilter {
 | 
	
		
			
				|  |  |     private DoctorAdminTeamDao doctorAdminTeamDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private SignPatientLabelInfoDao signPatientLabelInfoDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private CachePool cachePool;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private int count=0;
 | 
	
		
			
				|  |  |     /**
 | 
	
	
		
			
				|  | @ -125,13 +128,8 @@ public class SignDataFilter {
 | 
	
		
			
				|  |  |         Long adminCount = new Long(0L);//统计到所有团队的数目
 | 
	
		
			
				|  |  |         Long errorCount=new Long(0L);//脏数据
 | 
	
		
			
				|  |  |         Boolean isAll=true;//是否统计失败
 | 
	
		
			
				|  |  |         int a1=0;
 | 
	
		
			
				|  |  |         int a2=0;
 | 
	
		
			
				|  |  |         for (int i=0;i<signFamilies.size();i++){
 | 
	
		
			
				|  |  |             SignFamily signFamily=signFamilies.get(i);
 | 
	
		
			
				|  |  |             if("1".equals(signFamily.getExpensesStatus())){
 | 
	
		
			
				|  |  |                 a1++;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String orgCode = signFamily.getHospital();
 | 
	
		
			
				|  |  |             if(StringUtils.isEmpty(orgCode)) {
 | 
	
		
			
				|  |  |                 errorContent.append("签约code:"+signFamily.getCode()+",签约表中(wlyy_sign_family)中的hospital数据为空");
 | 
	
	
		
			
				|  | @ -196,9 +194,6 @@ public class SignDataFilter {
 | 
	
		
			
				|  |  |                 errorCount++;
 | 
	
		
			
				|  |  |                 continue;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if("1".equals(signFamilies.get(i).getExpensesStatus())){
 | 
	
		
			
				|  |  |                 a2++;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             //设置二级维度的Key
 | 
	
		
			
				|  |  |             String returnLevel2Key=getLevel2Key(level2Key,signFamily);
 | 
	
		
			
				|  |  |             String returnLevel3Key=getLevel3Key(level3Key,signFamily);
 | 
	
	
		
			
				|  | @ -327,9 +322,11 @@ public class SignDataFilter {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private String getHealth(SignFamily signFamily) {
 | 
	
		
			
				|  |  |         String returnLevel2Key="0";//查找每个患者的健康分布标签
 | 
	
		
			
				|  |  |         List<SignPatientLabelInfo> signPatientLabelInfoList= signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(signFamily.getPatient(),"2",1);
 | 
	
		
			
				|  |  |         if(signPatientLabelInfoList!=null&&signPatientLabelInfoList.size()>0){
 | 
	
		
			
				|  |  |             returnLevel2Key=signPatientLabelInfoList.get(0).getLabel();
 | 
	
		
			
				|  |  |         try{
 | 
	
		
			
				|  |  |             returnLevel2Key=cachePool.getHealthGroup(signFamily.getPatient());
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return returnLevel2Key;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return returnLevel2Key;
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -349,31 +346,31 @@ public class SignDataFilter {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private String getGroup(SignFamily signFamily) {
 | 
	
		
			
				|  |  |         String returnLevel2Key;
 | 
	
		
			
				|  |  |         List<SignPatientLabelInfo> signPatientLabelInfoList= signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(signFamily.getPatient(),"1",1);
 | 
	
		
			
				|  |  |         StringBuffer returnLevel2KeyBuffer= new StringBuffer("1");
 | 
	
		
			
				|  |  |         if(signPatientLabelInfoList!=null&&signPatientLabelInfoList.size()>0){
 | 
	
		
			
				|  |  |             returnLevel2KeyBuffer=new StringBuffer(signPatientLabelInfoList.get(0).getLabel());
 | 
	
		
			
				|  |  |         String returnLevel2Key="";
 | 
	
		
			
				|  |  |         String group=cachePool.getPatientGroup(signFamily.getPatient());
 | 
	
		
			
				|  |  |         if(StringUtils.isEmpty(group)){
 | 
	
		
			
				|  |  |             group="0";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         StringBuffer returnLevel2KeyBuffer=new StringBuffer(group);
 | 
	
		
			
				|  |  |         //如果是慢病组  区分65岁以上还是以下   65岁以上的慢病患者是7  65岁上下是2
 | 
	
		
			
				|  |  |         if("2".equals(returnLevel2KeyBuffer.toString())){
 | 
	
		
			
				|  |  |              Integer age=IdCardUtil.getAgeForIdcard(signFamily.getIdcard());
 | 
	
		
			
				|  |  |             if(age>65){
 | 
	
		
			
				|  |  |                 returnLevel2KeyBuffer=new StringBuffer("7");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | //        if("2".equals(returnLevel2KeyBuffer.toString())){
 | 
	
		
			
				|  |  | //             Integer age=IdCardUtil.getAgeForIdcard(signFamily.getIdcard());
 | 
	
		
			
				|  |  | //            if(age>65){
 | 
	
		
			
				|  |  | //                returnLevel2KeyBuffer=new StringBuffer("7");
 | 
	
		
			
				|  |  | //            }
 | 
	
		
			
				|  |  | //        }
 | 
	
		
			
				|  |  |         if("2".equals(returnLevel2KeyBuffer.toString())||"7".equals(returnLevel2KeyBuffer.toString())){
 | 
	
		
			
				|  |  |             String returnLevel2KeyTemp="0";
 | 
	
		
			
				|  |  |             boolean hasGXY=false;//有高血压
 | 
	
		
			
				|  |  |             boolean hasTNB=false;//糖尿病
 | 
	
		
			
				|  |  |             //得到患者的疾病标签
 | 
	
		
			
				|  |  |             signPatientLabelInfoList= signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(signFamily.getPatient(),"3",1);
 | 
	
		
			
				|  |  |             for (SignPatientLabelInfo signPatientLabelInfo:signPatientLabelInfoList){
 | 
	
		
			
				|  |  |                 if("1".equals(signPatientLabelInfo.getLabel())){//判斷是否有高血壓
 | 
	
		
			
				|  |  |           List<String> diseaseList=  cachePool.getDiseaseGroup(signFamily.getPatient());
 | 
	
		
			
				|  |  |             for (String diseaseCode:diseaseList){
 | 
	
		
			
				|  |  |                 if("1".equals(diseaseCode)){//判斷是否有高血壓
 | 
	
		
			
				|  |  |                     returnLevel2KeyTemp="4";
 | 
	
		
			
				|  |  |                     hasGXY=true;
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if("2".equals(signPatientLabelInfo.getLabel())){//判斷是否有糖尿病
 | 
	
		
			
				|  |  |                 if("2".equals(diseaseCode)){//判斷是否有糖尿病
 | 
	
		
			
				|  |  |                     returnLevel2KeyTemp="5";
 | 
	
		
			
				|  |  |                     hasTNB=true;
 | 
	
		
			
				|  |  |                 }
 |