소스 검색

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 년 전
부모
커밋
f377905716
1개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 10 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthRecordController.java

+ 10 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthRecordController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.health;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -9,6 +10,7 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
@ -103,10 +105,15 @@ public class DoctorHealthRecordController extends BaseController {
	 */
	@RequestMapping(value = "list_medication")
	@ResponseBody
	public String medication(String patient, String start,String end,int page, int pagesize) {
	public String medication(String patient, @RequestParam(required = false) String start,@RequestParam(required = false) String end,@RequestParam(required = false) int page,@RequestParam(required = false) String sortDate, int pagesize) {
		try {
			//Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicationByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(patient, start,end, page, pagesize);
			Page<PatientHealthRecordMedication> data = null;
			if(!StringUtils.isEmpty(sortDate)) {
				data = patientHealthRecordService.findMedicationByPatient(patient, DateUtil.strToDateLong(sortDate), pagesize);
			} else {
				data = patientHealthRecordService.findMedicalByPatientPage(patient, start, end, page, pagesize);
			}
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordMedication record : data) {