|
@ -2728,18 +2728,26 @@ public class ConsultTeamService extends ConsultService {
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public int countRemainConsult(String patient) throws Exception{
|
|
|
int count = 10;
|
|
|
public JSONObject countRemainConsult(String patient) throws Exception{
|
|
|
JSONObject json = new JSONObject();
|
|
|
try {
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String versionTime = systemDictDao.findByDictNameAndCode("VERSION_TIME","1.4.2");
|
|
|
int amount = consultTeamDao.countRemainConsult(patient,2,format.parse(versionTime));
|
|
|
count -= amount;
|
|
|
String consultTimes = systemDictDao.findByDictNameAndCode("CONSULT_TIMES","1.4.2");
|
|
|
int count = Integer.valueOf(consultTimes);
|
|
|
json.put("count",count);
|
|
|
SignFamily signFamily = signFamilyDao.findByjiatingPatient(patient);
|
|
|
if (signFamily == null){
|
|
|
return json;
|
|
|
}
|
|
|
int amount = consultTeamDao.countRemainConsult(patient,2,signFamily.getBegin(),signFamily.getEnd());
|
|
|
amount = count - amount;
|
|
|
if (amount<0){
|
|
|
amount = 0;
|
|
|
}
|
|
|
json.put("amount",amount);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
count = -1;
|
|
|
}
|
|
|
return count;
|
|
|
return json;
|
|
|
}
|
|
|
|
|
|
}
|