Commit 9195d3f665cf6ccc21dacd37f4118d4bf91a1040

Authored by liwei2917
1 parent 83227098

修改网家家目击者非免审时审核方式错误的bug

增加频道审核来新的申请时右下角弹窗提示
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
@@ -11,17 +11,23 @@ import com.cnlive.shenhe.utils.CommonUtils; @@ -11,17 +11,23 @@ import com.cnlive.shenhe.utils.CommonUtils;
11 import org.slf4j.Logger; 11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 12 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.beans.factory.annotation.Value;
14 import org.springframework.stereotype.Controller; 15 import org.springframework.stereotype.Controller;
  16 +import org.springframework.web.bind.annotation.GetMapping;
15 import org.springframework.web.bind.annotation.PostMapping; 17 import org.springframework.web.bind.annotation.PostMapping;
16 import org.springframework.web.bind.annotation.RequestMapping; 18 import org.springframework.web.bind.annotation.RequestMapping;
17 import org.springframework.web.bind.annotation.ResponseBody; 19 import org.springframework.web.bind.annotation.ResponseBody;
18 20
  21 +import java.util.HashMap;
19 import java.util.List; 22 import java.util.List;
  23 +import java.util.Map;
20 24
21 @Controller 25 @Controller
22 @RequestMapping("/api/channel") 26 @RequestMapping("/api/channel")
23 public class ChannelControllerApi { 27 public class ChannelControllerApi {
24 private static Logger logger = LoggerFactory.getLogger(ChannelControllerApi.class); 28 private static Logger logger = LoggerFactory.getLogger(ChannelControllerApi.class);
  29 + @Value("${spring.localhost.url}")
  30 + private String localhost_url;//本机地址
25 @Autowired 31 @Autowired
26 AuditPass Pass; 32 AuditPass Pass;
27 @Autowired 33 @Autowired
@@ -85,5 +91,29 @@ public class ChannelControllerApi { @@ -85,5 +91,29 @@ public class ChannelControllerApi {
85 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"审核请求收到失败(新增)"); 91 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"审核请求收到失败(新增)");
86 } 92 }
87 } 93 }
  94 +
  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 + }
88 118
89 } 119 }
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -157,9 +157,9 @@ public class VideosController extends BaseController { @@ -157,9 +157,9 @@ public class VideosController extends BaseController {
157 ShySites shySites = sitesService.findspidDescByspid(videos.getSpid()); 157 ShySites shySites = sitesService.findspidDescByspid(videos.getSpid());
158 if (CommonUtils.isNotNull(shySites)) { 158 if (CommonUtils.isNotNull(shySites)) {
159 if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)){ 159 if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)){
160 - videos.setSpid_desc(shySites.getName()+"目击者"); 160 + videos.setSpid_desc(shySites.getName()+"(目击者)");
161 }else if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)){ 161 }else if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)){
162 - videos.setSpid_desc(shySites.getName()+"朋友圈"); 162 + videos.setSpid_desc(shySites.getName()+"(朋友圈)");
163 }else{ 163 }else{
164 videos.setSpid_desc(shySites.getName()); 164 videos.setSpid_desc(shySites.getName());
165 } 165 }
src/main/java/com/cnlive/shenhe/job/ChannelJob.java
@@ -65,7 +65,7 @@ public class ChannelJob { @@ -65,7 +65,7 @@ public class ChannelJob {
65 if (channelList.size() > 0) { 65 if (channelList.size() > 0) {
66 logger.info("您有"+channelList.size()+"条新的频道审核申请,请注意查看!"); 66 logger.info("您有"+channelList.size()+"条新的频道审核申请,请注意查看!");
67 // 设置Headless模式,linux系统下 67 // 设置Headless模式,linux系统下
68 -// System.setProperty("java.awt.headless", "true"); 68 + System.setProperty("java.awt.headless", "false");
69 infoUtil.show("新频道申请", "您有"+channelList.size()+"条新的频道审核申请,请注意查看!",localhost_url+"/channel/page?shenhe_status=0&receive=0"); 69 infoUtil.show("新频道申请", "您有"+channelList.size()+"条新的频道审核申请,请注意查看!",localhost_url+"/channel/page?shenhe_status=0&receive=0");
70 } 70 }
71 71
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -411,22 +411,21 @@ public class VideosServiceImpl { @@ -411,22 +411,21 @@ public class VideosServiceImpl {
411 Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审 411 Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
412 //如果当前sp是免审sp 412 //如果当前sp是免审sp
413 if(sites.contains(shyVideo.getSpid())){ 413 if(sites.contains(shyVideo.getSpid())){
414 - //如果栏目是“目击者”  
415 - if(CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)){  
416 - //如果用户id存在  
417 - if(CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())){  
418 - ShyUsersfree shyUserfree=usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());  
419 - //如果存在免审用户  
420 - if(CommonUtils.isNotNull(shyUserfree)){  
421 - shenheType=1;//免审  
422 - }else{//用户不免审  
423 - shenheType=2;//机审  
424 - }  
425 - }else{//如果用户id不存在 414 + shenheType=1;//免审
  415 + }
  416 + //如果栏目是“目击者”
  417 + if(CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)){
  418 + //如果用户id存在
  419 + if(CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())){
  420 + ShyUsersfree shyUserfree=usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());
  421 + //如果存在免审用户
  422 + if(CommonUtils.isNotNull(shyUserfree)){
  423 + shenheType=1;//免审
  424 + }else{//用户不免审
426 shenheType=2;//机审 425 shenheType=2;//机审
427 } 426 }
428 - }else{//如果栏目不存在或者不是非免审栏目  
429 - shenheType=1;//免审 427 + }else{//如果用户id不存在
  428 + shenheType=2;//机审
430 } 429 }
431 } 430 }
432 shyVideo.setShenhe_type(shenheType); 431 shyVideo.setShenhe_type(shenheType);
src/main/resources/templates/common/head.html
@@ -81,8 +81,283 @@ @@ -81,8 +81,283 @@
81 <script src="../../static/js/app.js"></script> 81 <script src="../../static/js/app.js"></script>
82 82
83 <!-- 最新的 Bootstrap 核心 JavaScript 文件 --> 83 <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
84 - <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"  
85 - integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"  
86 - crossorigin="anonymous"></script> 84 +<!-- <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" -->
  85 +<!-- integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" -->
  86 +<!-- crossorigin="anonymous"></script> -->
  87 +
  88 + <!--添加Dialog 的js-->
  89 +<!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDrag.js"></script> -->
  90 +<!-- <script type="text/javascript" src="http://resweb.cnliveimg.com/system/dialog/zDialog.js"></script> -->
  91 +<!-- <link href="../../static/css/dialog.css" rel="stylesheet"> -->
  92 +<!-- <link href="../../static/js/JetDialog.js" rel="stylesheet"> -->
  93 +
  94 + <script language=javascript>
  95 +
  96 + var x0=0,y0=0,x1=0,y1=0;
  97 +// var offx=6,offy=6;
  98 + var moveable=false;//鼠标是否是按下状态
  99 +// var hover='orange',normal='slategray';//color;
  100 + var hover='slategray',normal='slategray';//color;
  101 + var index=10000;//z-index;
  102 + var isShow=true;//是否显示消息框
  103 +
  104 + //创建一个对象;
  105 + function xWin(id,tit,msg,url)
  106 + {
  107 +  index = index+2;
  108 + isShow=false;
  109 +  this.id      = id;
  110 +  this.width   = 300;//主窗体宽度
  111 +  this.height  = 200;//主窗体高度
  112 +  this.right   = 0;//位置距右
  113 +  this.bottom  = 0;//位置距下
  114 +  this.zIndex  = index;
  115 +  this.title   = tit;//标题
  116 +  this.message = msg;//消息体
  117 +  this.url = url;//url
  118 +  this.obj     = null;
  119 +  this.bulid   = bulid;
  120 +  this.bulid();
  121 + }
  122 + //初始化;
  123 + function bulid(){
  124 +  var str = ""
  125 +   + "<div id=xMsg" + this.id + " "
  126 +   + "style='"
  127 +   + "z-index:" + this.zIndex + ";"
  128 +   + "width:" + this.width + "px;"
  129 +   + "height:" + this.height + "px;"
  130 +   + "right:" + this.right + ";"
  131 +   + "bottom:" + this.bottom + ";"
  132 +   + "background-color:white;"
  133 +   + "color:" + normal + ";"
  134 +   + "font-size:18px;"
  135 +   + "font-family:Verdana;"
  136 +   + "position:fixed;"
  137 +   + "cursor:default;"
  138 +   + "-webkit-user-select:none;"
  139 +   + "-moz-user-select:none;"
  140 +   + "-ms-user-select:none;"
  141 +   + "user-select:none;"
  142 +   + "border:2px solid " + normal + ";"
  143 +   + "' "
  144 +   + "οnmοusedοwn='getFocus(this)'"
  145 + +">"
  146 +// 标题开始
  147 +    + "<div "
  148 +    + "style='"
  149 +    + "background-color:" + normal + ";"
  150 +    + "width:" + (this.width-2*2) + "px;"
  151 +    + "height:28px;"
  152 +    + "color:white;"
  153 +    + "' "
  154 +    + "onmousedown='startDrag(this)' "
  155 +    + "onmouseup='stopDrag(this)' "
  156 +    + "onmousemove='drag(this)' "
  157 +    + "ondblclick='min(this.childNodes[1])'"
  158 +    + ">"
  159 +     + "<span style='width:" + (this.width-2*25-4) + "px;padding-left:3px; display:-moz-inline-box; display:inline-block;'>" + this.title + "</span>"
  160 +     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='min(this)'>0</span>"
  161 +     + "<span style='width:25px;border-width:0px;color:white;font-family:webdings;display:-moz-inline-box; display:inline-block;' onclick='cls(this)'>r</span>"
  162 +    + "</div>"
  163 +//     主窗体开始
  164 + + "<div style='"
  165 +     + "width:100%;"
  166 +     + "height:" + (this.height-28-4) + "px;"
  167 +     + "min-height:" + (this.height-28-4) + "px;"
  168 +     + "background-color:white;"
  169 +     + "word-break:break-all;"
  170 +     + "padding:3px;"
  171 +     + "'>"
  172 +// 主窗体的内容部分
  173 + + "<div style='"
  174 +     + "width:100%;"
  175 +     + "height:" + (this.height-28-4-50) + "px;"
  176 +     + "min-height:" + (this.height-28-4-50) + "px;"
  177 +     + "line-height:20px;"
  178 +     + "text-align: center;"
  179 +     + "word-break:break-all;"
  180 +     + "padding:3px;"
  181 +     + "padding-top: 40px;"
  182 + + "color:red;"
  183 +     + "'>"
  184 + + this.message
  185 + + "</div>"
  186 +// 主窗体的按钮部分(按钮1)
  187 + + "<div style='"
  188 +    + "width:60px;"
  189 +    + "height:30px;"
  190 +    + "color: #fff;"
  191 +    + "line-height: 30px;"
  192 +    + "text-align: center;"
  193 +    + "font-size: 15px;"
  194 +    + "float:left;"
  195 +    + "margin-left: 120px;"
  196 +   + "background-color:" + normal + ";"
  197 +   + "'"
  198 + +" type='button'"
  199 + +" onclick='cls(this)'"
  200 + +">确定</div>"
  201 +// 主窗体的按钮部分(按钮2)
  202 + + "<div style='"
  203 +    + "width:60px;"
  204 +    + "height:30px;"
  205 +    + "color: #fff;"
  206 +    + "line-height: 30px;"
  207 +    + "text-align: center;"
  208 +    + "font-size: 15px;"
  209 +    + "float:right;"
  210 +    + "margin-right:20px;"
  211 +   + "background-color:" + normal + ";"
  212 +   + "'"
  213 + +" type='button'"
  214 + +" onclick=\"toLink('"+this.url+"')\""
  215 + +">查看</div>"
  216 + + "</div>"
  217 +   
  218 +  
  219 + + "</div>";
  220 +  document.body.insertAdjacentHTML("beforeEnd",str);
  221 + }
  222 +
  223 + //开始拖动;
  224 + function startDrag(obj){
  225 +  if(event.button==0){
  226 +   //锁定标题栏;
  227 +//   obj.setCapture();
  228 +   //定义对象;
  229 +   var win = obj.parentNode;
  230 +//   var sha = win.nextSibling;
  231 +   //记录鼠标和层位置;
  232 +   x0 = event.clientX;
  233 +   y0 = event.clientY;
  234 +   x1 = parseInt(win.style.right.replace("px",""));
  235 +   y1 = parseInt(win.style.bottom.replace("px",""));
  236 +   //记录颜色;
  237 +   normal = obj.style.backgroundColor;
  238 +   //改变风格;
  239 +   obj.style.backgroundColor = hover;
  240 +   win.style.borderColor = hover;
  241 +   obj.nextSibling.style.color = hover;
  242 +//   sha.style.right = (x1 - offx)+"px";
  243 +//   sha.style.bottom  = (y1 - offy)+"px";
  244 +   moveable = true;
  245 +  }
  246 + }
  247 + //拖动;
  248 + function drag(obj){
  249 +  if(moveable){
  250 +   var win = obj.parentNode;
  251 +//   var sha = win.nextSibling;
  252 +   win.style.right = ( x1+x0-event.clientX)+"px";
  253 +   win.style.bottom  = ( y1+y0-event.clientY)+"px";
  254 +//   sha.style.right = (parseInt(win.style.right.replace("px","")) - offx)+"px";
  255 +//   sha.style.bottom  = (parseInt(win.style.bottom.replace("px","")) - offy)+"px";
  256 +  }
  257 + }
  258 + //停止拖动;
  259 + function stopDrag(obj){
  260 +  if(moveable){
  261 +   var win = obj.parentNode;
  262 +//   var sha = win.nextSibling;
  263 +   var msg = obj.nextSibling;
  264 +   win.style.borderColor     = normal;
  265 +   obj.style.backgroundColor = normal;
  266 +   msg.style.color           = normal;
  267 +//   sha.style.right = obj.parentNode.style.right;
  268 +//   sha.style.bottom  = obj.parentNode.style.bottom;
  269 +//   obj.releaseCapture();
  270 +   moveable = false;
  271 +  }
  272 + }
  273 + //获得焦点;
  274 + function getFocus(obj)
  275 + {
  276 +  if(obj.style.zIndex!=index)
  277 +  {
  278 +   index = index + 2;
  279 +   var idx = index;
  280 +   obj.style.zIndex=idx;
  281 +   obj.nextSibling.style.zIndex=idx-1;
  282 +  }
  283 + }
  284 + //最小化;
  285 + function min(obj){
  286 +  var win = obj.parentNode.parentNode;
  287 +//  var sha = win.nextSibling;
  288 +  var tit = obj.parentNode;
  289 +  var msg = tit.nextSibling;
  290 +  var flg = msg.style.display=="none";
  291 +  if(flg)
  292 +  {
  293 +   win.style.height  = (parseInt(msg.style.height.replace("px","")) + parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
  294 +//   sha.style.height  = win.style.height;
  295 +   msg.style.display = "block";
  296 +   obj.innerHTML = "0";
  297 +  }
  298 +  else
  299 +  {
  300 +   win.style.height  = (parseInt(tit.style.height.replace("px","")) + 2*2)+"px";
  301 +//   sha.style.height  = win.style.height;
  302 +   obj.innerHTML = "2";
  303 +   msg.style.display = "none";
  304 +  }
  305 + }
  306 + //关闭;
  307 + function cls(obj){
  308 +  var win = obj.parentNode.parentNode;
  309 +//  var sha = win.nextSibling;
  310 +  win.style.visibility = "hidden";
  311 +//  sha.style.visibility = "hidden";
  312 + isShow=true;
  313 + }
  314 + //点击查看跳转链接
  315 + function toLink(url){
  316 + isShow=true;
  317 + window.location.href= url;
  318 +// window.location.href= window.location.protocol+"//"+window.location.host+"/channel/page?shenhe_status=0&receive=0";
  319 + }
  320 + //-->
  321 + </script>
  322 + <script language='JScript'>
  323 + function initialize(){
  324 +  var a = new xWin("1","新频道审核通知","您有三条未审核的频道消息,请尽快审核,谢谢!","www.baidu.com");
  325 +//  var b = new xWin("2",100,200,0,200,"arui2","test2");
  326 +  //var c = new xWin("3",200,160,250,50,"arui3","test3");
  327 + }
  328 +// window.onload = initialize;
  329 +
  330 +
  331 + var t1;
  332 + $(function(){
  333 + t1 = window.setInterval(
  334 + function(){
  335 + if(isShow){
  336 + notice()
  337 + }
  338 + },10000);
  339 + });
  340 +
  341 + function notice(){
  342 + $.ajax({
  343 + type:'get',
  344 + dataType:'json',
  345 + data:'',
  346 + url: "/api/channel/channelNotice",
  347 + success:function(data){
  348 + if(data!=null && data!="" ){
  349 +// alert(data.title+":"+data.content);
  350 + //去掉定时器的方法
  351 +// window.clearInterval(t1);
  352 + new xWin(data.id,data.title,data.content,data.url);
  353 + }
  354 + }
  355 + });
  356 + }
  357 +
  358 +//去掉定时器的方法
  359 +//window.clearInterval(t1);
  360 +
  361 +</script>
87 </head> 362 </head>
88 </html> 363 </html>
89 \ No newline at end of file 364 \ No newline at end of file
src/main/resources/templates/page/content.html
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <h1> 13 <h1>
14 图文审核 14 图文审核
15 </h1> 15 </h1>
16 - <div th:text="${T(com.cnlive.shenhe.controller.VideosController).ceshi('')}">JAN</div> 16 +<!-- <div th:text="${T(com.cnlive.shenhe.controller.VideosController).ceshi('')}">JAN</div> -->
17 <ol class="breadcrumb"> 17 <ol class="breadcrumb">
18 <li>首页</li> 18 <li>首页</li>
19 <li class="active">图文审核</li> 19 <li class="active">图文审核</li>