2023-11-07 09:32:12 +08:00
|
|
|
|
package com.zcloud.controller.keyProjects;
|
|
|
|
|
|
2023-12-20 09:18:51 +08:00
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.zcloud.aspect.DockAnnotation;
|
2023-11-07 09:32:12 +08:00
|
|
|
|
import com.zcloud.controller.base.BaseController;
|
|
|
|
|
import com.zcloud.entity.Page;
|
|
|
|
|
import com.zcloud.entity.PageData;
|
|
|
|
|
import com.zcloud.service.keyProjects.VideoManagerService;
|
|
|
|
|
import com.zcloud.util.DateUtil;
|
|
|
|
|
import com.zcloud.util.Jurisdiction;
|
|
|
|
|
import com.zcloud.util.Tools;
|
|
|
|
|
import com.zcloud.util.hk.HKUtil;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 说明:视频管理
|
|
|
|
|
* 作者:luoxiaobao
|
|
|
|
|
* 时间:2021-05-10
|
|
|
|
|
* 官网:www.zcloudchina.com
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("/videomanager")
|
|
|
|
|
public class VideoManagerController extends BaseController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private VideoManagerService videomanagerService;
|
|
|
|
|
|
|
|
|
|
/**新增
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/add")
|
|
|
|
|
@RequiresPermissions("videomanager:add")
|
|
|
|
|
@ResponseBody
|
2023-12-20 09:18:51 +08:00
|
|
|
|
@DockAnnotation(isAdd = true)
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object add() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
pd.put("VIDEOMANAGER_ID", this.get32UUID()); //主键
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
pd.put("OPDATE", DateUtil.date2Str(new Date())); //操作日期
|
|
|
|
|
pd.put("OPUSER", Jurisdiction.getUsername()); //操作人
|
|
|
|
|
pd.put("ISDELETE", "0"); //是否删除
|
|
|
|
|
videomanagerService.save(pd);
|
2023-12-20 09:18:51 +08:00
|
|
|
|
map.put("dockData", JSON.toJSONString(pd));
|
2023-11-07 09:32:12 +08:00
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**删除
|
|
|
|
|
* @param out
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/delete")
|
|
|
|
|
@RequiresPermissions("videomanager:del")
|
|
|
|
|
@ResponseBody
|
2023-12-20 09:18:51 +08:00
|
|
|
|
@DockAnnotation
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object delete() throws Exception{
|
|
|
|
|
Map<String,String> map = new HashMap<String,String>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
videomanagerService.delete(pd);
|
|
|
|
|
map.put("result", errInfo); //返回结果
|
2023-12-28 19:33:26 +08:00
|
|
|
|
map.put("dockData", JSON.toJSONString(pd)); //返回结果
|
2023-11-07 09:32:12 +08:00
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**修改
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/edit")
|
|
|
|
|
@RequiresPermissions("videomanager:edit")
|
|
|
|
|
@ResponseBody
|
2023-12-20 09:18:51 +08:00
|
|
|
|
@DockAnnotation(isAdd = true)
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object edit() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
videomanagerService.edit(pd);
|
2023-12-20 09:18:51 +08:00
|
|
|
|
map.put("dockData", JSON.toJSONString(pd));
|
2023-11-07 09:32:12 +08:00
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**定位
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/savePosition")
|
|
|
|
|
@RequiresPermissions("videomanager:edit")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object savePosition() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
videomanagerService.savePosition(pd);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/goAllVideo")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object goAllVideo() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
|
|
|
|
|
String DATA_IDS = pd.getString("DATA_IDS");
|
|
|
|
|
if(Tools.notEmpty(DATA_IDS)){
|
|
|
|
|
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
|
|
|
|
pd.put("ArrayDATA_IDS", ArrayDATA_IDS);
|
|
|
|
|
}
|
|
|
|
|
List<PageData> videoList = videomanagerService.listBo(pd); //根据ID读取
|
|
|
|
|
for (PageData video : videoList) {
|
|
|
|
|
if(video.get("INDEXCODE")!=null && !"".equals(video.getString("INDEXCODE"))){
|
|
|
|
|
video.put("HLSVIDEOURL", HKUtil.camerasPreviewURLs(video.getString("INDEXCODE"),"hls"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("videoList", videoList);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**列表
|
|
|
|
|
* @param page
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/list")
|
|
|
|
|
@RequiresPermissions("videomanager:list")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object list(Page page) throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
|
|
|
|
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
|
|
|
|
|
|
|
|
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
page.setPd(pd);
|
|
|
|
|
|
|
|
|
|
List<PageData> varList = videomanagerService.list(page); //列出VideoManager列表
|
|
|
|
|
map.put("varList", varList);
|
|
|
|
|
map.put("page", page);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/listAllForMap")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object listAllForMap() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
|
|
|
|
|
List<PageData> videoList = videomanagerService.listAllForMap(pd); //根据ID读取
|
|
|
|
|
map.put("videoList", videoList);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/editIsShow")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object editIsShow() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
PageData epd = new PageData();
|
|
|
|
|
epd.put("ISSHOW", '0');
|
|
|
|
|
epd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
videomanagerService.editIsShowBycorpinfoid(epd); //根据ID读取
|
|
|
|
|
|
|
|
|
|
pd.put("ISSHOW", '1');
|
|
|
|
|
videomanagerService.editIsShow(pd); //根据ID读取
|
|
|
|
|
map.put("pd", pd);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
/**去修改页面获取数据
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/goEdit")
|
|
|
|
|
@RequiresPermissions("videomanager:edit")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object goEdit() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
pd = videomanagerService.findById(pd); //根据ID读取
|
|
|
|
|
map.put("pd", pd);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**批量删除
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="/deleteAll")
|
|
|
|
|
@RequiresPermissions("videomanager:del")
|
|
|
|
|
@ResponseBody
|
2023-12-20 09:18:51 +08:00
|
|
|
|
@DockAnnotation
|
2023-11-07 09:32:12 +08:00
|
|
|
|
public Object deleteAll() throws Exception{
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = new PageData();
|
|
|
|
|
pd = this.getPageData();
|
|
|
|
|
String DATA_IDS = pd.getString("DATA_IDS");
|
|
|
|
|
if(Tools.notEmpty(DATA_IDS)){
|
|
|
|
|
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
|
|
|
|
videomanagerService.deleteAll(ArrayDATA_IDS);
|
|
|
|
|
errInfo = "success";
|
|
|
|
|
}else{
|
|
|
|
|
errInfo = "error";
|
|
|
|
|
}
|
|
|
|
|
map.put("result", errInfo); //返回结果
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|