Browse Source

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

liubing 3 years ago
parent
commit
ba3627af16

+ 5 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/config/YsConfig.java

@ -62,6 +62,11 @@ public class YsConfig {
    //录像地址 多格式
    public static final String videoList2 = iotBaseUrl +"/api/lapp/v2/live/address/get";
    //全天录像
    //https://open.ys7.com/api/lapp/device/fullday/record/switch/set
//    //获取录像accessKey、上传录像地址
//    public static final String videoKey = baseUrl +"/seastart/vod/token";
//

+ 7 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/YsDeviceController.java

@ -117,7 +117,7 @@ public class YsDeviceController extends BaseController {
    @RequestMapping(value = "getDeviceLiveAddress", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String getDeviceLiveAddress(
            @ApiParam(name="patient")@RequestParam(value = "patient",required = false)String patient,
            @ApiParam(name="deviceSerial",required = true,value="设备序列号")
            @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 = true,defaultValue = "1") Integer channelNo,
@ -199,8 +199,8 @@ public class YsDeviceController extends BaseController {
    @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 = true,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = true) String deviceSerial,
            @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点")
@ -345,9 +345,10 @@ public class YsDeviceController extends BaseController {
    @ApiOperation("获取视频地址信息(录像获取,直播地址另一个接口)")
    @RequestMapping(value = "videoList2", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String videoUpload(
            @ApiParam(name="patient")@RequestParam(value = "patient",required = false)String patient,
            @ApiParam(name="deviceSerial",required = true,value="设备序列号")
            @RequestParam(value = "deviceSerial",required = true) String deviceSerial,
            @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 = false,value="设备通道号,默认为1")
            @RequestParam(value = "channelNo",required = false,defaultValue = "1") Integer channelNo,
            @ApiParam(name="code",required = false,value="ezopen协议地址的设备的视频加密密码")

+ 4 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -269,7 +269,10 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    public Envelop deleteUser(@ApiParam(name="patient",required = true)
                                 @RequestParam(value = "patient")String patient){
        try {
            patientService.deleteUser(patient);
            JSONObject result = patientService.deleteUser(patient);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                return Envelop.getError(result.getString(ResponseContant.resultMsg));
            }
            return Envelop.getSuccess("操作成功");
        }catch (Exception e){
            e.printStackTrace();

+ 7 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/YsDeviceService.java

@ -395,7 +395,7 @@ public class YsDeviceService {
            param.add("startTime",timeStemp+"");
        }
        if (StringUtils.isNotBlank(endTime)){
            Date tmp = DateUtil.dateTimeParse(startTime);
            Date tmp = DateUtil.dateTimeParse(endTime);
            long timeStemp = tmp.getTime();
            param.add("endTime",timeStemp+"");
        }
@ -406,6 +406,11 @@ public class YsDeviceService {
        JSONObject responseBody = response.getBody();
        if (responseBody.getInteger("code")==200){
            JSONArray tmp = responseBody.getJSONArray("data");
            if (tmp==null){
                result.put(ResponseContant.resultFlag,ResponseContant.fail);
                result.put(ResponseContant.resultMsg,"未获取到当天录像信息");
                return result;
            }
            tmp.sort(Comparator.comparing(obj -> Long.parseLong(((LinkedHashMap) obj).get("startTime").toString())));
            for (int i=0;i<tmp.size();i++){
                LinkedHashMap mapTmp = tmp.getObject(i,LinkedHashMap.class);
@ -420,7 +425,7 @@ public class YsDeviceService {
            result.put(ResponseContant.resultMsg,tmp);
        }else {
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"查询失败,请联系管理员");
            result.put(ResponseContant.resultMsg,responseBody.getString("msg"));
        }
        return result;
        //https://open.ys7.com/doc/zh/book/index/device_select.html#device_select-api9

+ 13 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -320,7 +320,18 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return result;
    }
    public void deleteUser(String patient){
        patientDao.delete(patient);
    public JSONObject deleteUser(String patient){
        JSONObject result = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(patient);
        if (StringUtils.isNotBlank(patientDO.getIdcard())){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"账号已完成注册,无法注销");
        }else if (patientDO.getArchiveType()!=null){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"账号已完成注册,无法注销");
        } else {
            patientDao.delete(patient);
        }
        return result;
    }
}

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

@ -314,7 +314,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            try {
                JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(orderDO.getPatient(),devicePatientDeviceDos.get(0).getDeviceSn(),1,null);
                Map<String,Object> map = new HashMap<>();
                monitorUrl.put("infoStatus",result.getIntValue(ResponseContant.resultFlag));
//                map.put("monitorInfoStatus",result.getIntValue(ResponseContant.resultFlag));
                if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                    map.put("monitorInfo",monitorUrl.getString(ResponseContant.resultMsg));
                }
@ -1161,7 +1161,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        else{
            try {
                JSONObject monitorUrl = ysDeviceServicel.getDeviceLiveAddress(patient,devicePatientDeviceDos.get(0).getDeviceSn(),1,null);
                monitorUrl.put("infoStatus",result.getIntValue(ResponseContant.resultFlag));
                result.put("monitorInfoStatus",result.getIntValue(ResponseContant.resultFlag));
                if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                    result.put("monitorInfo",monitorUrl.getString(ResponseContant.resultMsg));
                }