| 
					
				 | 
			
			
				@ -864,13 +864,42 @@ public class FamilyContractService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 保存用户信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientDao.save(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Calendar now = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        int month = now.get(Calendar.MONTH) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Calendar begin = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Calendar end = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 起始时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        begin.set(Calendar.HOUR,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        begin.set(Calendar.MINUTE,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.SECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        begin.set(Calendar.MILLISECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 结束时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.HOUR,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.MINUTE,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.SECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.MILLISECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.MONTH, 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        end.set(Calendar.DATE,30); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (month < 3 || month > 6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (month > 6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                end.add(Calendar.YEAR, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            begin.set(Calendar.MONTH, 7); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            begin.set(Calendar.DATE,1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.add(Calendar.YEAR, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 更新签约日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setBegin(begin.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setEnd(end.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setOpenid(patient.getOpenid()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setPatient(patient.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 改为签约生效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 更新签约日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setBegin(DateUtil.getNowDateShort()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sf.setEnd(DateUtil.strToDateShort(DateUtil.getNextYear(DateUtil.getNowDateShort(), 1))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //建立团队 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DoctorTeam doctorTeam = new DoctorTeam(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String doctorTeamCode = getCode(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1023,14 +1052,43 @@ public class FamilyContractService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<SystemDict> systemDicts = systemDictDao.findByDictName("SIGN_YEAR"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String year = systemDicts.get(0).getCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Calendar now = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            int month = now.get(Calendar.MONTH) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Calendar begin = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Calendar end = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 起始时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            begin.set(Calendar.HOUR,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            begin.set(Calendar.MINUTE,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.SECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            begin.set(Calendar.MILLISECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 结束时间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.HOUR,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.MINUTE,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.SECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.MILLISECOND,0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.MONTH, 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            end.set(Calendar.DATE,30); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (month < 3 || month > 6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (month > 6) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    end.add(Calendar.YEAR, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                begin.set(Calendar.MONTH, 7); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                begin.set(Calendar.DATE,1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                end.add(Calendar.YEAR, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 更新签约日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setBegin(begin.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setEnd(end.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //签约类型:1三师签约,2家庭签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 改为签约生效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            // 更新签约日期 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setBegin(DateUtil.getNowDateShort()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setSignType("1");//患者发起签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setExpensesType(StringUtils.isEmpty(expenses) ? "01" : expenses);//收费类别 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setEnd(DateUtil.strToDateShort(DateUtil.getNextYear(DateUtil.getNowDateShort(), 1))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sf.setAdminTeamId(adminTeamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotEmpty(doctor)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //设置全科医生 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1913,7 +1971,7 @@ public class FamilyContractService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " WHERE " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " sf.type = 2 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND sf. STATUS > 0 " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               // " and sf.doctor = ? " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                // " and sf.doctor = ? " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " and sf.admin_team_code = ? " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " AND ( sf.doctor_health is null or sf.doctor_health ='' ) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> datas = null; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1921,7 +1979,7 @@ public class FamilyContractService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        datas = jdbcTemplate.queryForList(sql, labelType, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //根据类别查找标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SignPatientLabel> s =  labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1,teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, teamCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (s != null && s.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (SignPatientLabel one : s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                returnMap.put(one.getLabelName(), new JSONArray()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2249,7 +2307,7 @@ public class FamilyContractService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("参数错误!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //根据类别查找标签 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1,team); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<SignPatientLabel> s = labelDao.findByLabelTypeAndStatusAndTeamCode(labelType, 1, team); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (s != null && s.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (SignPatientLabel one : s) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                returnMap.put(one.getLabelName(), new JSONArray()); 
			 |