1.修改视频场景增加监测封堵按钮2.增加patch调用接口更改配置状态方法
This commit is contained in:
@@ -15,6 +15,7 @@ import java.util.Map;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
@@ -376,21 +377,75 @@ public class AvCfgService extends BaseService{
|
||||
}
|
||||
|
||||
}
|
||||
public void auditAvSignSample(AvSignSampleCfg entity) throws MaatConvertException{
|
||||
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
list.add(entity);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("音视频标志样状态变更响应信息:"+result.getMsg());
|
||||
|
||||
}
|
||||
//预置配置下发
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void auditAvSignSample() throws MaatConvertException{
|
||||
try {
|
||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||
List<AvSignSampleCfg> avSignSampleList = avCfgDao.getAvSignSampleList(entity);
|
||||
if(avSignSampleList!=null&&avSignSampleList.size()>0){
|
||||
// avCfgDao.updateAvSignSampleValid(entity);
|
||||
// avCfgDao.auditAvSignSample(entity);
|
||||
// List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
// avSignSampleList.add(entity);
|
||||
for (AvSignSampleCfg av : avSignSampleList) {
|
||||
av.setAuditTime(new Date());
|
||||
av.setAuditorId(UserUtils.getUser().getId());
|
||||
if(av.getIsValid()!=null&&av.getIsValid()!=1){
|
||||
av.setIsValid(1);
|
||||
}
|
||||
avCfgDao.updateAvSignSampleValid(av);
|
||||
}
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(avSignSampleList);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
ToMaatResult result = ConfigServiceUtil.postCallbackCfg(json);
|
||||
logger.info("音视频标志样状态变更响应信息:"+result.getMsg());
|
||||
}else{
|
||||
logger.info("视频场景预置失败,数据为空");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("视频场景预置失败,数据为空");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void auditAvSignSample(AvSignSampleCfg entity) throws Exception{
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setDescription("0");
|
||||
list.add(entity);
|
||||
try {
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
|
||||
// avCfgDao.auditAvSignSample(entity);
|
||||
//更新配置
|
||||
|
||||
if(entity.getIsValid()!=null&&entity.getIsValid()==Constants.VALID_YES){
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
String result = ConfigServiceUtil.patch(json, 2);
|
||||
logger.info("视频标志样状态变更响应信息:"+result);
|
||||
}
|
||||
if(entity.getIsValid()!=null&&entity.getIsValid()==Constants.VALID_NO){
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
logger.info("视频标志样状态变更响应信息:"+result.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
/*public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
|
||||
Reference in New Issue
Block a user