|
@ -35,6 +35,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.http.NameValuePair;
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@ -567,6 +568,41 @@ public class ConsultTeamService extends ConsultService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询居民咨询记录
|
|
|
*
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param page
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray findByPatientAndTeam(String patient, Long teamCode, int page, int pageSize) {
|
|
|
PageRequest pageRequest = new PageRequest(page, pageSize);
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
Page<Object> result = consultDao.findByPatientAndTeam(patient, teamCode, pageRequest);
|
|
|
JSONArray array = new JSONArray();
|
|
|
|
|
|
for (Object obj : result) {
|
|
|
JSONObject consult = new JSONObject();
|
|
|
Object[] objArr = (Object[]) obj;
|
|
|
consult.put("id", objArr[0]);
|
|
|
consult.put("code", objArr[2]);
|
|
|
consult.put("type", objArr[1]);
|
|
|
consult.put("title", objArr[3]);
|
|
|
consult.put("symptoms", objArr[4]);
|
|
|
consult.put("czrq", objArr[5]);
|
|
|
consult.put("status", objArr[6]);
|
|
|
consult.put("adminTeamCode", objArr[7]);
|
|
|
consult.put("patient", patient);
|
|
|
consult.put("patientName", p.getName());
|
|
|
consult.put("patientPhoto", p.getPhoto());
|
|
|
array.put(consult);
|
|
|
}
|
|
|
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 添加咨询记录
|
|
|
*
|