Commit a2f6e2d4623ad1273c0433f8eb7240de21178907

Authored by liwei2917
2 parents ebc3c5bd 5e3cfb54

Merge branch 'dev'

Showing 30 changed files with 1725 additions and 330 deletions
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
... ... @@ -26,8 +26,7 @@ import java.util.Map;
26 26 @RequestMapping("/api/channel")
27 27 public class ChannelControllerApi {
28 28 private static Logger logger = LoggerFactory.getLogger(ChannelControllerApi.class);
29   - @Value("${spring.localhost.url}")
30   - private String localhost_url;//本机地址
  29 +
31 30 @Autowired
32 31 AuditPass Pass;
33 32 @Autowired
... ... @@ -92,28 +91,6 @@ public class ChannelControllerApi {
92 91 }
93 92 }
94 93  
95   - /**
96   - * @Auther: liwei
97   - * @Date: 2019/08/17 11:17
98   - * @Description: 频道前台通知接口
99   - */
100   - @GetMapping("/channelNotice")
101   - @ResponseBody
102   - public Map<String,Object> channelNotice() {
103   - Map<String,Object> map=new HashMap<>();
104   - ShyChannel shyChannel = new ShyChannel();
105   - shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
106   - shyChannel.setShenhe_status(CommonConst.AUDIT_INTT);
107   - List<ShyChannel> channelList = channelService.findshyChannel(shyChannel);
108   - if (channelList.size() > 0) {
109   - logger.info("您有"+channelList.size()+"条新的频道审核申请,请注意查看!");
110   - map.put("id", "1");//第一个提示框,避免冲突
111   - map.put("title", "新频道审核通知");
112   - map.put("content","您有"+channelList.size()+"条新的频道审核申请,请注意查看!" );
113   - map.put("url",localhost_url+"/channel/page?shenhe_status=0&receive=0" );
114   - return map;
115   - }
116   - return null;
117   - }
  94 +
118 95  
119 96 }
... ...
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
... ... @@ -11,6 +11,7 @@ import com.cnlive.shenhe.entity.ShyVideos;
11 11 import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl;
12 12 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
13 13 import com.cnlive.shenhe.utils.AntiFraudUtil;
  14 +import com.cnlive.shenhe.utils.CommonConst;
14 15 import com.cnlive.shenhe.utils.CommonUtils;
15 16  
16 17 import java.sql.Timestamp;
... ... @@ -60,32 +61,25 @@ public class LiveApplyControllerApi {
60 61 String callback = json.getString("callback");//回调地址
61 62 String organization = json.getString("organization");//直播发起单位
62 63 String theme = json.getString("theme");//直播主题
63   - String startTime = json.getString("preStartTime");//预计开始时间
64 64 Integer businessModel = Integer.parseInt(json.getString("businessModel"));//商务模式:0免费 1收费
65 65 Integer contentProperty = Integer.parseInt(json.getString("contentProperty"));//内容属性:1商业类活动 0非商业活动
66 66 String simpleContent = json.getString("simpleContent");//内容简述
  67 + String live_type = json.getString("liveType");//直播类型
67 68 String keys = json.getString("keys");//要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
68 69 String livePlace = json.getString("livePlace");//直播地点
69 70 String pushUrl = json.getString("pushUrl");//推流地址
70 71 String pullUrl = json.getString("pullUrl");//拉流地址
71 72 String platforms = json.getString("platforms");//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
  73 + String startTime = json.getString("preStartTime");//预计开始时间
72 74 Date timestamp_start =null;
73   -// if (CommonUtils.isNotEmpty(startTime)) {
74   -// timestamp_start = new Timestamp(Long.valueOf(startTime));
75   -// }
76 75 if (CommonUtils.isNotEmpty(startTime)) {
77   - timestamp_start = CommonUtils.getTimestamp(startTime, "yyyy-MM-dd HH:mm:ss");
78   -
  76 + timestamp_start = new Timestamp(Long.valueOf(startTime));
79 77 }
80 78 String endTime = json.getString("preEndTime");//预计结束时间
81 79 Date timestamp_end =null;
82   -// if (CommonUtils.isNotEmpty(endTime)) {
83   -// timestamp_end = new Timestamp(Long.valueOf(endTime));
84   -// }
85 80 if (CommonUtils.isNotEmpty(endTime)) {
86   - timestamp_end = CommonUtils.getTimestamp(endTime, "yyyy-MM-dd HH:mm:ss");
87   -
88   - }
  81 + timestamp_end = new Timestamp(Long.valueOf(endTime));
  82 + }
89 83 ShyLiveapply shyliveApply1 = new ShyLiveapply();
90 84 //得到直播活动id去查询是否已有
91 85 shyliveApply1.setActivity_id(activityId);
... ... @@ -100,6 +94,7 @@ public class LiveApplyControllerApi {
100 94 shyliveApply.setMobile(mobile);//设置联系方式
101 95 shyliveApply.setOrganization(organization);//设置直播发起单位
102 96 shyliveApply.setTheme(theme);//直播主题
  97 + shyliveApply.setLive_type(live_type);//直播类型
103 98 shyliveApply.setPre_start_time(timestamp_start);//预计开始时间
104 99 shyliveApply.setPre_end_time(timestamp_end);//预计结束时间
105 100 shyliveApply.setBusiness_model(businessModel);//商务模式:0免费 1收费
... ... @@ -111,8 +106,9 @@ public class LiveApplyControllerApi {
111 106 shyliveApply.setPull_url(pullUrl);//拉流地址
112 107 shyliveApply.setPlatforms(platforms);//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
113 108 shyliveApply.setCallback(callback);//设置回调地址
114   - shyliveApply.setReceive(0);
115   - shyliveApply.setShenhe_state(0);
  109 + shyliveApply.setReceive(CommonConst.RECEIVE_BEFORE);
  110 + shyliveApply.setShenhe_state(CommonConst.AUDIT_INTT);
  111 + shyliveApply.setEmail_notice_state(CommonConst.NOTICE_INTT);
116 112 shyliveApply.setUpdater(null);
117 113 shyliveApply.setAuditor(null);
118 114 shyliveApply.setUpdated_at(CommonUtils.getCurrentTime());//更新时间
... ... @@ -127,6 +123,7 @@ public class LiveApplyControllerApi {
127 123 shyliveApply1.setMobile(mobile);//设置联系方式
128 124 shyliveApply1.setOrganization(organization);//设置直播发起单位
129 125 shyliveApply1.setTheme(theme);//直播主题
  126 + shyliveApply1.setLive_type(live_type);//直播类型
130 127 shyliveApply1.setPre_start_time(timestamp_start);//预计开始时间
131 128 shyliveApply1.setPre_end_time(timestamp_end);//预计结束时间
132 129 shyliveApply1.setBusiness_model(businessModel);//商务模式:0免费 1收费
... ... @@ -139,11 +136,13 @@ public class LiveApplyControllerApi {
139 136 shyliveApply1.setPlatforms(platforms);//播出平台及通道:0网家家 1CNLive网站 2@TV互动电视
140 137 shyliveApply1.setCallback(callback);//设置回调地址
141 138 liveApplyServiceImpl.getShenheType(shyliveApply1);//获取审核类型
142   - shyliveApply1.setReceive(0);
143   - shyliveApply1.setShenhe_state(0);
  139 + shyliveApply1.setReceive(CommonConst.RECEIVE_BEFORE);
  140 + shyliveApply1.setShenhe_state(CommonConst.AUDIT_INTT);
  141 + shyliveApply1.setEmail_notice_state(CommonConst.NOTICE_INTT);
144 142 shyliveApply1.setUpdater(null);
145 143 shyliveApply1.setAuditor(null);
146 144 shyliveApply1.setShenhe_msg(null);
  145 + shyliveApply1.setEmail_notice_msg("");
147 146 shyliveApply1.setCreated_at(CommonUtils.getCurrentTime());//创建时间
148 147 shyliveApply1.setUpdated_at(CommonUtils.getCurrentTime());//更新时间
149 148  
... ...
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
... ... @@ -55,6 +55,7 @@ public class LiveControllerApi {
55 55 String activityName = json.getString("activityName");//直播活动名称
56 56 Integer activityStatus = Integer.parseInt(json.getString("activityStatus"));//直播活动状态
57 57 String channelId = json.getString("channelId");//直播频道id
  58 + String live_type = json.getString("liveType");//直播频道id
58 59 String mp4Url = json.getString("mp4Url");//rtmp直播流
59 60 String hlsUrl = json.getString("hlsUrl");//m3u8直播流
60 61 Integer spId = Integer.parseInt(json.getString("spId"));//spid
... ... @@ -74,6 +75,17 @@ public class LiveControllerApi {
74 75 timestamp_end = new Timestamp(Long.valueOf(endTime));
75 76 }
76 77  
  78 + String pre_startTime = json.getString("preStartTime");//预计开始时间
  79 + Date pre_timestamp_start =null;
  80 + if (CommonUtils.isNotEmpty(pre_startTime)) {
  81 + pre_timestamp_start = new Timestamp(Long.valueOf(pre_startTime));
  82 + }
  83 + String pre_endTime = json.getString("preEndTime");//预计结束时间
  84 + Date pre_timestamp_end =null;
  85 + if (CommonUtils.isNotEmpty(pre_endTime)) {
  86 + pre_timestamp_end = new Timestamp(Long.valueOf(pre_endTime));
  87 + }
  88 +
77 89 ShyLive shylive1 = new ShyLive();
78 90 //得到直播活动id去查询是否已有
79 91 shylive1.setActivity_id(activityId);
... ... @@ -86,25 +98,31 @@ public class LiveControllerApi {
86 98 shyLive.setSp_id(spId);//设置spid
87 99 shyLive.setActivity_name(activityName);//设置直播活动名称
88 100 shyLive.setActivity_status(activityStatus);//设置直播活动状态
  101 + shyLive.setPre_start_time(pre_timestamp_start);
  102 + shyLive.setPre_end_time(pre_timestamp_end);
89 103 if(activityStatus==3){//发布直播
90   - shyLive.setActivity_start_time(timestamp_start);
91   - shyLive.setActivity_end_time(timestamp_end);
  104 + shyLive.setActivity_start_time(null);
  105 + shyLive.setActivity_end_time(null);
92 106 shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是
93 107 }else if(activityStatus==1){//启动直播
94 108 shyLive.setActivity_start_time(timestamp_start);
  109 + shyLive.setActivity_end_time(null);
95 110 shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是
96 111 }else if(activityStatus==2){//停止直播
  112 + shyLive.setActivity_start_time(timestamp_start);
97 113 shyLive.setActivity_end_time(timestamp_end);
98 114 shyLive.setPlayback_url(playbackUrl);//回放地址
99 115 shyLive.setShenhe_state(2);//状态 0:未认领 1.已领未审,2:已审
100 116 shyLive.setUpdater("自动通过");;//直播完成后自动通过
101 117 shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是
102 118 }else if(activityStatus==4){//审核强制下线
  119 + shyLive.setActivity_start_time(timestamp_start);
103 120 shyLive.setActivity_end_time(timestamp_end);
104 121 shyLive.setPlayback_url(playbackUrl);//回放地址
105 122 shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是
106 123 }
107 124 shyLive.setActivity_intro(activityIntro);//直播活动简介
  125 + shyLive.setLive_type(live_type);
108 126 shyLive.setM3u8_url(hlsUrl);//m3u8直播流
109 127 shyLive.setRtmp_url(mp4Url);//rtmp直播流
110 128 shyLive.setCallback(callback);//回调地址
... ... @@ -129,27 +147,30 @@ public class LiveControllerApi {
129 147 shylive1.setSp_id(spId);//设置spid
130 148 shylive1.setShenhe_state(0); //状态 0:未认领 1.已领未审,2:已审
131 149 shylive1.setIs_hot(2);//是否是热点: 1:不是 ,2: 是
  150 + shylive1.setPre_start_time(pre_timestamp_start);
  151 + shylive1.setPre_end_time(pre_timestamp_end);
132 152 if(activityStatus==3){//发布直播
133   - shylive1.setActivity_start_time(timestamp_start);
134   - shylive1.setActivity_end_time(timestamp_end);
  153 + shylive1.setActivity_start_time(null);
  154 + shylive1.setActivity_end_time(null);
135 155 }else if(activityStatus==1){//启动直播
136   - shylive1.setActivity_start_time(CommonUtils.getCurrentTime());
137   - shylive1.setActivity_end_time(timestamp_end);
  156 + shylive1.setActivity_start_time(timestamp_start);
  157 + shylive1.setActivity_end_time(null);
138 158 }else if(activityStatus==2){//停止直播
139 159 shylive1.setActivity_start_time(timestamp_start);
140   - shylive1.setActivity_end_time(CommonUtils.getCurrentTime());
  160 + shylive1.setActivity_end_time(timestamp_end);
141 161 shylive1.setPlayback_url(playbackUrl);//回放地址
142 162 shylive1.setShenhe_state(2); //状态 0:未认领 1.已领未审,2:已审
143 163 shylive1.setUpdater("自动通过");;//直播完成后自动通过
144 164 shylive1.setIs_hot(1);//是否是热点: 1:不是 ,2: 是
145 165 }else if(activityStatus==4){//审核强制下线
146 166 shylive1.setActivity_start_time(timestamp_start);
147   - shylive1.setActivity_end_time(CommonUtils.getCurrentTime());
  167 + shylive1.setActivity_end_time(timestamp_end);
148 168 shylive1.setPlayback_url(playbackUrl);//回放地址
149 169 shylive1.setShenhe_state(2); //状态 0:未认领 1.已领未审,2:已审
150 170 shylive1.setIs_hot(1);//是否是热点: 1:不是 ,2: 是
151 171 }
152 172 shylive1.setActivity_intro(activityIntro);//直播活动简介
  173 + shylive1.setLive_type(live_type);
153 174 shylive1.setM3u8_url(hlsUrl);//m3u8直播流
154 175 shylive1.setRtmp_url(mp4Url);//rtmp直播流
155 176 shylive1.setCallback(callback);//回调地址
... ...
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
... ... @@ -20,19 +20,24 @@ import com.github.pagehelper.PageInfo;
20 20 import org.slf4j.Logger;
21 21 import org.slf4j.LoggerFactory;
22 22 import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.beans.factory.annotation.Value;
23 24 import org.springframework.stereotype.Controller;
24 25 import org.springframework.ui.Model;
25 26 import org.springframework.web.bind.annotation.*;
26 27  
27 28 import javax.servlet.http.HttpSession;
28 29 import java.util.Date;
  30 +import java.util.HashMap;
29 31 import java.util.List;
  32 +import java.util.Map;
30 33  
31 34  
32 35 @Controller
33 36 @RequestMapping("/channel")
34 37 public class ChannelController {
35 38 private static Logger logger = LoggerFactory.getLogger(ChannelController.class);
  39 + @Value("${spring.localhost.url}")
  40 + private String localhost_url;//本机地址
36 41 @Autowired
37 42 AuditPass Pass;
38 43 @Autowired
... ... @@ -249,4 +254,29 @@ public class ChannelController {
249 254 }
250 255 return responseBean;
251 256 }
  257 +
  258 +
  259 + /**
  260 + * @Auther: liwei
  261 + * @Date: 2019/08/17 11:17
  262 + * @Description: 频道前台通知接口
  263 + */
  264 + @GetMapping("/channelNotice")
  265 + @ResponseBody
  266 + public Map<String,Object> channelNotice() {
  267 + Map<String,Object> map=new HashMap<>();
  268 + ShyChannel shyChannel = new ShyChannel();
  269 + shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
  270 + shyChannel.setShenhe_status(CommonConst.AUDIT_INTT);
  271 + List<ShyChannel> channelList = channelService.findshyChannel(shyChannel);
  272 + if (channelList.size() > 0) {
  273 + logger.info("您有"+channelList.size()+"条新的频道审核申请,请注意查看!");
  274 + map.put("id", "1");//第一个提示框,避免冲突
  275 + map.put("title", "新频道审核通知");
  276 + map.put("content","您有"+channelList.size()+"条新的频道审核申请,请注意查看!" );
  277 + map.put("url",localhost_url+"/channel/page?shenhe_status=0&receive=0" );
  278 + return map;
  279 + }
  280 + return null;
  281 + }
252 282 }
... ...
src/main/java/com/cnlive/shenhe/controller/EmailController.java 0 → 100644
  1 +package com.cnlive.shenhe.controller;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.bean.ErrorEnum;
  5 +import com.cnlive.shenhe.bean.ResponseBean;
  6 +import com.cnlive.shenhe.bean.SessionUser;
  7 +import com.cnlive.shenhe.entity.ShyEmail;
  8 +import com.cnlive.shenhe.entity.ShySites;
  9 +import com.cnlive.shenhe.entity.ShyUsers;
  10 +import com.cnlive.shenhe.entity.ShyUsersfree;
  11 +import com.cnlive.shenhe.serviceImpl.EmailServiceImpl;
  12 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  13 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  14 +import com.cnlive.shenhe.utils.CommonConst;
  15 +import com.cnlive.shenhe.utils.CommonUtils;
  16 +import com.github.pagehelper.PageInfo;
  17 +
  18 +import org.jasig.cas.client.authentication.AttributePrincipal;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Controller;
  21 +import org.springframework.ui.Model;
  22 +import org.springframework.web.bind.annotation.GetMapping;
  23 +import org.springframework.web.bind.annotation.PathVariable;
  24 +import org.springframework.web.bind.annotation.PostMapping;
  25 +import org.springframework.web.bind.annotation.RequestMapping;
  26 +import org.springframework.web.bind.annotation.ResponseBody;
  27 +
  28 +import java.util.HashMap;
  29 +import java.util.List;
  30 +import java.util.Map;
  31 +
  32 +import javax.print.attribute.HashAttributeSet;
  33 +import javax.servlet.http.HttpServletRequest;
  34 +import javax.servlet.http.HttpSession;
  35 +
  36 +/**
  37 + * @Auther: liwei
  38 + * @Date: 2019/08/20 14:22
  39 + * @Description:
  40 + */
  41 +@Controller
  42 +@RequestMapping("/email")
  43 +public class EmailController {
  44 +
  45 + @Autowired
  46 + EmailServiceImpl emailServiceImpl;
  47 + @Autowired
  48 + SitesServiceImpl sitesService;
  49 +
  50 + @Autowired
  51 + UsersServiceImpl usersService;
  52 +
  53 +
  54 + @GetMapping(value = "/page")
  55 + public String page(Model model, Integer page, Integer pageSize, String orderByClause,
  56 + String remark,String email, HttpSession session) {
  57 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  58 + if(CommonUtils.isNull(sessionUser)){
  59 + return "redirect:/users/login";
  60 + }
  61 + if (CommonUtils.isNull(page)) page = 1;
  62 + if (CommonUtils.isNull(pageSize)) pageSize = 10;
  63 + PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(page, pageSize, orderByClause, remark,email);
  64 + List<ShyEmail> list = emailPage.getList();
  65 + JSONObject email_message = CommonConst.EMAIL_MESSAGE;
  66 + if (!list.isEmpty()) {
  67 + for (ShyEmail shyEmail : list) {
  68 + //获取更新人的名称
  69 + String updater="";
  70 + if (CommonUtils.isNotEmpty(shyEmail.getUpdater())) {
  71 + ShyUsers user = new ShyUsers();
  72 + user.setUser_id(shyEmail.getUpdater());
  73 + user = usersService.select(user);
  74 + if (CommonUtils.isNotNull(user)) {
  75 + String email_add = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  76 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email_add : user.getUsername();
  77 + updater = userName;
  78 + }
  79 + }
  80 + shyEmail.setUpdater(updater);
  81 +
  82 + //获取邮件消息类型名称
  83 + String email_type_name=shyEmail.getNotice_type();
  84 + if(CommonUtils.isNotEmpty(email_type_name)){
  85 + for (String bkey : email_message.keySet()) {
  86 + email_type_name = email_type_name.replace(bkey, email_message.getString(bkey));
  87 + }
  88 + }else{
  89 + email_type_name="无";
  90 + }
  91 + shyEmail.setEmail_type_name(email_type_name);
  92 + }
  93 + }
  94 + model.addAttribute("emailPage", emailPage);
  95 + model.addAttribute("pageSize", pageSize);
  96 + model.addAttribute("email_message", email_message);
  97 + return "page/email.html";
  98 + }
  99 +
  100 + @PostMapping("/updateState")
  101 + @ResponseBody
  102 + public ResponseBean updateState(Integer id, Boolean isEnable, HttpSession session) {
  103 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  104 + Integer n = emailServiceImpl.updateState(id, isEnable,sessionUser.getUserId());
  105 + if(n>0){
  106 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户"+(isEnable==true?"启用":"禁用")+"成功");
  107 + }
  108 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "操作失败,请重试");
  109 + }
  110 + @PostMapping("/deleted")
  111 + @ResponseBody
  112 + public ResponseBean deleted(Integer id,HttpSession session) {
  113 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  114 + Integer n = emailServiceImpl.deleted(id, sessionUser.getUserId());
  115 + if(n>0){
  116 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "数据删除成功");
  117 + }
  118 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "操作失败,请重试");
  119 + }
  120 +
  121 +
  122 +
  123 + @PostMapping(value = "/write")
  124 + public String write(Integer id,String email,String remark, String[] write_business, HttpSession session, String redirect_url) {
  125 + if(CommonUtils.isEmpty(email)&&CommonUtils.isEmpty(remark)){
  126 + return "error.html";
  127 + }
  128 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  129 + String write = "";
  130 + if (CommonUtils.isNotNull(write_business) && write_business.length > 0) {
  131 + for (String w : write_business) {
  132 + write = write + "," + w;
  133 + }
  134 + write = write.substring(1);
  135 + }
  136 + boolean success = emailServiceImpl.update(id,email,remark,write,sessionUser.getUserId());
  137 + if (success) {
  138 + return "redirect:" + redirect_url;
  139 + } else {
  140 + return "error.html";
  141 + }
  142 + }
  143 +
  144 +}
... ...
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
... ... @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
9 9 import com.cnlive.shenhe.bean.ErrorEnum;
10 10 import com.cnlive.shenhe.bean.ResponseBean;
11 11 import com.cnlive.shenhe.bean.SessionUser;
  12 +import com.cnlive.shenhe.entity.ShyChannel;
12 13 import com.cnlive.shenhe.entity.ShyLive;
13 14 import com.cnlive.shenhe.entity.ShyLiveapply;
14 15 import com.cnlive.shenhe.entity.ShySites;
... ... @@ -38,7 +39,9 @@ import javax.servlet.ServletOutputStream;
38 39 import javax.servlet.http.HttpServletResponse;
39 40 import javax.servlet.http.HttpSession;
40 41 import java.io.*;
  42 +import java.util.HashMap;
41 43 import java.util.List;
  44 +import java.util.Map;
42 45  
43 46 @Controller
44 47 @RequestMapping("/liveApply")
... ... @@ -55,11 +58,9 @@ public class LiveApplyController {
55 58 @Autowired
56 59 LiveServiceImpl liveService;
57 60  
58   - @Value("${qn_domain}")
59   - String qn_domain;
60   -
61   - @Value("${ks_domain}")
62   - String ks_domain;
  61 +
  62 + @Value("${spring.localhost.url}")
  63 + private String localhost_url;//本机地址
63 64  
64 65  
65 66 @Autowired
... ... @@ -311,60 +312,12 @@ public class LiveApplyController {
311 312 }
312 313  
313 314 /**
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 315 * 根据条件导出excel
363 316 */
364 317 @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) {
  318 + public void getExcel(String start_date,String end_date,
  319 + String theme, Integer business_model, Integer page,Integer pageSize,
  320 + Integer shenhe_state,Integer receive, String sp_desc,String orderByClause, HttpSession session,HttpServletResponse response) {
368 321 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
369 322 Integer spid = sessionUser.getSpid();
370 323 String userId = sessionUser.getUserId();
... ... @@ -376,10 +329,10 @@ public class LiveApplyController {
376 329 }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
377 330 spid = null;
378 331 }
379   - List<ShyLive> liveList = liveService.findByCondition(activity_name, start_date,end_date,
380   - activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid);
  332 + List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findByCondition(theme, start_date,end_date,
  333 + business_model, page, pageSize, shenhe_state,receive, orderByClause, spid, userId);
381 334  
382   - String fileName = "直播数据";
  335 + String fileName = "直播申请数据";
383 336  
384 337 XSSFWorkbook wb = new XSSFWorkbook();
385 338 ServletOutputStream out = null;
... ... @@ -391,119 +344,64 @@ public class LiveApplyController {
391 344 XSSFCell cell = row.createCell(0);//列
392 345 cell.setCellValue("id");
393 346 cell = row.createCell(1);//列
394   - cell.setCellValue("sp昵称");
  347 + cell.setCellValue("直播日期");
395 348 cell = row.createCell(2);//列
396   - cell.setCellValue("频道_id");
  349 + cell.setCellValue("预计开始时间");
397 350 cell = row.createCell(3);//列
398   - cell.setCellValue("直播活动id");
  351 + cell.setCellValue("预计结束时间");
399 352 cell = row.createCell(4);//列
400   - cell.setCellValue("直播活动名称");
  353 + cell.setCellValue("直播主题");
401 354 cell = row.createCell(5);//列
402   - cell.setCellValue("直播活动状态");
  355 + cell.setCellValue("直播申请方");
403 356 cell = row.createCell(6);//列
404   - cell.setCellValue("直播活动开始时间");
  357 + cell.setCellValue("直播类型");
405 358 cell = row.createCell(7);//列
406   - cell.setCellValue("直播活动结束时间");
  359 + cell.setCellValue("直播简介");
407 360 cell = row.createCell(8);//列
408   - cell.setCellValue("直播活动简介");
  361 + cell.setCellValue("频道_id");
409 362 cell = row.createCell(9);//列
410   - cell.setCellValue("审核类型");
  363 + cell.setCellValue("直播活动id");
411 364 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 365 cell.setCellValue("创建时间");
419   - cell = row.createCell(14);//列
420   - cell.setCellValue("最后更新时间");
421 366  
422   - for (int i = 0; i < liveList.size(); i++) {
  367 + for (int i = 0; i < liveApplyList.size(); i++) {
423 368 row = sheetlist.createRow((short) (i + 1));//行
424 369 cell = row.createCell(0);//列
425   - cell.setCellValue(liveList.get(i).getId());
  370 + cell.setCellValue(liveApplyList.get(i).getId());
426 371 cell = row.createCell(1);//列
427   - cell.setCellValue(sitesService.findspidDescByspid(liveList.get(i).getSp_id()).getName());
  372 + cell.setCellValue(CommonUtils.formatDate(liveApplyList.get(i).getPre_start_time(), "yyyy/MM/dd"));
428 373 cell = row.createCell(2);//列
429   - cell.setCellValue(liveList.get(i).getChannel_id());
  374 + cell.setCellValue(CommonUtils.formatDate(liveApplyList.get(i).getPre_start_time(), "HH:mm"));
  375 + String endTime="";
  376 + long start = liveApplyList.get(i).getPre_start_time().getTime()+8*60*60*1000;
  377 + if(CommonUtils.isNull(liveApplyList.get(i).getPre_end_time())){//结束时间为空
  378 + endTime="待定";
  379 + }else{
  380 + long end = liveApplyList.get(i).getPre_end_time().getTime()+8*60*60*1000;
  381 + long count=end/(24*3600*1000)-start/(24*3600*1000);
  382 + logger.info(String.valueOf(count));
  383 + if(count==0){
  384 + endTime=CommonUtils.formatDate(liveApplyList.get(i).getPre_end_time(), "HH:mm");
  385 + }else if(count > 0){
  386 + endTime="跨"+count+"天 "+CommonUtils.formatDate(liveApplyList.get(i).getPre_end_time(), "HH:mm");
  387 + }
  388 + }
430 389 cell = row.createCell(3);//列
431   - cell.setCellValue(liveList.get(i).getActivity_id());
  390 + cell.setCellValue(endTime);
432 391 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   - }
  392 + cell.setCellValue(liveApplyList.get(i).getTheme());
447 393 cell = row.createCell(5);//列
448   - cell.setCellValue(activityStatus);
  394 + cell.setCellValue(sitesService.findspidDescByspid(liveApplyList.get(i).getSp_id()).getName());
449 395 cell = row.createCell(6);//列
450   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "yyyy-MM-dd HH:mm:ss"));
  396 + cell.setCellValue(liveApplyList.get(i).getLive_type());
451 397 cell = row.createCell(7);//列
452   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "yyyy-MM-dd HH:mm:ss"));
  398 + cell.setCellValue(liveApplyList.get(i).getSimple_content());
453 399 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   -
  400 + cell.setCellValue(liveApplyList.get(i).getChannel_id());
466 401 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   -
  402 + cell.setCellValue(liveApplyList.get(i).getActivity_id());
479 403 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"));
  404 + cell.setCellValue(CommonUtils.formatDate(liveApplyList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm"));
507 405 }
508 406  
509 407 ByteArrayOutputStream os = new ByteArrayOutputStream();
... ... @@ -541,6 +439,30 @@ public class LiveApplyController {
541 439 }
542 440 }
543 441 }
  442 +
  443 + /**
  444 + * @Auther: liwei
  445 + * @Date: 2019/11/08 11:17
  446 + * @Description: 直播申请前台通知接口
  447 + */
  448 + @GetMapping("/liveApplyNotice")
  449 + @ResponseBody
  450 + public Map<String, Object> channelNotice() {
  451 + Map<String, Object> map = new HashMap<>();
  452 + ShyLiveapply shyLiveapply = new ShyLiveapply();
  453 + shyLiveapply.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
  454 + shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT);
  455 + List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findshyLiveApply(shyLiveapply);
  456 + if (liveApplyList.size() > 0) {
  457 + logger.info("您有" + liveApplyList.size() + "条新的直播申请,请注意查看!");
  458 + map.put("id", "2");// 第二个提示框,避免冲突
  459 + map.put("title", "新直播申请通知");
  460 + map.put("content", "您有" + liveApplyList.size() + "条新的直播申请,请注意查看!");
  461 + map.put("url", localhost_url + "/liveApply/page?shenhe_state=0&receive=0");
  462 + return map;
  463 + }
  464 + return null;
  465 + }
544 466  
545 467 @PostMapping("/ceshi")
546 468 @ResponseBody
... ...
src/main/java/com/cnlive/shenhe/controller/LiveController.java
... ... @@ -362,7 +362,7 @@ public class LiveController {
362 362 spid = null;
363 363 }
364 364 List<ShyLive> liveList = liveService.findByCondition(activity_name, start_date,end_date,
365   - activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid);
  365 + activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid,userId);
366 366  
367 367 String fileName = "直播数据";
368 368  
... ... @@ -376,94 +376,64 @@ public class LiveController {
376 376 XSSFCell cell = row.createCell(0);//列
377 377 cell.setCellValue("id");
378 378 cell = row.createCell(1);//列
379   - cell.setCellValue("sp昵称");
  379 + cell.setCellValue("预计直播日期");
380 380 cell = row.createCell(2);//列
381   - cell.setCellValue("频道_id");
  381 + cell.setCellValue("预计开始时间");
382 382 cell = row.createCell(3);//列
383   - cell.setCellValue("直播活动id");
  383 + cell.setCellValue("预计结束时间");
384 384 cell = row.createCell(4);//列
385   - cell.setCellValue("直播活动名称");
  385 + cell.setCellValue("直播主题");
386 386 cell = row.createCell(5);//列
387   - cell.setCellValue("直播活动状态");
  387 + cell.setCellValue("直播申请方");
388 388 cell = row.createCell(6);//列
389   - cell.setCellValue("直播活动开始时间");
  389 + cell.setCellValue("直播类型");
390 390 cell = row.createCell(7);//列
391   - cell.setCellValue("直播活动结束时间");
  391 + cell.setCellValue("监播人");
392 392 cell = row.createCell(8);//列
393   - cell.setCellValue("直播活动简介");
  393 + cell.setCellValue("实际直播日期");
394 394 cell = row.createCell(9);//列
395   - cell.setCellValue("审核类型");
  395 + cell.setCellValue("实际开始时间");
396 396 cell = row.createCell(10);//列
397   - cell.setCellValue("审核状态");
  397 + cell.setCellValue("实际结束时间");
398 398 cell = row.createCell(11);//列
399   - cell.setCellValue("审核员");
  399 + cell.setCellValue("时长");
400 400 cell = row.createCell(12);//列
401   - cell.setCellValue("审核信息");
  401 + cell.setCellValue("备注");
402 402 cell = row.createCell(13);//列
403   - cell.setCellValue("创建时间");
404   - cell = row.createCell(14);//列
405   - cell.setCellValue("最后更新时间");
  403 + cell.setCellValue("版权来源");
406 404  
407 405 for (int i = 0; i < liveList.size(); i++) {
408 406 row = sheetlist.createRow((short) (i + 1));//行
409 407 cell = row.createCell(0);//列
410 408 cell.setCellValue(liveList.get(i).getId());
411 409 cell = row.createCell(1);//列
412   - cell.setCellValue(sitesService.findspidDescByspid(liveList.get(i).getSp_id()).getName());
  410 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getPre_start_time(), "yyyy/MM/dd"));
413 411 cell = row.createCell(2);//列
414   - cell.setCellValue(liveList.get(i).getChannel_id());
  412 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getPre_start_time(), "HH:mm"));
  413 + /*预计结束时间需要处理成用户可读*/
  414 + String pre_endTime="";
  415 + long start = liveList.get(i).getPre_start_time().getTime()+8*60*60*1000;
  416 + if(CommonUtils.isNull(liveList.get(i).getPre_end_time())){//结束时间为空
  417 + pre_endTime="待定";
  418 + }else{
  419 + long end = liveList.get(i).getPre_end_time().getTime()+8*60*60*1000;
  420 + long count=end/(24*3600*1000)-start/(24*3600*1000);
  421 + logger.info(String.valueOf(count));
  422 + if(count==0){
  423 + pre_endTime=CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm");
  424 + }else if(count > 0){
  425 + pre_endTime="跨"+count+"天 "+CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm");
  426 + }
  427 + }
415 428 cell = row.createCell(3);//列
416   - cell.setCellValue(liveList.get(i).getActivity_id());
  429 + cell.setCellValue(pre_endTime);
417 430 cell = row.createCell(4);//列
418 431 cell.setCellValue(liveList.get(i).getActivity_name());
419   - /*状态需要处理成用户可读*/
420   - String activityStatus = "";//直播活动状态,1:直播中,2:直播完成,3:待直播,0:直播撤销(手动),4:直播下线(强制)
421   - if (liveList.get(i).getActivity_status() == 0) {
422   - activityStatus = "直播撤销(手动)";
423   - } else if (liveList.get(i).getActivity_status() == 1) {
424   - activityStatus = "正在直播";
425   - } else if(liveList.get(i).getActivity_status() == 2){
426   - activityStatus = "直播完成";
427   - }else if(liveList.get(i).getActivity_status() == 3){
428   - activityStatus = "等待直播";
429   - }else if(liveList.get(i).getActivity_status() == 4){
430   - activityStatus = "直播下线(强制)";
431   - }
432 432 cell = row.createCell(5);//列
433   - cell.setCellValue(activityStatus);
  433 + cell.setCellValue(sitesService.findspidDescByspid(liveList.get(i).getSp_id()).getName());
434 434 cell = row.createCell(6);//列
435   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "yyyy-MM-dd HH:mm:ss"));
  435 + cell.setCellValue(liveList.get(i).getLive_type());
436 436 cell = row.createCell(7);//列
437   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "yyyy-MM-dd HH:mm:ss"));
438   - cell = row.createCell(8);//列
439   - cell.setCellValue(liveList.get(i).getActivity_intro());
440   -
441   - /*状态需要处理成用户可读*/
442   - String shenheType = "";//审核类型,1:免审,2:机审,3:人工审
443   - if (liveList.get(i).getShenhe_type() == 1) {
444   - shenheType = "免审";
445   - } else if (liveList.get(i).getShenhe_type() == 2) {
446   - shenheType = "机审";
447   - } else {
448   - shenheType = "人工审";
449   - }
450   -
451   - cell = row.createCell(9);//列
452   - cell.setCellValue(shenheType);
453   -
454   - /*状态需要处理成用户可读*/
455   - String shenheState = "";//审核状态 0:未认领 1.已认领,2:已审核
456   - if (liveList.get(i).getShenhe_type() == 1) {
457   - shenheState = "已认领";
458   - } else if (liveList.get(i).getShenhe_type() == 2) {
459   - shenheState = "已审核";
460   - } else {
461   - shenheState = "未认领";
462   - }
463   -
464   - cell = row.createCell(10);//列
465   - cell.setCellValue(shenheState);
466   -
467 437 /* 审核员需要做处理*/
468 438 String updater = "";//审核员名字
469 439 if (liveList.get(i).getShenhe_state() != CommonConst.RECEIVE_BEFORE) {
... ... @@ -480,15 +450,34 @@ public class LiveController {
480 450 }
481 451 }
482 452 }
483   -
484   - cell = row.createCell(11);//列
485 453 cell.setCellValue(updater);
  454 + cell = row.createCell(8);//列
  455 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "yyyy/MM/dd"));
  456 + cell = row.createCell(9);//列
  457 + cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "HH:mm"));
  458 + /*实际结束时间需要处理成用户可读*/
  459 + String Activity_endTime="";
  460 + long Activity_start = liveList.get(i).getActivity_start_time().getTime()+8*60*60*1000;
  461 + long Activity_end = liveList.get(i).getActivity_end_time().getTime()+8*60*60*1000;
  462 + long Activity_count=Activity_end/(24*3600*1000)-Activity_start/(24*3600*1000);
  463 + logger.info(String.valueOf(Activity_count));
  464 + if(Activity_count==0){
  465 + Activity_endTime=CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm");
  466 + }else if(Activity_count > 0){
  467 + Activity_endTime="跨"+Activity_count+"天 "+CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm");
  468 + }
  469 +
  470 + cell = row.createCell(10);//列
  471 + cell.setCellValue(Activity_endTime);
  472 + cell = row.createCell(11);//时长
  473 + /*时长需要处理成用户可读,单位:分钟*/
  474 + long time_length = (Activity_end-Activity_start)/(60*1000);
  475 + cell.setCellValue(time_length);
  476 +
486 477 cell = row.createCell(12);//列
487   - cell.setCellValue(liveList.get(i).getShenhe_msg());
  478 + cell.setCellValue("");
488 479 cell = row.createCell(13);//列
489   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm:ss"));
490   - cell = row.createCell(14);//列
491   - cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getUpdated_at(), "yyyy-MM-dd HH:mm:ss"));
  480 + cell.setCellValue("");
492 481 }
493 482  
494 483 ByteArrayOutputStream os = new ByteArrayOutputStream();
... ...
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
... ... @@ -104,9 +104,6 @@ public class UsersFreeController {
104 104 if(CommonUtils.isEmpty(userId)&&CommonUtils.isEmpty(userMobile)){
105 105 return "error.html";
106 106 }
107   - if(CommonUtils.isNull(write_business)){
108   - return "error.html";
109   - }
110 107 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
111 108 String write = "";
112 109 if (CommonUtils.isNotNull(write_business) && write_business.length > 0) {
... ...
src/main/java/com/cnlive/shenhe/controller/VideosController.java
... ... @@ -392,9 +392,9 @@ public class VideosController extends BaseController {
392 392 ShySites shySites = sitesService.findspidDescByspid(shyVideosList.get(i).getSpid());
393 393 if (CommonUtils.isNotNull(shySites)) {
394 394 if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&&shyVideosList.get(i).getCategory().equals(CommonConst.CATEGORY_WITNESS)){
395   - cell.setCellValue(shySites.getName()+"目击者");
  395 + cell.setCellValue(shySites.getName()+"(目击者)");
396 396 }else if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&&shyVideosList.get(i).getCategory().equals(CommonConst.CATEGORY_MOMENT)){
397   - cell.setCellValue(shySites.getName()+"朋友圈");
  397 + cell.setCellValue(shySites.getName()+"(朋友圈)");
398 398 }else{
399 399 cell.setCellValue(shySites.getName());
400 400 }
... ...
src/main/java/com/cnlive/shenhe/entity/ShyEmail.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import java.util.Date;
  4 +import javax.persistence.*;
  5 +
  6 +@Table(name = "shy_email")
  7 +public class ShyEmail {
  8 + /**
  9 + * id
  10 + */
  11 + @Id
  12 + private Integer id;
  13 +
  14 + /**
  15 + * email地址
  16 + */
  17 + private String email;
  18 +
  19 + /**
  20 + * 备注
  21 + */
  22 + private String remark;
  23 +
  24 + /**
  25 + * 通知类型,逗号分隔:1、直播申请通知
  26 + */
  27 + private String notice_type;
  28 +
  29 + /**
  30 + * 是否启用,0:未启用,1:启用
  31 + */
  32 + private Boolean is_enable;
  33 +
  34 + /**
  35 + * 是否删除,0:未删除,1:已删除
  36 + */
  37 + private Boolean is_delete;
  38 +
  39 + /**
  40 + * 更新人
  41 + */
  42 + private String updater;
  43 +
  44 + /**
  45 + * 创建时间
  46 + */
  47 + private Date created_at;
  48 +
  49 + /**
  50 + * 更新时间
  51 + */
  52 + private Date updated_at;
  53 +
  54 + @Transient
  55 + private String email_type_name;
  56 +
  57 + /**
  58 + * 获取id
  59 + *
  60 + * @return id - id
  61 + */
  62 + public Integer getId() {
  63 + return id;
  64 + }
  65 +
  66 + /**
  67 + * 设置id
  68 + *
  69 + * @param id id
  70 + */
  71 + public void setId(Integer id) {
  72 + this.id = id;
  73 + }
  74 +
  75 + /**
  76 + * 获取email地址
  77 + *
  78 + * @return email - email地址
  79 + */
  80 + public String getEmail() {
  81 + return email;
  82 + }
  83 +
  84 + /**
  85 + * 设置email地址
  86 + *
  87 + * @param email email地址
  88 + */
  89 + public void setEmail(String email) {
  90 + this.email = email;
  91 + }
  92 +
  93 + /**
  94 + * 获取备注
  95 + *
  96 + * @return remark - 备注
  97 + */
  98 + public String getRemark() {
  99 + return remark;
  100 + }
  101 +
  102 + /**
  103 + * 设置备注
  104 + *
  105 + * @param remark 备注
  106 + */
  107 + public void setRemark(String remark) {
  108 + this.remark = remark;
  109 + }
  110 +
  111 + /**
  112 + * 获取通知类型,逗号分隔:1、直播申请通知
  113 + *
  114 + * @return notice_type - 通知类型,逗号分隔:1、直播申请通知
  115 + */
  116 + public String getNotice_type() {
  117 + return notice_type;
  118 + }
  119 +
  120 + /**
  121 + * 设置通知类型,逗号分隔:1、直播申请通知
  122 + *
  123 + * @param notice_type 通知类型,逗号分隔:1、直播申请通知
  124 + */
  125 + public void setNotice_type(String notice_type) {
  126 + this.notice_type = notice_type;
  127 + }
  128 +
  129 + /**
  130 + * 获取是否启用,0:未启用,1:启用
  131 + *
  132 + * @return is_enable - 是否启用,0:未启用,1:启用
  133 + */
  134 + public Boolean getIs_enable() {
  135 + return is_enable;
  136 + }
  137 +
  138 + /**
  139 + * 设置是否启用,0:未启用,1:启用
  140 + *
  141 + * @param is_enable 是否启用,0:未启用,1:启用
  142 + */
  143 + public void setIs_enable(Boolean is_enable) {
  144 + this.is_enable = is_enable;
  145 + }
  146 +
  147 + /**
  148 + * 获取是否删除,0:未删除,1:已删除
  149 + *
  150 + * @return is_delete - 是否删除,0:未删除,1:已删除
  151 + */
  152 + public Boolean getIs_delete() {
  153 + return is_delete;
  154 + }
  155 +
  156 + /**
  157 + * 设置是否删除,0:未删除,1:已删除
  158 + *
  159 + * @param is_delete 是否删除,0:未删除,1:已删除
  160 + */
  161 + public void setIs_delete(Boolean is_delete) {
  162 + this.is_delete = is_delete;
  163 + }
  164 +
  165 + /**
  166 + * 获取更新人
  167 + *
  168 + * @return updater - 更新人
  169 + */
  170 + public String getUpdater() {
  171 + return updater;
  172 + }
  173 +
  174 + /**
  175 + * 设置更新人
  176 + *
  177 + * @param updater 更新人
  178 + */
  179 + public void setUpdater(String updater) {
  180 + this.updater = updater;
  181 + }
  182 +
  183 + /**
  184 + * 获取创建时间
  185 + *
  186 + * @return created_at - 创建时间
  187 + */
  188 + public Date getCreated_at() {
  189 + return created_at;
  190 + }
  191 +
  192 + /**
  193 + * 设置创建时间
  194 + *
  195 + * @param created_at 创建时间
  196 + */
  197 + public void setCreated_at(Date created_at) {
  198 + this.created_at = created_at;
  199 + }
  200 +
  201 + /**
  202 + * 获取更新时间
  203 + *
  204 + * @return updated_at - 更新时间
  205 + */
  206 + public Date getUpdated_at() {
  207 + return updated_at;
  208 + }
  209 +
  210 + /**
  211 + * 设置更新时间
  212 + *
  213 + * @param updated_at 更新时间
  214 + */
  215 + public void setUpdated_at(Date updated_at) {
  216 + this.updated_at = updated_at;
  217 + }
  218 +
  219 + public String getEmail_type_name() {
  220 + return email_type_name;
  221 + }
  222 +
  223 + public void setEmail_type_name(String email_type_name) {
  224 + this.email_type_name = email_type_name;
  225 + }
  226 +
  227 +
  228 +}
0 229 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/entity/ShyLive.java
... ... @@ -34,6 +34,16 @@ public class ShyLive {
34 34 private Integer activity_status;
35 35  
36 36 /**
  37 + * 预计开始时间
  38 + */
  39 + private Date pre_start_time;
  40 +
  41 + /**
  42 + * 预计结束时间
  43 + */
  44 + private Date pre_end_time;
  45 +
  46 + /**
37 47 * 直播活动开始时间
38 48 */
39 49 private Date activity_start_time;
... ... @@ -44,6 +54,11 @@ public class ShyLive {
44 54 private Date activity_end_time;
45 55  
46 56 /**
  57 + * 直播类型
  58 + */
  59 + private String live_type;
  60 +
  61 + /**
47 62 * 直播活动简介
48 63 */
49 64 private String activity_intro;
... ... @@ -245,6 +260,42 @@ public class ShyLive {
245 260 }
246 261  
247 262 /**
  263 + * 获取预计开始时间
  264 + *
  265 + * @return pre_start_time - 预计开始时间
  266 + */
  267 + public Date getPre_start_time() {
  268 + return pre_start_time;
  269 + }
  270 +
  271 + /**
  272 + * 设置预计开始时间
  273 + *
  274 + * @param pre_start_time 预计开始时间
  275 + */
  276 + public void setPre_start_time(Date pre_start_time) {
  277 + this.pre_start_time = pre_start_time;
  278 + }
  279 +
  280 + /**
  281 + * 获取预计结束时间
  282 + *
  283 + * @return pre_end_time - 预计结束时间
  284 + */
  285 + public Date getPre_end_time() {
  286 + return pre_end_time;
  287 + }
  288 +
  289 + /**
  290 + * 设置预计结束时间
  291 + *
  292 + * @param pre_end_time 预计结束时间
  293 + */
  294 + public void setPre_end_time(Date pre_end_time) {
  295 + this.pre_end_time = pre_end_time;
  296 + }
  297 +
  298 + /**
248 299 * 获取直播活动开始时间
249 300 *
250 301 * @return activity_start_time - 直播活动开始时间
... ... @@ -281,6 +332,24 @@ public class ShyLive {
281 332 }
282 333  
283 334 /**
  335 + * 获取直播类型
  336 + *
  337 + * @return live_type - 直播类型
  338 + */
  339 + public String getLive_type() {
  340 + return live_type;
  341 + }
  342 +
  343 + /**
  344 + * 设置直播类型
  345 + *
  346 + * @param live_type 直播类型
  347 + */
  348 + public void setLive_type(String live_type) {
  349 + this.live_type = live_type;
  350 + }
  351 +
  352 + /**
284 353 * 获取直播活动简介
285 354 *
286 355 * @return activity_intro - 直播活动简介
... ...
src/main/java/com/cnlive/shenhe/entity/ShyLiveapply.java
... ... @@ -47,6 +47,11 @@ public class ShyLiveapply {
47 47 private String theme;
48 48  
49 49 /**
  50 + * 直播类型
  51 + */
  52 + private String live_type;
  53 +
  54 + /**
50 55 * 预计开始时间
51 56 */
52 57 private Date pre_start_time;
... ... @@ -127,6 +132,16 @@ public class ShyLiveapply {
127 132 private String shenhe_msg;
128 133  
129 134 /**
  135 + * 邮件通知状态 1未通知 2已通知 3通知失败
  136 + */
  137 + private Integer email_notice_state;
  138 +
  139 + /**
  140 + * 邮件通知消息
  141 + */
  142 + private String email_notice_msg;
  143 +
  144 + /**
130 145 * 创建时间
131 146 */
132 147 private Date created_at;
... ... @@ -289,6 +304,24 @@ public class ShyLiveapply {
289 304 }
290 305  
291 306 /**
  307 + * 获取直播类型
  308 + *
  309 + * @return live_type - 直播类型
  310 + */
  311 + public String getLive_type() {
  312 + return live_type;
  313 + }
  314 +
  315 + /**
  316 + * 设置直播类型
  317 + *
  318 + * @param live_type 直播类型
  319 + */
  320 + public void setLive_type(String live_type) {
  321 + this.live_type = live_type;
  322 + }
  323 +
  324 + /**
292 325 * 获取预计开始时间
293 326 *
294 327 * @return pre_start_time - 预计开始时间
... ... @@ -577,6 +610,42 @@ public class ShyLiveapply {
577 610 }
578 611  
579 612 /**
  613 + * 获取邮件通知状态 1未通知 2已通知 3通知失败
  614 + *
  615 + * @return email_notice_state - 邮件通知状态 1未通知 2已通知 3通知失败
  616 + */
  617 + public Integer getEmail_notice_state() {
  618 + return email_notice_state;
  619 + }
  620 +
  621 + /**
  622 + * 设置邮件通知状态 1未通知 2已通知 3通知失败
  623 + *
  624 + * @param email_notice_state 邮件通知状态 1未通知 2已通知 3通知失败
  625 + */
  626 + public void setEmail_notice_state(Integer email_notice_state) {
  627 + this.email_notice_state = email_notice_state;
  628 + }
  629 +
  630 + /**
  631 + * 获取邮件通知消息
  632 + *
  633 + * @return email_notice_msg - 邮件通知消息
  634 + */
  635 + public String getEmail_notice_msg() {
  636 + return email_notice_msg;
  637 + }
  638 +
  639 + /**
  640 + * 设置邮件通知消息
  641 + *
  642 + * @param email_notice_msg 邮件通知消息
  643 + */
  644 + public void setEmail_notice_msg(String email_notice_msg) {
  645 + this.email_notice_msg = email_notice_msg;
  646 + }
  647 +
  648 + /**
580 649 * 获取创建时间
581 650 *
582 651 * @return created_at - 创建时间
... ...
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java 0 → 100644
  1 +package com.cnlive.shenhe.job;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.bean.ErrorEnum;
  5 +import com.cnlive.shenhe.bean.ResponseBean;
  6 +import com.cnlive.shenhe.entity.ShyChannel;
  7 +import com.cnlive.shenhe.entity.ShyComments;
  8 +import com.cnlive.shenhe.entity.ShyEmail;
  9 +import com.cnlive.shenhe.entity.ShyLiveapply;
  10 +import com.cnlive.shenhe.entity.ShyVideos;
  11 +import com.cnlive.shenhe.mapper.ShyLiveapplyMapper;
  12 +import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl;
  13 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  14 +import com.cnlive.shenhe.serviceImpl.EmailServiceImpl;
  15 +import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl;
  16 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  17 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  18 +import com.cnlive.shenhe.utils.AuditPass;
  19 +import com.cnlive.shenhe.utils.CommonConst;
  20 +import com.cnlive.shenhe.utils.CommonUtils;
  21 +import com.cnlive.shenhe.utils.HttpUtil;
  22 +import com.cnlive.shenhe.utils.InfoUtil;
  23 +import com.cnlive.shenhe.utils.OpenUtil;
  24 +
  25 +import tk.mybatis.mapper.entity.Example;
  26 +import tk.mybatis.mapper.entity.Example.Criteria;
  27 +
  28 +import org.slf4j.Logger;
  29 +import org.slf4j.LoggerFactory;
  30 +import org.springframework.beans.factory.annotation.Autowired;
  31 +import org.springframework.beans.factory.annotation.Value;
  32 +import org.springframework.scheduling.annotation.Scheduled;
  33 +import org.springframework.stereotype.Component;
  34 +
  35 +import java.util.HashMap;
  36 +import java.util.List;
  37 +import java.util.Map;
  38 +
  39 +@Component
  40 +public class LiveApplyJob {
  41 + private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class);
  42 + @Value("${spring.localhost.url}")
  43 + private String localhost_url;//本机地址
  44 + @Value("${email_app_id}")
  45 + private String email_app_id;//开发者对应的id,与app_key相对应
  46 + @Value("${email_app_key}")
  47 + private String email_app_key;//开发者帐号对应的key. 请开发者谨慎保管此值。
  48 + @Value("${email_send_URL}")
  49 + private String email_send_URL;//调用邮件发送服务器的地址
  50 +
  51 + @Autowired
  52 + SitesServiceImpl sitesService;
  53 + @Autowired
  54 + AuditPass Pass;
  55 + @Autowired
  56 + InfoUtil infoUtil;
  57 + @Autowired
  58 + LiveApplyServiceImpl liveApplyServiceImpl;
  59 + @Autowired
  60 + ShyLiveapplyMapper shyLiveApplyMapper;
  61 +
  62 + @Autowired
  63 + UsersServiceImpl usersService;
  64 + @Autowired
  65 + EmailServiceImpl emailServiceImpl;
  66 +
  67 + @Scheduled(fixedRate = 60 * 1000)
  68 + public void updateLiveApply() {
  69 +
  70 + //遍历免审的spid去更改状态值
  71 + ShyLiveapply shyLiveApply = new ShyLiveapply();
  72 + shyLiveApply.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);// 审核类型为免审
  73 + shyLiveApply.setShenhe_state(CommonConst.AUDIT_INTT);
  74 + List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findshyLiveApply(shyLiveApply);
  75 + if (liveApplyList.size() > 0) {
  76 + for (ShyLiveapply liveApply : liveApplyList) {
  77 + liveApplyServiceImpl.updateLiveApply(liveApply.getId(), "","白名单", CommonConst.AUDIT_SUCCESS,"白名单通过");
  78 + }
  79 + }
  80 + }
  81 +
  82 + /**
  83 + * 直播申请邮件通知
  84 + */
  85 + @Scheduled(fixedRate = 60 * 1000)
  86 + public void liveApplyNotice() {
  87 + Example example = new Example(ShyLiveapply.class);
  88 + Criteria criteria = example.createCriteria();
  89 + criteria.andEqualTo("shenhe_state", CommonConst.AUDIT_SUCCESS);
  90 + criteria.andNotEqualTo("email_notice_state", CommonConst.NOTICE_SUCCESS);//状态不等于已通知
  91 + List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example);
  92 + if (shyLiveApplyList.size() > 0) {
  93 + String app_id = email_app_id; //开发者对应的id,与app_key相对应
  94 + String app_key = email_app_key; //开发者帐号对应的key. 请开发者谨慎保管此值。
  95 + String URL = email_send_URL;//调用邮件发送服务器的地址
  96 + List<String> shyEmailList=emailServiceImpl.getEmailSendList(CommonConst.EMAIL_LIVEAPPLY);
  97 + logger.info("直播申请邮件通知开始,共"+shyLiveApplyList.size()+"个申请,每个申请通知"+shyEmailList.size()+"个邮箱");
  98 + for(ShyLiveapply liveApply : shyLiveApplyList){
  99 + Integer notice_state = liveApply.getEmail_notice_state();//初始化通知状态
  100 + String notice_msg = liveApply.getEmail_notice_msg();//初始化通知消息
  101 + for(String emailAddr:shyEmailList){//循环需要发送邮件的邮箱
  102 + String startTime=CommonUtils.formatDate(liveApply.getPre_start_time(), "yyyy-MM-dd HH:mm:ss");
  103 + String endTime=CommonUtils.isNotNull(liveApply.getPre_end_time())?CommonUtils.formatDate(liveApply.getPre_end_time(), "yyyy-MM-dd HH:mm:ss"):"待定";
  104 + String content = liveApply.getSender()+"__"+liveApply.getMobile()+"__"+liveApply.getOrganization()+"__"+liveApply.getTheme()+"__"+startTime+"__"+endTime+"__"+liveApply.getLive_place()+"__"+liveApply.getPush_url()+"__"+liveApply.getPull_url();
  105 + String dateTime=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss");//获取一个格式化后的当前时间
  106 +// String emailAddr = "642522156@qq.com";
  107 + String title = "新直播开播申请";
  108 + String templateId = "4017";
  109 + Map<String, String> params = new HashMap<>();
  110 + params.put("appId", app_id);
  111 + params.put("emailAddr", emailAddr);
  112 + params.put("title",title );
  113 + params.put("content", content);
  114 + params.put("templateId", templateId);
  115 + params.put("sign", OpenUtil.sign(params,app_key));
  116 + HttpUtil httpUtil = HttpUtil.init();
  117 + httpUtil.setParamMap(params);
  118 + try {
  119 + Map<String, String> post = httpUtil.post(URL);
  120 + logger.info(post.get("result"));
  121 + JSONObject result=JSONObject.parseObject(post.get("result"));
  122 + if (result == null) {
  123 + notice_state=CommonConst.NOTICE_FAIL;
  124 + notice_msg=notice_msg+","+dateTime+" 邮件服务器调用失败,result为空";
  125 + break;
  126 + }
  127 + Integer code = result.getInteger("errorCode");
  128 + if (code != 0) {
  129 + notice_state=CommonConst.NOTICE_FAIL;
  130 + notice_msg=notice_msg+","+dateTime+" 邮件服务器调用失败,result返回消息为:"+result.getString("errorMessage");
  131 + break;
  132 + }else{
  133 + notice_state=CommonConst.NOTICE_SUCCESS;
  134 + notice_msg=notice_msg+","+dateTime+" 邮件"+emailAddr+"发送成功";
  135 + }
  136 + } catch (Exception e) {
  137 + notice_state=CommonConst.NOTICE_FAIL;
  138 + notice_msg=notice_msg+","+dateTime+" 邮件服务器调用失败,服务器报错了";
  139 + break;
  140 + }
  141 + }
  142 +
  143 + liveApply.setEmail_notice_state(notice_state);
  144 + liveApply.setEmail_notice_msg(notice_msg);
  145 + liveApplyServiceImpl.updateshyLiveApply(liveApply);
  146 + }
  147 + }
  148 +
  149 + }
  150 + /**
  151 + * 自动退领
  152 + */
  153 + @Scheduled(cron="0 0 0 * * ? ")//每天0点执行
  154 + public void autoRetReceive() {
  155 + logger.info("直播申请自动退领的进入.....");
  156 + ShyLiveapply liveApply = new ShyLiveapply();
  157 + liveApply.setShenhe_state(CommonConst.AUDIT_INTT);//审核状态:未审核
  158 + liveApply.setReceive(CommonConst.RECEIVE_AFTER);//已领取
  159 + List<ShyLiveapply> shyLiveapplyList = liveApplyServiceImpl.findshyLiveApply(liveApply);
  160 + if(shyLiveapplyList.size()>0){
  161 + for (ShyLiveapply liveapply : shyLiveapplyList) {
  162 + logger.info("自动退领的liveApply_id:"+liveapply.getId());
  163 + liveapply.setReceive(CommonConst.RECEIVE_BEFORE);//未领取
  164 + liveapply.setAuditor(null);
  165 + liveApplyServiceImpl.updateshyLiveApply(liveApply);
  166 + }
  167 + }
  168 + }
  169 +
  170 +}
... ...
src/main/java/com/cnlive/shenhe/mapper/ShyEmailMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyEmail;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface ShyEmailMapper extends Mapper<ShyEmail> {
  7 +}
0 8 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/EmailServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.entity.ShyEmail;
  5 +import com.cnlive.shenhe.entity.ShySites;
  6 +import com.cnlive.shenhe.entity.ShyUsers;
  7 +import com.cnlive.shenhe.entity.ShyUsersfree;
  8 +import com.cnlive.shenhe.mapper.ShyEmailMapper;
  9 +import com.cnlive.shenhe.mapper.ShyUsersMapper;
  10 +import com.cnlive.shenhe.mapper.ShyUsersfreeMapper;
  11 +import com.cnlive.shenhe.utils.AuditPass;
  12 +import com.cnlive.shenhe.utils.CommonUtils;
  13 +import com.github.pagehelper.PageHelper;
  14 +import com.github.pagehelper.PageInfo;
  15 +
  16 +import java.util.ArrayList;
  17 +import java.util.Arrays;
  18 +import java.util.List;
  19 +
  20 +import org.slf4j.Logger;
  21 +import org.slf4j.LoggerFactory;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.stereotype.Service;
  24 +import tk.mybatis.mapper.entity.Example;
  25 +
  26 +/**
  27 + * @Auther: 周伟鹏
  28 + * @Date: 2018/11/29 14:23
  29 + * @Description:
  30 + */
  31 +@Service
  32 +public class EmailServiceImpl {
  33 + private static Logger logger = LoggerFactory.getLogger(EmailServiceImpl.class);
  34 + @Autowired
  35 + ShyEmailMapper shyEmailMapper;
  36 +
  37 + public PageInfo<ShyEmail> getPage(Integer page, Integer pageSize, String orderByClause,
  38 + String remark,String email) {
  39 + Example example = new Example(ShyEmail.class);
  40 + Example.Criteria criteria = example.createCriteria();
  41 + if (CommonUtils.isNotEmpty(orderByClause)) {
  42 + example.setOrderByClause(orderByClause);
  43 + }else{
  44 + example.setOrderByClause("created_at desc");
  45 + }
  46 + if (CommonUtils.isNotEmpty(remark)) {
  47 + criteria.andLike("remark", "%" + remark + "%");
  48 + }
  49 + if (CommonUtils.isNotEmpty(email)) {
  50 + criteria.andLike("email", "%" + email + "%");
  51 + }
  52 + criteria.andEqualTo("is_delete",false);
  53 + PageHelper.startPage(page, pageSize, true);
  54 + List<ShyEmail> ShyEmailList = shyEmailMapper.selectByExample(example);
  55 + PageInfo<ShyEmail> pageInfo = new PageInfo<ShyEmail>(ShyEmailList);
  56 + return pageInfo;
  57 + }
  58 +
  59 + public ShyEmail get(Integer id) {
  60 + return shyEmailMapper.selectByPrimaryKey(id);
  61 + }
  62 +
  63 + public ShyEmail select(ShyEmail shyEmail) {
  64 + return shyEmailMapper.selectOne(shyEmail);
  65 + }
  66 +
  67 + public Integer updateState(Integer id, Boolean isEnable,String userId) {
  68 + ShyEmail shyEmail=get(id);
  69 + shyEmail.setIs_enable(isEnable);
  70 + shyEmail.setUpdater(userId);
  71 + shyEmail.setUpdated_at(CommonUtils.getCurrentTime());
  72 + return shyEmailMapper.updateByPrimaryKeySelective(shyEmail);
  73 + }
  74 +
  75 + public Integer deleted(Integer id, String userId) {
  76 + ShyEmail shyEmail=get(id);
  77 + shyEmail.setUpdater(userId);
  78 + shyEmail.setIs_delete(true);
  79 + shyEmail.setUpdated_at(CommonUtils.getCurrentTime());
  80 + return shyEmailMapper.updateByPrimaryKeySelective(shyEmail);
  81 + }
  82 +
  83 + public boolean update(Integer id, String email, String remark, String write, String updater) {
  84 +
  85 + ShyEmail shyEmail = new ShyEmail();
  86 + if (CommonUtils.isNotNull(id)) {
  87 + shyEmail.setId(id);
  88 + shyEmail = shyEmailMapper.selectOne(shyEmail);
  89 + if (shyEmail != null) {
  90 + shyEmail.setEmail(email);
  91 + shyEmail.setRemark(remark);
  92 + shyEmail.setNotice_type(write);
  93 + shyEmail.setUpdater(updater);
  94 + shyEmail.setUpdated_at(CommonUtils.getCurrentTime());
  95 + int re = shyEmailMapper.updateByPrimaryKeySelective(shyEmail);
  96 + if (re != 1) {
  97 + return false;
  98 + }
  99 + }
  100 + } else {
  101 + shyEmail.setEmail(email);
  102 + shyEmail.setIs_delete(false);
  103 + shyEmail.setIs_enable(true);
  104 + shyEmail.setNotice_type(write);
  105 + shyEmail.setRemark(remark);
  106 + shyEmail.setUpdater(updater);
  107 + shyEmail.setCreated_at(CommonUtils.getCurrentTime());
  108 + shyEmail.setUpdated_at(CommonUtils.getCurrentTime());
  109 + int re = shyEmailMapper.insertSelective(shyEmail);
  110 + if (re != 1) {
  111 + return false;
  112 + }
  113 + }
  114 + return true;
  115 + }
  116 +
  117 + /**
  118 + * 通过邮件发送类型,获取需要发送邮件的list
  119 + * @param emailSendType
  120 + * @return
  121 + */
  122 + public List<String> getEmailSendList(Integer emailSendType) {
  123 + ShyEmail shyEmail= new ShyEmail();
  124 + shyEmail.setIs_delete(false);
  125 + shyEmail.setIs_enable(true);
  126 + List<ShyEmail> shyEmailList = shyEmailMapper.select(shyEmail);
  127 + List<String> emailList = new ArrayList<String>();
  128 + for (ShyEmail shyEmail2 : shyEmailList) {
  129 + if (CommonUtils.isNotEmpty(shyEmail2.getNotice_type())) {
  130 + String[] business = shyEmail2.getNotice_type().split(",");
  131 + List<String> asList = Arrays.asList(business);
  132 + if (asList.contains(emailSendType + "")) {
  133 + emailList.add(shyEmail2.getEmail());
  134 + }
  135 + }
  136 + }
  137 + return emailList;
  138 +
  139 + }
  140 +
  141 +}
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
... ... @@ -81,6 +81,13 @@ public class LiveApplyServiceImpl {
81 81 List<ShyLiveapply> shyLiveApplylist = shyLiveApplyMapper.selectByRowBounds(shyLiveApply, new RowBounds(0, 100));
82 82 return shyLiveApplylist;
83 83 }
  84 +
  85 + public ShyLiveapply queryshyLiveApply(String activity_id) {
  86 + ShyLiveapply shyLiveApply =new ShyLiveapply();
  87 + shyLiveApply.setActivity_id(activity_id);
  88 + List<ShyLiveapply> shyLiveApplylist = shyLiveApplyMapper.select(shyLiveApply);
  89 + return shyLiveApplylist.get(0);
  90 + }
84 91  
85 92 //==============
86 93 public boolean updateshyLiveApply(ShyLiveapply shyLiveApply) {
... ... @@ -237,53 +244,57 @@ public class LiveApplyServiceImpl {
237 244 * 根据条件导出数据excel
238 245 * @return
239 246 */
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);
  247 + public List<ShyLiveapply> findByCondition(String theme, String start_date, String end_date,
  248 + Integer business_model, Integer page, Integer pageSize,
  249 + Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) {
  250 + Example example = new Example(ShyLiveapply.class);
244 251 Example.Criteria criteria = example.createCriteria();
245 252 if (CommonUtils.isNotEmpty(orderByClause)) {
246 253 example.setOrderByClause(orderByClause);
247 254 }else{
248   - //默认排序
249   - example.setOrderByClause("activity_start_time asc");
  255 + example.setOrderByClause("pre_start_time");
250 256 }
251 257 if (CommonUtils.isNotEmpty(start_date)) {
252 258 Timestamp startdate = null;
253 259 try {
254   - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm");
  260 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
255 261 } catch (ParseException e) {
256 262 e.printStackTrace();
257 263 }
258   - criteria.andGreaterThanOrEqualTo("activity_start_time", startdate);
  264 + criteria.andGreaterThanOrEqualTo("pre_start_time", startdate);
259 265 }
260 266 if ( CommonUtils.isNotEmpty(end_date)) {
261 267 Timestamp enddate = null;
262 268 try {
263   - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm");
  269 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
264 270 } catch (ParseException e) {
265 271 e.printStackTrace();
266 272 }
267   - criteria.andLessThanOrEqualTo("activity_end_time", enddate);
268   - }
269   - if (CommonUtils.isNotEmpty(activity_name)) {
270   - criteria.andLike("activity_name", "%" + activity_name + "%");
  273 + criteria.andLessThanOrEqualTo("pre_end_time", enddate);
271 274 }
272   - if (CommonUtils.isNotNull(activity_status) ) {
273   - criteria.andEqualTo("activity_status", activity_status);
  275 + if (CommonUtils.isNotEmpty(theme)) {
  276 + criteria.andLike("theme", "%" + theme + "%");
274 277 }
275   - if (CommonUtils.isNotEmpty(activity_id)) {
276   - criteria.andEqualTo("activity_id", activity_id);
  278 +
  279 + if (CommonUtils.isNotNull(business_model)) {
  280 + criteria.andEqualTo("business_model", business_model);
277 281 }
278 282 if (CommonUtils.isNotNull(spid)) {
279   - criteria.andEqualTo("spid", spid);
  283 + criteria.andEqualTo("sp_id", spid);
280 284 }
281   - if (CommonUtils.isNotNull(shenhe_state)) {
  285 + if (CommonUtils.isNotNull(shenhe_state)&& shenhe_state != 3) {
282 286 criteria.andEqualTo("shenhe_state", shenhe_state);
  287 + }else if(CommonUtils.isNotNull(shenhe_state)&& shenhe_state == 3){
  288 + criteria.andNotEqualTo("shenhe_state", 0);
283 289 }
284   -
285   - List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example);
286   - return shyLiveList;
  290 + if (CommonUtils.isNotNull(receive)) {
  291 + criteria.andEqualTo("receive", receive);
  292 + if(receive!=0 && CommonUtils.isNotEmpty(userId)){
  293 + criteria.andEqualTo("auditor", userId);
  294 + }
  295 + }
  296 + List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example);
  297 + return shyLiveApplyList;
287 298 }
288 299  
289 300 /**
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
... ... @@ -89,7 +89,6 @@ public class LiveServiceImpl {
89 89 Integer shenhe_state, String orderByClause, Integer spid, String userId) {
90 90 Example example = new Example(ShyLive.class);
91 91 Example.Criteria criteria = example.createCriteria();
92   -// Example.Criteria criteria2 = example.createCriteria();
93 92 if (CommonUtils.isNotEmpty(orderByClause)) {
94 93 example.setOrderByClause(orderByClause);
95 94 }
... ... @@ -101,7 +100,6 @@ public class LiveServiceImpl {
101 100 e.printStackTrace();
102 101 }
103 102 criteria.andGreaterThanOrEqualTo("activity_start_time", startdate);
104   -// criteria2.andGreaterThanOrEqualTo("activity_start_time", startdate);
105 103 }
106 104 if ( CommonUtils.isNotEmpty(end_date)) {
107 105 Timestamp enddate = null;
... ... @@ -111,35 +109,27 @@ public class LiveServiceImpl {
111 109 e.printStackTrace();
112 110 }
113 111 criteria.andLessThanOrEqualTo("activity_end_time", enddate);
114   -// criteria2.andLessThanOrEqualTo("activity_end_time", enddate);
115 112 }
116 113 if (CommonUtils.isNotEmpty(activity_name)) {
117 114 criteria.andLike("activity_name", "%" + activity_name + "%");
118   -// criteria2.andLike("activity_name", "%" + activity_name + "%");
119 115 }
120 116  
121 117 if (CommonUtils.isNotEmpty(activity_id)) {
122 118 criteria.andEqualTo("activity_id", activity_id);
123   -// criteria2.andEqualTo("activity_id", activity_id);
124 119 }
125 120 if (CommonUtils.isNotNull(spid)) {
126 121 criteria.andEqualTo("sp_id", spid);
127   -// criteria2.andEqualTo("spid", spid);
128 122 }
129 123 if (CommonUtils.isNotNull(shenhe_state)) {
130 124 criteria.andEqualTo("shenhe_state", shenhe_state);
131   -// criteria2.andEqualTo("shenhe_state", shenhe_state);
132 125 if (shenhe_state != CommonConst.RECEIVE_BEFORE) {
133 126 criteria.andEqualTo("auditor", userId);
134   -// criteria2.andEqualTo("auditor", userId);
135 127 }
136 128 }
137 129 if (CommonUtils.isNotNull(activity_status) ) {
138 130 criteria.andEqualTo("activity_status", activity_status);
139 131 }
140 132 criteria.andEqualTo("is_show", 1);
141   - //排序
142   -// example.setOrderByClause("is_hot desc, activity_start_time desc");
143 133 PageHelper.startPage(page, pageSize, true);
144 134 List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example);
145 135 PageInfo<ShyLive> pageInfo = new PageInfo<>(shyLiveList);
... ... @@ -220,21 +210,20 @@ public class LiveServiceImpl {
220 210 * 根据条件导出数据excel
221 211 * @return
222 212 */
223   - public List<ShyLive> findByCondition(String activity_id,String start_date,String end_date,
224   - String activity_name, Integer activity_status, Integer page,Integer pageSize,
225   - Integer shenhe_state, String orderByClause, Integer spid) {
  213 + public List<ShyLive> findByCondition(String activity_name, String start_date, String end_date,
  214 + String activity_id, Integer activity_status, Integer page, Integer pageSize,
  215 + Integer shenhe_state, String orderByClause, Integer spid, String userId) {
226 216 Example example = new Example(ShyLive.class);
227 217 Example.Criteria criteria = example.createCriteria();
228 218 if (CommonUtils.isNotEmpty(orderByClause)) {
229 219 example.setOrderByClause(orderByClause);
230 220 }else{
231   - //默认排序
232   - example.setOrderByClause("activity_start_time asc");
  221 + example.setOrderByClause("activity_start_time");
233 222 }
234 223 if (CommonUtils.isNotEmpty(start_date)) {
235 224 Timestamp startdate = null;
236 225 try {
237   - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm");
  226 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
238 227 } catch (ParseException e) {
239 228 e.printStackTrace();
240 229 }
... ... @@ -243,7 +232,7 @@ public class LiveServiceImpl {
243 232 if ( CommonUtils.isNotEmpty(end_date)) {
244 233 Timestamp enddate = null;
245 234 try {
246   - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm");
  235 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
247 236 } catch (ParseException e) {
248 237 e.printStackTrace();
249 238 }
... ... @@ -252,19 +241,23 @@ public class LiveServiceImpl {
252 241 if (CommonUtils.isNotEmpty(activity_name)) {
253 242 criteria.andLike("activity_name", "%" + activity_name + "%");
254 243 }
255   - if (CommonUtils.isNotNull(activity_status) ) {
256   - criteria.andEqualTo("activity_status", activity_status);
257   - }
  244 +
258 245 if (CommonUtils.isNotEmpty(activity_id)) {
259 246 criteria.andEqualTo("activity_id", activity_id);
260 247 }
261 248 if (CommonUtils.isNotNull(spid)) {
262   - criteria.andEqualTo("spid", spid);
  249 + criteria.andEqualTo("sp_id", spid);
263 250 }
264 251 if (CommonUtils.isNotNull(shenhe_state)) {
265 252 criteria.andEqualTo("shenhe_state", shenhe_state);
  253 + if (shenhe_state != CommonConst.RECEIVE_BEFORE) {
  254 + criteria.andEqualTo("auditor", userId);
  255 + }
266 256 }
267   -
  257 + if (CommonUtils.isNotNull(activity_status) ) {
  258 + criteria.andEqualTo("activity_status", activity_status);
  259 + }
  260 + criteria.andEqualTo("is_show", 1);
268 261 List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example);
269 262 return shyLiveList;
270 263 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -103,8 +103,12 @@ public class VideosServiceImpl {
103 103 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id);
104 104 shyVideos.setAuditor_id(auditor_id);
105 105 shyVideos.setState(state);
106   - shyVideos.setAttr_tags(attr_tags);
107   - shyVideos.setMsg(msg);
  106 + if(CommonUtils.isNotEmpty(attr_tags)){
  107 + shyVideos.setAttr_tags(attr_tags);
  108 + }
  109 + if(CommonUtils.isNotEmpty(msg)){
  110 + shyVideos.setMsg(msg);
  111 + }
108 112 shyVideos.setUpdater(updater);
109 113 if(CommonUtils.isNotEmpty(auditor_id)){
110 114 shyVideos.setReceive(CommonConst.RECEIVE_AFTER);
... ...
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
... ... @@ -61,6 +61,19 @@ public class CommonConst {
61 61 * 用户状态:禁用
62 62 */
63 63 public static Integer USER_STATUS_FORBID = 2;
  64 +
  65 + /**
  66 + * 通知状态:未通知
  67 + */
  68 + public static Integer NOTICE_INTT = 1;
  69 + /**
  70 + * 通知状态:已通知
  71 + */
  72 + public static Integer NOTICE_SUCCESS = 2;
  73 + /**
  74 + * 通知状态:通知失败
  75 + */
  76 + public static Integer NOTICE_FAIL = 3;
64 77  
65 78  
66 79 /**
... ... @@ -92,6 +105,14 @@ public class CommonConst {
92 105 public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\"}");
93 106 //通知消息设置
94 107 public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\"}");
  108 +
  109 + /**
  110 + * 邮件消息:直播申请
  111 + */
  112 + public static Integer EMAIL_LIVEAPPLY = 1;
  113 +
  114 + //邮件消息设置
  115 + public static JSONObject EMAIL_MESSAGE = JSONObject.parseObject("{\"1\":\"直播申请邮件通知\"}");
95 116  
96 117 /**
97 118 * 抽帧状态:未抽帧
... ...
src/main/java/com/cnlive/shenhe/utils/OpenUtil.java
1 1 package com.cnlive.shenhe.utils;
2 2  
3 3 import javax.servlet.ServletRequest;
  4 +
  5 +import com.alibaba.fastjson.JSONObject;
  6 +
4 7 import java.io.UnsupportedEncodingException;
5 8 import java.net.URLDecoder;
6 9 import java.net.URLEncoder;
... ... @@ -8,6 +11,24 @@ import java.util.*;
8 11  
9 12 public class OpenUtil {
10 13  
  14 +
  15 + //生成post方式的请求参数签名
  16 + public static void main(String[] args) {
  17 +// String app_key = "ad101b9152817a79b5c33c3617b96ff91385096ff3b4ba"; //开发者帐号对应的key. 请开发者谨慎保管此值。
  18 +// Map<String, String> params = new HashMap<>();
  19 +// params.put("appId", "769_jetja50p18");
  20 +// params.put("emailAddr", "642522156@qq.com");
  21 +// params.put("title", "新直播开播申请");
  22 +// params.put("content", "李伟 __12001072345__中投视讯sdadadad__测试2测试2测试2测试2__2019-10-30 14:53:50__2019-10-30 14:55:15__花园桥花园桥花园桥花园桥花园桥花园桥__rtmp://sxzg.rtmpt2.cnlive.com/live-sxzg-82/82_newshen4?key=564329e44212e754__rtmp://sxzg.rtmpt2.cnlive.com/live-sxzg-82/82_newshen4");
  23 +// params.put("templateId", "4017");
  24 +// params.put("sign", sign(params,app_key));
  25 +// HttpUtil httpUtil = HttpUtil.init();
  26 +// httpUtil.setParamMap(params);
  27 +// String URL = "http://sms.cnlive.com/CnliveM3/email/sendMoreVarEmail.action";
  28 +// Map<String, String> post = httpUtil.post(URL);
  29 +// System.out.println(post.get("result"));
  30 + }
  31 +
11 32  
12 33 /**
13 34 * 验证签名
... ...
src/main/resources/application.properties
... ... @@ -65,6 +65,11 @@ avsmple_callback=http://shen.cnlive.com/api/avsample/callback
65 65 #\u540c\u6b65\u76f4\u64ad\u4e91\u4fe1\u606f
66 66 live_url=http://bc.cnlive.com/bokong/activity/activityShenHe
67 67  
  68 +#\u90ae\u4ef6\u4f7f\u7528\u5e38\u91cf
  69 +email_app_id=769_jetja50p18
  70 +email_app_key=ad101b9152817a79b5c33c3617b96ff91385096ff3b4ba
  71 +email_send_URL=http://sms.cnlive.com/CnliveM3/email/sendMoreVarEmail.action
  72 +
68 73 #\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d
69 74 #qn_bucket=cnlivetest
70 75 #qn_domain=http://test.qnvod.cnlive.com
... ...
src/main/resources/mapper/ShyEmailMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.cnlive.shenhe.mapper.ShyEmailMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyEmail">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="email" jdbcType="VARCHAR" property="email" />
  10 + <result column="remark" jdbcType="VARCHAR" property="remark" />
  11 + <result column="notice_type" jdbcType="VARCHAR" property="notice_type" />
  12 + <result column="is_enable" jdbcType="BIT" property="is_enable" />
  13 + <result column="is_delete" jdbcType="BIT" property="is_delete" />
  14 + <result column="updater" jdbcType="VARCHAR" property="updater" />
  15 + <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
  16 + <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
  17 + </resultMap>
  18 +</mapper>
0 19 \ No newline at end of file
... ...
src/main/resources/mapper/ShyLiveMapper.xml
... ... @@ -11,8 +11,11 @@
11 11 <result column="activity_id" jdbcType="VARCHAR" property="activity_id" />
12 12 <result column="activity_name" jdbcType="VARCHAR" property="activity_name" />
13 13 <result column="activity_status" jdbcType="INTEGER" property="activity_status" />
  14 + <result column="pre_start_time" jdbcType="TIMESTAMP" property="pre_start_time" />
  15 + <result column="pre_end_time" jdbcType="TIMESTAMP" property="pre_end_time" />
14 16 <result column="activity_start_time" jdbcType="TIMESTAMP" property="activity_start_time" />
15 17 <result column="activity_end_time" jdbcType="TIMESTAMP" property="activity_end_time" />
  18 + <result column="live_type" jdbcType="VARCHAR" property="live_type" />
16 19 <result column="activity_intro" jdbcType="VARCHAR" property="activity_intro" />
17 20 <result column="m3u8_url" jdbcType="VARCHAR" property="m3u8_url" />
18 21 <result column="rtmp_url" jdbcType="VARCHAR" property="rtmp_url" />
... ...
src/main/resources/mapper/ShyLiveapplyMapper.xml
... ... @@ -13,6 +13,7 @@
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="live_type" jdbcType="VARCHAR" property="live_type" />
16 17 <result column="pre_start_time" jdbcType="TIMESTAMP" property="pre_start_time" />
17 18 <result column="pre_end_time" jdbcType="TIMESTAMP" property="pre_end_time" />
18 19 <result column="business_model" jdbcType="INTEGER" property="business_model" />
... ... @@ -29,6 +30,8 @@
29 30 <result column="updater" jdbcType="VARCHAR" property="updater" />
30 31 <result column="auditor" jdbcType="VARCHAR" property="auditor" />
31 32 <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" />
  33 + <result column="email_notice_state" jdbcType="INTEGER" property="email_notice_state" />
  34 + <result column="email_notice_msg" jdbcType="VARCHAR" property="email_notice_msg" />
32 35 <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
33 36 <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
34 37 <result column="simple_content" jdbcType="LONGVARCHAR" property="simple_content" />
... ...
src/main/resources/templates/common/frame.html
... ... @@ -91,6 +91,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
91 91 <li><a href="/users/page" id="/users/page"> 审核云用户管理</a></li>
92 92 <li><a href="/sites/page" id="/sites/page"> SP白名单管理</a></li>
93 93 <li><a href="/usersFree/page" id="/usersFree/page"> 用户白名单管理</a></li>
  94 + <li><a href="/email/page" id="/email/page"> 邮件消息管理</a></li>
94 95 </ul>
95 96 </li>
96 97 </ul>
... ...
src/main/resources/templates/common/head.html
... ... @@ -111,6 +111,7 @@
111 111 }
112 112 if(data.isShow_liveApply){
113 113 isShow_liveApply=true;
  114 + notice_liveApply();//第一次进来就弹窗
114 115 }
115 116 }
116 117 });
... ... @@ -121,18 +122,36 @@
121 122 initialize();
122 123 t1 = window.setInterval(
123 124 function(){
124   - if(((parseInt(new Date().getTime()/1000))%(5*60)==0) && isShow_chinnal){
125   - notice_channel()
  125 + if(((parseInt(new Date().getTime()/1000))%(5*60)==0)){//弹窗设置每5分钟启用
  126 + if(isShow_chinnal){
  127 + notice_channel();
  128 + }
  129 + if(isShow_liveApply){
  130 + notice_liveApply();
  131 + }
126 132 }
127 133 },1000);
128 134 });
129 135  
  136 + function notice_liveApply(){
  137 + $.ajax({
  138 + type:'get',
  139 + dataType:'json',
  140 + data:'',
  141 + url: "/channel/channelNotice",
  142 + success:function(data){
  143 + if(data!=null && data!="" ){
  144 + new xWin(data.id,data.title,data.content,data.url);
  145 + }
  146 + }
  147 + });
  148 + }
130 149 function notice_channel(){
131 150 $.ajax({
132 151 type:'get',
133 152 dataType:'json',
134 153 data:'',
135   - url: "/api/channel/channelNotice",
  154 + url: "/liveApply/liveApplyNotice",
136 155 success:function(data){
137 156 if(data!=null && data!="" ){
138 157 new xWin(data.id,data.title,data.content,data.url);
... ...
src/main/resources/templates/email/email_templates.html 0 → 100644
  1 +<html>
  2 +<head>
  3 +<title>新直播开播申请</title>
  4 +</head>
  5 +<body>
  6 + <div align="center" id="tabContents" class="tab-content">
  7 + <span style="font-size:30px;font-weight: bold;color:#F4A460;">中国网家家直播申请单</span>
  8 + <table border="1" style="background-color:#F5FFFA;width:80%;font-size:20px;" id="table">
  9 + <tr align="center" valign="middle" height="40px">
  10 + <td width="25%" >直播发起人</td>
  11 + <td width="30%" colspan="2" >
  12 + <span style="color:#DC143C" >${sender}</span>
  13 + </td>
  14 + <td width="15%">联系方式</td>
  15 + <td width="30%" colspan="2">
  16 + <span style="color:#DC143C" >${mobile}</span>
  17 + </td>
  18 + </tr>
  19 + <tr align="center" valign="middle" height="40px">
  20 + <td >直播发起单位</td>
  21 + <td colspan="5">
  22 + <span style="color:#DC143C" >${organization}</span>
  23 + </td>
  24 + </tr>
  25 + <tr align="center" valign="middle" height="40px">
  26 + <td >直播主题</td>
  27 + <td colspan="5">
  28 + <span style="color:#DC143C" >${theme}</span>
  29 + </td>
  30 + </tr>
  31 + <tr align="center" valign="middle" height="40px">
  32 + <td >直播开始时间</td>
  33 + <td colspan="5">
  34 + <span style="color:#DC143C" >${pre_start_time}</span>
  35 + </td>
  36 + </tr>
  37 + <tr align="center" valign="middle" height="40px">
  38 + <td >直播结束时间</td>
  39 + <td colspan="5">
  40 + <span style="color:#DC143C" >${pre_end_time}</span>
  41 + </td>
  42 + </tr>
  43 +
  44 + <tr align="center" valign="middle" height="40px">
  45 + <td >直播地点</td>
  46 + <td colspan="5">
  47 + <span style="color:#DC143C" >${live_place}</span>
  48 + </td>
  49 + </tr>
  50 + <tr align="center" valign="middle" height="40px">
  51 + <td >推流地址</td>
  52 + <td colspan="5">
  53 + <span style="color:#DC143C" >${push_url}</span>
  54 + </td>
  55 + </tr>
  56 + <tr align="center" valign="middle" height="40px">
  57 + <td >拉流地址</td>
  58 + <td colspan="5">
  59 + <span style="color:#DC143C" >${pull_url}</span>
  60 + </td>
  61 + </tr>
  62 +
  63 + </table>
  64 +
  65 + </div>
  66 +</body>
  67 +</html>
0 68 \ No newline at end of file
... ...
src/main/resources/templates/page/email.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"></head>
  5 +<style type="text/css">
  6 + .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{margin-top: 0px;}
  7 + .table{margin-bottom:0;}
  8 +
  9 +
  10 + .switch {
  11 + position: relative;
  12 + display: inline-block;
  13 + width: 60px;
  14 + height: 34px;
  15 +}
  16 +
  17 +.switch input {display:none;}
  18 +
  19 +.slider {
  20 + position: absolute;
  21 + cursor: pointer;
  22 + top: 0;
  23 + left: 0;
  24 + right: 0;
  25 + bottom: 0;
  26 + background-color: red;
  27 + -webkit-transition: .4s;
  28 + transition: .4s;
  29 +}
  30 +
  31 +.slider:before {
  32 + position: absolute;
  33 + content: "";
  34 + height: 26px;
  35 + width: 26px;
  36 + left: 4px;
  37 + bottom: 4px;
  38 + background-color: white;
  39 + -webkit-transition: .4s;
  40 + transition: .4s;
  41 +}
  42 +
  43 +input:checked + .slider {
  44 + background-color: #2196F3;
  45 +}
  46 +
  47 +input:focus + .slider {
  48 + box-shadow: 0 0 1px #2196F3;
  49 +}
  50 +
  51 +input:checked + .slider:before {
  52 + -webkit-transform: translateX(26px);
  53 + -ms-transform: translateX(26px);
  54 + transform: translateX(26px);
  55 +}
  56 +
  57 +/* Rounded sliders */
  58 +.slider.round {
  59 + border-radius: 34px;
  60 +}
  61 +
  62 +.slider.round:before {
  63 + border-radius: 50%;
  64 +}
  65 +
  66 +</style>
  67 +<body class="skin-blue sidebar-mini">
  68 +
  69 +<div class="wrapper">
  70 +
  71 + <div th:replace="../templates/common/frame::frame"></div>
  72 +
  73 + <div class="content-wrapper" style="min-height: 788px;">
  74 + <section class="content-header">
  75 + <h1>
  76 + 邮件消息管理
  77 + </h1>
  78 + <ol class="breadcrumb">
  79 + <li>首页</li>
  80 + <li>系统管理</li>
  81 + <li class="active">邮件消息管理</li>
  82 + </ol>
  83 + </section>
  84 + <section class="content">
  85 + <div class="row">
  86 + <div class="col-xs-12">
  87 + <div class="box box-info">
  88 + <div class="box-body">
  89 + <div class="btn-group margin-bottom " style="padding: 0; width: 98%; float: right;">
  90 + <div class="columns columns-right btn-group ">
  91 + <button class="btn btn-success" onclick="javascript:add()" type="button" name="refresh" title="添加" id="email_addS">添加</button>
  92 + </div>
  93 + <div class="col-md-6 pull-right" style="padding: 0; width: 5%;">
  94 + <button class="btn btn-default" type="button" name="refresh"
  95 + title="搜索" id="emailQuery">搜索</button>
  96 + </div>
  97 + <div class="col-md-6 pull-right" style="padding: 0; width: 20%;">
  98 + <label for="mobile" class="control-label cb-toolbar"
  99 + style="font-size: 15px; top: 8px; font-weight: 100;">邮件地址:</label>
  100 + <div class="col-sm-7" style="padding: 0;">
  101 + <input class="form-control" type="text" th:value="${param.email}" id="email_query">
  102 + </div>
  103 + </div>
  104 + <div class="col-md-5 pull-right" style="padding: 0; width: 15%;">
  105 + <label for="sp_id" class="control-label cb-toolbar"
  106 + style="font-size: 15px; top: 8px; font-weight: 100;">邮件人:</label>
  107 + <div class="col-sm-7" style="padding: 0;">
  108 + <input class="form-control" type="text" th:value="${param.remark}" id="remark_query">
  109 + </div>
  110 + </div>
  111 + </div>
  112 +
  113 +
  114 +
  115 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  116 + <div class="fixed-table-body">
  117 + <table data-toggle="table" data-pagination="true" data-search="false" data-show-refresh="true"
  118 + data-show-toggle="true" data-show-columns="true" data-toolbar="#toolbar" class="table table-hover">
  119 + <thead>
  120 + <tr>
  121 + <th style="text-align: center; width: 5%;" data-field="sp_id" tabindex="0">
  122 + <div class="th-inner ">ID</div>
  123 + <div class="fht-cell"></div>
  124 + </th>
  125 + <th style="text-align: center; width: 12%;" data-field="sp_id_brief" tabindex="0">
  126 + <div class="th-inner ">邮件地址</div>
  127 + <div class="fht-cell"></div>
  128 + </th>
  129 + <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">
  130 + <div class="th-inner ">邮件人</div>
  131 + <div class="fht-cell"></div>
  132 + </th>
  133 + <th style="text-align: center; width: 12%;" data-field="type" tabindex="0">
  134 + <div class="th-inner ">通知类型</div>
  135 + <div class="fht-cell"></div>
  136 + </th>
  137 + <th style="text-align: center; width: 6%;" data-field="type" tabindex="0">
  138 + <div class="th-inner ">使用状态</div>
  139 + <div class="fht-cell"></div>
  140 + </th>
  141 + <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">
  142 + <div class="th-inner ">修改人</div>
  143 + <div class="fht-cell"></div>
  144 + </th>
  145 + <th style="text-align: center; width: 12%;" data-field="upload_time" tabindex="0">
  146 + <div class="th-inner ">创建时间</div>
  147 + <div class="fht-cell"></div>
  148 + </th>
  149 + <th style="text-align: center; width: 12%;" data-field="updated_at" tabindex="0">
  150 + <div class="th-inner ">更新时间</div>
  151 + <div class="fht-cell"></div>
  152 + </th>
  153 + <th style="text-align: center; width: 10%;" data-field="action" tabindex="0">
  154 + <div class="th-inner ">操作</div>
  155 + <div class="fht-cell"></div>
  156 + </th>
  157 + </tr>
  158 + </thead>
  159 + <tbody>
  160 + <tr th:data-index="${emailStat.index}" th:each="email : ${emailPage.list}">
  161 + <td style="text-align: center; width: 5%;" th:text="${email.id}">82</td>
  162 + <td style="text-align: center; width: 12%;" th:text="${email.email}">视讯中国</td>
  163 + <td style="text-align: center; width: 8%;" th:text="${email.remark}">用户名</td>
  164 + <td style="text-align: center; width: 12%;" th:text="${email.email_type_name}"></td>
  165 + <td style="text-align: center; width: 6%;" th:if="${email.is_enable==true}">
  166 + <label class="switch"><input type="checkbox" checked th:id="'id'+${email.id}"><span class="slider round" th:id="${email.id}"></span></label>
  167 + </td>
  168 + <td style="text-align: center; width: 6%;" th:if="${email.is_enable!=true}">
  169 + <label class="switch"><input type="checkbox" th:id="'id'+${email.id}"><span class="slider round" th:id="${email.id}"></span></label>
  170 + </td>
  171 + <td style="text-align: center; width: 8%;" th:text="${email.updater}"></td>
  172 + <td style="text-align: center; width: 12%;" th:text="${#dates.format(email.created_at, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22
  173 + 23:08:48</td>
  174 + <td style="text-align: center; width: 12%;" th:text="${#dates.format(email.updated_at, 'yyyy-MM-dd HH:mm:ss')}">2016-08-03
  175 + 14:27:17</td>
  176 + <td style="text-align: center; width: 10%;">
  177 + <span>&nbsp;</span>
  178 + <a class="edit" th:href="'javascript:edit('+${email.id}+',\''+${email.email}+'\',\''+${email.remark}+'\',\''+${email.notice_type} +'\')'">
  179 + <button class="btn btn-primary btn-xs">修改</button>
  180 + </a><span> </span><span>&nbsp;</span>
  181 + <span>&nbsp;</span>
  182 + <a class="delete" th:href="'javascript:deleted('+${email.id}+')'">
  183 + <button class="btn btn-danger btn-xs">删除</button>
  184 + </a><span> </span><span>&nbsp;</span></td>
  185 + </tr>
  186 +
  187 + </tbody>
  188 + </table>
  189 + </div>
  190 +
  191 + <div class="fixed-table-pagination" style="display: block;">
  192 + <div class="pull-left pagination-detail">
  193 + <span class="pagination-info"
  194 + th:text="'共 '+${emailPage.total}+' 条记录,每页显示'">共 0 条记录</span>
  195 + <select class="" id="pageSize" name="pageSize"
  196 + onchange="selectPageSize()">
  197 + <option value="10" th:selected="${pageSize==10}">10</option>
  198 + <option value="20" th:selected="${pageSize==20}">20</option>
  199 + <option value="50" th:selected="${pageSize==50}">50</option>
  200 + <option value="100" th:selected="${pageSize==100}">100</option>
  201 + </select> <span class="pagination-info">条记录</span>
  202 + </div>
  203 + <div class="pull-right pagination">
  204 + <ul class="pagination" th:if="${emailPage.pages>1}">
  205 + <li class="page-pre"><a
  206 + th:href="'javascript:fanye(1);'">‹‹</a></li>
  207 + <li class="page-pre" th:if="${!emailPage.isFirstPage}"><a
  208 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'">‹</a>
  209 + </li>
  210 +
  211 + <li class="page-number" th:if="${emailPage.pageNum-3>=1}"><a
  212 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum-3}+'\');'"
  213 + th:text="${emailPage.pageNum-3}">2</a></li>
  214 + <li class="page-number" th:if="${emailPage.pageNum-2>=1}"><a
  215 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum-2}+'\');'"
  216 + th:text="${emailPage.pageNum-2}">2</a></li>
  217 + <li class="page-number" th:if="${emailPage.pageNum-1>=1}"><a
  218 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'"
  219 + th:text="${emailPage.pageNum-1}">2</a></li>
  220 + <li class="page-number active"><a
  221 + href="javaScript:void(0);" th:text="${emailPage.pageNum}">2</a></li>
  222 + <li class="page-number"
  223 + th:if="${emailPage.pageNum+1<=emailPage.pages}"><a
  224 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'"
  225 + th:text="${emailPage.pageNum+1}">2</a></li>
  226 + <li class="page-number"
  227 + th:if="${emailPage.pageNum+2<=emailPage.pages}"><a
  228 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum+2}+'\');'"
  229 + th:text="${emailPage.pageNum+2}">2</a></li>
  230 + <li class="page-number"
  231 + th:if="${emailPage.pageNum+3<=emailPage.pages}"><a
  232 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum+3}+'\');'"
  233 + th:text="${emailPage.pageNum+3}">2</a></li>
  234 +
  235 + <li class="page-next" th:if="${!emailPage.isLastPage}"><a
  236 + th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'">›</a>
  237 + </li>
  238 + <li class="page-next"><a
  239 + th:onclick="'javascript:fanye(\''+${emailPage.pages}+'\');'">››</a>
  240 + </li>
  241 + </ul>
  242 + </div>
  243 + </div>
  244 + </div>
  245 + </div>
  246 + <div class="clearfix"></div>
  247 + </div>
  248 + </div>
  249 + </div>
  250 + </section>
  251 + </div>
  252 +
  253 +<!-- 模态框(Modal) -->
  254 +<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  255 + <div class="modal-dialog">
  256 + <div class="modal-content" style="margin-top: 30%;">
  257 + <div class="modal-header">
  258 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  259 + <h4 class="modal-title" id="myModalLabel">编辑邮件消息</h4>
  260 + </div>
  261 + <div class="modal-body">
  262 + <form action="/email/write" method="post" id="editWrite">
  263 + <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
  264 + <div class="form-group hide">
  265 + <label class="control-label col-sm-3" style="font-size: 15px;" >Id:</label>
  266 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  267 + <input class="form-control" style="width:30%;" type="text" value="" id="id" name="id">
  268 + </div>
  269 + </div>
  270 + <div class="form-group">
  271 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件地址:</label>
  272 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  273 + <input class="form-control" style="width:40%;" type="text" value="" id="email_edit" name="email">
  274 + </div>
  275 + </div>
  276 + <div class="form-group">
  277 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件人:</label>
  278 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  279 + <input class="form-control" style="width:20%;" type="text" value="" id="remark_edit" name="remark">
  280 + </div>
  281 + </div>
  282 +
  283 + <div class="form-group">
  284 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件类型:</label>
  285 + <div class="col-sm-9" style="float: left">
  286 + <div th:each="bu:${email_message}" style="padding-right: 30px;" class="write_check">
  287 + <span th:text="${bu.value}" style="font-size: 15px"></span>
  288 + <input type="checkbox" name="write_business" th:value="${bu.key}" th:id="'write_check_'+${bu.key}">
  289 + </div>
  290 + </div>
  291 + </div>
  292 +
  293 + </form>
  294 + </div>
  295 + <div class="modal-footer">
  296 + <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交</button>
  297 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  298 + </div>
  299 + </div><!-- /.modal-content -->
  300 + </div><!-- /.modal-dialog -->
  301 +</div>
  302 +<!-- /.modal -->
  303 + <script>
  304 + //打开编辑窗口
  305 + function edit(Id,email,remark,write_business){
  306 + $("#myModalLabel").text("编辑邮件消息");
  307 + $("#id").val(Id);
  308 + $("#email_edit").val(email);
  309 + $("#email_edit").attr("readonly","true");
  310 + $("#remark_edit").val(remark);
  311 + $("#redirect_url").val(location.pathname+location.search);
  312 + $(".write_check input").prop("checked",false);
  313 + if($.trim(write_business)!=''){
  314 + var array = write_business.split(",")
  315 + for (var i=0;i<array.length;i++){
  316 + $("#write_check_"+array[i]).prop("checked",true);
  317 + }
  318 + }
  319 + $('#editModal').modal('show');
  320 + }
  321 +
  322 + //打开添加窗口
  323 + function add(){
  324 + $("#id").val("");
  325 + $("#email_edit").val("");
  326 + $("#email_edit").removeAttr("readonly");
  327 + $("#remark_edit").val("");
  328 + $(".write_check input").prop("checked",false);
  329 +
  330 + $("#redirect_url").val(location.pathname+location.search);
  331 + $("#myModalLabel").text("添加邮件消息");
  332 + $('#editModal').modal('show');
  333 + }
  334 +
  335 + //删除操作
  336 + function deleted(id){
  337 + var r = confirm("您确定删除本条内容吗?");
  338 + if (r == true) {
  339 + $.post("/email/deleted?id=" + id, function (data) {
  340 + if (data.errorCode == 0) {
  341 + alert(data.errorMessage);
  342 + location.href = location.href;
  343 + } else {
  344 + alert(data.errorMessage);
  345 + }
  346 + })
  347 + }
  348 + }
  349 +
  350 +
  351 + //开关的点击事件
  352 + $(".slider").on('click',function(e){
  353 + var myId=$(this).prop("id");
  354 + // var myIndex = $(".slider").index($(this));
  355 + var checked=$("#id"+myId).prop("checked");//获取当前状态,下一个状态用!checked表示
  356 + $.post("/email/updateState?id=" + myId+"&isEnable="+!checked, function (data) {
  357 + if (data.errorCode == 0) {
  358 + alert(data.errorMessage);
  359 + location.href = location.href;
  360 + } else {
  361 + alert(data.errorMessage);
  362 + location.href = location.href;
  363 + }
  364 + })
  365 + })
  366 +
  367 + //翻页函数
  368 + function fanye(page) {
  369 + var param = location.search;
  370 + if (param.indexOf("page=") != -1) {
  371 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  372 + var split = se.split("&");
  373 + var h = "";
  374 + for (var i = 0; i < split.length; i++) {
  375 + var s = split[i];
  376 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  377 + }
  378 + h = h.substring(1, h.length);
  379 + window.location.href = "/email/page?" + h + "&page=" + page;
  380 + } else {
  381 + param = param.substring(1, param.length);
  382 + window.location.href = "/email/page?" + param + "&page=" + page;
  383 + }
  384 + }
  385 +
  386 + //选择每页数量触发函数
  387 + function selectPageSize(){
  388 + var pageSize=$("#pageSize").val();
  389 + var param = location.search;
  390 + if (param.indexOf("pageSize=") != -1) {
  391 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  392 + var split = se.split("&");
  393 + var h = "";
  394 + for (var i = 0; i < split.length; i++) {
  395 + var s = split[i];
  396 + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
  397 + }
  398 + h = h.substring(1, h.length);
  399 + window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
  400 + } else {
  401 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  402 + var split = se.split("&");
  403 + var h = "";
  404 + for (var i = 0; i < split.length; i++) {
  405 + var s = split[i];
  406 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  407 + }
  408 + h = h.substring(1, h.length);
  409 + window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
  410 + }
  411 + }
  412 +
  413 + //搜索
  414 + $('#emailQuery').click(function () {
  415 + var email = $("#email_query").val();
  416 + var remark = $("#remark_query").val();
  417 + var pageSize = $("#pageSize").val();
  418 + window.location.href = "/email/page?email=" + email + "&remark=" + remark+ "&pageSize=" + pageSize;
  419 + });
  420 +
  421 + //鼠标回车事件
  422 + $(document).keyup(function(event){
  423 + if(event.keyCode ==13){
  424 + $("#emailQuery").trigger("click");
  425 + }
  426 + });
  427 + </script>
  428 +
  429 + <footer th:replace="../templates/common/foot::foot" ></footer>
  430 +
  431 +
  432 + <!-- Add the sidebar's background. This div must be placed
  433 + immediately after the control sidebar -->
  434 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  435 +
  436 +</div><!-- ./wrapper -->
  437 +
  438 +
  439 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  440 +<script type="text/javascript">
  441 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  442 +</script>
  443 +
  444 +<!-- AdminLTE App -->
  445 +<script src="../../static/js/app.min.js"></script>
  446 +<!-- AdminLTE for demo purposes -->
  447 +<script src="../../static/js/sidebar.js"></script>
  448 +
  449 +
  450 +</body>
  451 +</html>
0 452 \ No newline at end of file
... ...
src/main/resources/templates/page/live.html
... ... @@ -217,7 +217,7 @@
217 217 <p style="line-height: 0">
218 218 <span class="text-success" th:text="${live.shenhe_state==2?'已审':'待审'}">待审</span>
219 219 <span class="text-primary pull-right"
220   - th:text="${#dates.format(live.activity_start_time, 'yyyy-MM-dd HH:mm:ss')}">2019-06-26 14:56:33</span>
  220 + th:text="${#dates.format(live.pre_start_time, 'yyyy-MM-dd HH:mm:ss')}">2019-06-26 14:56:33</span>
221 221 </p>
222 222 <p class="info-box-text">
223 223 <input type="checkbox" class="check" th:value="${live.id}" name="btSelectItem">
... ...
src/main/resources/templates/page/liveDetail.html
... ... @@ -53,6 +53,20 @@
53 53 </div>
54 54 </div>
55 55 <div class="form-group" >
  56 + <label for="claimed_at" class="control-label col-sm-2">预计开始时间:</label>
  57 + <div class="col-sm-10">
  58 + <h5 th:text="${#dates.format(live.pre_start_time, 'yyyy-MM-dd HH:mm:ss')}">
  59 + 2018-11-29 10:04:35</h5>
  60 + </div>
  61 + </div>
  62 + <div class="form-group" >
  63 + <label for="claimed_at" class="control-label col-sm-2">预计结束时间:</label>
  64 + <div class="col-sm-10">
  65 + <h5 th:text="${#dates.format(live.pre_end_time, 'yyyy-MM-dd HH:mm:ss')}">
  66 + 2018-11-29 10:04:35</h5>
  67 + </div>
  68 + </div>
  69 + <div class="form-group" >
56 70 <label for="claimed_at" class="control-label col-sm-2">直播开始时间:</label>
57 71 <div class="col-sm-10">
58 72 <h5 th:text="${#dates.format(live.activity_start_time, 'yyyy-MM-dd HH:mm:ss')}">
... ... @@ -66,13 +80,7 @@
66 80 2018-11-29 10:04:35</h5>
67 81 </div>
68 82 </div>
69   - <div class="form-group">
70   - <label for="live_title" class="control-label col-sm-2">直播简介</label>
71   - <div class="col-sm-8">
72   - <h5 style="font-size:1.5em; "
73   - th:text="${live.activity_intro}"></h5>
74   - </div>
75   - </div>
  83 +
76 84 <div class="form-group" th:if="${live.activity_status== 4 or live.activity_status== 2}">
77 85 <div class="col-sm-10">
78 86 <div class="modal-body" id="videoBox" style="height:400px">
... ... @@ -156,6 +164,13 @@
156 164 </div>
157 165 </div>
158 166 <div class="form-group">
  167 + <label for="live_title" class="control-label col-sm-2">直播简介:</label>
  168 + <div class="col-sm-8">
  169 + <h5 style="font-size:1.5em; "
  170 + th:text="${live.activity_intro}"></h5>
  171 + </div>
  172 + </div>
  173 + <div class="form-group">
159 174 <label for="live_user_name" class="control-label col-sm-2">审核类型:</label>
160 175 <div class="col-sm-10">
161 176 <h5 class="status" th:if="${live.shenhe_type==1}">免审</h5>
... ...