Browse Source

代码修改

LAPTOP-KB9HII50\70708 3 years ago
parent
commit
9d153ad64a

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -88,7 +88,7 @@ public class PatientDeviceController extends BaseController {
    public String envMessage(@ApiParam(name = "patientId", value = "居民id", defaultValue = "1")
                                    @RequestParam(value = "patientId", required = true) String patientId){
        try {
            JSONObject json = patientDeviceService.envMessage(patientId);
            com.alibaba.fastjson.JSONObject json = patientDeviceService.envMessage(patientId);
            return write(200,"获取成功","data",json);
        } catch (Exception ex) {
            return errorResult(ex);

+ 14 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/statistics/DetectionPlatformEndpoint.java

@ -18,6 +18,8 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/***
 * @ClassName: DetectionPlatformEndpoint
 * @Description: 社区云照护平台--物联网健康监测展示平台 v1.0.0
@ -35,6 +37,18 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientDeviceService patientDeviceService;
    @ApiOperation("环境信息")
    @RequestMapping(value = "envMessage", method = RequestMethod.GET)
    public ObjEnvelop envMessage(@ApiParam(name = "patientId", value = "居民id", defaultValue = "1")
                             @RequestParam(value = "patientId", required = true) String patientId){
        try {
            return success(patientDeviceService.envMessage(patientId));
        } catch (Exception ex) {
            return failedObjEnvelopException(ex);
        }
    }
    /**************************v1.1.0新增 设备异常动态************************************/
    @GetMapping(value = "getHealthMonitoringListNew")
    @ApiOperation(value = "体征监测/安防监护")

+ 5 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -133,8 +133,8 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     * 获取烟雾 燃气浓度
     * @param patient
     */
    public JSONObject concentrationMessage(String patient){
        JSONObject result = new JSONObject();
    public com.alibaba.fastjson.JSONObject concentrationMessage(String patient){
        com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
        String sql = "SELECT CONCAT(r.value,r.unit) value from wlyy_patient_device pd,base_device_health_index r " +
                "WHERE pd.device_sn = r.device_sn and pd.`user` = '"+patient+"' ";
@ -162,13 +162,14 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     * 环境信息
     * @return
     */
    public JSONObject envMessage(String patient){
        JSONObject jsonObject = new JSONObject();
    public com.alibaba.fastjson.JSONObject envMessage(String patient){
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("concentration",concentrationMessage(patient));
        jsonObject.put("weather",emergencyAssistanceService.getBaiduWeather());
        return jsonObject;
    }
    /**
     * 燃气浓度
     * @param patient