|
@ -35,6 +35,7 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
@ -1074,7 +1075,7 @@ public class PatientHealthIndexService {
|
|
|
* @param end 结束时间
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray findChartByPatient(String patient, int type, int gi_type, String begin, String end) {
|
|
|
public JSONArray findChartByPatient(String patient, int type, int gi_type, String begin, String end) throws ParseException {
|
|
|
JSONArray re = new JSONArray();
|
|
|
String sql = "SELECT " +
|
|
|
"MIN(id) id" +
|
|
@ -1088,8 +1089,8 @@ public class PatientHealthIndexService {
|
|
|
",value7" +
|
|
|
",device_sn" +
|
|
|
",type" +
|
|
|
",record_date" +
|
|
|
",sort_date" +
|
|
|
",DATE_FORMAT(record_date, '%Y-%m-%d %H:%i:%s')'record_date' " +
|
|
|
",DATE_FORMAT(sort_date, '%Y-%m-%d %H:%i:%s') 'sort_date'" +
|
|
|
",min(czrq) czrq " +
|
|
|
" from wlyy_patient_health_index " +
|
|
|
" WHERE `user` = '" + patient + "' " +
|
|
@ -1120,7 +1121,11 @@ public class PatientHealthIndexService {
|
|
|
json.put("deviceSn", map.get("device_sn") == null ? "" : map.get("device_sn"));
|
|
|
json.put("type", map.get("type"));
|
|
|
|
|
|
Date date = (Date) map.get("record_date");
|
|
|
// Date date = (Date) map.get("record_date");
|
|
|
|
|
|
SimpleDateFormat dateFormat6 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
SimpleDateFormat dateFormat3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Date date = dateFormat6.parse(map.get("record_date").toString()) ;
|
|
|
if (type == 2) {
|
|
|
json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
} else {
|
|
@ -1352,7 +1357,7 @@ public class PatientHealthIndexService {
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray findIndexByPatient(String patient, int type, String start, String end, int page, int pageSize) {
|
|
|
public JSONArray findIndexByPatient(String patient, int type, String start, String end, int page, int pageSize) throws Exception {
|
|
|
JSONArray re = new JSONArray();
|
|
|
if (page > 0) {
|
|
|
page = page - 1;
|
|
@ -1376,8 +1381,8 @@ public class PatientHealthIndexService {
|
|
|
",value7" +
|
|
|
",device_sn" +
|
|
|
",type" +
|
|
|
",record_date" +
|
|
|
",sort_date" +
|
|
|
",DATE_FORMAT(record_date, '%Y-%m-%d %H:%i:%s')'record_date' " +
|
|
|
",DATE_FORMAT(sort_date, '%Y-%m-%d %H:%i:%s') 'sort_date'" +
|
|
|
",czrq as createDate" +
|
|
|
",min(czrq) czrq " +
|
|
|
" from wlyy_patient_health_index " +
|
|
@ -1403,8 +1408,10 @@ public class PatientHealthIndexService {
|
|
|
json.put("value7", map.get("value7"));
|
|
|
json.put("deviceSn", map.get("device_sn") == null ? "" : map.get("device_sn"));
|
|
|
json.put("type", map.get("type"));
|
|
|
|
|
|
Date date = (Date) map.get("record_date");
|
|
|
System.out.println(map.get("record_date"));
|
|
|
SimpleDateFormat dateFormat6 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
SimpleDateFormat dateFormat3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Date date = dateFormat6.parse(map.get("record_date").toString()) ;
|
|
|
if (type == 2) {
|
|
|
json.put("date", DateUtil.dateToStr(date, DateUtil.YYYY_MM_DD_HH_MM_SS));
|
|
|
} else {
|
|
@ -1414,8 +1421,8 @@ public class PatientHealthIndexService {
|
|
|
json.put("czrq", map.get("czrq"));
|
|
|
|
|
|
//是否为补传数据(设备上传且测量时间和创建时间不匹配)
|
|
|
Date recordDate = (Date)map.get("record_date");
|
|
|
Date createDate = (Date) map.get("createDate");
|
|
|
Date recordDate = dateFormat6.parse(map.get("record_date").toString());
|
|
|
Date createDate = dateFormat6.parse( map.get("createDate").toString());
|
|
|
String recordTime = DateUtil.dateToStr(recordDate,DateUtil.YYYY_MM_DD);
|
|
|
String createTime = DateUtil.dateToStr(createDate,DateUtil.YYYY_MM_DD);
|
|
|
if (map.get("device_sn") == null){
|