Explorar el Código

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

wangzhinan hace 3 años
padre
commit
2388dd2425

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

@ -12,11 +12,12 @@ import com.yihu.jw.care.service.device.YsDeviceService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.ListEnvelop;
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.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -186,4 +187,33 @@ public class PDeviceController extends BaseController {
            return errorResult(e);
        }
    }
    @ApiOperation("获取设备录像存储信息")
    @RequestMapping(value = "deviceVideoTimeList", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String deviceVideoTimeList(
            @ApiParam(name="patient")@RequestParam(value = "patient",required = false)String patient,
            @ApiParam(name="deviceSerial",required = false,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = false) String deviceSerial,
            @ApiParam(name="channelNo",required = true,value="通道号,IPC设备填1")
            @RequestParam(value = "channelNo",required = false,defaultValue = "1") Integer channelNo,
            @ApiParam(name="startTime",required = false,value="起始时间,时间格式为:YYYY-MM-DD hh:ss:mm。非必选,默认为当天0点")
            @RequestParam(value = "startTime",required = false) String startTime,
            @ApiParam(name="endTime",required = false,value="结束时间,时间格式为:YYYY-MM-DD hh:ss:mm。非必选,默认为当前时间")
            @RequestParam(value = "endTime",required = false) String endTime,
            @ApiParam(name="recType",required = false,value="回放源,0-系统自动选择,1-云存储,2-本地录像。非必选,默认为0")
            @RequestParam(value = "recType",required = false) Integer recType,
            HttpServletRequest request){
        try {
            if (org.apache.commons.lang.StringUtils.isBlank(patient)&& StringUtils.isBlank(deviceSerial)){
                return error(-1,"参数错误");
            }
            JSONObject result = ysDeviceService.deviceVideoTimeList(patient,deviceSerial,channelNo,startTime,endTime,recType,request);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                return error(200,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"查询成功","data",result.getJSONArray(ResponseContant.resultMsg));
        }catch (Exception e){
            return errorResult(e);
        }
    }
}

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

@ -5,6 +5,7 @@ import com.yihu.jw.care.config.AqgConfig;
import com.yihu.jw.care.dao.device.DeviceDao;
import com.yihu.jw.care.dao.device.PatientDeviceDao;
import com.yihu.jw.care.dao.device.WlyyDeviceDao;
import com.yihu.jw.care.util.DateUtil;
import com.yihu.jw.care.util.DeviceLostMessageUtil;
import com.yihu.jw.entity.care.device.Device;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
@ -239,11 +240,8 @@ public class PatientDeviceService {
        Date nowDate = device1.getTime();
        String startTimeDevice1 = sdf.format(nowDate);
        Calendar device2 = Calendar.getInstance();
        device2.setTime(new Date());
        device2.add(device2.DATE, -2);
        Date nowDate2 = device2.getTime();
        String startTimeDevice2 = sdf.format(nowDate2);
        String startTimeDevice2 =  DateUtil.getPreTime(endTime,-60*2+"");
        try {
            List<String> lostSN = new ArrayList<>();
            List<String> onContact = new ArrayList<>();