Quellcode durchsuchen

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Shi Kejing vor 3 Jahren
Ursprung
Commit
1cdf979999

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

@ -146,8 +146,8 @@ public class DetectionPlatformEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "pageSize")Integer pageSize){
        try {
            org.json.JSONObject result = patientDeviceService.getPatientDeviceData(patient,deviceSn,page,pageSize);
            if (result.getInt(ResponseContant.resultFlag)==ResponseContant.success){
            com.alibaba.fastjson.JSONObject result = patientDeviceService.getPatientDeviceData(patient,deviceSn,page,pageSize);
            if (result.getInteger(ResponseContant.resultFlag)==ResponseContant.success){
                return success(JSON.parseObject(result.getString(ResponseContant.resultMsg)));
            }else {
                return success(result.getString(ResponseContant.resultMsg), -1);

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

@ -1068,9 +1068,9 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
     * @param deviceSn 设备sn码
     * @return
     */
    public JSONObject getPatientDeviceData(String patient,String deviceSn,Integer page,Integer pageSize)throws Exception{
    public com.alibaba.fastjson.JSONObject getPatientDeviceData(String patient,String deviceSn,Integer page,Integer pageSize)throws Exception{
        page = page>0?page-1:0;
        JSONObject result = new JSONObject();
        com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
        List<DevicePatientDevice> devices = patientDeviceDao.findByDeviceSn(deviceSn);
        if (devices.size()>0){
            DevicePatientDevice device = devices.get(0);
@ -1097,7 +1097,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        return result;
    }
    public JSONObject getHealthIndex(JSONObject result,Integer type,String deviceSn,String patient,Integer page,Integer pageSize){
    public com.alibaba.fastjson.JSONObject getHealthIndex(com.alibaba.fastjson.JSONObject result,Integer type,String deviceSn,String patient,Integer page,Integer pageSize){
        page = page>0?page-1:0;
        Long count =0l;
        PageRequest pageRequest = new PageRequest(page, pageSize);
@ -1199,7 +1199,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        return result;
    }
    public JSONObject getEmeWarn(JSONObject result,String deviceSn,String patient,Integer page,Integer pageSize){
    public com.alibaba.fastjson.JSONObject getEmeWarn(com.alibaba.fastjson.JSONObject result,String deviceSn,String patient,Integer page,Integer pageSize){
        String sqlCount = "select SUM(total) from( \n" +
                "select count(ord.id) as total from base_emergency_assistance_order ord  where ord.device_sn='"+deviceSn+"' " +
@ -1224,10 +1224,13 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        long count = jdbcTemplate.queryForObject(sqlCount,long.class);
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        String str = JSON.toJSONString(list,SerializerFeature.WriteMapNullValue);
        com.alibaba.fastjson.JSONArray arr = com.alibaba.fastjson.JSONArray.parseArray(str);
        result.put("total",count);
        result.put("page",page+1);
        result.put("pageSize",pageSize);
        result.put("dataList",list);
        result.put("dataList", arr);
        return result;
    }

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

@ -1475,14 +1475,15 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                        dayTime = getSleepMonitoringDay(new Date(),patient);
                    }
                    List<BaseSleepPlanDetail> planDetails = sleepPlanDetailDao.findByPatientAndDay(patient,dayTime);
                    BaseSleepPlanDetail planDetail = new BaseSleepPlanDetail();
                    if (planDetails.size()>0){
                        BaseSleepPlanDetail planDetail =  planDetails.get(0);
                        planDetail =  planDetails.get(0);
                        List<BaseSleepNightRecord> sleepNightRecordList = nightRecordDao.findByPatientAndDayOrderByCreateTimeDesc(patient,dayTime);
                        planDetail.setSleepNightRecordList(sleepNightRecordList);
                        String jsonStr = JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
                        sleepInfo = JSONObject.parseObject(jsonStr);
                        sleepInfo.put("day",dayTime);
                    }
                    String jsonStr = JSON.toJSONStringWithDateFormat(planDetail, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue);
                    sleepInfo = JSONObject.parseObject(jsonStr);
                    sleepInfo.put("day",dayTime);
                    List<BaseSleepPlan> sleepPlans = sleepPlanDao.findByPatient(patient);
                    if (sleepPlans.size()>0){
                        BaseSleepPlan sleepPlan = sleepPlans.get(0);

+ 13 - 13
svr/svr-cloud-device/src/main/java/com/yihu/jw/care/endpoint/DeviceController.java

@ -31,7 +31,7 @@ import java.util.*;
 * @Description:
 */
@RestController
@RequestMapping("/device")
@RequestMapping(value = "/device",produces = "application/json")
@Api(value = "爱牵挂设备相关服务", description = "设备相关服务")
public class DeviceController {
@ -161,7 +161,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂设备sos数据接收")
    @RequestMapping(value = "aqgsos", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "aqgsos", method = {RequestMethod.POST,RequestMethod.GET})
    public String aqgsos(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = false) String imei,
@ -186,7 +186,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂设备开关机数据接收")
    @RequestMapping(value = "aqgSwitch", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "aqgSwitch", method = {RequestMethod.POST,RequestMethod.GET})
    public String aqgSwitch(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = false) String imei,
@ -210,7 +210,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂设备消息通知数据接收")
    @RequestMapping(value = "pushdata", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "pushdata", method = {RequestMethod.POST,RequestMethod.GET})
    public String pushdata(
            @ApiParam(name="type",required = false,value="根据type来定义给用户推送提示  type=1 SOS,type=5 设备低电, 其他类型非本机型所有",defaultValue = "")
            @RequestParam(value = "type",required = false) int type,
@ -234,7 +234,7 @@ public class DeviceController {
    //
    @ApiOperation("爱牵挂位置接收")
    @RequestMapping(value = "byLocation", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "byLocation", method = {RequestMethod.POST,RequestMethod.GET})
    public String byLocation(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = true) String imei,
@ -269,7 +269,7 @@ public class DeviceController {
    @ApiOperation("爱牵挂心率数据接收")
    @RequestMapping(value = "byHeartRate", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "byHeartRate",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byHeartRate(
            @ApiParam(name = "imei", value = "15位设备唯一序号")
            @RequestParam(value = "imei",required = true)String imei,
@ -295,7 +295,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂血压数据接收")
    @RequestMapping(value = "byBloodPressure", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "byBloodPressure",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byBloodPressure(
            @ApiParam(name = "imei", value = "15位设备唯一序号", required = true)
            @RequestParam(value = "imei",required = true)String imei,
@ -323,7 +323,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂跌倒数据接收")
    @RequestMapping(value = "byFall", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "byFall",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byFall(
            @ApiParam(name = "imei", value = "15位设备唯一序号", required = true)
            @RequestParam(value = "imei",required = true)String imei,
@ -353,7 +353,7 @@ public class DeviceController {
    }
    @ApiOperation("设备步数接收")
    @RequestMapping(value = "bySteps", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "bySteps",  method = {RequestMethod.POST,RequestMethod.GET})
    public String bySteps(
            @ApiParam(name="imei",required = false,value="15位设备唯一序号",defaultValue = "")
            @RequestParam(value = "imei",required = true) String imei,
@ -376,7 +376,7 @@ public class DeviceController {
    /*******************************************睡眠带begin****************************************************************/
    @ApiOperation("爱牵挂-睡眠带睡眠接收")
    @RequestMapping(value = "bySleep", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "bySleep",  method = {RequestMethod.POST,RequestMethod.GET})
    public String bySleep(
            @ApiParam(name="device",required = false,value="睡眠带MAC地址",defaultValue = "")
            @RequestParam(value = "device",required = true) String device,
@ -386,7 +386,7 @@ public class DeviceController {
            @RequestParam(value = "heartrate",required = false) String heartrate,
            @ApiParam(name="breath",required = false,value="呼吸率(离床或翻身测量失败时为0)")
            @RequestParam(value = "breath",required = false) String breath,
                @ApiParam(name="bed_status",required = false,value="在离床状态(0 离床,1 在床) ")
            @ApiParam(name="bed_status",required = false,value="在离床状态(0 离床,1 在床) ")
            @RequestParam(value = "bed_status",required = false) String bed_status,
            @ApiParam(name="turn_over",required = false,value="翻身状态(0 没翻身,1 在翻身)")
            @RequestParam(value = "turn_over",required = false)String turn_over,
@ -408,7 +408,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂-睡眠带睡眠报告接收")
    @RequestMapping(value = "bySleepReport", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "bySleepReport",  method = {RequestMethod.POST,RequestMethod.GET})
    public String bySleep(
            @ApiParam(name="device",required = false,value="睡眠带MAC地址",defaultValue = "")
            @RequestParam(value = "device",required = true) String device,
@ -465,7 +465,7 @@ public class DeviceController {
    }
    @ApiOperation("爱牵挂-睡眠带wifi在线状态接收")
    @RequestMapping(value = "byOnlineStatus", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    @RequestMapping(value = "byOnlineStatus",  method = {RequestMethod.POST,RequestMethod.GET})
    public String byOnlineStatus(
            @ApiParam(name="device",required = false,value="睡眠带MAC地址",defaultValue = "")
            @RequestParam(value = "device",required = true) String device,

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

@ -597,6 +597,10 @@ public class DeviceService {
                        planDetail.setDay(dayTime);
                        planDetail.setPatient(patient);
                        planDetail.setDeviceSn(device);
                        if (!needSiesta){//无午睡计划
                            SiestaBegin = bedBegin;
                        }
                        /***起床***/
                        Long timeDiffer = timeDate.getTime() - bedUp.getTime();
                        if(DateUtil.isInArea(timeDate,bedUpBegin,SiestaBegin)){//起床时间内