Kaynağa Gözat

萤石监控地址获取(协议),日报代码修改

liubing 2 yıl önce
ebeveyn
işleme
8c56fa1b31

+ 8 - 2
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -370,7 +370,7 @@ public class DailyReportUploadService {
        dailyReportUploadDO = dailyReportUploadDao.save(dailyReportUploadDO);
        for (BaseDailyReportDetailDO tmp :detailDOList){
            tmp.setReportId(dailyReportUploadDO.getId());
            if (tmp.getReportItemFlag()==true){//新则自建关联项目
            if (tmp.isReportItemFlag()==true){//新则自建关联项目
                String title = tmp.getReportItemTitle();
                BaseDailyReportItemDO reportItemDO = new BaseDailyReportItemDO();
                reportItemDO.setState(0);
@ -668,6 +668,7 @@ public class DailyReportUploadService {
     * @throws Exception
     */
    public BaseDailyReportUploadDO selectReportById(String reportId) throws Exception {
        String nowDate = DateUtil.getStringDateShort();
        BaseDailyReportUploadDO reportUploadDO = dailyReportUploadDao.findOne(reportId);
        if (null==reportUploadDO){
            throw new Exception("未找到日报记录");
@ -677,6 +678,11 @@ public class DailyReportUploadService {
            List<BaseDailyReportLogDO> dailyReportLogDOList = dailyReportLogDao.findByReportId(reportUploadDO.getId());
            reportUploadDO.setDailyReportLogDOList(dailyReportLogDOList);
        }
        if (DateUtil.getDays(nowDate,reportUploadDO.getReportDate())>7){
            reportUploadDO.setVerifiedRepeatFlag(false);
        }else {
            reportUploadDO.setVerifiedRepeatFlag(true);
        }
        return reportUploadDO;
    }
@ -1246,7 +1252,7 @@ public class DailyReportUploadService {
        for (i = 0; i < list.size(); i++) {
            String date = list.get(i);
            String doubtSql = " select up.doctor_id,up.doctor_name,rd.id detailId,rd.report_id uploadId,rd.sort,rd.report_content, " +
                    " rd.completion_schedule,IFNULL(rd.actual_completion_hour,IFNULL(rd.completion_hour,0)) as 'completion_hour', " +
                    " rd.completion_schedule,rd.actual_completion_hour,rd.completion_hour, " +
                    " rd.state,DATE_FORMAT(rd.verification_time,'%Y-%m-%d %H:%i:%S') verification_time,rd.remark,rd.doubt,rd.doubt_state, " +
                    " rd.doubt_remark,rd.report_item_id,rd.report_item_name,rd.verification_user_name,rd.doubt_type " +
                    " from base_doctor_daily_report_upload up " +

+ 2 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportDetailDO.java

@ -175,7 +175,7 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    }
    @Transient
    public boolean getReportItemFlag() {
    public boolean isReportItemFlag() {
        return reportItemFlag;
    }
@ -191,4 +191,5 @@ public class BaseDailyReportDetailDO extends UuidIdentityEntityWithOperator {
    public void setReportItemTitle(String reportItemTitle) {
        this.reportItemTitle = reportItemTitle;
    }
}

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/dailyReport/BaseDailyReportUploadDO.java

@ -24,6 +24,7 @@ public class BaseDailyReportUploadDO extends UuidIdentityEntityWithOperator {
    private String reportDate; //上报日期
    private String totalHour;//上报时长
    private boolean verifiedRepeatFlag;
    public String getTotalHour() {
        return totalHour;
@ -111,4 +112,12 @@ public class BaseDailyReportUploadDO extends UuidIdentityEntityWithOperator {
        this.leaveHour = leaveHour;
    }
    @Transient
    public boolean isVerifiedRepeatFlag() {
        return verifiedRepeatFlag;
    }
    public void setVerifiedRepeatFlag(boolean verifiedRepeatFlag) {
        this.verifiedRepeatFlag = verifiedRepeatFlag;
    }
}

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

@ -41,6 +41,9 @@ public class YsConfig {
    //获取设备有效直播地址
    public static final String getDeviceLiveAddress = iotBaseUrl+ "/api/lapp/live/address/limited";
    //获取设备有效直播地址
    public static final String getDeviceLiveAddress2 = iotBaseUrl+ "/api/lapp/v2/live/address/get";
    //设备视频加解密开关
    public static final String deviceEncrypt = baseUrl+ "/api/resource/device/encrypt/switch";

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

@ -406,5 +406,25 @@ public class YsDeviceController extends BaseController {
        }
    }
    @ApiOperation("获取播放地址--协议")
    @RequestMapping(value = "getDeviceLiveAddress2", produces = "application/x-www-form-urlencoded;charset=UTF-8", method = {RequestMethod.POST,RequestMethod.GET})
    public String getDeviceLiveAddress2(
            @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
    ){
        try {
            JSONObject result = ysDeviceService.getDeviceLiveAddress2(deviceSerial,channelNo);
            if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail){
                return error(200,result.getString(ResponseContant.resultMsg));
            }
            return write(200,"查询成功","data",result.getString(ResponseContant.resultMsg));
        }catch (Exception e){
            return errorResult(e);
        }
    }
}

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

@ -750,6 +750,29 @@ public class YsDeviceService {
        return result;
    }
    public JSONObject getDeviceLiveAddress2(String deviceSerial,Integer channelNo) throws Exception {
        JSONObject result = new JSONObject();
        MultiValueMap<String,String> param = new LinkedMultiValueMap<>();
        param.add("accessToken",getIotAccessToken(deviceSerial));
        if (StringUtils.isNotBlank(deviceSerial)){
            param.add("deviceSerial",deviceSerial);
        }
        if (channelNo!=null){
            param.add("channelNo",channelNo+"");
        }
        HttpEntity<JSONObject> response = httpClientUtil.iotAssesTokenPostHttp(YsConfig.getDeviceLiveAddress2,param,HttpMethod.POST);
        JSONObject responseBody = response.getBody();
        if (responseBody.getInteger("code")==200){
            result.put(ResponseContant.resultFlag,ResponseContant.success);
            result.put(ResponseContant.resultMsg,responseBody.getJSONObject("data").getString("url"));
        }else {
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,responseBody.getString("msg"));
        }
        return result;
    }
    /**
     * 消息解密
     * @param sSrc