|
@ -1,8 +1,17 @@
|
|
|
package com.yihu.wlyy.web.patient.health;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.yihu.wlyy.entity.dict.Medicines;
|
|
|
import com.yihu.wlyy.entity.education.Sports;
|
|
|
import com.yihu.wlyy.entity.education.SportsType;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordMedication;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordSports;
|
|
|
import com.yihu.wlyy.service.app.health.PatientHealthRecordService;
|
|
|
import com.yihu.wlyy.service.app.medicines.MedicinesService;
|
|
|
import com.yihu.wlyy.service.app.sports.SportsService;
|
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
@ -16,18 +25,8 @@ 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.dict.Medicines;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordMedication;
|
|
|
import com.yihu.wlyy.entity.patient.PatientHealthRecordSports;
|
|
|
import com.yihu.wlyy.entity.education.Sports;
|
|
|
import com.yihu.wlyy.entity.education.SportsType;
|
|
|
import com.yihu.wlyy.service.app.health.PatientHealthRecordService;
|
|
|
import com.yihu.wlyy.service.app.medicines.MedicinesService;
|
|
|
import com.yihu.wlyy.service.app.sports.SportsService;
|
|
|
import com.yihu.wlyy.util.CommonUtil;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.WeixinBaseController;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 健康记录控制类
|
|
@ -177,7 +176,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
PatientHealthRecordSports record = new PatientHealthRecordSports();
|
|
|
record.setDel("1");
|
|
|
record.setCzrq(new Date());
|
|
|
record.setPatient(getUID());
|
|
|
record.setPatient(getRepUID());
|
|
|
// record.setPatient(getUID());
|
|
|
record.setRecordDate(DateUtil.strToDateShort(record_date));
|
|
|
record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
record.setSportsTime(sportsTime);
|
|
@ -206,7 +206,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
PatientHealthRecordMedication record = new PatientHealthRecordMedication();
|
|
|
record.setDel("1");
|
|
|
record.setCzrq(new Date());
|
|
|
record.setPatient(getUID());
|
|
|
record.setPatient(getRepUID());
|
|
|
// record.setPatient(getUID());
|
|
|
record.setRecordDate(DateUtil.strToDateShort(record_date));
|
|
|
record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
record.setMedicines(medicines);
|
|
@ -236,7 +237,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
PatientHealthRecordDiet record = new PatientHealthRecordDiet();
|
|
|
record.setDel("1");
|
|
|
record.setCzrq(new Date());
|
|
|
record.setPatient(getUID());
|
|
|
record.setPatient(getRepUID());
|
|
|
// record.setPatient(getUID());
|
|
|
record.setRecordDate(DateUtil.strToDateShort(record_date));
|
|
|
record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
record.setContent(content);
|
|
@ -267,7 +269,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String recent() {
|
|
|
try {
|
|
|
JSONObject json = patientHealthRecordService.findRecentByPatient(getUID());
|
|
|
// JSONObject json = patientHealthRecordService.findRecentByPatient(getUID());
|
|
|
JSONObject json = patientHealthRecordService.findRecentByPatient(getRepUID());
|
|
|
if (json != null) {
|
|
|
return write(200, "查询成功", "data", json);
|
|
|
} else {
|
|
@ -288,7 +291,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String sports(String start,String end,int page, int pagesize) {
|
|
|
try {
|
|
|
Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getUID(), start,end,page, pagesize);
|
|
|
Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getRepUID(), start,end,page, pagesize);
|
|
|
// Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getUID(), start,end,page, pagesize);
|
|
|
if (data != null) {
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (PatientHealthRecordSports record : data) {
|
|
@ -329,7 +333,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String medication(String start,String end,int page, int pagesize) {
|
|
|
try {
|
|
|
Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getUID(), start, end, page, pagesize);
|
|
|
Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getRepUID(), start, end, page, pagesize);
|
|
|
// Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getUID(), start, end, page, pagesize);
|
|
|
if (data != null) {
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (PatientHealthRecordMedication record : data) {
|
|
@ -366,7 +371,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
|
|
|
@ResponseBody
|
|
|
public String diet(String start,String end,int page,int pagesize) {
|
|
|
try {
|
|
|
Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getUID(),start,end,page, pagesize);
|
|
|
Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getRepUID(),start,end,page, pagesize);
|
|
|
// Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getUID(),start,end,page, pagesize);
|
|
|
if (data != null) {
|
|
|
JSONArray array = new JSONArray();
|
|
|
for (PatientHealthRecordDiet record : data) {
|