|
|
@ -1,14 +1,17 @@ |
|
|
|
package com.zc.business.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.ruoyi.common.constant.HttpStatus; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser; |
|
|
|
import com.ruoyi.common.utils.SecurityUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.zc.business.controller.DcDeviceController; |
|
|
|
import com.zc.business.domain.DcBoardPublish; |
|
|
|
import com.zc.business.domain.DcBoardReleaseLog; |
|
|
|
import com.zc.business.mapper.DcBoardReleaseLogMapper; |
|
|
|
import com.zc.business.service.IDcBoardService; |
|
|
|
import org.checkerframework.checker.units.qual.A; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -29,6 +32,9 @@ public class DcBoardServiceImpl implements IDcBoardService { |
|
|
|
@Autowired |
|
|
|
private DcBoardReleaseLogMapper dcBoardReleaseLogMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private DcDeviceController deviceController; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 情报板发布 |
|
|
|
* |
|
|
@ -48,24 +54,34 @@ public class DcBoardServiceImpl implements IDcBoardService { |
|
|
|
String deviceId = dcBoardPublish.getDeviceId(); |
|
|
|
List<Map<String,Object>> contentList = dcBoardPublish.getContent(); |
|
|
|
|
|
|
|
//TODO 调用控制设备接口
|
|
|
|
/* //下发文件名
|
|
|
|
AjaxResult ajaxResult = new AjaxResult(); |
|
|
|
String status = "1"; |
|
|
|
|
|
|
|
try{ |
|
|
|
//下发文件名
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put("size","65535"); |
|
|
|
param.put("fileName","play010.lst"); |
|
|
|
invokeFunction(deviceId,"11",param); |
|
|
|
ajaxResult = deviceController.invokedFunction(deviceId,"11",param); |
|
|
|
if (HttpStatus.SUCCESS == Integer.parseInt(String.valueOf(ajaxResult.get("code")))){ |
|
|
|
|
|
|
|
//功能码13 下发内容
|
|
|
|
param = new HashMap<>(); |
|
|
|
param.put("parameters",contentList); |
|
|
|
invokeFunction(deviceId,"1B",param); |
|
|
|
ajaxResult = deviceController.invokedFunction(deviceId,"13",param); |
|
|
|
|
|
|
|
if (HttpStatus.SUCCESS == Integer.parseInt(String.valueOf(ajaxResult.get("code")))) { |
|
|
|
|
|
|
|
//功能码1B 播放
|
|
|
|
param = new HashMap<>(); |
|
|
|
param.put("fileId","10"); |
|
|
|
invokeFunction(deviceId,"13",param);*/ |
|
|
|
param.put("fileId", "10"); |
|
|
|
ajaxResult = deviceController.invokedFunction(deviceId, "1B", param); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
String status = "1"; |
|
|
|
if (HttpStatus.SUCCESS != Integer.parseInt(String.valueOf(ajaxResult.get("code")))) { |
|
|
|
status = "0"; |
|
|
|
} |
|
|
|
|
|
|
|
//发布记录
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
@ -81,9 +97,11 @@ public class DcBoardServiceImpl implements IDcBoardService { |
|
|
|
releaseLog.setReleaseDeptId(loginUser.getDeptId().toString()); |
|
|
|
dcBoardReleaseLogMapper.insertDcBoardReleaseLog(releaseLog); |
|
|
|
} |
|
|
|
}catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return AjaxResult.success(); |
|
|
|
return ajaxResult; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -95,10 +113,15 @@ public class DcBoardServiceImpl implements IDcBoardService { |
|
|
|
*/ |
|
|
|
public AjaxResult realtimeProperty(String deviceId){ |
|
|
|
|
|
|
|
/*Map<String,Object> param = new HashMap<>(); |
|
|
|
AjaxResult ajaxResult = new AjaxResult(); |
|
|
|
try { |
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put("async",false); |
|
|
|
invokeFunction(deviceId,"3A",param);*/ |
|
|
|
ajaxResult = deviceController.invokedFunction(deviceId,"3A",param); |
|
|
|
} catch (Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success(); |
|
|
|
return ajaxResult; |
|
|
|
} |
|
|
|
} |
|
|
|