String visitDate=hypertensionVisit.getVisitDate();
System.out.println(visitDate);
Calendar cal = Calendar.getInstance();
Date date = null;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
date = sdf.parse(visitDate);
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
}
cal.setTime(date);
String period = hypertensionVisit.getPeriod();
if ("3个月".equals(period)) {
cal.add(Calendar.MONTH, 3);
}else if("2个月".equals(period)){
cal.add(Calendar.MONTH, 2);
}
else {
cal.add(Calendar.MONTH, 1);
}
Date date2 = cal.getTime();
String nextDate = sdf.format(date2);
String newNextDate = nextDate.replace(" ", "T");
hypertensionVisit.setNextDate(newNextDate);