فهرست منبع

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

trick9191 8 سال پیش
والد
کامیت
f6fe6ded44

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -741,13 +741,13 @@ public class PatientHealthIndexService extends BaseService {
        if(gi_type != 0){
            Sort sort = new Sort(Direction.ASC, "recordDate");
            PageRequest pageRequest = new PageRequest(0, 1000, sort);
            re = patientHealthIndexDao.findIndexByPatient(patient, type,gi_type+"", startDate, endDate, pageRequest).getContent();
            re = patientHealthIndexDao.findIndexByPatientNative(patient, type,gi_type+"", startDate, endDate, pageRequest.getOffset(),pageRequest.getPageSize());
        }else{
            // 排序
            Sort sort = new Sort(Direction.ASC, "recordDate");
            PageRequest pageRequest = new PageRequest(0, 1000, sort);
            re = patientHealthIndexDao.findIndexByPatient(patient, type, startDate, endDate, pageRequest).getContent();
            re = patientHealthIndexDao.findIndexByPatientNative(patient, type, startDate, endDate, pageRequest.getOffset(),pageRequest.getPageSize());
        }
        return re;
@ -776,7 +776,7 @@ public class PatientHealthIndexService extends BaseService {
        {
            PageRequest pageRequest = new PageRequest(page, pageSize);
            //根据时间过滤排序
            List<String> dateList = patientHealthIndexDao.findDateList(patient, startDate, endDate, pageRequest.getPageNumber(),pageRequest.getPageSize());
            List<String> dateList = patientHealthIndexDao.findDateList(patient, startDate, endDate, pageRequest.getOffset(),pageRequest.getPageSize());
            if (dateList != null && dateList.size() > 0) {
                for (String dateString : dateList) {
                    DevicePatientHealthIndex obj = getPatientXT(patient, dateString);

+ 22 - 12
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthRecordService.java

@ -4,6 +4,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.yihu.wlyy.util.DateUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -248,27 +249,36 @@ public class PatientHealthRecordService extends BaseService {
		// 查询最近的饮食
		Page<PatientHealthRecordDiet> diet = patientHealthRecordDietDao.findRecentByPatient(patient, new PageRequest(0, 1));
		if (sports != null && sports.getSize() > 0) {
			JSONObject sportObject = new JSONObject();
			for (PatientHealthRecordSports temp : sports) {
				jsonObject.put("sports", temp.getSportsName());
				jsonObject.put("sports_time",temp.getSportsTime());
				jsonObject.put("sports_type",temp.getSportsType());
				jsonObject.put("sports_typeName",temp.getSportsTypeName());
				jsonObject.put("czrq",DateUtil.dateToStr(temp.getCzrq(), DateUtil.YYYY_MM_DD));
				jsonObject.put("sortDate",DateUtil.dateToStr(temp.getSortDate(), DateUtil.YYYY_MM_DD));
		}
				sportObject.put("sports", temp.getSportsName());
				sportObject.put("sports_time", temp.getSportsTime());
				sportObject.put("sports_type", temp.getSportsType());
				sportObject.put("sports_typeName", temp.getSportsTypeName());
				sportObject.put("czrq", DateUtil.dateToStr(temp.getCzrq(), DateUtil.YYYY_MM_DD));
				sportObject.put("sortDate", DateUtil.dateToStr(temp.getSortDate(), DateUtil.YYYY_MM_DD));
			}
			jsonObject.put("sprot",sportObject);
		}
		if (medication != null) {
			JSONObject medicationObject = new JSONObject();
			for (PatientHealthRecordMedication temp : medication) {
				jsonObject.put("medication", temp.getMedicinesName());
				jsonObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
				medicationObject.put("medication", temp.getMedicinesName());
				medicationObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
			}
			jsonObject.put("medication",medicationObject);
		}
		if (diet != null) {
			JSONObject dietObject = new JSONObject();
			for (PatientHealthRecordDiet temp : diet) {
				jsonObject.put("diet", temp.getContent());
				jsonObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
				jsonObject.put("images",temp.getImages());
				dietObject.put("diet", temp.getContent());
				dietObject.put("recordDate",DateUtil.dateToStr(temp.getRecordDate(), DateUtil.YYYY_MM_DD));
				dietObject.put("images",temp.getImages());
			}
			jsonObject.put("diet",dietObject);
		}
		return jsonObject;
	}

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -265,10 +265,10 @@ public class DoctorHealthController extends BaseController {
										   @RequestParam(value="patient",required = true) String patient) {
		try {
			Map<String,Object> map = new HashMap<>();
			com.alibaba.fastjson.JSONObject xt = healthIndexService.findLastBypatient(patient,1);
			DevicePatientHealthIndex xt = healthIndexService.findLastByPatien(patient,1);
			if(xt!=null)
			{
				map.put("xt",xt.toJSONString());
				map.put("xt",xt);
			}
			DevicePatientHealthIndex xy = healthIndexService.findLastByPatien(patient,2);
			if(xy!=null)

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -276,7 +276,7 @@ public class PatientHealthController extends BaseController {
			DevicePatientHealthIndex xt = healthIndexService.findLastByPatien(patient,1);
			if(xt!=null)
			{
				map.put("xt",xt.toString());
				map.put("xt",xt);
			}
			DevicePatientHealthIndex xy = healthIndexService.findLastByPatien(patient,2);
			if(xy!=null)