Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wujunjie 8 years ago
parent
commit
a5cb1d26ef

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

@ -108,7 +108,9 @@ public class PatientHealthIndexService extends BaseService {
            }
            patientHealthIndexDao.save(result);
            verifyHealthIndex(result.getId());
            if ("1".equals(result.getType()) || "2".equals(result.getType())) {
                verifyHealthIndex(result.getId());
            }
        }
        else{
           throw new Exception("Result not exit!");
@ -471,6 +473,7 @@ public class PatientHealthIndexService extends BaseService {
            for (DevicePatientHealthIndex item : list) {
                String data = item.getValue1();
                String dataType = item.getValue2();
                String deviceSn = item.getDeviceSn()==null?"":item.getDeviceSn();
                String recordDate = DateUtil.dateToStr(item.getRecordDate(), DateUtil.YYYY_MM_DD_HH_MM_SS);
                Long id = item.getId();
                if (data != null && dataType != null) {
@ -478,36 +481,43 @@ public class PatientHealthIndexService extends BaseService {
                        obj.put("value1", data);
                        obj.put("time1", recordDate);
                        obj.put("id1", id);
                        obj.put("deviceSn1", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("2")) {
                        obj.put("value2", data);
                        obj.put("time2", recordDate);
                        obj.put("id2", id);
                        obj.put("deviceSn2", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("3")) {
                        obj.put("value3", data);
                        obj.put("time3", recordDate);
                        obj.put("id3", id);
                        obj.put("deviceSn3", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("4")) {
                        obj.put("value4", data);
                        obj.put("time4", recordDate);
                        obj.put("id4", id);
                        obj.put("deviceSn4", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("5")) {
                        obj.put("value5", data);
                        obj.put("time5", recordDate);
                        obj.put("id5", id);
                        obj.put("deviceSn5", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("6")) {
                        obj.put("value6", data);
                        obj.put("time6", recordDate);
                        obj.put("id6", id);
                        obj.put("deviceSn6", deviceSn);
                        hadData = true;
                    } else if (dataType.equals("7")) {
                        obj.put("value7", data);
                        obj.put("time7", recordDate);
                        obj.put("id7", id);
                        obj.put("deviceSn7", deviceSn);
                        hadData = true;
                    }
                }

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

@ -1,20 +1,16 @@
package com.yihu.wlyy.web.patient.health;
import java.text.SimpleDateFormat;
import java.util.*;
import com.alibaba.fastjson.JSON;
import com.yihu.wlyy.entity.patient.PatientHealthStandard;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.util.SendNews;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -22,10 +18,7 @@ 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.PatientHealthStandard;
import com.yihu.wlyy.service.app.health.PatientHealthIndexService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import java.util.*;
@Controller
@RequestMapping(value = "/patient/health_index", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ -495,6 +488,7 @@ public class PatientHealthController extends BaseController {
                        modelJson.put("value5", model.getValue5());
                        modelJson.put("value6", model.getValue6());
                        modelJson.put("value7", model.getValue7());
                        modelJson.put("deviceSn", model.getDeviceSn()==null?"":model.getDeviceSn());
                        modelJson.put("type", model.getType());
                        if (type == 2) {
                            modelJson.put("date", DateUtil.dateToStr(model.getRecordDate(), DateUtil.YYYY_MM_DD_HH_MM_SS));