| 
					
				 | 
			
			
				@ -112,8 +112,9 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.street_name as streetName" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.sex" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.openid" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where doctor = ?  and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                (status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -137,8 +138,9 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.street_name as streetName" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.sex" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.openid" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where (doctor = ? or doctor_health = ?) and status > ? and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where doctor = ?  and status > ? and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -161,8 +163,9 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.street_name as streetName" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.sex" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,b.openid" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where (doctor = ? or doctor_health = ?) and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select renew_flag,code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where doctor = ?  and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -173,19 +176,19 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> patients = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        switch (status) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 1:// 待签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 2:// 待解约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 2}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 2}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 3:// 已签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 1}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 1}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 4:// 4已经解约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, doctor, -3, -4}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(surrSql, new Object[]{doctor, -3, -4}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 5: // 未缴费 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return patients; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -847,7 +850,7 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.czrq" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where doctor = ? and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -874,7 +877,7 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.czrq" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select czrq,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status > ? and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select czrq,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family_renew where doctor = ? and status > ? and type = 2 order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code and a.expenses_status = '0' order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -900,7 +903,7 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.czrq" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "    ,a.renew_flag as renewFlag "+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " from " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select expenses_status,czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where (doctor = ? or doctor_health = ?) and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ( select expenses_status,czrq,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin,renew_flag from wlyy_sign_family_renew where doctor = ? and status = ? and type = 2" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " order by begin desc ) a " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " ,wlyy_patient b " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where a.patient = b.code and a.expenses_status = '1' order by a.begin desc limit " + page * pageSize + "," + pageSize; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -911,13 +914,13 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> patients = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        switch (status) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 1:// 待处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sql, new Object[]{doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 2:// 待缴费 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(sqlExpenses, new Object[]{doctor, 0}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            case 3:// 已签约 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(signedSql, new Object[]{doctor, doctor, 1}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                patients = jdbcTemplate.queryForList(signedSql, new Object[]{doctor, 1}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1879,4 +1882,20 @@ public class SignWebService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       List<SystemDict> systemDict = systemDictService.getDictByDictName("RENEW_CHANGE_REASON"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new JSONArray(systemDict); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject getPatientSignLogInfo(String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Patient p = patientService.findByCode(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(p!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sql = "SELECT f.hospital_name as oldHospitalName,t.name AS oldTeamName,d.name as OldLeaderName,f.doctor_name AS OldDoctorName,f.doctor_health_name AS OldHealthDoctorName FROM wlyy_sign_family_renew_log r  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_sign_family f ON r.old_sign_code = f.code " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_admin_team t ON r.old_admin_team_id = t.id " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFt JOIN wlyy_doctor d ON t.leader_code = d.code  " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " WHERE r.idcard ='"+p.getIdcard()+"' AND r.sign_year='"+DateUtil.getSignYear()+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(list!=null&&list.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               return new JSONObject(list.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |