Explorar o código

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing %!s(int64=4) %!d(string=hai) anos
pai
achega
7786561798

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/copdDevice/WlyyCopdHuamiHealthScoreDO.java

@ -19,6 +19,8 @@ public class WlyyCopdHuamiHealthScoreDO extends UuidIdentityEntity {
    private String  name;   //健康分名称,为”h5”
    private String  score;  //健康分值
    private String  total;  //健康分总分,默认100
    private String  date;//创建时间
    @Column(name="device_sn")
    public String getDeviceSn() {
@ -73,4 +75,13 @@ public class WlyyCopdHuamiHealthScoreDO extends UuidIdentityEntity {
    public void setTotal(String total) {
        this.total = total;
    }
    @Column(name="date")
    public String getDate() {
        return date;
    }
    public void setDate(String date) {
        this.date = date;
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/copdDevice/WlyyCopdHuamiPaiDO.java

@ -18,6 +18,7 @@ public class WlyyCopdHuamiPaiDO extends UuidIdentityEntity {
    private String  timestamp;  //数据上传到华米后端的时间戳
    private String  totalPai;  //用户本周运动前获得的所有PAI
    private String  dailyPai;  //用户在当天获得的PAI
    private String  date;//创建时间
    @Column(name="device_sn")
    public String getDeviceSn() {
@ -63,4 +64,13 @@ public class WlyyCopdHuamiPaiDO extends UuidIdentityEntity {
    public void setDailyPai(String dailyPai) {
        this.dailyPai = dailyPai;
    }
    @Column(name="date")
    public String getDate() {
        return date;
    }
    public void setDate(String date) {
        this.date = date;
    }
}

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/iot/copdDevice/WlyyCopdHuamiRealtimeDateDO.java

@ -17,7 +17,7 @@ public class WlyyCopdHuamiRealtimeDateDO extends UuidIdentityEntity {
    private String  hr; //实时心率
    private String  st; //实时步数,采集开始后的累积步数
    private String  cal;    //实时卡路里,累积卡路里
    private String  data;// 创建时间
    private String  date;// 创建时间
    @Column(name="device_sn")
    public String getDeviceSn() {
@ -55,12 +55,12 @@ public class WlyyCopdHuamiRealtimeDateDO extends UuidIdentityEntity {
        this.cal = cal;
    }
    @Column(name="data")
    public String getData() {
        return data;
    @Column(name="date")
    public String getDate() {
        return date;
    }
    public void setData(String data) {
        this.data = data;
    public void setDate(String date) {
        this.date = date;
    }
}

+ 5 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/CopdXeekDeviceController.java

@ -6,6 +6,7 @@ import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
@ -27,7 +28,7 @@ public class CopdXeekDeviceController extends EnvelopRestEndpoint {
    @RequestMapping(value = "getXeekDeviceData",method = RequestMethod.GET)
    @ApiOperation(value = "塞克设备数据获取")
    public ObjEnvelop getXeekDeviceData(@ApiParam(name="deviceSN",value = "设备sn码")
                                @RequestParam(value = "deviceSN")String deviceSN,
                                @RequestParam(value = "deviceSN",required = false)String deviceSN,
                                    @ApiParam(name="reportType",value = "测试项目 1=吸气测试;2=呼气测试;6=MVV 测试;7=慢通气测试")
                                @RequestParam(value = "reportType")String reportType,
                                    @ApiParam(name="patient",value = "patient")
@ -41,6 +42,9 @@ public class CopdXeekDeviceController extends EnvelopRestEndpoint {
                                    @ApiParam(name="end",value = "结束时间 YYYY-MM-DD HH:MM:SS" ,defaultValue = "2021-04-14 23:59:59" )
                                @RequestParam(value = "end")String end)
    {
        if (StringUtils.isBlank(patient)&&StringUtils.isBlank(deviceSN)){
            return ObjEnvelop.getError("参数错误");
        }
        try {
            return ObjEnvelop.getSuccess("查询成功",copdXeekDeviceService.getDeviceData(patient,deviceSN,reportType,parameter,time,begin,end));
        }catch (Exception e){

+ 20 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -23,6 +23,7 @@ import io.swagger.annotations.ApiParam;
import iot.device.LocationDataVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -52,6 +53,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
    private IotCompanyService iotCompanyService;
    @Autowired
    private CopdXeekDeviceService copdXeekDeviceService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @PostMapping(value = IotRequestMapping.PatientDevice.addPatientDevice)
@ -634,7 +637,7 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
    @RequestMapping(value = "getXeekDeviceData",method = RequestMethod.GET)
    @ApiOperation(value = "塞克设备数据获取")
    public ObjEnvelop getXeekDeviceData(@ApiParam(name="deviceSN",value = "设备sn码")
                                    @RequestParam(value = "deviceSN")String deviceSN,
                                    @RequestParam(value = "deviceSN",required = false)String deviceSN,
                                    @ApiParam(name="reportType",value = "测试项目 1=吸气测试;2=呼气测试;6=MVV 测试;7=慢通气测试")
                                    @RequestParam(value = "reportType")String reportType,
                                    @ApiParam(name="patient",value = "patient")
@ -648,6 +651,9 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
                                    @ApiParam(name="end",value = "结束时间 YYYY-MM-DD HH:MM:SS" ,defaultValue = "2021-04-14 23:59:59" )
                                    @RequestParam(value = "end")String end)
    {
        if (StringUtils.isBlank(patient)&&StringUtils.isBlank(deviceSN)){
            return ObjEnvelop.getError("参数错误");
        }
        try {
            return ObjEnvelop.getSuccess("查询成功",copdXeekDeviceService.getDeviceData(patient,deviceSN,reportType,parameter,time,begin,end));
        }catch (Exception e){
@ -1028,4 +1034,17 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        return sdf.format(calendar.getTime());
    }
    @ApiOperation("获取赛客查询指标")
    @RequestMapping(value = "getXeekParameters",method = {RequestMethod.POST,RequestMethod.GET})
    public ObjEnvelop getSportRecord(){
        try {
            String sql = "select value as code,name from xmiot.wlyy_iot_tz_dict where code='COPD_PARAMETER' and del=1";
            List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
            return  ObjEnvelop.getSuccess("查询成功",result);
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败"+e.getMessage());
        }
    }
}