194 lines
6.1 KiB
Java
194 lines
6.1 KiB
Java
|
package com.zcloud.controller.keyProjects;
|
|||
|
|
|||
|
import com.zcloud.controller.base.BaseController;
|
|||
|
import com.zcloud.entity.Page;
|
|||
|
import com.zcloud.entity.PageData;
|
|||
|
import com.zcloud.service.keyProjects.VideoResourcesService;
|
|||
|
import com.zcloud.util.DateUtil;
|
|||
|
import com.zcloud.util.Jurisdiction;
|
|||
|
import com.zcloud.util.Tools;
|
|||
|
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("/videoResources")
|
|||
|
public class VideoResourcesController extends BaseController {
|
|||
|
|
|||
|
@Autowired
|
|||
|
private VideoResourcesService videoResourcesService;
|
|||
|
|
|||
|
/**
|
|||
|
* 新增
|
|||
|
*
|
|||
|
* @param
|
|||
|
* @throws Exception
|
|||
|
*/
|
|||
|
@RequestMapping(value = "/add")
|
|||
|
@RequiresPermissions("videomanager:add")
|
|||
|
@ResponseBody
|
|||
|
public Object add() throws Exception {
|
|||
|
Map<String, Object> map = new HashMap<String, Object>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
pd.put("VIDEO_RESOURCES_ID", this.get32UUID()); //主键
|
|||
|
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //操作日期
|
|||
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //操作日期
|
|||
|
pd.put("OPERATOR", Jurisdiction.getUsername()); //操作人
|
|||
|
pd.put("CREATOR", Jurisdiction.getUsername()); //操作人
|
|||
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //操作人
|
|||
|
pd.put("ISDELETE", "0"); //是否删除
|
|||
|
videoResourcesService.save(pd);
|
|||
|
map.put("result", errInfo);
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 删除
|
|||
|
*
|
|||
|
* @param
|
|||
|
* @throws Exception
|
|||
|
*/
|
|||
|
@RequestMapping(value = "/delete")
|
|||
|
@RequiresPermissions("videomanager:del")
|
|||
|
@ResponseBody
|
|||
|
public Object delete() throws Exception {
|
|||
|
Map<String, String> map = new HashMap<String, String>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = new PageData();
|
|||
|
pd = this.getPageData();
|
|||
|
videoResourcesService.delete(pd);
|
|||
|
map.put("result", errInfo); //返回结果
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
@RequestMapping(value = "/findById")
|
|||
|
@ResponseBody
|
|||
|
public Object findById() {
|
|||
|
Map<String, Object> map = new HashMap<>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
PageData value = videoResourcesService.findById(pd);
|
|||
|
map.put("pd", value); //返回结果
|
|||
|
map.put("result", errInfo); //返回结果
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
@RequestMapping(value = "/getPageOutSourceBySid")
|
|||
|
@ResponseBody
|
|||
|
public Object getPageOutSourceBySid(Page page) {
|
|||
|
Map<String, Object> map = new HashMap<>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
page.setPd(pd);
|
|||
|
List<PageData> value = videoResourcesService.getPageOutSourceBySid(page);
|
|||
|
map.put("page", page); //返回结果
|
|||
|
map.put("varList", value); //返回结果
|
|||
|
map.put("result", errInfo); //返回结果
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 修改
|
|||
|
*
|
|||
|
* @param
|
|||
|
* @throws Exception
|
|||
|
*/
|
|||
|
@RequestMapping(value = "/edit")
|
|||
|
@RequiresPermissions("videomanager:edit")
|
|||
|
@ResponseBody
|
|||
|
public Object edit() throws Exception {
|
|||
|
Map<String, Object> map = new HashMap<String, Object>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
videoResourcesService.edit(pd);
|
|||
|
map.put("result", errInfo);
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* 列表
|
|||
|
*
|
|||
|
* @param page
|
|||
|
* @throws Exception
|
|||
|
*/
|
|||
|
@RequestMapping(value = "/listAll")
|
|||
|
@ResponseBody
|
|||
|
public Object listAll() throws Exception {
|
|||
|
Map<String, Object> map = new HashMap<String, Object>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
|||
|
List<PageData> varList = videoResourcesService.listAll(pd); //列出VideoManager列表
|
|||
|
map.put("varList", varList);
|
|||
|
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 = this.getPageData();
|
|||
|
String KEYWORDS = pd.getString("VIDEONAME"); //关键词检索条件
|
|||
|
if (Tools.notEmpty(KEYWORDS)) pd.put("VIDEONAME", KEYWORDS.trim());
|
|||
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|||
|
page.setPd(pd);
|
|||
|
List<PageData> varList = videoResourcesService.list(page); //列出VideoManager列表
|
|||
|
map.put("varList", varList);
|
|||
|
map.put("page", page);
|
|||
|
map.put("result", errInfo);
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/**
|
|||
|
* 批量删除
|
|||
|
*
|
|||
|
* @param
|
|||
|
* @throws Exception
|
|||
|
*/
|
|||
|
@RequestMapping(value = "/deleteAll")
|
|||
|
@RequiresPermissions("videomanager:del")
|
|||
|
@ResponseBody
|
|||
|
public Object deleteAll() throws Exception {
|
|||
|
Map<String, Object> map = new HashMap<String, Object>();
|
|||
|
String errInfo = "success";
|
|||
|
PageData pd = this.getPageData();
|
|||
|
String DATA_IDS = pd.getString("DATA_IDS");
|
|||
|
if (Tools.notEmpty(DATA_IDS)) {
|
|||
|
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
|||
|
videoResourcesService.deleteAll(ArrayDATA_IDS);
|
|||
|
errInfo = "success";
|
|||
|
} else {
|
|||
|
errInfo = "error";
|
|||
|
}
|
|||
|
map.put("result", errInfo); //返回结果
|
|||
|
return map;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|