Commit ebc3c5bde985978e35c9ccaed321a8752a8a407e

Authored by liwei2917
2 parents 3cec996b 00eaf988

Merge branch 'dev'

src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java 0 → 100644
  1 +package com.cnlive.shenhe.api;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONArray;
  5 +import com.alibaba.fastjson.JSONObject;
  6 +import com.cnlive.shenhe.bean.ErrorEnum;
  7 +import com.cnlive.shenhe.bean.ResponseBean;
  8 +import com.cnlive.shenhe.entity.ShyLive;
  9 +import com.cnlive.shenhe.entity.ShyLiveapply;
  10 +import com.cnlive.shenhe.entity.ShyVideos;
  11 +import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl;
  12 +import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
  13 +import com.cnlive.shenhe.utils.AntiFraudUtil;
  14 +import com.cnlive.shenhe.utils.CommonUtils;
  15 +
  16 +import java.sql.Timestamp;
  17 +import java.util.Date;
  18 +import java.util.HashMap;
  19 +import java.util.List;
  20 +import java.util.Map;
  21 +import java.util.UUID;
  22 +
  23 +import org.apache.commons.lang3.StringUtils;
  24 +import org.slf4j.Logger;
  25 +import org.slf4j.LoggerFactory;
  26 +import org.springframework.beans.factory.annotation.Autowired;
  27 +import org.springframework.stereotype.Controller;
  28 +import org.springframework.web.bind.annotation.PostMapping;
  29 +import org.springframework.web.bind.annotation.RequestBody;
  30 +import org.springframework.web.bind.annotation.RequestMapping;
  31 +import org.springframework.web.bind.annotation.RequestMethod;
  32 +import org.springframework.web.bind.annotation.ResponseBody;
  33 +import com.cnlive.shenhe.utils.AntiFraudUtil;
  34 +
  35 +
  36 +@SuppressWarnings("unused")
  37 +@Controller
  38 +@RequestMapping("/api/liveApply")
  39 +public class LiveApplyControllerApi {
  40 + private static Logger logger = LoggerFactory.getLogger(LiveApplyControllerApi.class);
  41 +
  42 + @Autowired
  43 + LiveApplyServiceImpl liveApplyServiceImpl;
  44 +
  45 + @PostMapping("/import")
  46 + @ResponseBody
  47 + public JSONObject impotVideo(String param) {
  48 + JSONObject map = new JSONObject();
  49 + JSONObject result = new JSONObject();
  50 + boolean YorN =true;//初始化一个请求数据库返回结果
  51 +
  52 + logger.info("直播申请入库,param=====" + param);
  53 + JSONObject json = JSONObject.parseObject(param);
  54 + //获取所有参数
  55 + String activityId = json.getString("activityId");//直播活动id
  56 + String channelId = json.getString("channelId");//直播频道id
  57 + Integer spId = Integer.parseInt(json.getString("spId"));//spid
  58 + String sender = json.getString("sender");//直播发起人
  59 + String mobile = json.getString("mobile");//联系方式
  60 + String callback = json.getString("callback");//回调地址
  61 + String organization = json.getString("organization");//直播发起单位
  62 + String theme = json.getString("theme");//直播主题
  63 + String startTime = json.getString("preStartTime");//预计开始时间
  64 + Integer businessModel = Integer.parseInt(json.getString("businessModel"));//商务模式:0免费 1收费
  65 + Integer contentProperty = Integer.parseInt(json.getString("contentProperty"));//内容属性:1商业类活动 0非商业活动
  66 + String simpleContent = json.getString("simpleContent");//内容简述
  67 + String keys = json.getString("keys");//要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
  68 + String livePlace = json.getString("livePlace");//直播地点
  69 + String pushUrl = json.getString("pushUrl");//推流地址
  70 + String pullUrl = json.getString("pullUrl");//拉流地址
  71 + String platforms = json.getString("platforms");//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
  72 + Date timestamp_start =null;
  73 +// if (CommonUtils.isNotEmpty(startTime)) {
  74 +// timestamp_start = new Timestamp(Long.valueOf(startTime));
  75 +// }
  76 + if (CommonUtils.isNotEmpty(startTime)) {
  77 + timestamp_start = CommonUtils.getTimestamp(startTime, "yyyy-MM-dd HH:mm:ss");
  78 +
  79 + }
  80 + String endTime = json.getString("preEndTime");//预计结束时间
  81 + Date timestamp_end =null;
  82 +// if (CommonUtils.isNotEmpty(endTime)) {
  83 +// timestamp_end = new Timestamp(Long.valueOf(endTime));
  84 +// }
  85 + if (CommonUtils.isNotEmpty(endTime)) {
  86 + timestamp_end = CommonUtils.getTimestamp(endTime, "yyyy-MM-dd HH:mm:ss");
  87 +
  88 + }
  89 + ShyLiveapply shyliveApply1 = new ShyLiveapply();
  90 + //得到直播活动id去查询是否已有
  91 + shyliveApply1.setActivity_id(activityId);
  92 + //查询一下 存在,更新 没有,插入
  93 + List<ShyLiveapply> listshyLiveApply = liveApplyServiceImpl.findshyLiveApply(shyliveApply1);
  94 +
  95 + if (listshyLiveApply.size() > 0) {
  96 + ShyLiveapply shyliveApply = listshyLiveApply.get(0);
  97 + //封装数据入库
  98 + shyliveApply.setSp_id(spId);//设置spid
  99 + shyliveApply.setSender(sender);//设置发送者
  100 + shyliveApply.setMobile(mobile);//设置联系方式
  101 + shyliveApply.setOrganization(organization);//设置直播发起单位
  102 + shyliveApply.setTheme(theme);//直播主题
  103 + shyliveApply.setPre_start_time(timestamp_start);//预计开始时间
  104 + shyliveApply.setPre_end_time(timestamp_end);//预计结束时间
  105 + shyliveApply.setBusiness_model(businessModel);//商务模式:0免费 1收费
  106 + shyliveApply.setContent_property(contentProperty);//内容属性:1商业类活动 0非商业活动
  107 + shyliveApply.setSimple_content(simpleContent);//内容简述
  108 + shyliveApply.setPoint_key(keys);//要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
  109 + shyliveApply.setLive_place(livePlace);//直播地点
  110 + shyliveApply.setPush_url(pushUrl);//推流地址
  111 + shyliveApply.setPull_url(pullUrl);//拉流地址
  112 + shyliveApply.setPlatforms(platforms);//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
  113 + shyliveApply.setCallback(callback);//设置回调地址
  114 + shyliveApply.setReceive(0);
  115 + shyliveApply.setShenhe_state(0);
  116 + shyliveApply.setUpdater(null);
  117 + shyliveApply.setAuditor(null);
  118 + shyliveApply.setUpdated_at(CommonUtils.getCurrentTime());//更新时间
  119 +
  120 + liveApplyServiceImpl.getShenheType(shyliveApply);//获取审核类型
  121 + YorN = liveApplyServiceImpl.updateshyLiveApply(shyliveApply);
  122 + }else{
  123 + //查了,没有,直接插入数据库
  124 + shyliveApply1.setChannel_id(channelId);//设置频道id
  125 + shyliveApply1.setSp_id(spId);//设置spid
  126 + shyliveApply1.setSender(sender);//设置发送者
  127 + shyliveApply1.setMobile(mobile);//设置联系方式
  128 + shyliveApply1.setOrganization(organization);//设置直播发起单位
  129 + shyliveApply1.setTheme(theme);//直播主题
  130 + shyliveApply1.setPre_start_time(timestamp_start);//预计开始时间
  131 + shyliveApply1.setPre_end_time(timestamp_end);//预计结束时间
  132 + shyliveApply1.setBusiness_model(businessModel);//商务模式:0免费 1收费
  133 + shyliveApply1.setContent_property(contentProperty);//内容属性:1商业类活动 0非商业活动
  134 + shyliveApply1.setSimple_content(simpleContent);//内容简述
  135 + shyliveApply1.setPoint_key(keys);//要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
  136 + shyliveApply1.setLive_place(livePlace);//直播地点
  137 + shyliveApply1.setPush_url(pushUrl);//推流地址
  138 + shyliveApply1.setPull_url(pullUrl);//拉流地址
  139 + shyliveApply1.setPlatforms(platforms);//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
  140 + shyliveApply1.setCallback(callback);//设置回调地址
  141 + liveApplyServiceImpl.getShenheType(shyliveApply1);//获取审核类型
  142 + shyliveApply1.setReceive(0);
  143 + shyliveApply1.setShenhe_state(0);
  144 + shyliveApply1.setUpdater(null);
  145 + shyliveApply1.setAuditor(null);
  146 + shyliveApply1.setShenhe_msg(null);
  147 + shyliveApply1.setCreated_at(CommonUtils.getCurrentTime());//创建时间
  148 + shyliveApply1.setUpdated_at(CommonUtils.getCurrentTime());//更新时间
  149 +
  150 + YorN = liveApplyServiceImpl.impotLiveApply(shyliveApply1);
  151 + }
  152 +
  153 + if (YorN == true) {
  154 + result.put("errorCode", "0");
  155 + result.put("errorMessage", "直播申请审核请求收到成功");
  156 + map.put("statusCode", "200");
  157 + map.put("result", result);
  158 + } else {
  159 + result.put("errorCode", "-1");
  160 + result.put("errorMessage", "直播申请审核入库失败");
  161 + map.put("statusCode", "300");
  162 + map.put("result", result);
  163 + }
  164 + return map;
  165 + }
  166 +
  167 +}
... ...
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
... ... @@ -83,7 +83,7 @@ public class LiveControllerApi {
83 83 if (listshyLive.size() > 0) {
84 84 ShyLive shyLive = listshyLive.get(0);
85 85 //封装数据入库
86   - shylive1.setSp_id(spId);//设置spid
  86 + shyLive.setSp_id(spId);//设置spid
87 87 shyLive.setActivity_name(activityName);//设置直播活动名称
88 88 shyLive.setActivity_status(activityStatus);//设置直播活动状态
89 89 if(activityStatus==3){//发布直播
... ...
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java 0 → 100644
  1 +package com.cnlive.shenhe.controller;
  2 +
  3 +import org.apache.poi.xssf.usermodel.XSSFCell;
  4 +import org.apache.poi.xssf.usermodel.XSSFRow;
  5 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  6 +import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  7 +import com.alibaba.fastjson.JSON;
  8 +import com.alibaba.fastjson.JSONObject;
  9 +import com.cnlive.shenhe.bean.ErrorEnum;
  10 +import com.cnlive.shenhe.bean.ResponseBean;
  11 +import com.cnlive.shenhe.bean.SessionUser;
  12 +import com.cnlive.shenhe.entity.ShyLive;
  13 +import com.cnlive.shenhe.entity.ShyLiveapply;
  14 +import com.cnlive.shenhe.entity.ShySites;
  15 +import com.cnlive.shenhe.entity.ShyUsers;
  16 +import com.cnlive.shenhe.entity.ShyVideos;
  17 +import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl;
  18 +import com.cnlive.shenhe.serviceImpl.LiveServiceImpl;
  19 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  20 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  21 +import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
  22 +import com.cnlive.shenhe.utils.AuditPass;
  23 +import com.cnlive.shenhe.utils.CommonConst;
  24 +import com.cnlive.shenhe.utils.CommonUtils;
  25 +import com.github.pagehelper.PageInfo;
  26 +import org.slf4j.Logger;
  27 +import org.slf4j.LoggerFactory;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.beans.factory.annotation.Value;
  30 +import org.springframework.stereotype.Controller;
  31 +import org.springframework.ui.Model;
  32 +import org.springframework.web.bind.annotation.GetMapping;
  33 +import org.springframework.web.bind.annotation.PostMapping;
  34 +import org.springframework.web.bind.annotation.RequestMapping;
  35 +import org.springframework.web.bind.annotation.ResponseBody;
  36 +
  37 +import javax.servlet.ServletOutputStream;
  38 +import javax.servlet.http.HttpServletResponse;
  39 +import javax.servlet.http.HttpSession;
  40 +import java.io.*;
  41 +import java.util.List;
  42 +
  43 +@Controller
  44 +@RequestMapping("/liveApply")
  45 +public class LiveApplyController {
  46 + private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class);
  47 + @Autowired
  48 + AuditPass Pass;
  49 + @Autowired
  50 + VideosServiceImpl videosService;
  51 + @Autowired
  52 + UsersServiceImpl usersService;
  53 + @Autowired
  54 + SitesServiceImpl sitesService;
  55 + @Autowired
  56 + LiveServiceImpl liveService;
  57 +
  58 + @Value("${qn_domain}")
  59 + String qn_domain;
  60 +
  61 + @Value("${ks_domain}")
  62 + String ks_domain;
  63 +
  64 +
  65 + @Autowired
  66 + LiveApplyServiceImpl liveApplyServiceImpl;
  67 +
  68 + /**
  69 + * 直播申请审核信息回调接口
  70 + *
  71 + * @param activity_id 视频id
  72 + * @param state 状态码
  73 + * @param attr_tags 标签
  74 + * @param msg 备注信息
  75 + * @return
  76 + */
  77 + @PostMapping("/shenheLiveApply")
  78 + @ResponseBody
  79 + public ResponseBean shenheInfo(String ids, Integer state, String msg, HttpSession session) {
  80 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  81 + String userId = sessionUser.getUserId();
  82 + ResponseBean responseBean = new ResponseBean();
  83 + String[] shyLiveApplyIds = ids.split(",");
  84 + String showMsg = "";
  85 + for (String shyLiveApplyId : shyLiveApplyIds) {
  86 + ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId));
  87 + JSONObject result = null;
  88 + try {
  89 + result = Pass.liveApplyPass(shyLiveapply.getActivity_id(), state+2, msg, msg, shyLiveapply.getCallback());
  90 + } catch (Exception e) {
  91 + logger.error("直播视频审核失败,id==" + shyLiveApplyId, e);
  92 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
  93 + break;
  94 + }
  95 + if (result == null) {
  96 + logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveApplyId);
  97 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
  98 + break;
  99 + }
  100 + Integer code = result.getInteger("errorCode");
  101 + if (code != 0) {
  102 + logger.error("直播视频审核失败,id:{},code:{}", shyLiveApplyId, code);
  103 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " " + result.getString(" errorMessage");
  104 + break;
  105 + }
  106 + int i = liveApplyServiceImpl.updateLiveApply(Integer.parseInt(shyLiveApplyId), userId,"", state, msg);
  107 + if (i == 0) {
  108 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 更新失败";
  109 + break;
  110 + }
  111 + }
  112 + if (CommonUtils.isNotEmpty(showMsg)) {
  113 + responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
  114 + responseBean.setErrorMessage(showMsg);
  115 + }
  116 + return responseBean;
  117 + }
  118 +
  119 + /**
  120 + * 内容分页列表接口
  121 + *
  122 + * @param video_title
  123 + * @param start_date
  124 + * @param end_date
  125 + * @param state
  126 + * @param page
  127 + * @param pageSize
  128 + * @param orderByClause
  129 + * @return
  130 + */
  131 + @GetMapping("/page")
  132 + public Object getListLiveApply(Model model,String start_date,String end_date,
  133 + String theme, Integer business_model, Integer page,Integer pageSize,
  134 + Integer shenhe_state,Integer receive, String sp_desc,String orderByClause, HttpSession session) {
  135 + System.out.println("进入直播申请内容页");
  136 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  137 + if(CommonUtils.isNull(sessionUser)){
  138 + return "redirect:/users/login";
  139 + }
  140 + Integer spid = sessionUser.getSpid();
  141 + String userId = sessionUser.getUserId();
  142 + if (CommonUtils.isNull(page)) page = 1;
  143 + if (CommonUtils.isNull(pageSize)) pageSize = 10;
  144 + if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  145 + ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  146 + if(CommonUtils.isNotNull(shySite)){
  147 + spid = shySite.getSpid();
  148 + }else{
  149 + return "page/sitesError.html";
  150 + }
  151 + } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  152 + spid = null;
  153 + }
  154 + PageInfo<ShyLiveapply> liveApplyPage = liveApplyServiceImpl.getListLiveApply(theme, start_date,end_date,
  155 + business_model, page, pageSize, shenhe_state,receive, orderByClause, spid, userId);
  156 + List<ShyLiveapply> list = liveApplyPage.getList();
  157 + if (!list.isEmpty()) {
  158 + for (ShyLiveapply liveApply : list) {
  159 + if (liveApply.getShenhe_state() != CommonConst.AUDIT_INTT) {
  160 + String updater =CommonUtils.isEmpty(liveApply.getUpdater()) || "null".equals(liveApply.getUpdater())? "白名单":liveApply.getUpdater();
  161 + String auditor_id = liveApply.getAuditor();
  162 + if (CommonUtils.isNotEmpty(auditor_id)) {
  163 + ShyUsers user = new ShyUsers();
  164 + user.setUser_id(auditor_id);
  165 + user = usersService.select(user);
  166 + if (CommonUtils.isNotNull(user)) {
  167 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  168 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  169 + updater = userName;
  170 + }
  171 + }
  172 + liveApply.setUpdater(updater);
  173 + }
  174 + //显示spid简称
  175 + ShySites shySites = sitesService.findspidDescByspid(liveApply.getSp_id());
  176 + if (CommonUtils.isNotNull(shySites)) {
  177 + liveApply.setSpid_desc(shySites.getName());
  178 + }
  179 + }
  180 + }
  181 + model.addAttribute("liveApplyPage", liveApplyPage);
  182 + model.addAttribute("pageSize", pageSize);
  183 + return "page/liveApply.html";
  184 + }
  185 +
  186 + /**
  187 + * 内容详情页接口(查看)
  188 + *
  189 + * @param id
  190 + * @return
  191 + */
  192 + @GetMapping("/details")
  193 + public Object getDetailsLive(Model model, Integer id) {
  194 + ShyLiveapply shyLiveapply = liveApplyServiceImpl.getDetailsLive(id);
  195 +
  196 + //显示spid简称
  197 + ShySites shySites = sitesService.findspidDescByspid(shyLiveapply.getSp_id());
  198 + if (CommonUtils.isNotNull(shySites)) {
  199 + shyLiveapply.setSpid_desc(shySites.getName());
  200 + }
  201 +
  202 + model.addAttribute("shyLiveapply", shyLiveapply);
  203 +
  204 + return "page/liveApplyDetail.html";
  205 + }
  206 +
  207 + /**
  208 + * 认领
  209 + *
  210 + * @param ids 根据id认领
  211 + * @param num 认领条数
  212 + * @param session
  213 + * @return
  214 + */
  215 + @PostMapping("/receive")
  216 + @ResponseBody
  217 + public ResponseBean receive(String ids, Integer num, HttpSession session) {
  218 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  219 + String userId = sessionUser.getUserId();
  220 + Integer spid = sessionUser.getSpid();
  221 + //领取时要检查领取的数据是否可以领
  222 + if (CommonUtils.isNotEmpty(ids)) {
  223 + String[] cids = ids.split(",");
  224 + for (String cid : cids) {
  225 + ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(cid));
  226 + if (CommonUtils.isNotNull(shyLiveapply)) {
  227 + if (shyLiveapply.getShenhe_state() != CommonConst.RECEIVE_BEFORE ) {
  228 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容中有已被领取或者已经被审核,请检查并重试");
  229 + }
  230 + } else {
  231 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容不存在,请检查并重试");
  232 +
  233 + }
  234 + }
  235 + }
  236 + Integer n = liveApplyServiceImpl.receive(ids, num, userId, spid);
  237 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "认领到" + n + "条内容");
  238 + }
  239 +
  240 +
  241 + /**
  242 + * 退领
  243 + * @param ids
  244 + * @param session
  245 + * @return
  246 + */
  247 + @PostMapping("/retReceive")
  248 + @ResponseBody
  249 + public ResponseBean retReceive(String ids, HttpSession session) {
  250 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  251 + String userId = sessionUser.getUserId();
  252 + //在退领操作前先判断是否包含已退领或者已经审核的数据,有则退回检查并重新退领
  253 + String[] cids = ids.split(",");
  254 + for (String cid : cids) {
  255 + ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(cid));
  256 + if (shyLiveapply.getReceive() != CommonConst.RECEIVE_AFTER || !shyLiveapply.getAuditor().equals(userId)||shyLiveapply.getShenhe_state()!=CommonConst.AUDIT_INTT) {
  257 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的");
  258 + }
  259 + }
  260 + return liveApplyServiceImpl.retReceive(ids, userId);
  261 + }
  262 +
  263 + /**
  264 + * 打回(审核拒绝)
  265 + *
  266 + * @param ids
  267 + * @param msg
  268 + * @param session
  269 + * @return
  270 + */
  271 + @PostMapping("/repulse")
  272 + @ResponseBody
  273 + public ResponseBean repulse(String ids, String msg, HttpSession session) {
  274 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  275 + String userId = sessionUser.getUserId();
  276 + ResponseBean responseBean = new ResponseBean();
  277 + String[] shyLiveIds = ids.split(",");
  278 + String showMsg = "";
  279 + for (String shyLiveId : shyLiveIds) {
  280 + ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveId));
  281 + JSONObject result = null;
  282 + try {
  283 + result = Pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback());
  284 + } catch (Exception e) {
  285 + logger.error("直播视频审核失败,id==" + shyLiveId, e);
  286 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
  287 + break;
  288 + }
  289 + if (result == null) {
  290 + logger.error("直播视频审核失败且接口错误没有返回信息,id==" + shyLiveId);
  291 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
  292 + break;
  293 + }
  294 + Integer code = result.getInteger("errorCode");
  295 + if (code != 0) {
  296 + logger.error("直播视频审核失败,id:{},code:{}", shyLiveId, code);
  297 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " " + result.getString(" errorMessage");
  298 + break;
  299 + }
  300 + int i = liveService.updateLive(Integer.parseInt(shyLiveId), userId,"", 4, msg);
  301 + if (i == 0) {
  302 + showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 更新失败";
  303 + break;
  304 + }
  305 + }
  306 + if (CommonUtils.isNotEmpty(showMsg)) {
  307 + responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
  308 + responseBean.setErrorMessage(showMsg);
  309 + }
  310 + return responseBean;
  311 + }
  312 +
  313 + /**
  314 + * 同步直播云信息
  315 + *
  316 + * @param ids
  317 + * @param msg
  318 + * @param session
  319 + * @return
  320 + */
  321 + @PostMapping("/syncLive")
  322 + @ResponseBody
  323 + public ResponseBean syncLive(String ids, HttpSession session) {
  324 + logger.info("同步直播云信息接口进入");
  325 + ResponseBean responseBean = new ResponseBean();
  326 + String[] shyLiveIds = ids.split(",");
  327 + String showMsg = "";
  328 + for (String shyLiveId : shyLiveIds) {
  329 + ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
  330 + JSONObject result = null;
  331 + try {
  332 + result = Pass.syncLive(shyLive.getActivity_id());
  333 + } catch (Exception e) {
  334 + logger.error("直播云信息同步失败,id==" + shyLiveId, e);
  335 + showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败";
  336 + break;
  337 + }
  338 + if (result == null) {
  339 + logger.error("直播云信息同步失败且接口错误没有返回信息,id==" + shyLiveId);
  340 + showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败";
  341 + break;
  342 + }
  343 + Integer code = result.getInteger("errorCode");
  344 + if (code != 0) {
  345 + logger.error("直播云信息同步失败,id:{},code:{}", shyLiveId, code);
  346 + showMsg = result.getString("errorMessage");
  347 + break;
  348 + }
  349 + }
  350 + if (CommonUtils.isNotEmpty(showMsg)) {
  351 + responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
  352 + responseBean.setErrorMessage(showMsg);
  353 + }else{
  354 + showMsg="直播云信息同步成功";
  355 + responseBean.setErrorCode(ErrorEnum.SUCCESS.getErrorCode());
  356 + responseBean.setErrorMessage(showMsg);
  357 + }
  358 + return responseBean;
  359 + }
  360 +
  361 + /**
  362 + * 根据条件导出excel
  363 + */
  364 + @GetMapping("excel")
  365 + public void getExcel(String activity_id,String start_date,String end_date,
  366 + String activity_name, Integer activity_status, Integer page,Integer pageSize,
  367 + Integer shenhe_state, String orderByClause, String sp_desc, HttpSession session,HttpServletResponse response) {
  368 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  369 + Integer spid = sessionUser.getSpid();
  370 + String userId = sessionUser.getUserId();
  371 + if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  372 + ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  373 + if(CommonUtils.isNotNull(shySite)){
  374 + spid = shySite.getSpid();
  375 + }
  376 + }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  377 + spid = null;
  378 + }
  379 + List<ShyLive> liveList = liveService.findByCondition(activity_name, start_date,end_date,
  380 + activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid);
  381 +
  382 + String fileName = "直播数据";
  383 +
  384 + XSSFWorkbook wb = new XSSFWorkbook();
  385 + ServletOutputStream out = null;
  386 + BufferedInputStream bis = null;
  387 + BufferedOutputStream bos = null;
  388 + try {
  389 + XSSFSheet sheetlist = wb.createSheet(fileName);
  390 + XSSFRow row = sheetlist.createRow(0);//行
  391 + XSSFCell cell = row.createCell(0);//列
  392 + cell.setCellValue("id");
  393 + cell = row.createCell(1);//列
  394 + cell.setCellValue("sp昵称");
  395 + cell = row.createCell(2);//列
  396 + cell.setCellValue("频道_id");
  397 + cell = row.createCell(3);//列
  398 + cell.setCellValue("直播活动id");
  399 + cell = row.createCell(4);//列
  400 + cell.setCellValue("直播活动名称");
  401 + cell = row.createCell(5);//列
  402 + cell.setCellValue("直播活动状态");
  403 + cell = row.createCell(6);//列
  404 + cell.setCellValue("直播活动开始时间");
  405 + cell = row.createCell(7);//列
  406 + cell.setCellValue("直播活动结束时间");
  407 + cell = row.createCell(8);//列
  408 + cell.setCellValue("直播活动简介");
  409 + cell = row.createCell(9);//列
  410 + cell.setCellValue("审核类型");
  411 + cell = row.createCell(10);//列
  412 + cell.setCellValue("审核状态");
  413 + cell = row.createCell(11);//列
  414 + cell.setCellValue("审核员");
  415 + cell = row.createCell(12);//列
  416 + cell.setCellValue("审核信息");
  417 + cell = row.createCell(13);//列
  418 + cell.setCellValue("创建时间");
  419 + cell = row.createCell(14);//列
  420 + cell.setCellValue("最后更新时间");
  421 +
  422 + for (int i = 0; i < liveList.size(); i++) {
  423 + row = sheetlist.createRow((short) (i + 1));//行
  424 + cell = row.createCell(0);//列
  425 + cell.setCellValue(liveList.get(i).getId());
  426 + cell = row.createCell(1);//列
  427 + cell.setCellValue(sitesService.findspidDescByspid(liveList.get(i).getSp_id()).getName());
  428 + cell = row.createCell(2);//列
  429 + cell.setCellValue(liveList.get(i).getChannel_id());
  430 + cell = row.createCell(3);//列
  431 + cell.setCellValue(liveList.get(i).getActivity_id());
  432 + cell = row.createCell(4);//列
  433 + cell.setCellValue(liveList.get(i).getActivity_name());
  434 + /*状态需要处理成用户可读*/
  435 + String activityStatus = "";//直播活动状态,1:直播中,2:直播完成,3:待直播,0:直播撤销(手动),4:直播下线(强制)
  436 + if (liveList.get(i).getActivity_status() == 0) {
  437 + activityStatus = "直播撤销(手动)";
  438 + } else if (liveList.get(i).getActivity_status() == 1) {
  439 + activityStatus = "正在直播";
  440 + } else if(liveList.get(i).getActivity_status() == 2){
  441 + activityStatus = "直播完成";
  442 + }else if(liveList.get(i).getActivity_status() == 3){
  443 + activityStatus = "等待直播";
  444 + }else if(liveList.get(i).getActivity_status() == 4){
  445 + activityStatus = "直播下线(强制)";
  446 + }
  447 + cell = row.createCell(5);//列
  448 + cell.setCellValue(activityStatus);
  449 + cell = row.createCell(6);//列
  450 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "yyyy-MM-dd HH:mm:ss"));
  451 + cell = row.createCell(7);//列
  452 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "yyyy-MM-dd HH:mm:ss"));
  453 + cell = row.createCell(8);//列
  454 + cell.setCellValue(liveList.get(i).getActivity_intro());
  455 +
  456 + /*状态需要处理成用户可读*/
  457 + String shenheType = "";//审核类型,1:免审,2:机审,3:人工审
  458 + if (liveList.get(i).getShenhe_type() == 1) {
  459 + shenheType = "免审";
  460 + } else if (liveList.get(i).getShenhe_type() == 2) {
  461 + shenheType = "机审";
  462 + } else {
  463 + shenheType = "人工审";
  464 + }
  465 +
  466 + cell = row.createCell(9);//列
  467 + cell.setCellValue(shenheType);
  468 +
  469 + /*状态需要处理成用户可读*/
  470 + String shenheState = "";//审核状态 0:未认领 1.已认领,2:已审核
  471 + if (liveList.get(i).getShenhe_type() == 1) {
  472 + shenheState = "已认领";
  473 + } else if (liveList.get(i).getShenhe_type() == 2) {
  474 + shenheState = "已审核";
  475 + } else {
  476 + shenheState = "未认领";
  477 + }
  478 +
  479 + cell = row.createCell(10);//列
  480 + cell.setCellValue(shenheState);
  481 +
  482 + /* 审核员需要做处理*/
  483 + String updater = "";//审核员名字
  484 + if (liveList.get(i).getShenhe_state() != CommonConst.RECEIVE_BEFORE) {
  485 + updater = CommonUtils.isEmpty(liveList.get(i).getUpdater()) || "null".equals(liveList.get(i).getUpdater())? "自动通过":liveList.get(i).getUpdater();
  486 + String auditor_id = liveList.get(i).getAuditor();
  487 + if (CommonUtils.isNotEmpty(auditor_id)) {
  488 + ShyUsers user = new ShyUsers();
  489 + user.setUser_id(auditor_id);
  490 + user = usersService.select(user);
  491 + if (CommonUtils.isNotNull(user)) {
  492 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  493 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  494 + updater = userName ;
  495 + }
  496 + }
  497 + }
  498 +
  499 + cell = row.createCell(11);//列
  500 + cell.setCellValue(updater);
  501 + cell = row.createCell(12);//列
  502 + cell.setCellValue(liveList.get(i).getShenhe_msg());
  503 + cell = row.createCell(13);//列
  504 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm:ss"));
  505 + cell = row.createCell(14);//列
  506 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getUpdated_at(), "yyyy-MM-dd HH:mm:ss"));
  507 + }
  508 +
  509 + ByteArrayOutputStream os = new ByteArrayOutputStream();
  510 + wb.write(os);
  511 + byte[] content = os.toByteArray();
  512 + InputStream is = new ByteArrayInputStream(content);
  513 + response.setContentType("application/vnd.ms-excel;charset=utf-8");
  514 + response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1"));
  515 + out = response.getOutputStream();
  516 + bis = new BufferedInputStream(is);
  517 + bos = new BufferedOutputStream(out);
  518 + byte[] buff = new byte[2048];
  519 + int bytesRead;
  520 + while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
  521 + bos.write(buff, 0, bytesRead);
  522 + }
  523 + } catch (final Exception e) {
  524 + e.printStackTrace();
  525 + try {
  526 + if (bis != null)
  527 + bis.close();
  528 + if (bos != null)
  529 + bos.close();
  530 + } catch (Exception e1) {
  531 + e1.printStackTrace();
  532 + }
  533 + } finally {
  534 + try {
  535 + if (bis != null)
  536 + bis.close();
  537 + if (bos != null)
  538 + bos.close();
  539 + } catch (Exception e2) {
  540 + e2.printStackTrace();
  541 + }
  542 + }
  543 + }
  544 +
  545 + @PostMapping("/ceshi")
  546 + @ResponseBody
  547 + public static String ceshi(String name) {
  548 +
  549 +
  550 + return name;
  551 + }
  552 +
  553 +}
... ...
src/main/java/com/cnlive/shenhe/controller/UsersController.java
... ... @@ -131,10 +131,10 @@ public class UsersController {
131 131 shyUser =usersService.select(shyUser);
132 132 boolean isShow_chinnal=false;//是否显示频道消息框
133 133 boolean isShow_liveApply=false;//是否显示直播申请消息框
134   - if(shyUser.getNotice_show().contains("1")){
  134 + if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&&shyUser.getNotice_show().contains("1")){
135 135 isShow_chinnal=true;
136 136 }
137   - if(shyUser.getNotice_show().contains("2")){
  137 + if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&&shyUser.getNotice_show().contains("2")){
138 138 isShow_liveApply=true;
139 139 }
140 140 Map<String,Object> map=new HashMap<>();
... ...
src/main/java/com/cnlive/shenhe/entity/ShyLiveapply.java
... ... @@ -49,42 +49,42 @@ public class ShyLiveapply {
49 49 /**
50 50 * 预计开始时间
51 51 */
52   - private Date preStartTime;
  52 + private Date pre_start_time;
53 53  
54 54 /**
55 55 * 预计结束时间
56 56 */
57   - private Date preEndTime;
  57 + private Date pre_end_time;
58 58  
59 59 /**
60 60 * 商务模式:0免费 1收费
61 61 */
62   - private Integer businessModel;
  62 + private Integer business_model;
63 63  
64 64 /**
65 65 * 内容属性:1商业类活动 0非商业活动
66 66 */
67   - private Integer contentProperty;
  67 + private Integer content_property;
68 68  
69 69 /**
70 70 * 要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
71 71 */
72   - private String keys;
  72 + private String point_key;
73 73  
74 74 /**
75 75 * 直播地点
76 76 */
77   - private String livePlace;
  77 + private String live_place;
78 78  
79 79 /**
80 80 * 推流地址
81 81 */
82   - private String pushUrl;
  82 + private String push_url;
83 83  
84 84 /**
85 85 * 拉流地址
86 86 */
87   - private String pullUrl;
  87 + private String pull_url;
88 88  
89 89 /**
90 90 * 播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
... ... @@ -139,7 +139,10 @@ public class ShyLiveapply {
139 139 /**
140 140 * 内容简述
141 141 */
142   - private String simpleContent;
  142 + private String simple_content;
  143 +
  144 + @Transient
  145 + private String spid_desc;
143 146  
144 147 /**
145 148 * 获取id
... ... @@ -288,145 +291,145 @@ public class ShyLiveapply {
288 291 /**
289 292 * 获取预计开始时间
290 293 *
291   - * @return preStartTime - 预计开始时间
  294 + * @return pre_start_time - 预计开始时间
292 295 */
293   - public Date getPreStartTime() {
294   - return preStartTime;
  296 + public Date getPre_start_time() {
  297 + return pre_start_time;
295 298 }
296 299  
297 300 /**
298 301 * 设置预计开始时间
299 302 *
300   - * @param preStartTime 预计开始时间
  303 + * @param pre_start_time 预计开始时间
301 304 */
302   - public void setPreStartTime(Date preStartTime) {
303   - this.preStartTime = preStartTime;
  305 + public void setPre_start_time(Date pre_start_time) {
  306 + this.pre_start_time = pre_start_time;
304 307 }
305 308  
306 309 /**
307 310 * 获取预计结束时间
308 311 *
309   - * @return preEndTime - 预计结束时间
  312 + * @return pre_end_time - 预计结束时间
310 313 */
311   - public Date getPreEndTime() {
312   - return preEndTime;
  314 + public Date getPre_end_time() {
  315 + return pre_end_time;
313 316 }
314 317  
315 318 /**
316 319 * 设置预计结束时间
317 320 *
318   - * @param preEndTime 预计结束时间
  321 + * @param pre_end_time 预计结束时间
319 322 */
320   - public void setPreEndTime(Date preEndTime) {
321   - this.preEndTime = preEndTime;
  323 + public void setPre_end_time(Date pre_end_time) {
  324 + this.pre_end_time = pre_end_time;
322 325 }
323 326  
324 327 /**
325 328 * 获取商务模式:0免费 1收费
326 329 *
327   - * @return businessModel - 商务模式:0免费 1收费
  330 + * @return business_model - 商务模式:0免费 1收费
328 331 */
329   - public Integer getBusinessModel() {
330   - return businessModel;
  332 + public Integer getBusiness_model() {
  333 + return business_model;
331 334 }
332 335  
333 336 /**
334 337 * 设置商务模式:0免费 1收费
335 338 *
336   - * @param businessModel 商务模式:0免费 1收费
  339 + * @param business_model 商务模式:0免费 1收费
337 340 */
338   - public void setBusinessModel(Integer businessModel) {
339   - this.businessModel = businessModel;
  341 + public void setBusiness_model(Integer business_model) {
  342 + this.business_model = business_model;
340 343 }
341 344  
342 345 /**
343 346 * 获取内容属性:1商业类活动 0非商业活动
344 347 *
345   - * @return contentProperty - 内容属性:1商业类活动 0非商业活动
  348 + * @return content_property - 内容属性:1商业类活动 0非商业活动
346 349 */
347   - public Integer getContentProperty() {
348   - return contentProperty;
  350 + public Integer getContent_property() {
  351 + return content_property;
349 352 }
350 353  
351 354 /**
352 355 * 设置内容属性:1商业类活动 0非商业活动
353 356 *
354   - * @param contentProperty 内容属性:1商业类活动 0非商业活动
  357 + * @param content_property 内容属性:1商业类活动 0非商业活动
355 358 */
356   - public void setContentProperty(Integer contentProperty) {
357   - this.contentProperty = contentProperty;
  359 + public void setContent_property(Integer content_property) {
  360 + this.content_property = content_property;
358 361 }
359 362  
360 363 /**
361 364 * 获取要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
362 365 *
363   - * @return keys - 要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
  366 + * @return point_key - 要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
364 367 */
365   - public String getKeys() {
366   - return keys;
  368 + public String getPoint_key() {
  369 + return point_key;
367 370 }
368 371  
369 372 /**
370 373 * 设置要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
371 374 *
372   - * @param keys 要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
  375 + * @param point_key 要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
373 376 */
374   - public void setKeys(String keys) {
375   - this.keys = keys;
  377 + public void setPoint_key(String point_key) {
  378 + this.point_key = point_key;
376 379 }
377 380  
378 381 /**
379 382 * 获取直播地点
380 383 *
381   - * @return livePlace - 直播地点
  384 + * @return live_place - 直播地点
382 385 */
383   - public String getLivePlace() {
384   - return livePlace;
  386 + public String getLive_place() {
  387 + return live_place;
385 388 }
386 389  
387 390 /**
388 391 * 设置直播地点
389 392 *
390   - * @param livePlace 直播地点
  393 + * @param live_place 直播地点
391 394 */
392   - public void setLivePlace(String livePlace) {
393   - this.livePlace = livePlace;
  395 + public void setLive_place(String live_place) {
  396 + this.live_place = live_place;
394 397 }
395 398  
396 399 /**
397 400 * 获取推流地址
398 401 *
399   - * @return pushUrl - 推流地址
  402 + * @return push_url - 推流地址
400 403 */
401   - public String getPushUrl() {
402   - return pushUrl;
  404 + public String getPush_url() {
  405 + return push_url;
403 406 }
404 407  
405 408 /**
406 409 * 设置推流地址
407 410 *
408   - * @param pushUrl 推流地址
  411 + * @param push_url 推流地址
409 412 */
410   - public void setPushUrl(String pushUrl) {
411   - this.pushUrl = pushUrl;
  413 + public void setPush_url(String push_url) {
  414 + this.push_url = push_url;
412 415 }
413 416  
414 417 /**
415 418 * 获取拉流地址
416 419 *
417   - * @return pullUrl - 拉流地址
  420 + * @return pull_url - 拉流地址
418 421 */
419   - public String getPullUrl() {
420   - return pullUrl;
  422 + public String getPull_url() {
  423 + return pull_url;
421 424 }
422 425  
423 426 /**
424 427 * 设置拉流地址
425 428 *
426   - * @param pullUrl 拉流地址
  429 + * @param pull_url 拉流地址
427 430 */
428   - public void setPullUrl(String pullUrl) {
429   - this.pullUrl = pullUrl;
  431 + public void setPull_url(String pull_url) {
  432 + this.pull_url = pull_url;
430 433 }
431 434  
432 435 /**
... ... @@ -612,18 +615,27 @@ public class ShyLiveapply {
612 615 /**
613 616 * 获取内容简述
614 617 *
615   - * @return simpleContent - 内容简述
  618 + * @return simple_content - 内容简述
616 619 */
617   - public String getSimpleContent() {
618   - return simpleContent;
  620 + public String getSimple_content() {
  621 + return simple_content;
619 622 }
620 623  
621 624 /**
622 625 * 设置内容简述
623 626 *
624   - * @param simpleContent 内容简述
  627 + * @param simple_content 内容简述
625 628 */
626   - public void setSimpleContent(String simpleContent) {
627   - this.simpleContent = simpleContent;
  629 + public void setSimple_content(String simple_content) {
  630 + this.simple_content = simple_content;
628 631 }
  632 +
  633 + public String getSpid_desc() {
  634 + return spid_desc;
  635 + }
  636 +
  637 + public void setSpid_desc(String spid_desc) {
  638 + this.spid_desc = spid_desc;
  639 + }
  640 +
629 641 }
630 642 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONArray;
  5 +import com.alibaba.fastjson.JSONObject;
  6 +import com.cnlive.shenhe.bean.ErrorEnum;
  7 +import com.cnlive.shenhe.bean.ResponseBean;
  8 +import com.cnlive.shenhe.entity.ShyChannel;
  9 +import com.cnlive.shenhe.entity.ShyLive;
  10 +import com.cnlive.shenhe.entity.ShyLiveapply;
  11 +import com.cnlive.shenhe.entity.ShySites;
  12 +import com.cnlive.shenhe.entity.ShyUsers;
  13 +import com.cnlive.shenhe.entity.ShyUsersfree;
  14 +import com.cnlive.shenhe.entity.ShyVideofilter;
  15 +import com.cnlive.shenhe.entity.ShyVideos;
  16 +import com.cnlive.shenhe.job.VideosJob;
  17 +import com.cnlive.shenhe.mapper.ShyLiveMapper;
  18 +import com.cnlive.shenhe.mapper.ShyLiveapplyMapper;
  19 +import com.cnlive.shenhe.mapper.ShySitesMapper;
  20 +import com.cnlive.shenhe.mapper.ShyUsersMapper;
  21 +import com.cnlive.shenhe.mapper.ShyVideosMapper;
  22 +import com.cnlive.shenhe.utils.AntiFraudUtil;
  23 +import com.cnlive.shenhe.utils.AuditPass;
  24 +import com.cnlive.shenhe.utils.CommonConst;
  25 +import com.cnlive.shenhe.utils.CommonUtils;
  26 +import com.github.pagehelper.PageHelper;
  27 +import com.github.pagehelper.PageInfo;
  28 +
  29 +
  30 +import org.apache.ibatis.session.RowBounds;
  31 +import org.slf4j.Logger;
  32 +import org.slf4j.LoggerFactory;
  33 +import org.springframework.beans.factory.annotation.Autowired;
  34 +import org.springframework.beans.factory.annotation.Value;
  35 +import org.springframework.stereotype.Service;
  36 +import tk.mybatis.mapper.entity.Example;
  37 +
  38 +import java.sql.Timestamp;
  39 +import java.text.ParseException;
  40 +import java.util.ArrayList;
  41 +import java.util.Arrays;
  42 +import java.util.HashMap;
  43 +import java.util.List;
  44 +import java.util.Map;
  45 +
  46 +/**
  47 + * @Auther: liwei
  48 + * @Date: 2018/11/30 14:23
  49 + * @Description:
  50 + */
  51 +@Service
  52 +public class LiveApplyServiceImpl {
  53 + private static Logger logger = LoggerFactory.getLogger(LiveApplyServiceImpl.class);
  54 + @Autowired
  55 + ShyLiveMapper shyLiveMapper;
  56 + @Autowired
  57 + ShyLiveapplyMapper shyLiveApplyMapper;
  58 + @Autowired
  59 + ShyUsersMapper shyUsersMapper;
  60 +
  61 + @Autowired
  62 + SitesServiceImpl sitesService;
  63 +
  64 + //==============
  65 + public boolean impotLiveApply(ShyLiveapply shyLiveApply) {
  66 + int result = shyLiveApplyMapper.insertSelective(shyLiveApply);
  67 + if (result == 0) {
  68 + return false;
  69 + }
  70 + return true;
  71 + }
  72 +
  73 + //==============
  74 + public ShyLiveapply selectByPrimaryKey(Integer id) {
  75 + ShyLiveapply shyLiveApply = shyLiveApplyMapper.selectByPrimaryKey(id);
  76 + return shyLiveApply;
  77 + }
  78 +
  79 + //=============
  80 + public List<ShyLiveapply> findshyLiveApply(ShyLiveapply shyLiveApply) {
  81 + List<ShyLiveapply> shyLiveApplylist = shyLiveApplyMapper.selectByRowBounds(shyLiveApply, new RowBounds(0, 100));
  82 + return shyLiveApplylist;
  83 + }
  84 +
  85 + //==============
  86 + public boolean updateshyLiveApply(ShyLiveapply shyLiveApply) {
  87 + int i = shyLiveApplyMapper.updateByPrimaryKey(shyLiveApply);
  88 + if (i == 0) {
  89 + return false;
  90 + }
  91 + return true;
  92 + }
  93 +
  94 + //==============
  95 + public int updateLiveApply(Integer id, String auditor_id,String updater, Integer status, String msg) {
  96 + ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id);
  97 + shyLiveapply.setAuditor(auditor_id);
  98 + shyLiveapply.setShenhe_state(status);
  99 + shyLiveapply.setReceive(CommonConst.RECEIVE_AFTER);
  100 + shyLiveapply.setShenhe_msg(msg);
  101 + shyLiveapply.setUpdater(updater);
  102 + shyLiveapply.setUpdated_at(CommonUtils.getCurrentTime());
  103 + return shyLiveApplyMapper.updateByPrimaryKey(shyLiveapply);
  104 + }
  105 +
  106 + //===============
  107 + public PageInfo<ShyLiveapply> getListLiveApply(String theme, String start_date, String end_date,
  108 + Integer business_model, Integer page, Integer pageSize,
  109 + Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) {
  110 + Example example = new Example(ShyLiveapply.class);
  111 + Example.Criteria criteria = example.createCriteria();
  112 + if (CommonUtils.isNotEmpty(orderByClause)) {
  113 + example.setOrderByClause(orderByClause);
  114 + }else{
  115 + example.setOrderByClause("pre_start_time");
  116 + }
  117 + if (CommonUtils.isNotEmpty(start_date)) {
  118 + Timestamp startdate = null;
  119 + try {
  120 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  121 + } catch (ParseException e) {
  122 + e.printStackTrace();
  123 + }
  124 + criteria.andGreaterThanOrEqualTo("pre_start_time", startdate);
  125 + }
  126 + if ( CommonUtils.isNotEmpty(end_date)) {
  127 + Timestamp enddate = null;
  128 + try {
  129 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  130 + } catch (ParseException e) {
  131 + e.printStackTrace();
  132 + }
  133 + criteria.andLessThanOrEqualTo("pre_end_time", enddate);
  134 + }
  135 + if (CommonUtils.isNotEmpty(theme)) {
  136 + criteria.andLike("theme", "%" + theme + "%");
  137 + }
  138 +
  139 + if (CommonUtils.isNotNull(business_model)) {
  140 + criteria.andEqualTo("business_model", business_model);
  141 + }
  142 + if (CommonUtils.isNotNull(spid)) {
  143 + criteria.andEqualTo("sp_id", spid);
  144 + }
  145 + if (CommonUtils.isNotNull(shenhe_state)&& shenhe_state != 3) {
  146 + criteria.andEqualTo("shenhe_state", shenhe_state);
  147 + }else if(CommonUtils.isNotNull(shenhe_state)&& shenhe_state == 3){
  148 + criteria.andNotEqualTo("shenhe_state", 0);
  149 + }
  150 + if (CommonUtils.isNotNull(receive)) {
  151 + criteria.andEqualTo("receive", receive);
  152 + if(receive!=0 && CommonUtils.isNotEmpty(userId)){
  153 + criteria.andEqualTo("auditor", userId);
  154 + }
  155 + }
  156 + PageHelper.startPage(page, pageSize, true);
  157 + List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example);
  158 + PageInfo<ShyLiveapply> pageInfo = new PageInfo<>(shyLiveApplyList);
  159 + return pageInfo;
  160 + }
  161 +
  162 + //======================
  163 + public ShyLiveapply getDetailsLive(Integer id) {
  164 + ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id);
  165 + if (shyLiveapply.getShenhe_state() != CommonConst.RECEIVE_BEFORE) {
  166 + String updater = CommonUtils.isEmpty(shyLiveapply.getUpdater()) || "null".equals(shyLiveapply.getUpdater())? "自动通过":shyLiveapply.getUpdater();
  167 + String auditor_id = shyLiveapply.getAuditor();
  168 + if (CommonUtils.isNotEmpty(auditor_id)) {
  169 + ShyUsers user = new ShyUsers();
  170 + user.setUser_id(auditor_id);
  171 + user = shyUsersMapper.selectOne(user);
  172 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail())? "" : user.getEmail();
  173 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email: user.getUsername();
  174 + updater = userName;
  175 + }
  176 + shyLiveapply.setUpdater(updater);
  177 + }
  178 + return shyLiveapply;
  179 + }
  180 +
  181 + //====================
  182 + public Integer receive(String ids, Integer num, String userId, Integer spid) {
  183 + Integer n = 0;
  184 + if (CommonUtils.isNotEmpty(ids)) {
  185 + String[] cids = ids.split(",");
  186 + for (String cid : cids) {
  187 + ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(Integer.parseInt(cid));
  188 + if (CommonUtils.isNotNull(shyLiveapply) && shyLiveapply.getShenhe_state() == CommonConst.RECEIVE_BEFORE ) {
  189 + shyLiveapply.setAuditor(userId);;
  190 + shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT);
  191 + shyLiveapply.setReceive(CommonConst.RECEIVE_AFTER);
  192 + shyLiveApplyMapper.updateByPrimaryKeySelective(shyLiveapply);
  193 + n++;
  194 + }
  195 + }
  196 + } else if (CommonUtils.isNotNull(num) && num > 0) {
  197 + Example example = new Example(ShyLiveapply.class);
  198 + example.setOrderByClause("pre_start_time asc");
  199 + example.and().andEqualTo("shenhe_state", CommonConst.AUDIT_INTT);
  200 + example.and().andEqualTo("receive", CommonConst.RECEIVE_BEFORE);
  201 + if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid);
  202 + List<ShyLiveapply> shyLiveapplyList = shyLiveApplyMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num));
  203 + if (!shyLiveapplyList.isEmpty()) {
  204 + for (ShyLiveapply shyLiveapply : shyLiveapplyList) {
  205 + shyLiveapply.setAuditor(userId);
  206 + shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT);
  207 + shyLiveapply.setReceive(CommonConst.RECEIVE_AFTER);
  208 + shyLiveApplyMapper.updateByPrimaryKeySelective(shyLiveapply);
  209 + n++;
  210 + }
  211 + }
  212 + }
  213 + return n;
  214 + }
  215 +
  216 + //================
  217 + public ResponseBean retReceive(String ids, String userId) {
  218 + String[] cids = ids.split(",");
  219 + for (String cid : cids) {
  220 + ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(Integer.parseInt(cid));
  221 + if (shyLiveapply.getShenhe_state() == CommonConst.AUDIT_INTT &&shyLiveapply.getReceive() == CommonConst.RECEIVE_AFTER && shyLiveapply.getAuditor().equals(userId)) {
  222 + shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT);
  223 + shyLiveapply.setReceive(CommonConst.RECEIVE_BEFORE);
  224 + shyLiveapply.setAuditor(null);
  225 + int i = shyLiveApplyMapper.updateByPrimaryKey(shyLiveapply);
  226 + if (i != 1) {
  227 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,请重试");
  228 + }
  229 + } else {
  230 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的");
  231 + }
  232 + }
  233 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "已退领");
  234 + }
  235 +
  236 + /**
  237 + * 根据条件导出数据excel
  238 + * @return
  239 + */
  240 + public List<ShyLive> findByCondition(String activity_id,String start_date,String end_date,
  241 + String activity_name, Integer activity_status, Integer page,Integer pageSize,
  242 + Integer shenhe_state, String orderByClause, Integer spid) {
  243 + Example example = new Example(ShyLive.class);
  244 + Example.Criteria criteria = example.createCriteria();
  245 + if (CommonUtils.isNotEmpty(orderByClause)) {
  246 + example.setOrderByClause(orderByClause);
  247 + }else{
  248 + //默认排序
  249 + example.setOrderByClause("activity_start_time asc");
  250 + }
  251 + if (CommonUtils.isNotEmpty(start_date)) {
  252 + Timestamp startdate = null;
  253 + try {
  254 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm");
  255 + } catch (ParseException e) {
  256 + e.printStackTrace();
  257 + }
  258 + criteria.andGreaterThanOrEqualTo("activity_start_time", startdate);
  259 + }
  260 + if ( CommonUtils.isNotEmpty(end_date)) {
  261 + Timestamp enddate = null;
  262 + try {
  263 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm");
  264 + } catch (ParseException e) {
  265 + e.printStackTrace();
  266 + }
  267 + criteria.andLessThanOrEqualTo("activity_end_time", enddate);
  268 + }
  269 + if (CommonUtils.isNotEmpty(activity_name)) {
  270 + criteria.andLike("activity_name", "%" + activity_name + "%");
  271 + }
  272 + if (CommonUtils.isNotNull(activity_status) ) {
  273 + criteria.andEqualTo("activity_status", activity_status);
  274 + }
  275 + if (CommonUtils.isNotEmpty(activity_id)) {
  276 + criteria.andEqualTo("activity_id", activity_id);
  277 + }
  278 + if (CommonUtils.isNotNull(spid)) {
  279 + criteria.andEqualTo("spid", spid);
  280 + }
  281 + if (CommonUtils.isNotNull(shenhe_state)) {
  282 + criteria.andEqualTo("shenhe_state", shenhe_state);
  283 + }
  284 +
  285 + List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example);
  286 + return shyLiveList;
  287 + }
  288 +
  289 + /**
  290 + * 获得审核类型
  291 + * @param shyChannel
  292 + */
  293 + public void getShenheType(ShyLiveapply shyLiveApply){
  294 +
  295 + //获取直播频道免审sp
  296 + List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_LIVEAPPLY);
  297 + //初始化一个审核状态
  298 + Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
  299 + //如果当前sp是免审sp
  300 + if(sites.contains(shyLiveApply.getSp_id())){
  301 + shenheType=1;//免审
  302 + }
  303 + shyLiveApply.setShenhe_type(shenheType);
  304 + }
  305 +
  306 +
  307 +}
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
1 1 package com.cnlive.shenhe.serviceImpl;
2 2  
3   -import com.alibaba.fastjson.JSON;
4   -import com.alibaba.fastjson.JSONArray;
5   -import com.alibaba.fastjson.JSONObject;
6 3 import com.cnlive.shenhe.bean.ErrorEnum;
7 4 import com.cnlive.shenhe.bean.ResponseBean;
8 5 import com.cnlive.shenhe.entity.ShyLive;
9   -import com.cnlive.shenhe.entity.ShySites;
10 6 import com.cnlive.shenhe.entity.ShyUsers;
11   -import com.cnlive.shenhe.entity.ShyUsersfree;
12   -import com.cnlive.shenhe.entity.ShyVideofilter;
13   -import com.cnlive.shenhe.entity.ShyVideos;
14   -import com.cnlive.shenhe.job.VideosJob;
15 7 import com.cnlive.shenhe.mapper.ShyLiveMapper;
16 8 import com.cnlive.shenhe.mapper.ShySitesMapper;
17 9 import com.cnlive.shenhe.mapper.ShyUsersMapper;
18 10 import com.cnlive.shenhe.mapper.ShyVideosMapper;
19   -import com.cnlive.shenhe.utils.AntiFraudUtil;
20 11 import com.cnlive.shenhe.utils.AuditPass;
21 12 import com.cnlive.shenhe.utils.CommonConst;
22 13 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -34,11 +25,7 @@ import tk.mybatis.mapper.entity.Example;
34 25  
35 26 import java.sql.Timestamp;
36 27 import java.text.ParseException;
37   -import java.util.ArrayList;
38   -import java.util.Arrays;
39   -import java.util.HashMap;
40 28 import java.util.List;
41   -import java.util.Map;
42 29  
43 30 /**
44 31 * @Auther: chenhao
... ... @@ -49,33 +36,10 @@ import java.util.Map;
49 36 public class LiveServiceImpl {
50 37 private static Logger logger = LoggerFactory.getLogger(LiveServiceImpl.class);
51 38 @Autowired
52   - ShyVideosMapper shyVideosMapper;
53   - @Autowired
54 39 ShyLiveMapper shyLiveMapper;
55 40 @Autowired
56   - ShySitesMapper shySitesMapper;
57   - @Autowired
58 41 ShyUsersMapper shyUsersMapper;
59 42  
60   - @Autowired
61   - LiveServiceImpl videosService;
62   - @Autowired
63   - SitesServiceImpl sitesService;
64   -
65   - @Autowired
66   - UsersfreeServiceImpl usersfreeServiceImpl;
67   -
68   - @Autowired
69   - VideofilterServiceImpl videofilterServiceImpl;
70   -
71   - @Value("${qn_domain}")
72   - String qn_domain;
73   -
74   - @Value("${ks_domain}")
75   - String ks_domain;
76   -
77   - @Autowired
78   - AuditPass Pass;
79 43  
80 44 //==============
81 45 public boolean impotVideo(ShyLive shyLive) {
... ...
src/main/java/com/cnlive/shenhe/utils/AuditPass.java
... ... @@ -87,6 +87,28 @@ public class AuditPass {
87 87 }
88 88  
89 89 /**
  90 + * 直播视频回调
  91 + *
  92 + * @param activity_id
  93 + * @param state
  94 + * @param attr_tags
  95 + * @param msg
  96 + * @return
  97 + */
  98 + public JSONObject liveApplyPass(String activity_id, int state, String attr_tags, String msg, String callBack) {
  99 + logger.info("直播申请回调:id:{},state:{},attr_tags:{},exceptionMessage:{}", activity_id, state, attr_tags, msg);
  100 + JSONObject params = new JSONObject();
  101 + params.put("id", activity_id);
  102 + params.put("state", state);
  103 + params.put("attr_tags", attr_tags);
  104 + params.put("exceptionMessage", msg);
  105 + HttpUtil httpUtil = HttpUtil.init();
  106 + httpUtil.setParam("param", params.toJSONString());
  107 + Map<String, String> post = httpUtil.post(callBack);
  108 + return JSONObject.parseObject(post.get("result"));
  109 + }
  110 +
  111 + /**
90 112 * 直播云信息同步
91 113 * @param json
92 114 * @param callBack
... ...
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
... ... @@ -83,8 +83,13 @@ public class CommonConst {
83 83 */
84 84 public static Integer BUSINESS_CHANNEL = 4;
85 85  
  86 + /**
  87 + * 白名单业务:直播申请
  88 + */
  89 + public static Integer BUSINESS_LIVEAPPLY = 5;
  90 +
86 91 //白名单设置
87   - public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\"}");
  92 + public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\"}");
88 93 //通知消息设置
89 94 public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\"}");
90 95  
... ...
src/main/resources/mapper/ShyLiveapplyMapper.xml
... ... @@ -13,14 +13,14 @@
13 13 <result column="mobile" jdbcType="VARCHAR" property="mobile" />
14 14 <result column="organization" jdbcType="VARCHAR" property="organization" />
15 15 <result column="theme" jdbcType="VARCHAR" property="theme" />
16   - <result column="preStartTime" jdbcType="TIMESTAMP" property="preStartTime" />
17   - <result column="preEndTime" jdbcType="TIMESTAMP" property="preEndTime" />
18   - <result column="businessModel" jdbcType="INTEGER" property="businessModel" />
19   - <result column="contentProperty" jdbcType="INTEGER" property="contentProperty" />
20   - <result column="keys" jdbcType="VARCHAR" property="keys" />
21   - <result column="livePlace" jdbcType="VARCHAR" property="livePlace" />
22   - <result column="pushUrl" jdbcType="VARCHAR" property="pushUrl" />
23   - <result column="pullUrl" jdbcType="VARCHAR" property="pullUrl" />
  16 + <result column="pre_start_time" jdbcType="TIMESTAMP" property="pre_start_time" />
  17 + <result column="pre_end_time" jdbcType="TIMESTAMP" property="pre_end_time" />
  18 + <result column="business_model" jdbcType="INTEGER" property="business_model" />
  19 + <result column="content_property" jdbcType="INTEGER" property="content_property" />
  20 + <result column="point_key" jdbcType="VARCHAR" property="point_key" />
  21 + <result column="live_place" jdbcType="VARCHAR" property="live_place" />
  22 + <result column="push_url" jdbcType="VARCHAR" property="push_url" />
  23 + <result column="pull_url" jdbcType="VARCHAR" property="pull_url" />
24 24 <result column="platforms" jdbcType="VARCHAR" property="platforms" />
25 25 <result column="callback" jdbcType="VARCHAR" property="callback" />
26 26 <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type" />
... ... @@ -31,6 +31,6 @@
31 31 <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" />
32 32 <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
33 33 <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
34   - <result column="simpleContent" jdbcType="LONGVARCHAR" property="simpleContent" />
  34 + <result column="simple_content" jdbcType="LONGVARCHAR" property="simple_content" />
35 35 </resultMap>
36 36 </mapper>
37 37 \ No newline at end of file
... ...
src/main/resources/templates/common/frame.html
... ... @@ -79,6 +79,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
79 79 <li><a href="/comments/page?state=0&receive=0" id="/comments/page"> 评论审核</a></li>
80 80 <li><a href="/content/page?receive_status=0" id="/content/page"> 图文审核</a></li>
81 81 <li><a href="/channel/page?shenhe_status=0&receive=0" id="/channel/page"> 频道审核</a></li>
  82 + <li><a href="/liveApply/page?shenhe_state=0&receive=0" id="/liveApply/page">直播申请审核</a></li>
82 83 </ul>
83 84 </li>
84 85 <!-- <li class="treeview" th:if="${session.sessionUser.spid==0 or session.sessionUser.master}"> -->
... ...
src/main/resources/templates/page/channel.html
... ... @@ -120,11 +120,10 @@
120 120 <div class="col-md-6" style="padding: 0;width: 45%;">
121 121 <label for="start_date" class="control-label cb-toolbar">时间:</label>
122 122 <div class="input-group col-md-9 date">
123   - <input class="form-control date" name="start_date" type="text"
124   - id="start_date" >
  123 + <input class="form-control date" name="start_date" type="text" id="start_date" >
125 124 <span class="input-group-addon">
126   - <span class="glyphicon glyphicon-calendar"></span>
127   - </span>
  125 + <span class="glyphicon glyphicon-calendar"></span>
  126 + </span>
128 127 </div>
129 128 </div>
130 129 <div class="col-md-6" style="padding: 0;width: 45%;">
... ... @@ -133,8 +132,8 @@
133 132 <input class="form-control date" name="end_date" type="text"
134 133 id="end_date" >
135 134 <span class="input-group-addon">
136   - <span class="glyphicon glyphicon-calendar"></span>
137   - </span>
  135 + <span class="glyphicon glyphicon-calendar"></span>
  136 + </span>
138 137 </div>
139 138 </div>
140 139 </div>
... ...
src/main/resources/templates/page/liveApply.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +
  4 +<head th:replace="../templates/common/head::head">
  5 +</head>
  6 +
  7 +<body class="skin-blue sidebar-mini">
  8 +
  9 +<div class="wrapper">
  10 + <div th:replace="../templates/common/frame::frame"></div>
  11 + <div class="content-wrapper" style="min-height: 788px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 直播申请审核
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li>首页</li>
  18 + <li class="active">直播申请审核</li>
  19 + </ol>
  20 + </section>
  21 + <section class="content">
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <div class="box box-info">
  25 + <div class="box-body">
  26 +
  27 + <div class="btn-group margin-bottom pull-left">
  28 +<!-- <input type="hidden" name="state" id="state" value=""/> -->
  29 + <div class="btn-group margin-bottom" id="hide_select_area_2" style=>
  30 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  31 + value="2" data="claim" id="claim" data-toggle="modal"
  32 + data-target="#modal" onclick="receive(0);">认领
  33 + </button>
  34 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  35 + value="2" data="claim100" id="claim100" data-toggle="modal"
  36 + data-target="#modal" onclick="receive(10);">认领10条
  37 + </button>
  38 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  39 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  40 + data-target="#modal" onclick="receive(100);">认领100条
  41 + </button>
  42 + <button type="button" class="btn btn-warning btn-sm margin-r-5 action claim"
  43 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  44 + data-target="#modal" onclick="retReceive();">退领
  45 + </button>
  46 + <button type="button" class="btn btn-danger btn-sm margin-r-5 action claim"
  47 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  48 + data-target="#modal" onclick="repulse();">拒绝
  49 + </button>
  50 + </div>
  51 + </div>
  52 +
  53 +
  54 + <div class="btn-group margin-bottom pull-right">
  55 + <button type="button" class="btn btn-success btn-sm margin-r-5 filter "
  56 + th:onclick="'javascript:daochu()'" value="" id="excel">
  57 + 导出excel
  58 + </button>
  59 + <button type="button" class="btn btn-sm margin-r-5 filter "
  60 + th:onclick="'javascript:quanbu()'" value="" id="quanbu">
  61 + 全部
  62 + </button>
  63 + </button>
  64 + <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen"
  65 + th:onclick="'javascript:daishen()'" value="0">全部待领
  66 + </button>
  67 + <button type="button" class="btn btn-sm margin-r-5 filter " id="Mydaishen"
  68 + th:onclick="'javascript:Mydaishen()'" value="0">我的待审
  69 + </button>
  70 + <button type="button" class="btn btn-sm margin-r-5 filter " id="yishen"
  71 + th:onclick="'javascript:yishen()'" value="1">我的已审
  72 + </button>
  73 + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
  74 + onclick="openOrClose(&#39;forms&#39;)">查询
  75 + <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
  76 + </button>
  77 + </div>
  78 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;">
  79 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 18%;float: left;">
  80 + <div class="col-md-6" style="padding: 0;width: 100%;">
  81 + <label for="liveApply_theme" class="control-label cb-toolbar">直播主题:</label>
  82 + <div class="col-sm-8" style="padding: 0;">
  83 + <input class="form-control" type="text" value="" id="liveApply_theme">
  84 + </div>
  85 + </div>
  86 + </div>
  87 +
  88 + <div class="btn-group margin-bottom col-md-6" style="padding-left:10px;width: 13%;float: left;">
  89 + <div class="col-md-5" style="padding: 0;width: 100%;">
  90 + <label for="shenhe_state" class="control-label cb-toolbar">状态:</label>
  91 + <div class="col-sm-8" style="padding: 0;">
  92 + <select class="form-control" id="shenhe_state" name="shenhe_state">
  93 + <option value="">全部</option>
  94 + <option value="0">未审核</option>
  95 + <option value="1">已通过</option>
  96 + <option value="2">已拒绝</option>
  97 + </select>
  98 + </div>
  99 + </div>
  100 + </div>
  101 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 13%;float: left;">
  102 + <div class="col-md-5" style="padding: 0;width: 100%;">
  103 + <label for="business_model" class="control-label cb-toolbar">模式:</label>
  104 + <div class="col-sm-8" style="padding: 0;">
  105 + <select class="form-control" id="business_model" name="business_model">
  106 + <option value="">全部</option>
  107 + <option value="0">免费</option>
  108 + <option value="1">收费</option>
  109 + </select>
  110 + </div>
  111 + </div>
  112 + </div>
  113 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 18%;float: left;">
  114 + <div class="col-md-6" style="padding: 0;width: 100%;" th:if="${session.sessionUser.spid==0}">
  115 + <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label>
  116 + <div class="col-sm-8" style="padding: 0;">
  117 + <input class="form-control" type="text" value="" id="sp_desc">
  118 + </div>
  119 + </div>
  120 + </div>
  121 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 20%;float: left;">
  122 + <div class="col-md-12" style="padding: 0;width: 100%;">
  123 + <label for="start_date" class="control-label cb-toolbar">预计时间:</label>
  124 + <div class="input-group col-md-8 date">
  125 + <input class="form-control date" name="start_date" type="text"
  126 + id="start_date">
  127 + <span class="input-group-addon">
  128 + <span class="glyphicon glyphicon-calendar"></span>
  129 + </span>
  130 + </div>
  131 + </div>
  132 + </div>
  133 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 18%;float: left;">
  134 + <div class="col-md-9" style="padding: 0;width: 100%;">
  135 + <label for="start_date" class="control-label cb-toolbar">至</label>
  136 + <div class="input-group col-md-8 date">
  137 + <input class="form-control date" name="end_date" type="text"
  138 + id="end_date">
  139 + <span class="input-group-addon">
  140 + <span class="glyphicon glyphicon-calendar"></span>
  141 + </span>
  142 + </div>
  143 + </div>
  144 + </div>
  145 +
  146 +
  147 +<!-- <div class="btn-group margin-bottom col-md-6 pull-right" -->
  148 +<!-- style="position: relative;width: 40%;float: left !important;"> -->
  149 +<!-- <div class="col-md-12" style="width: 100%;padding: 0;"> -->
  150 +<!-- <div class="col-md-11" style="padding: 0;width: 25%;"> -->
  151 +<!-- <label for="start_date" class="control-label cb-toolbar">时间:</label> -->
  152 +<!-- <div class="input-group col-md-9 date"> -->
  153 +<!-- <input class="form-control date" name="start_date" type="text" -->
  154 +<!-- id="start_date"> -->
  155 +<!-- <span class="input-group-addon"> -->
  156 +<!-- <span class="glyphicon glyphicon-calendar"></span> -->
  157 +<!-- </span> -->
  158 +<!-- </div> -->
  159 +<!-- </div> -->
  160 +<!-- <div class="col-md-11" style="padding: 0;width: 25%;"> -->
  161 +<!-- <label for="start_date" class="control-label cb-toolbar">至</label> -->
  162 +<!-- <div class="input-group col-md-9 date"> -->
  163 +<!-- <input class="form-control date" name="end_date" type="text" -->
  164 +<!-- id="end_date"> -->
  165 +<!-- <span class="input-group-addon"> -->
  166 +<!-- <span class="glyphicon glyphicon-calendar"></span> -->
  167 +<!-- </span> -->
  168 +<!-- </div> -->
  169 +<!-- </div> -->
  170 +
  171 +
  172 +<!-- </div> -->
  173 +<!-- </div> -->
  174 + </div>
  175 +
  176 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  177 + <div class="fixed-table-body">
  178 + <table id="table" data-toggle="table" class="table table-hover table-striped"
  179 + style="margin-bottom: 0; ">
  180 + <thead>
  181 + <tr>
  182 + <th class="bs-checkbox " style="width: 5%; " data-field="state"
  183 + tabindex="0">
  184 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  185 + id="select_all">
  186 + </div>
  187 + <div class="fht-cell"></div>
  188 + </th>
  189 + <th style="text-align: center; width: 6%; " data-field="sp_id_brief"
  190 + tabindex="0">
  191 + <div class="th-inner ">sp简称</div>
  192 + <div class="fht-cell"></div>
  193 + </th>
  194 + <th style="text-align: center; width: 20%; " data-field="video_title"
  195 + tabindex="0">
  196 + <div class="th-inner ">直播主题</div>
  197 + <div class="fht-cell"></div>
  198 + </th>
  199 + <th style="text-align: center; width: 3%; " data-field="is_hot_name"
  200 + tabindex="0">
  201 + <div class="th-inner ">商务模式</div>
  202 + <div class="fht-cell"></div>
  203 + </th>
  204 + <th style="text-align: center; width: 6%; " data-field="updater"
  205 + tabindex="0">
  206 + <div class="th-inner ">审核员</div>
  207 + <div class="fht-cell"></div>
  208 + </th>
  209 + <th style="text-align: center; width: 3%; " data-field="state_name"
  210 + tabindex="0">
  211 + <div class="th-inner ">审核状态</div>
  212 + <div class="fht-cell"></div>
  213 + </th>
  214 + <th style="text-align: center; width: 3%; " data-field="state_name"
  215 + tabindex="0">
  216 + <div class="th-inner ">审核类型</div>
  217 + <div class="fht-cell"></div>
  218 + </th>
  219 + <th style="text-align: center; width: 10%; " data-field="upload_time"
  220 + tabindex="0">
  221 + <div class="th-inner ">直播申请时间</div>
  222 + <div class="fht-cell"></div>
  223 + </th>
  224 + <th style="text-align: center; width: 10%; " data-field="created_at"
  225 + tabindex="0">
  226 + <div class="th-inner ">预计开播时间</div>
  227 + <div class="fht-cell"></div>
  228 + </th>
  229 + <th style="text-align: center; width: 17%; " data-field="action"
  230 + tabindex="0">
  231 + <div class="th-inner ">操作</div>
  232 + <div class="fht-cell"></div>
  233 + </th>
  234 + </tr>
  235 + </thead>
  236 + <tbody>
  237 + <tr data-index="0" th:each="liveApply : ${liveApplyPage.list}">
  238 + <td class="bs-checkbox ">
  239 + <input data-index="0" name="btSelectItem" type="checkbox" th:value="${liveApply.id}">
  240 + </td>
  241 + <td style="text-align: center; width: 6%;" th:text="${liveApply.spid_desc}"></td>
  242 + <td style="text-align: center; width: 20%;" >
  243 + <a class="detail" th:href="@{'/liveApply/details/?id='+${liveApply.id}}">
  244 + <span th:text="${liveApply.theme}">邓建国正面PK冯小刚</span>
  245 + </a>
  246 + </td>
  247 + <td style="text-align: center; width: 3%;"
  248 + th:text="${liveApply.business_model=='1'?'收费':'免费'}">收费
  249 + </td>
  250 + <td style="text-align: center; width: 6%;" th:text="${liveApply.updater}">审核员
  251 + </td>
  252 + <td style="text-align: center; width: 3%;">
  253 + <span class="btn btn-sm btn-warning" th:if="${liveApply.shenhe_state==0}">待审</span>
  254 + <span class="btn btn-sm btn-success" th:if="${liveApply.shenhe_state==1}">通过</span>
  255 + <span class="btn btn-sm btn-danger" th:if="${liveApply.shenhe_state==2}">拒绝</span>
  256 + </td>
  257 + <td style="text-align: center; width: 3%;">
  258 + <span th:if="${liveApply.shenhe_type==1}">免审</span>
  259 + <span th:if="${liveApply.shenhe_type==2}">机审</span>
  260 + <span th:if="${liveApply.shenhe_type==3}">人工审</span>
  261 + </td>
  262 + <td style="text-align: center; width: 10%;"
  263 + th:text="${#dates.format(liveApply.created_at, 'yyyy-MM-dd HH:mm:ss')}">
  264 + 2018-03-07 16:56:20
  265 + </td>
  266 + <td style="text-align: center; width: 10%;"
  267 + th:text="${#dates.format(liveApply.pre_start_time, 'yyyy-MM-dd HH:mm:ss')}">
  268 + 2018-03-07 16:56:20
  269 + </td>
  270 + <td style="text-align: center; width: 17%;">
  271 + <a class="detail" th:href="@{'/liveApply/details/?id='+${liveApply.id}}">
  272 + <button class="btn btn-info btn-sm" >查看</button>
  273 + </a>
  274 + <span th:if="${liveApply.shenhe_state==0 and liveApply.receive==0}"> &nbsp;</span>
  275 + <a th:href="@{'javascript:applyReceive('+${liveApply.id}+')'}"
  276 + th:if="${liveApply.shenhe_state==0 and liveApply.receive==0}">
  277 + <button class="btn btn-primary btn-sm">认领</button>
  278 + </a>
  279 + <span th:if="${liveApply.shenhe_state==0 and liveApply.receive==1 and session.sessionUser.userId==liveApply.auditor}"> &nbsp;</span>
  280 + <a th:href="@{'javascript:applyRetReceive('+${liveApply.id}+')'}"
  281 + th:if="${liveApply.shenhe_state==0 and liveApply.receive==1 and session.sessionUser.userId==liveApply.auditor}">
  282 + <button class="btn btn-warning btn-sm">退领</button>
  283 + </a>
  284 + </td>
  285 + </tr>
  286 + </tbody>
  287 + </table>
  288 + </div>
  289 +
  290 +
  291 + <!--分页处理-->
  292 + <div class="fixed-table-pagination" style="display: block;">
  293 + <div class="pull-left pagination-detail">
  294 + <span class="pagination-info" th:text="'共 '+${liveApplyPage.total}+' 条记录,每页显示'">共 0 条记录</span>
  295 + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()">
  296 + <option value="10" th:selected="${pageSize==10}">10</option>
  297 + <option value="20" th:selected="${pageSize==20}">20</option>
  298 + <option value="50" th:selected="${pageSize==50}">50</option>
  299 + <option value="100" th:selected="${pageSize==100}">100</option>
  300 + </select>
  301 + <span class="pagination-info" >条记录</span>
  302 + </div>
  303 + <div class="pull-right pagination">
  304 + <ul class="pagination" th:if="${liveApplyPage.pages>1}">
  305 + <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li>
  306 + <li class="page-pre" th:if="${!liveApplyPage.isFirstPage}"><a
  307 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum-1}+'\');'">‹</a>
  308 + </li>
  309 +
  310 + <li class="page-number" th:if="${liveApplyPage.pageNum-3>=1}"><a
  311 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum-3}+'\');'"
  312 + th:text="${liveApplyPage.pageNum-3}">2</a></li>
  313 + <li class="page-number" th:if="${liveApplyPage.pageNum-2>=1}"><a
  314 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum-2}+'\');'"
  315 + th:text="${liveApplyPage.pageNum-2}">2</a></li>
  316 + <li class="page-number" th:if="${liveApplyPage.pageNum-1>=1}"><a
  317 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum-1}+'\');'"
  318 + th:text="${liveApplyPage.pageNum-1}">2</a></li>
  319 + <li class="page-number active"><a href="javaScript:void(0);"
  320 + th:text="${liveApplyPage.pageNum}">2</a></li>
  321 + <li class="page-number" th:if="${liveApplyPage.pageNum+1<=liveApplyPage.pages}"><a
  322 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum+1}+'\');'"
  323 + th:text="${liveApplyPage.pageNum+1}">2</a></li>
  324 + <li class="page-number" th:if="${liveApplyPage.pageNum+2<=liveApplyPage.pages}"><a
  325 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum+2}+'\');'"
  326 + th:text="${liveApplyPage.pageNum+2}">2</a></li>
  327 + <li class="page-number" th:if="${liveApplyPage.pageNum+3<=liveApplyPage.pages}"><a
  328 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum+3}+'\');'"
  329 + th:text="${liveApplyPage.pageNum+3}">2</a></li>
  330 +
  331 + <li class="page-next" th:if="${!liveApplyPage.isLastPage}"><a
  332 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pageNum+1}+'\');'">›</a>
  333 + </li>
  334 + <li class="page-next"><a
  335 + th:onclick="'javascript:fanye(\''+${liveApplyPage.pages}+'\');'">››</a>
  336 + </li>
  337 + </ul>
  338 + </div>
  339 + </div>
  340 + </div>
  341 + </div>
  342 + </div>
  343 + </div>
  344 + </div>
  345 + </section>
  346 + </div>
  347 + <script th:inline="javascript">
  348 + $(function () {
  349 + //按钮颜色设置
  350 + var state = [[${param.shenhe_state}]] ? [[${param.shenhe_state}]][0] : null;
  351 + var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
  352 + var stateIsNull = $.trim(state) == "";
  353 + var receiveIsNull = $.trim(receive) == "";
  354 + if (receiveIsNull) {
  355 + $("#quanbu").addClass("btn-info");
  356 + } else if (state == '0' && receive == '0') {
  357 + $("#daishen").addClass("btn-warning");
  358 + } else if (state == '0' && receive == '1') {
  359 + $("#Mydaishen").addClass("btn-success");
  360 + } else if (!stateIsNull && state != '0' && receive == '1') {
  361 + $("#yishen").addClass("btn-danger");
  362 + }
  363 +
  364 + })
  365 +
  366 + //翻页函数
  367 + function fanye(page) {
  368 + var param = location.search;
  369 + if (param.indexOf("page=") != -1) {
  370 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  371 + var split = se.split("&");
  372 + var h = "";
  373 + for (var i = 0; i < split.length; i++) {
  374 + var s = split[i];
  375 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  376 + }
  377 + h = h.substring(1, h.length);
  378 + window.location.href = "/liveApply/page?" + h + "&page=" + page;
  379 + } else {
  380 + param = param.substring(1, param.length);
  381 + window.location.href = "/liveApply/page?" + param + "&page=" + page;
  382 + }
  383 + }
  384 +
  385 + //选择每页数量触发函数
  386 + function selectPageSize(){
  387 + var pageSize=$("#pageSize").val();
  388 + var param = location.search;
  389 + if (param.indexOf("pageSize=") != -1) {
  390 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  391 + var split = se.split("&");
  392 + var h = "";
  393 + for (var i = 0; i < split.length; i++) {
  394 + var s = split[i];
  395 + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
  396 + }
  397 + h = h.substring(1, h.length);
  398 + window.location.href = "/liveApply/page?" + h + "&pageSize=" + pageSize;
  399 + } else {
  400 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  401 + var split = se.split("&");
  402 + var h = "";
  403 + for (var i = 0; i < split.length; i++) {
  404 + var s = split[i];
  405 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  406 + }
  407 + h = h.substring(1, h.length);
  408 + window.location.href = "/liveApply/page?" + h + "&pageSize=" + pageSize;
  409 + }
  410 + }
  411 +
  412 + //导出excel
  413 + function daochu() {
  414 + var param = location.search;
  415 + window.location.href = "/liveApply/excel" + param;
  416 + }
  417 +
  418 + var liveApply_theme = "";
  419 + var start_date ="";
  420 + var end_date = "";
  421 + var sp_desc ="";
  422 + var business_model = "";
  423 + var shenhe_state = "";
  424 + var count = "";
  425 +
  426 + function updateValue(){
  427 + liveApply_theme = $("#liveApply_theme").val();
  428 + start_date = $("#start_date").val();
  429 + end_date = $("#end_date").val();
  430 + shenhe_state = $("#shenhe_state").val();
  431 + business_model = $("#business_model").val();
  432 + count = $("#pageSize").val();
  433 + var spId=[[${session.sessionUser.spid}]];
  434 + if(spId==0){
  435 + sp_desc = $("#sp_desc").val();
  436 + }
  437 + }
  438 +
  439 +
  440 + //全部
  441 + function quanbu() {
  442 + updateValue();
  443 + var receive = "";
  444 + window.location.href = "/liveApply/page?theme=" + liveApply_theme + "&start_date=" + start_date + "&end_date=" + end_date + "&shenhe_state=" + shenhe_state + "&receive=" + receive + "&business_model=" + business_model + "&sp_desc=" + sp_desc+"&pageSize="+count;
  445 + }
  446 +
  447 + //全部待领
  448 + $('#daishen').click(function () {
  449 + updateValue();
  450 + if($.trim(shenhe_state) == '') shenhe_state=0;
  451 + var receive = 0;
  452 + window.location.href = "/liveApply/page?theme=" + liveApply_theme + "&start_date=" + start_date + "&end_date=" + end_date + "&shenhe_state=" + shenhe_state + "&receive=" + receive + "&business_model=" + business_model + "&sp_desc=" + sp_desc+"&pageSize="+count;
  453 + });
  454 + //我的待审核
  455 + $('#Mydaishen').click(function () {
  456 + updateValue();
  457 + var receive = 1;
  458 + if($.trim(shenhe_state) == '') shenhe_state=0;
  459 + window.location.href = "/liveApply/page?theme=" + liveApply_theme + "&start_date=" + start_date + "&end_date=" + end_date + "&shenhe_state=" + shenhe_state + "&receive=" + receive + "&business_model=" + business_model + "&sp_desc=" + sp_desc+"&pageSize="+count;
  460 + });
  461 + //我的已审核
  462 + $('#yishen').click(function () {
  463 + updateValue();
  464 + var receive = 1;
  465 + if($.trim(shenhe_state) == '') shenhe_state=3;//审核状态,3代表通过和拒绝都查询
  466 + window.location.href = "/liveApply/page?theme=" + liveApply_theme + "&start_date=" + start_date + "&end_date=" + end_date + "&shenhe_state=" + shenhe_state + "&receive=" + receive + "&business_model=" + business_model + "&sp_desc=" + sp_desc+"&pageSize="+count;
  467 + });
  468 +
  469 +
  470 + //查询
  471 + $('#videos_query').click(function () {
  472 + window.location.href = "/liveApply/page?theme=" + liveApply_theme + "&start_date=" + start_date + "&end_date=" + end_date + "&shenhe_state=" + shenhe_state + "&business_model=" + business_model + "&sp_desc=" + sp_desc+"&pageSize="+count;
  473 + });
  474 + /*全选的操作*/
  475 + $('#select_all').click(function () {
  476 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  477 + $("#select_all").prop('checked', true);
  478 + $("[name=btSelectItem]:checkbox").each(function () {
  479 + $(this).prop('checked', true);
  480 + });
  481 + } else {
  482 + $("#select_all").prop('checked', false);
  483 + $("[name=btSelectItem]:checkbox").each(function () {
  484 + $(this).prop('checked', false);
  485 + });
  486 + }
  487 + });
  488 +
  489 + /**
  490 + * 认领
  491 + */
  492 + function receive(n) {
  493 + if (n > 0) {
  494 + applyReceiveNum(n);
  495 + } else {
  496 + var rows = $("[name=btSelectItem]:checkbox:checked");
  497 + if (rows.length > 0) {
  498 + var ids = "";
  499 + rows.each(function (i, e) {
  500 + ids = ids + "," + e.value;
  501 + })
  502 + ids = ids.substring(1);
  503 + applyReceive(ids);
  504 + } else {
  505 + alert("请选择要认领的内容!");
  506 + }
  507 + }
  508 + }
  509 +
  510 + //认领选中请求
  511 + function applyReceive(ids) {
  512 + $.post("/liveApply/receive?ids=" + ids, function (data) {
  513 + if (data.errorCode == 0) {
  514 + alert(data.errorMessage);
  515 + location.href = location.href;
  516 + } else {
  517 + alert(data.errorMessage);
  518 + }
  519 + })
  520 + }
  521 +
  522 + //认领多条请求
  523 + function applyReceiveNum(num) {
  524 + $.post("/liveApply/receive?num=" + num, function (data) {
  525 + if (data.errorCode == 0) {
  526 + alert(data.errorMessage);
  527 + location.href = location.href;
  528 + } else {
  529 + alert(data.errorMessage);
  530 + }
  531 + })
  532 + }
  533 +
  534 + //退领选中内容
  535 + function retReceive() {
  536 + var rows = $("[name=btSelectItem]:checkbox:checked");
  537 + if (rows.length > 0) {
  538 + var r = confirm("您确定退领选中的" + rows.length + "条内容吗?");
  539 + if (r == true) {
  540 + var ids = "";
  541 + rows.each(function (i, e) {
  542 + ids = ids + "," + e.value;
  543 + })
  544 + ids = ids.substring(1);
  545 + applyRetReceive(ids);
  546 + }
  547 + } else {
  548 + alert("没有选中的数据!");
  549 + }
  550 + }
  551 +
  552 + //退领
  553 + function applyRetReceive(ids) {
  554 + $.post("/liveApply/retReceive?ids=" + ids, function (data) {
  555 + if (data.errorCode == 0) {
  556 + alert(data.errorMessage);
  557 + location.href = location.href;
  558 + } else {
  559 + alert(data.errorMessage);
  560 + }
  561 + })
  562 + }
  563 +
  564 + //拒绝(打回)弹窗
  565 + function repulse() {
  566 + var rows = $("[name=btSelectItem]:checkbox:checked");
  567 + if (rows.length > 0) {
  568 + var r = confirm("您确定拒绝选中的" + rows.length + "条内容吗?");
  569 + if (r == true) {
  570 + $('#msgModal').modal('show');
  571 + }
  572 + } else {
  573 + alert("没有选中的数据!");
  574 + }
  575 + }
  576 +
  577 + //批量打回
  578 + function repulseSubmit() {
  579 + var rows = $("[name=btSelectItem]:checkbox:checked");
  580 + var ids = "";
  581 + rows.each(function (i, e) {
  582 + ids = ids + "," + e.value;
  583 + })
  584 + ids = ids.substring(1);
  585 + var msg = $("#reviewMsg").val();
  586 + $.post("/liveApply/shenheLiveApply?ids=" + ids + "&msg=" + msg+"&state="+2, function (data) {
  587 + if (data.errorCode == 0) {
  588 + alert(data.errorMessage);
  589 + location.href = location.href;
  590 + } else {
  591 + alert(data.errorMessage);
  592 + }
  593 + })
  594 + }
  595 +
  596 + //批量通过
  597 + function morePass() {
  598 + var rows = $("[name=btSelectItem]:checkbox:checked");
  599 + if (rows.length > 0) {
  600 + var r = confirm("您确定通过选中的" + rows.length + "条内容吗?");
  601 + if (r == true) {
  602 + var ids = "";
  603 + rows.each(function (i, e) {
  604 + ids = ids + "," + e.value;
  605 + })
  606 + ids = ids.substring(1);
  607 + var msg ="直播申请审核通过";
  608 + $.post("/liveApply/shenheLiveApply?ids=" + ids + "&msg=" + msg+"&state="+1, function (data) {
  609 + if (data.errorCode == 0) {
  610 + alert(data.errorMessage);
  611 + location.href = location.href;
  612 + } else {
  613 + alert(data.errorMessage);
  614 + }
  615 + })
  616 + }
  617 + } else {
  618 + alert("没有选中的数据!");
  619 + }
  620 + }
  621 + </script>
  622 + <!-- 模态框(Modal) -->
  623 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  624 + <div class="modal-dialog">
  625 + <div class="modal-content" style="margin-top: 30%;">
  626 + <div class="modal-header">
  627 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  628 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  629 + </div>
  630 + <div class="modal-body">
  631 + <div class="form-group" style="margin-bottom: 0;">
  632 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  633 + </div>
  634 + <div class="form-group">
  635 + </div>
  636 + </div>
  637 + <div class="modal-footer">
  638 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  639 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  640 + </div>
  641 + </div><!-- /.modal-content -->
  642 + </div><!-- /.modal-dialog -->
  643 + </div>
  644 + <!-- /.modal -->
  645 +
  646 + <!--保留之前的样式代码-->
  647 + <script>
  648 + $('#a_down').hide();
  649 +
  650 + /*查询样式*/
  651 + function openOrClose(id_name_str) {
  652 + var id_name = '#' + id_name_str;
  653 + if ($(id_name).css('display') == 'block') {
  654 + $(id_name).slideUp(350);
  655 + $('#a_up').show();
  656 + $('#a_down').hide();
  657 + } else {
  658 + $(id_name).slideDown(350);
  659 + $('#a_up').hide();
  660 + $('#a_down').show();
  661 + }
  662 + }
  663 +
  664 + /*时间插件*/
  665 + $('.date').datetimepicker({
  666 +// format: 'YYYY-MM-DD HH:mm:ss',
  667 + format: 'YYYY-MM-DD',
  668 + locale: "zh-CN",
  669 + toolbarPlacement: 'bottom',
  670 + showClear: true,
  671 + });
  672 + </script>
  673 + <footer th:replace="../templates/common/foot::foot"></footer>
  674 + <!-- Add the sidebar's background. This div must be placed
  675 + immediately after the control sidebar -->
  676 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  677 +</div><!-- ./wrapper -->
  678 +
  679 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  680 +<script type="text/javascript">
  681 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  682 +</script>
  683 +
  684 +<!-- AdminLTE App -->
  685 +<script src="./../../static/js/app.min.js"></script>
  686 +<!-- AdminLTE for demo purposes -->
  687 +<script src="./../../static/js/sidebar.js"></script>
  688 +</body>
  689 +</html>
0 690 \ No newline at end of file
... ...
src/main/resources/templates/page/liveApplyDetail.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<head th:replace="../templates/common/head::head"></head>
  4 +
  5 +<body class="skin-blue sidebar-mini">
  6 +
  7 +<div class="wrapper">
  8 +
  9 + <div th:replace="../templates/common/frame::frame"></div>
  10 +
  11 + <div class="content-wrapper" style="min-height: 788px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 直播申请详情
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li> 首页</li>
  18 + <li class="active">直播审核</li>
  19 + </ol>
  20 + </section>
  21 +
  22 + <section class="content">
  23 + <div class="row">
  24 + <div class="col-xs-12">
  25 + <div class="box box-info">
  26 + <div class="box-body form-horizontal">
  27 + <div align="center" id="tabContents" class="tab-content">
  28 + <span style="font-size:30px;font-weight: bold;color:#F4A460;">中国网家家直播申请单</span>
  29 + <table border="1" style="background-color:#F5FFFA;width:80%;font-size:20px" id="table">
  30 + <tr align="center" valign="middle" height="40px">
  31 + <td width="25%" >直播发起人</td>
  32 + <td width="30%" colspan="2" >
  33 + <span style="color:#DC143C" th:text="${shyLiveapply.sender}">11111111111111</span>
  34 + </td>
  35 + <td width="15%">联系方式</td>
  36 + <td width="30%" colspan="2">
  37 + <span style="color:#DC143C" th:text="${shyLiveapply.mobile}">11111111111111</span>
  38 + </td>
  39 + </tr>
  40 + <tr align="center" valign="middle" height="40px">
  41 + <td >直播发起单位</td>
  42 + <td colspan="5">
  43 + <span style="color:#DC143C" th:text="${shyLiveapply.organization}">11111111111111</span>
  44 + </td>
  45 + </tr>
  46 + <tr align="center" valign="middle" height="40px">
  47 + <td >直播主题</td>
  48 + <td colspan="5">
  49 + <span style="color:#DC143C" th:text="${shyLiveapply.theme}">11111111111111</span>
  50 + </td>
  51 + </tr>
  52 + <tr align="center" valign="middle" height="40px">
  53 + <td >直播时间</td>
  54 + <td colspan="5">
  55 + <span style="color:#DC143C" th:text="${#dates.format(shyLiveapply.pre_start_time, 'yyyy-MM-dd HH:mm:ss')}">11111111111111</span>
  56 + <span>~</span>
  57 + <span style="color:#DC143C" th:text="${#dates.format(shyLiveapply.pre_end_time, 'yyyy-MM-dd HH:mm:ss')}">11111111111111</span>
  58 + </td>
  59 + </tr>
  60 + <tr align="center" valign="middle" height="40px">
  61 + <td >商务模式</td>
  62 + <td colspan="5">
  63 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${shyLiveapply.business_model==0}" disabled/>
  64 + <span th:style="${shyLiveapply.business_model==0?'color:#DC143C':''}">免费</span>
  65 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  66 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${shyLiveapply.business_model==1}" disabled/>
  67 + <span th:style="${shyLiveapply.business_model==1?'color:#DC143C':''}">收费</span>
  68 + </td>
  69 + </tr>
  70 + <tr align="center" valign="middle" height="40px">
  71 + <td >内容属性</td>
  72 + <td colspan="5">
  73 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${shyLiveapply.content_property==1}" disabled/>
  74 + <span th:style="${shyLiveapply.content_property==1?'color:#DC143C':''}">商业类活动</span>
  75 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  76 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${shyLiveapply.content_property==0}" disabled/>
  77 + <span th:style="${shyLiveapply.content_property==0?'color:#DC143C':''}">非商业类活动</span>
  78 + </td>
  79 + </tr>
  80 + <tr align="center" valign="middle" height="100px">
  81 + <td >内容简述</td>
  82 + <td colspan="5">
  83 + <span style="color:#DC143C" th:text="${shyLiveapply.simple_content}">11111111111111</span>
  84 + </td>
  85 + </tr>
  86 + <tr align="center" valign="middle" height="40px">
  87 + <td >要点报备</td>
  88 + <td colspan="5">
  89 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.point_key,'0')}" disabled/>
  90 + <span th:style="${#strings.contains(shyLiveapply.point_key,'0')?'color:#DC143C':''}">品牌植入</span>
  91 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  92 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.point_key,'1')}" disabled/>
  93 + <span th:style="${#strings.contains(shyLiveapply.point_key,'1')?'color:#DC143C':''}">广告植入</span>
  94 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  95 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.point_key,'2')}" disabled/>
  96 + <span th:style="${#strings.contains(shyLiveapply.point_key,'2')?'color:#DC143C':''}">商品推销</span>
  97 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  98 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.point_key,'3')}" disabled/>
  99 + <span th:style="${#strings.contains(shyLiveapply.point_key,'3')?'color:#DC143C':''}">网家家独家麦标</span>
  100 + </td>
  101 + </tr>
  102 + <tr align="center" valign="middle" height="40px">
  103 + <td >直播地点</td>
  104 + <td colspan="5">
  105 + <span style="color:#DC143C" th:text="${shyLiveapply.live_place}">11111111111111</span>
  106 + </td>
  107 + </tr>
  108 + <tr align="center" valign="middle" height="40px">
  109 + <td >推流地址</td>
  110 + <td colspan="5">
  111 + <span style="color:#DC143C" th:text="${shyLiveapply.push_url}">11111111111111</span>
  112 + </td>
  113 + </tr>
  114 + <tr align="center" valign="middle" height="40px">
  115 + <td >拉流地址</td>
  116 + <td colspan="5">
  117 + <span style="color:#DC143C" th:text="${shyLiveapply.pull_url}">11111111111111</span>
  118 + </td>
  119 + </tr>
  120 + <tr align="center" valign="middle" height="40px">
  121 + <td >播出平台及通道</td>
  122 + <td colspan="5">
  123 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.platforms,'0')}" disabled/>
  124 + <span th:style="${#strings.contains(shyLiveapply.platforms,'0')?'color:#DC143C':''}">网家家</span>
  125 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  126 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.platforms,'1')}" disabled/>
  127 + <span th:style="${#strings.contains(shyLiveapply.platforms,'1')?'color:#DC143C':''}">CNlive网站</span>
  128 + <span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
  129 + <input type="checkbox" style="height: 24px;width: 24px;" th:checked="${#strings.contains(shyLiveapply.platforms,'2')}" disabled/>
  130 + <span th:style="${#strings.contains(shyLiveapply.platforms,'2')?'color:#DC143C':''}">@TV互动电视</span>
  131 +<!-- <span>&nbsp;&nbsp;&nbsp;&nbsp;</span> -->
  132 +<!-- <input type="checkbox" style="height: 24px;width: 24px;" disabled/>其他平台 -->
  133 + </td>
  134 + </tr>
  135 + </table>
  136 +
  137 + <hr>
  138 + </div>
  139 +
  140 + <div class="form-group">
  141 + <input type="text" hidden="hidden" id="shyLiveapply_id" th:value="${shyLiveapply.id}">
  142 + </div>
  143 +
  144 +
  145 + <div class="box-footer">
  146 + <div class="col-sm-5">
  147 + <button type="button" class="btn btn-danger pull-right" onclick="live(2);">拒 绝
  148 + </button>
  149 + </div>
  150 +
  151 + <div class="col-sm-1" style="margin-right:26px;">
  152 + <button type="button" class="btn btn-primary pull-right" onclick="live(1);">通 过
  153 + </button>
  154 + </div>
  155 +
  156 + <div class="col-sm-1">
  157 + <button type="button" class="btn btn-info pull-right"
  158 + onclick="self.location=document.referrer;">返回列表
  159 + </button>
  160 + </div>
  161 + </div>
  162 +
  163 + <!-- 模态框(Modal) -->
  164 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  165 + <div class="modal-dialog">
  166 + <div class="modal-content" style="margin-top: 30%;">
  167 + <div class="modal-header">
  168 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  169 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  170 + </div>
  171 + <div class="modal-body">
  172 + <div class="form-group" style="margin-bottom: 0;">
  173 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  174 + </div>
  175 + <div class="form-group">
  176 + </div>
  177 + </div>
  178 + <div class="modal-footer">
  179 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  180 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  181 + </div>
  182 + </div><!-- /.modal-content -->
  183 + </div><!-- /.modal-dialog -->
  184 + </div>
  185 + <!-- /.modal -->
  186 + <script th:inline="javascript">
  187 + var liveId = [[${shyLiveapply.id}]];
  188 +
  189 + //审核操作,status=1为通过
  190 + function live(status) {
  191 + if (status == 1) {
  192 + var msg ="直播申请审核通过";
  193 + $.post("/liveApply/shenheLiveApply?ids=" + liveId + "&msg=" + msg+"&state="+1, function (data) {
  194 + if (data.errorCode == 0) {
  195 + //location.href = history.back();
  196 + alert(data.errorMessage);
  197 + self.location = document.referrer;
  198 + } else {
  199 + alert(data.errorMessage);
  200 + }
  201 + })
  202 + } else {
  203 + var r = confirm("您确定拒绝本条内容吗?");
  204 + if (r == true) {
  205 + $('#msgModal').modal('show');
  206 + }
  207 + }
  208 + }
  209 + //提交拒绝
  210 + function repulseSubmit() {
  211 + var msg = $("#reviewMsg").val();
  212 + $.post("/liveApply/shenheLiveApply?ids=" + liveId + "&msg=" + msg+"&state="+2, function (data) {
  213 + if (data.errorCode == 0) {
  214 + alert(data.errorMessage);
  215 + self.location = document.referrer;
  216 + } else {
  217 + alert(data.errorMessage);
  218 + }
  219 + })
  220 + }
  221 +
  222 + </script>
  223 +
  224 + </div>
  225 + </div>
  226 + </div>
  227 + </div>
  228 +
  229 + </section>
  230 + </div>
  231 +
  232 +
  233 + <footer th:replace="../templates/common/foot::foot"></footer>
  234 +
  235 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  236 +
  237 +</div><!-- ./wrapper -->
  238 +
  239 +<script type="text/javascript">
  240 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  241 +</script>
  242 +
  243 +<script src="../../static/js/app.min.js"></script>
  244 +<script src="../../static/js/sidebar.js"></script>
  245 +
  246 +
  247 +</body>
  248 +</html>
0 249 \ No newline at end of file
... ...