Commit 10db09ee4edb6be88ff062a93fb6b330caa9ef99

Authored by liwei2917
2 parents 3109a543 c2f3e20a

Merge branch 'dev'

# Conflicts:
#	src/main/resources/application.properties
Showing 46 changed files with 4154 additions and 167 deletions
@@ -56,6 +56,12 @@ @@ -56,6 +56,12 @@
56 <groupId>org.springframework.boot</groupId> 56 <groupId>org.springframework.boot</groupId>
57 <artifactId>spring-boot-starter-websocket</artifactId> 57 <artifactId>spring-boot-starter-websocket</artifactId>
58 </dependency> 58 </dependency>
  59 +
  60 + <!-- mq队列 -->
  61 + <dependency>
  62 + <groupId>org.springframework.boot</groupId>
  63 + <artifactId>spring-boot-starter-amqp</artifactId>
  64 + </dependency>
59 65
60 <!-- 自动更新 --> 66 <!-- 自动更新 -->
61 <dependency> 67 <dependency>
src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject; @@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSONObject;
4 import com.cnlive.shenhe.bean.ErrorEnum; 4 import com.cnlive.shenhe.bean.ErrorEnum;
5 import com.cnlive.shenhe.bean.ResponseBean; 5 import com.cnlive.shenhe.bean.ResponseBean;
6 import com.cnlive.shenhe.entity.ShyComments; 6 import com.cnlive.shenhe.entity.ShyComments;
  7 +import com.cnlive.shenhe.entity.ShyTopic;
7 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; 8 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  9 +import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
8 import com.cnlive.shenhe.utils.AuditPass; 10 import com.cnlive.shenhe.utils.AuditPass;
9 import com.cnlive.shenhe.utils.CommonConst; 11 import com.cnlive.shenhe.utils.CommonConst;
10 import com.cnlive.shenhe.utils.CommonUtils; 12 import com.cnlive.shenhe.utils.CommonUtils;
11 import org.slf4j.Logger; 13 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 14 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 15 import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.beans.factory.annotation.Value;
14 import org.springframework.stereotype.Controller; 17 import org.springframework.stereotype.Controller;
15 import org.springframework.web.bind.annotation.PostMapping; 18 import org.springframework.web.bind.annotation.PostMapping;
16 import org.springframework.web.bind.annotation.RequestMapping; 19 import org.springframework.web.bind.annotation.RequestMapping;
@@ -27,6 +30,11 @@ public class CommentsControllerApi { @@ -27,6 +30,11 @@ public class CommentsControllerApi {
27 AuditPass Pass; 30 AuditPass Pass;
28 @Autowired 31 @Autowired
29 CommentsServiceImpl commentsService; 32 CommentsServiceImpl commentsService;
  33 + @Autowired
  34 + TopicServiceImpl topicService;
  35 +
  36 + @Value("${topic_comment_shareH5}")
  37 + String topic_comment_shareH5;
30 38
31 /** 39 /**
32 * @Auther: chenhao 40 * @Auther: chenhao
@@ -38,6 +46,40 @@ public class CommentsControllerApi { @@ -38,6 +46,40 @@ public class CommentsControllerApi {
38 public ResponseBean impotComment(String param) { 46 public ResponseBean impotComment(String param) {
39 logger.info("评论入库,param=====" + param); 47 logger.info("评论入库,param=====" + param);
40 JSONObject json = JSONObject.parseObject(param); 48 JSONObject json = JSONObject.parseObject(param);
  49 + String type=json.getString("type")==null?"":json.getString("type");//评论类型,topic:话题
  50 + Integer level=json.getInteger("level")==null?1:json.getInteger("level");//评论的级别
  51 + String programId=json.getString("programId");
  52 + String originalUrl=json.getString("originalUrl");
  53 + String commentTitle=json.getString("commentTitle");
  54 + Integer commentUserId=json.getInteger("commentUserId");
  55 + String commentUserName=json.getString("commentUserName");
  56 + String commentUserAvatar=json.getString("commentUserAvatar");
  57 + String commentUserIP=json.getString("commentUserIP");
  58 + String commentContent=json.getString("commentContent");
  59 + String appId=json.getString("appId");
  60 + String platform=json.getString("platform");
  61 + String activityId=json.getString("activityId");
  62 + Boolean priority=json.getBoolean("priority");
  63 + String callback=json.getString("callback");
  64 + String commentTime = json.getString("commentTime");
  65 + Date timestamp =null;
  66 + if (CommonUtils.isNotEmpty(commentTime)) {
  67 + timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd HH:mm");
  68 + }
  69 +
  70 + if(type.equals(CommonConst.CATEGORY_TOPIC)){//评论类型是话题
  71 + if(level==1){
  72 + ShyTopic shyTopic = new ShyTopic();
  73 + shyTopic.setTopic_id(programId);
  74 + shyTopic=topicService.getShyTopic(shyTopic);
  75 + if(shyTopic!=null){
  76 + commentTitle=shyTopic.getTitle();//设置标题
  77 + originalUrl=topic_comment_shareH5+programId;
  78 + }
  79 + }
  80 +
  81 + }
  82 +
41 //判断是否存在 83 //判断是否存在
42 ShyComments shyComments = new ShyComments(); 84 ShyComments shyComments = new ShyComments();
43 shyComments.setActivity_id(json.getString("activityId")); 85 shyComments.setActivity_id(json.getString("activityId"));
@@ -53,26 +95,24 @@ public class CommentsControllerApi { @@ -53,26 +95,24 @@ public class CommentsControllerApi {
53 if (commentsList.size() > 0) { 95 if (commentsList.size() > 0) {
54 ShyComments shyComments1 = commentsList.get(0); 96 ShyComments shyComments1 = commentsList.get(0);
55 shyComments1.setState(CommonConst.AUDIT_INTT); 97 shyComments1.setState(CommonConst.AUDIT_INTT);
56 - shyComments1.setProgram_id(json.getString("programId"));  
57 - shyComments1.setComment_original_url(json.getString("originalUrl"));  
58 - shyComments1.setComment_title(json.getString("commentTitle"));  
59 - shyComments1.setComment_user_id(json.getInteger("commentUserId"));  
60 - shyComments1.setComment_user_name(json.getString("commentUserName"));  
61 - shyComments1.setComment_user_avatar(json.getString("commentUserAvatar"));  
62 - shyComments1.setComment_user_ip(json.getString("commentUserIP"));  
63 - shyComments1.setComment_content(json.getString("commentContent"));  
64 - String commentTime = json.getString("commentTime");  
65 - if (CommonUtils.isNotEmpty(commentTime)) {  
66 - Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd HH:mm");  
67 - shyComments1.setComment_time(timestamp);  
68 -  
69 - } 98 + shyComments1.setProgram_id(programId);
  99 + shyComments1.setComment_original_url(originalUrl);
  100 + shyComments1.setComment_title(commentTitle);
  101 + shyComments1.setComment_user_id(commentUserId);
  102 + shyComments1.setComment_user_name(commentUserName);
  103 + shyComments1.setComment_user_avatar(commentUserAvatar);
  104 + shyComments1.setComment_user_ip(commentUserIP);
  105 + shyComments1.setComment_content(commentContent);
  106 + shyComments1.setType(type);
  107 + shyComments1.setLevel(level);
  108 +
  109 + shyComments1.setComment_time(timestamp);
70 shyComments1.setSpid(sp_id); 110 shyComments1.setSpid(sp_id);
71 - shyComments1.setApp_id(json.getString("appId"));  
72 - shyComments1.setPlatform(json.getString("platform"));  
73 - shyComments1.setActivity_id(json.getString("activityId"));  
74 - shyComments1.setIs_hot(json.getBoolean("priority"));  
75 - shyComments1.setCallback(json.getString("callback")); 111 + shyComments1.setApp_id(appId);
  112 + shyComments1.setPlatform(platform);
  113 + shyComments1.setActivity_id(activityId);
  114 + shyComments1.setIs_hot(priority);
  115 + shyComments1.setCallback(callback);
76 boolean YorN = commentsService.updateshyComments1(shyComments1); 116 boolean YorN = commentsService.updateshyComments1(shyComments1);
77 if (YorN == true) { 117 if (YorN == true) {
78 return new ResponseBean(ErrorEnum.SUCCESS); 118 return new ResponseBean(ErrorEnum.SUCCESS);
@@ -82,24 +122,22 @@ public class CommentsControllerApi { @@ -82,24 +122,22 @@ public class CommentsControllerApi {
82 } 122 }
83 //如果不存在直接插入 123 //如果不存在直接插入
84 shyComments.setState(CommonConst.AUDIT_INTT); 124 shyComments.setState(CommonConst.AUDIT_INTT);
85 - shyComments.setProgram_id(json.getString("programId"));  
86 - shyComments.setComment_original_url(json.getString("originalUrl"));  
87 - shyComments.setComment_title(json.getString("commentTitle"));  
88 - shyComments.setComment_user_id(json.getInteger("commentUserId"));  
89 - shyComments.setComment_user_name(json.getString("commentUserName"));  
90 - shyComments.setComment_user_avatar(json.getString("commentUserAvatar"));  
91 - shyComments.setComment_user_ip(json.getString("commentUserIP"));  
92 - shyComments.setComment_content(json.getString("commentContent"));  
93 - String commentTime = json.getString("commentTime");  
94 - if (CommonUtils.isNotEmpty(commentTime)) {  
95 - Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd HH:mm");  
96 - shyComments.setComment_time(timestamp);  
97 - } 125 + shyComments.setProgram_id(programId);
  126 + shyComments.setComment_original_url(originalUrl);
  127 + shyComments.setComment_title(commentTitle);
  128 + shyComments.setComment_user_id(commentUserId);
  129 + shyComments.setComment_user_name(commentUserName);
  130 + shyComments.setComment_user_avatar(commentUserAvatar);
  131 + shyComments.setComment_user_ip(commentUserIP);
  132 + shyComments.setComment_content(commentContent);
  133 + shyComments.setComment_time(timestamp);
  134 + shyComments.setType(type);
  135 + shyComments.setLevel(level);
98 shyComments.setSpid(sp_id); 136 shyComments.setSpid(sp_id);
99 - shyComments.setApp_id(json.getString("appId"));  
100 - shyComments.setPlatform(json.getString("platform"));  
101 - shyComments.setIs_hot(json.getBoolean("priority"));  
102 - shyComments.setCallback(json.getString("callback")); 137 + shyComments.setApp_id(appId);
  138 + shyComments.setPlatform(platform);
  139 + shyComments.setIs_hot(priority);
  140 + shyComments.setCallback(callback);
103 commentsService.getShenheType(shyComments); 141 commentsService.getShenheType(shyComments);
104 boolean YorN = commentsService.impotComments(shyComments); 142 boolean YorN = commentsService.impotComments(shyComments);
105 if (YorN == true) { 143 if (YorN == true) {
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
@@ -55,7 +55,12 @@ public class LiveApplyControllerApi { @@ -55,7 +55,12 @@ public class LiveApplyControllerApi {
55 //获取所有参数 55 //获取所有参数
56 String activityId = json.getString("activityId");//直播活动id 56 String activityId = json.getString("activityId");//直播活动id
57 String channelId = json.getString("channelId");//直播频道id 57 String channelId = json.getString("channelId");//直播频道id
58 - Integer spId = Integer.parseInt(json.getString("spId"));//spid 58 + Integer spId=null;
  59 + try {
  60 + spId=json.getInteger("spId");
  61 + } catch (Exception e) {
  62 + spId=null;
  63 + }
59 String sender = json.getString("sender");//直播发起人 64 String sender = json.getString("sender");//直播发起人
60 String mobile = json.getString("mobile");//联系方式 65 String mobile = json.getString("mobile");//联系方式
61 String callback = json.getString("callback");//回调地址 66 String callback = json.getString("callback");//回调地址
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java 0 → 100644
  1 +package com.cnlive.shenhe.api;
  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.ShyTopic;
  7 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  8 +import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
  9 +import com.cnlive.shenhe.utils.AuditPass;
  10 +import com.cnlive.shenhe.utils.CommonConst;
  11 +import com.cnlive.shenhe.utils.CommonUtils;
  12 +import com.cnlive.shenhe.utils.TransitServiceUtils;
  13 +
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.stereotype.Controller;
  18 +import org.springframework.web.bind.annotation.GetMapping;
  19 +import org.springframework.web.bind.annotation.PostMapping;
  20 +import org.springframework.web.bind.annotation.RequestBody;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.ResponseBody;
  23 +
  24 +import java.util.HashMap;
  25 +import java.util.List;
  26 +import java.util.Map;
  27 +
  28 +@Controller
  29 +@RequestMapping("/api/topic")
  30 +public class TopicControllerApi {
  31 + private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class);
  32 + @Autowired
  33 + AuditPass Pass;
  34 + @Autowired
  35 + CommentsServiceImpl commentsService;
  36 + @Autowired
  37 + TopicServiceImpl topicService;
  38 +
  39 + @Autowired
  40 + TransitServiceUtils t;
  41 +
  42 + /**
  43 + * @author liwei
  44 + * @Date: 2019/12/13 15:17
  45 + * @Description: 话题送审接口
  46 + */
  47 + @PostMapping("/import")
  48 + @ResponseBody
  49 + public ResponseBean impotTopic(@RequestBody String param) {
  50 + logger.info("话题入库,param=====" + param);
  51 + JSONObject json = JSONObject.parseObject(param);
  52 + JSONObject result = new JSONObject();
  53 +
  54 + //获取所有参数
  55 + String topic_id = json.getString("topicId");//话题id
  56 +// Integer spId = Integer.parseInt(json.getString("spId"));//spId
  57 +// Integer spId = json.getInteger("spId");//spId
  58 + Integer spId=null;
  59 + try {
  60 + spId=json.getInteger("spId");
  61 + } catch (Exception e) {
  62 + spId=null;
  63 + }
  64 + String topicTitle = json.getString("topicTitle");//话题标题
  65 + String topicPic = json.getString("topicPic");//话题图片
  66 + String topic_text = json.getString("topicMsg");//话题内容
  67 + String topic_time = json.getString("createTime");//话题创建时间
  68 +
  69 + String topic_tag = json.getString("topicTag");//话题标签
  70 + String topic_url = json.getString("topicUrl");//话题url
  71 +
  72 + //判断是否存在
  73 + ShyTopic shyTopic=new ShyTopic();
  74 + shyTopic.setTopic_id(topic_id);
  75 + List<ShyTopic> topicList = topicService.findshyTopic(shyTopic);
  76 +
  77 + //获取审核类型
  78 + Integer shenheType = topicService.getShenheType(spId);
  79 + //存在则更新
  80 + if (topicList.size() > 0) {
  81 + ShyTopic shyTopic1 = topicList.get(0);
  82 + shyTopic1.setTitle(topicTitle);//话题标题
  83 + shyTopic1.setTopic_image(topicPic);//话题图片
  84 + shyTopic1.setShenhe_type(shenheType);//审核类型
  85 + shyTopic1.setTopic_text(topic_text);//话题内容
  86 + shyTopic1.setTopic_tag(topic_tag);//话题标签
  87 + shyTopic1.setTopic_url(topic_url);//话题url
  88 + shyTopic1.setTopic_time(topic_time);//话题创建时间
  89 + shyTopic1.setSp_id(spId);//spid
  90 + shyTopic1.setShenhe_status(CommonConst.AUDIT_INTT);;//当前话题的审核状态
  91 + shyTopic1.setUpdate_date(CommonUtils.getCurrentTime());//最后一次更新时间
  92 +
  93 +
  94 +
  95 + boolean YorN = topicService.updateshyTopic(shyTopic1);
  96 + if (YorN == true) {
  97 + return new ResponseBean(ErrorEnum.SUCCESS,new JSONObject().put("topic_id", topic_id));
  98 + } else {
  99 + return new ResponseBean(ErrorEnum.ERROR,new JSONObject().put("topic_id", topic_id));
  100 + }
  101 + }
  102 + //如果不存在直接插入
  103 + shyTopic.setTitle(topicTitle);//话题标题
  104 + shyTopic.setTopic_image(topicPic);//话题图片
  105 + shyTopic.setShenhe_type(shenheType);//审核类型
  106 + shyTopic.setTopic_text(topic_text);//话题内容
  107 + shyTopic.setTopic_tag(topic_tag);//话题标签
  108 + shyTopic.setTopic_url(topic_url);//话题url
  109 + shyTopic.setTopic_time(topic_time);//话题创建时间
  110 + shyTopic.setSp_id(spId);//spid
  111 + shyTopic.setShenhe_status(CommonConst.AUDIT_INTT);;//当前话题的审核状态
  112 + shyTopic.setUpdate_date(CommonUtils.getCurrentTime());//最后一次更新时间
  113 + shyTopic.setCreate_date(CommonUtils.getCurrentTime());//送审时间
  114 + boolean YorN = topicService.impotshyTopic(shyTopic);
  115 + if (YorN == true) {
  116 + return new ResponseBean(ErrorEnum.SUCCESS,new JSONObject().put("topic_id", topic_id));
  117 + } else {
  118 + return new ResponseBean(ErrorEnum.ERROR,new JSONObject().put("topic_id", topic_id));
  119 + }
  120 + }
  121 +
  122 + @GetMapping("/send")
  123 + @ResponseBody
  124 + public String send() {
  125 + System.out.println("1111");
  126 + JSONObject params = new JSONObject();
  127 + params.put("video_id", "11111");
  128 + params.put("state", "22222");
  129 + params.put("attr_tags", "33333");
  130 + params.put("msg", "4444");
  131 + t.send("cms","/api/callback", false, params);
  132 + return "1111";
  133 + }
  134 +
  135 + @PostMapping("/callback")
  136 + @ResponseBody
  137 + public ResponseBean callback(@RequestBody String param) {
  138 + logger.info("话题中转回调通知,param=====" + param);
  139 + JSONObject json = JSONObject.parseObject(param);
  140 + //获取中转服务器消息
  141 + String errorCode = json.getString("errorCode");
  142 + String errorMessage=json.getString("errorMessage");
  143 + //获取接收方消息
  144 + JSONObject dataObject = json.getJSONObject("data");
  145 + String topic_id=dataObject.getString("topic_id");
  146 + //获取当前话题实体
  147 + ShyTopic topic=new ShyTopic();
  148 + topic.setTopic_id(topic_id);
  149 + topic = topicService.getShyTopic(topic);
  150 +
  151 + if(errorCode.equals("0")){
  152 + logger.info("话题id为:"+topic_id+",cms系统已通知");
  153 + if(topic!=null){
  154 + topic.setShenhe_msg(topic.getShenhe_msg()+",cms系统已通知");
  155 + }
  156 + }else{//中转服务器失败
  157 + logger.info("话题id为:"+topic_id+",中转服务器调用cms失败,失败消息:"+errorMessage);
  158 + topic.setShenhe_msg(topic.getShenhe_msg()+",中转服务器调用cms失败,失败消息:"+errorMessage);
  159 + topic.setShenhe_status(CommonConst.AUDIT_INTT);
  160 + topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER);
  161 + topic.setAuditor_id(null);
  162 + }
  163 + boolean rs = topicService.updateshyTopic(topic);
  164 + Map<String,Object> ee=new HashMap<>();
  165 + ee.put("topic_id", topic_id);
  166 + if(rs){
  167 + return new ResponseBean(ErrorEnum.SUCCESS,ee);
  168 + }
  169 +
  170 + return new ResponseBean(300,"话题送审回调成功,入库失败",ee);
  171 + }
  172 +
  173 +
  174 +}
  175 +
src/main/java/com/cnlive/shenhe/bean/ResponseBean.java
@@ -39,6 +39,10 @@ public class ResponseBean implements Serializable { @@ -39,6 +39,10 @@ public class ResponseBean implements Serializable {
39 public ResponseBean(ErrorEnum errorEnum) { 39 public ResponseBean(ErrorEnum errorEnum) {
40 this.errorEnum = errorEnum; 40 this.errorEnum = errorEnum;
41 } 41 }
  42 + public ResponseBean(ErrorEnum errorEnum, Object data) {
  43 + this.errorEnum = errorEnum;
  44 + this.data = data;
  45 + }
42 46
43 public Integer getErrorCode() { 47 public Integer getErrorCode() {
44 if (CommonUtils.isNotNull(this.errorEnum)) { 48 if (CommonUtils.isNotNull(this.errorEnum)) {
src/main/java/com/cnlive/shenhe/controller/BaseController.java
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse; @@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
7 import javax.servlet.http.HttpSession; 7 import javax.servlet.http.HttpSession;
8 8
9 import org.springframework.stereotype.Controller; 9 import org.springframework.stereotype.Controller;
  10 +import org.springframework.ui.Model;
10 import org.springframework.web.bind.annotation.GetMapping; 11 import org.springframework.web.bind.annotation.GetMapping;
11 import org.springframework.web.bind.annotation.RequestMapping; 12 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.context.request.RequestContextHolder; 13 import org.springframework.web.context.request.RequestContextHolder;
@@ -71,7 +72,39 @@ public class BaseController { @@ -71,7 +72,39 @@ public class BaseController {
71 public void setSessionUser(SessionUser sessionUser){ 72 public void setSessionUser(SessionUser sessionUser){
72 this.getsession().setAttribute("",null); 73 this.getsession().setAttribute("",null);
73 } 74 }
  75 +
  76 + /**
  77 + * 设置报错页面显示信息——站点查询失败
  78 + * @param model
  79 + */
  80 + public void setmodel_site(Model model){
  81 + model.addAttribute("errorMessage", "站点查询失败,不存在此站点,请重新查询!");
  82 + model.addAttribute("remindMessage", "提示:站点查询请输入全称,不支持模糊查询");
  83 + }
  84 + /**
  85 + * 设置报错页面显示信息——参数校验失败
  86 + * @param model
  87 + * @param value 不能为空的参数
  88 + */
  89 + public void setmodel_param(Model model,String value){
  90 + model.addAttribute("errorMessage", "参数传递不能为空!"+value);
  91 + model.addAttribute("remindMessage", "提示:请检查所传参数,存在非空参数未赋值");
  92 + }
74 93
75 - 94 + /**
  95 + * 设置报错页面显示信息——入库结果失败
  96 + * @param model
  97 + */
  98 + public void setmodel_result(Model model){
  99 + model.addAttribute("errorMessage", "数据入库失败,请重试!");
  100 + model.addAttribute("remindMessage", "提示:如连续两次以上入库失败,请联系开发人员");
  101 + }
  102 + /**
  103 + * 设置报错页面显示信息——权限不足
  104 + * @param model
  105 + */
  106 + public void setmodel_limit(Model model){
  107 + model.addAttribute("errorMessage", "您没有此操作的权限,请重试或者联系管理员开通!");
  108 + }
76 109
77 } 110 }
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
@@ -34,7 +34,7 @@ import java.util.Map; @@ -34,7 +34,7 @@ import java.util.Map;
34 34
35 @Controller 35 @Controller
36 @RequestMapping("/channel") 36 @RequestMapping("/channel")
37 -public class ChannelController { 37 +public class ChannelController extends BaseController {
38 private static Logger logger = LoggerFactory.getLogger(ChannelController.class); 38 private static Logger logger = LoggerFactory.getLogger(ChannelController.class);
39 @Value("${spring.localhost.url}") 39 @Value("${spring.localhost.url}")
40 private String localhost_url;//本机地址 40 private String localhost_url;//本机地址
@@ -83,7 +83,8 @@ public class ChannelController { @@ -83,7 +83,8 @@ public class ChannelController {
83 if(CommonUtils.isNotNull(shySite)){ 83 if(CommonUtils.isNotNull(shySite)){
84 spid = shySite.getSpid(); 84 spid = shySite.getSpid();
85 }else{ 85 }else{
86 - return "page/sitesError.html"; 86 + setmodel_site(model);
  87 + return "error.html";
87 } 88 }
88 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 89 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
89 spid = null; 90 spid = null;
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -20,6 +20,7 @@ import com.github.pagehelper.PageInfo; @@ -20,6 +20,7 @@ import com.github.pagehelper.PageInfo;
20 import org.slf4j.Logger; 20 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 21 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.beans.factory.annotation.Value;
23 import org.springframework.stereotype.Controller; 24 import org.springframework.stereotype.Controller;
24 import org.springframework.ui.Model; 25 import org.springframework.ui.Model;
25 import org.springframework.web.bind.annotation.*; 26 import org.springframework.web.bind.annotation.*;
@@ -31,7 +32,7 @@ import java.util.List; @@ -31,7 +32,7 @@ import java.util.List;
31 32
32 @Controller 33 @Controller
33 @RequestMapping("/comments") 34 @RequestMapping("/comments")
34 -public class CommentsController { 35 +public class CommentsController extends BaseController {
35 private static Logger logger = LoggerFactory.getLogger(CommentsController.class); 36 private static Logger logger = LoggerFactory.getLogger(CommentsController.class);
36 @Autowired 37 @Autowired
37 AuditPass Pass; 38 AuditPass Pass;
@@ -130,6 +131,14 @@ public class CommentsController { @@ -130,6 +131,14 @@ public class CommentsController {
130 comment.setComment_original_url(shyContent.getContent_url()); 131 comment.setComment_original_url(shyContent.getContent_url());
131 } 132 }
132 } 133 }
  134 +
  135 + //评论的类型
  136 + if(CommonConst.CATEGORY_TOPIC.equals(comment.getType())){
  137 + comment.setType("话题");
  138 + }else{
  139 + comment.setType("其他");
  140 + }
  141 +
133 } 142 }
134 } 143 }
135 /* 获取参数值给前台 用来判断是否需要把查看显示出来 state recive*/ 144 /* 获取参数值给前台 用来判断是否需要把查看显示出来 state recive*/
src/main/java/com/cnlive/shenhe/controller/ContentController.java
@@ -45,7 +45,7 @@ import java.util.List; @@ -45,7 +45,7 @@ import java.util.List;
45 45
46 @Controller 46 @Controller
47 @RequestMapping("/content") 47 @RequestMapping("/content")
48 -public class ContentController { 48 +public class ContentController extends BaseController {
49 private static Logger logger = LoggerFactory.getLogger(ContentController.class); 49 private static Logger logger = LoggerFactory.getLogger(ContentController.class);
50 @Autowired 50 @Autowired
51 AuditPass Pass; 51 AuditPass Pass;
@@ -91,7 +91,8 @@ public class ContentController { @@ -91,7 +91,8 @@ public class ContentController {
91 if(CommonUtils.isNotNull(shySite)){ 91 if(CommonUtils.isNotNull(shySite)){
92 spid = shySite.getSpid(); 92 spid = shySite.getSpid();
93 }else{ 93 }else{
94 - return "page/sitesError.html"; 94 + setmodel_site(model);
  95 + return "error.html";
95 } 96 }
96 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 97 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
97 spid = null; 98 spid = null;
src/main/java/com/cnlive/shenhe/controller/EmailController.java
@@ -40,7 +40,7 @@ import javax.servlet.http.HttpSession; @@ -40,7 +40,7 @@ import javax.servlet.http.HttpSession;
40 */ 40 */
41 @Controller 41 @Controller
42 @RequestMapping("/email") 42 @RequestMapping("/email")
43 -public class EmailController { 43 +public class EmailController extends BaseController {
44 44
45 @Autowired 45 @Autowired
46 EmailServiceImpl emailServiceImpl; 46 EmailServiceImpl emailServiceImpl;
@@ -121,8 +121,9 @@ public class EmailController { @@ -121,8 +121,9 @@ public class EmailController {
121 121
122 122
123 @PostMapping(value = "/write") 123 @PostMapping(value = "/write")
124 - public String write(Integer id,String email,String remark, String[] write_business, HttpSession session, String redirect_url) { 124 + public String write(Model model,Integer id,String email,String remark, String[] write_business, HttpSession session, String redirect_url) {
125 if(CommonUtils.isEmpty(email)&&CommonUtils.isEmpty(remark)){ 125 if(CommonUtils.isEmpty(email)&&CommonUtils.isEmpty(remark)){
  126 + setmodel_param(model,"email,remark不能为空");
126 return "error.html"; 127 return "error.html";
127 } 128 }
128 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 129 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
@@ -137,7 +138,8 @@ public class EmailController { @@ -137,7 +138,8 @@ public class EmailController {
137 if (success) { 138 if (success) {
138 return "redirect:" + redirect_url; 139 return "redirect:" + redirect_url;
139 } else { 140 } else {
140 - return "error.html"; 141 + setmodel_result(model);
  142 + return "error.html";
141 } 143 }
142 } 144 }
143 145
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
@@ -45,7 +45,7 @@ import java.util.Map; @@ -45,7 +45,7 @@ import java.util.Map;
45 45
46 @Controller 46 @Controller
47 @RequestMapping("/liveApply") 47 @RequestMapping("/liveApply")
48 -public class LiveApplyController { 48 +public class LiveApplyController extends BaseController {
49 private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class); 49 private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class);
50 @Autowired 50 @Autowired
51 AuditPass Pass; 51 AuditPass Pass;
@@ -131,7 +131,7 @@ public class LiveApplyController { @@ -131,7 +131,7 @@ public class LiveApplyController {
131 */ 131 */
132 @GetMapping("/page") 132 @GetMapping("/page")
133 public Object getListLiveApply(Model model,String start_date,String end_date, 133 public Object getListLiveApply(Model model,String start_date,String end_date,
134 - String theme, Integer business_model, Integer page,Integer pageSize, 134 + String theme, String business_model, Integer page,Integer pageSize,
135 Integer shenhe_state,Integer receive, String sp_desc,String orderByClause, HttpSession session) { 135 Integer shenhe_state,Integer receive, String sp_desc,String orderByClause, HttpSession session) {
136 System.out.println("进入直播申请内容页"); 136 System.out.println("进入直播申请内容页");
137 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 137 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
@@ -147,7 +147,8 @@ public class LiveApplyController { @@ -147,7 +147,8 @@ public class LiveApplyController {
147 if(CommonUtils.isNotNull(shySite)){ 147 if(CommonUtils.isNotNull(shySite)){
148 spid = shySite.getSpid(); 148 spid = shySite.getSpid();
149 }else{ 149 }else{
150 - return "page/sitesError.html"; 150 + setmodel_site(model);
  151 + return "error.html";
151 } 152 }
152 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 153 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
153 spid = null; 154 spid = null;
@@ -352,16 +353,18 @@ public class LiveApplyController { @@ -352,16 +353,18 @@ public class LiveApplyController {
352 cell = row.createCell(4);//列 353 cell = row.createCell(4);//列
353 cell.setCellValue("直播主题"); 354 cell.setCellValue("直播主题");
354 cell = row.createCell(5);//列 355 cell = row.createCell(5);//列
355 - cell.setCellValue("直播申请方"); 356 + cell.setCellValue("spn昵称");
356 cell = row.createCell(6);//列 357 cell = row.createCell(6);//列
357 - cell.setCellValue("直播类型"); 358 + cell.setCellValue("直播申请方");
358 cell = row.createCell(7);//列 359 cell = row.createCell(7);//列
359 - cell.setCellValue("直播简介"); 360 + cell.setCellValue("直播类型");
360 cell = row.createCell(8);//列 361 cell = row.createCell(8);//列
361 - cell.setCellValue("频道_id"); 362 + cell.setCellValue("直播简介");
362 cell = row.createCell(9);//列 363 cell = row.createCell(9);//列
363 - cell.setCellValue("直播活动id"); 364 + cell.setCellValue("频道_id");
364 cell = row.createCell(10);//列 365 cell = row.createCell(10);//列
  366 + cell.setCellValue("直播活动id");
  367 + cell = row.createCell(11);//列
365 cell.setCellValue("创建时间"); 368 cell.setCellValue("创建时间");
366 369
367 for (int i = 0; i < liveApplyList.size(); i++) { 370 for (int i = 0; i < liveApplyList.size(); i++) {
@@ -393,14 +396,16 @@ public class LiveApplyController { @@ -393,14 +396,16 @@ public class LiveApplyController {
393 cell = row.createCell(5);//列 396 cell = row.createCell(5);//列
394 cell.setCellValue(sitesService.findspidDescByspid(liveApplyList.get(i).getSp_id()).getName()); 397 cell.setCellValue(sitesService.findspidDescByspid(liveApplyList.get(i).getSp_id()).getName());
395 cell = row.createCell(6);//列 398 cell = row.createCell(6);//列
396 - cell.setCellValue(liveApplyList.get(i).getLive_type()); 399 + cell.setCellValue(liveApplyList.get(i).getOrganization());
397 cell = row.createCell(7);//列 400 cell = row.createCell(7);//列
398 - cell.setCellValue(liveApplyList.get(i).getSimple_content()); 401 + cell.setCellValue(liveApplyList.get(i).getLive_type());
399 cell = row.createCell(8);//列 402 cell = row.createCell(8);//列
400 - cell.setCellValue(liveApplyList.get(i).getChannel_id()); 403 + cell.setCellValue(liveApplyList.get(i).getSimple_content());
401 cell = row.createCell(9);//列 404 cell = row.createCell(9);//列
402 - cell.setCellValue(liveApplyList.get(i).getActivity_id()); 405 + cell.setCellValue(liveApplyList.get(i).getChannel_id());
403 cell = row.createCell(10);//列 406 cell = row.createCell(10);//列
  407 + cell.setCellValue(liveApplyList.get(i).getActivity_id());
  408 + cell = row.createCell(11);//列
404 cell.setCellValue(CommonUtils.formatDate(liveApplyList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm")); 409 cell.setCellValue(CommonUtils.formatDate(liveApplyList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm"));
405 } 410 }
406 411
src/main/java/com/cnlive/shenhe/controller/LiveController.java
@@ -40,7 +40,7 @@ import java.util.List; @@ -40,7 +40,7 @@ import java.util.List;
40 40
41 @Controller 41 @Controller
42 @RequestMapping("/live") 42 @RequestMapping("/live")
43 -public class LiveController { 43 +public class LiveController extends BaseController {
44 private static Logger logger = LoggerFactory.getLogger(LiveController.class); 44 private static Logger logger = LoggerFactory.getLogger(LiveController.class);
45 @Autowired 45 @Autowired
46 AuditPass Pass; 46 AuditPass Pass;
@@ -133,7 +133,8 @@ public class LiveController { @@ -133,7 +133,8 @@ public class LiveController {
133 if(CommonUtils.isNotNull(shySite)){ 133 if(CommonUtils.isNotNull(shySite)){
134 spid = shySite.getSpid(); 134 spid = shySite.getSpid();
135 }else{ 135 }else{
136 - return "page/sitesError.html"; 136 + setmodel_site(model);
  137 + return "error.html";
137 } 138 }
138 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 139 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
139 spid = null; 140 spid = null;
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.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.ShyComments;
  8 +import com.cnlive.shenhe.entity.ShyContent;
  9 +import com.cnlive.shenhe.entity.ShyNotspeak;
  10 +import com.cnlive.shenhe.entity.ShySites;
  11 +import com.cnlive.shenhe.entity.ShyUsers;
  12 +import com.cnlive.shenhe.entity.ShyVideos;
  13 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  14 +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  15 +import com.cnlive.shenhe.serviceImpl.NotspeakServiceImpl;
  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.github.pagehelper.PageInfo;
  22 +import org.slf4j.Logger;
  23 +import org.slf4j.LoggerFactory;
  24 +import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.beans.factory.annotation.Value;
  26 +import org.springframework.stereotype.Controller;
  27 +import org.springframework.ui.Model;
  28 +import org.springframework.web.bind.annotation.*;
  29 +
  30 +import javax.servlet.http.HttpSession;
  31 +import java.util.Date;
  32 +import java.util.List;
  33 +
  34 +
  35 +@Controller
  36 +@RequestMapping("/notSpeak")
  37 +public class NotSpeakController extends BaseController {
  38 + private static Logger logger = LoggerFactory.getLogger(NotSpeakController.class);
  39 + @Autowired
  40 + AuditPass Pass;
  41 + @Autowired
  42 + CommentsServiceImpl commentsService;
  43 + @Autowired
  44 + NotspeakServiceImpl notSpeakService;
  45 +
  46 + @Autowired
  47 + UsersServiceImpl usersService;
  48 +
  49 + @Autowired
  50 + SitesServiceImpl sitesService;
  51 + @Autowired
  52 + ContentServiceImpl contentService;
  53 +
  54 + /**
  55 + * 禁言列表页
  56 + *
  57 + * @param activity_id
  58 + * @param content
  59 + * @param is_hot
  60 + * @param start_date
  61 + * @param end_date
  62 + * @param state
  63 + * @param page
  64 + * @param pageSize
  65 + * @param orderByClause
  66 + * @return
  67 + */
  68 + @GetMapping("/page")
  69 + public String getPage(Model model, String user_name, Integer user_id,Integer state,
  70 + Integer page, Integer pageSize, String orderByClause, HttpSession session) {
  71 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  72 + if(CommonUtils.isNull(sessionUser)){
  73 + return "redirect:/users/login";
  74 + }
  75 + String userId = sessionUser.getUserId();
  76 + if (CommonUtils.isNull(page)) page = 1;
  77 + if (CommonUtils.isNull(pageSize)) pageSize = 10;
  78 + PageInfo<ShyNotspeak> shyNotspeakPage = notSpeakService.getPage(user_name,user_id, state, page, pageSize, orderByClause);
  79 + List<ShyNotspeak> list = shyNotspeakPage.getList();
  80 + if (!list.isEmpty()) {
  81 + for (ShyNotspeak notspeak : list) {
  82 + String updater = CommonUtils.isEmpty(notspeak.getUpdater()) || "null".equals(notspeak.getUpdater())? "无":notspeak.getUpdater();
  83 + String auditor_id = notspeak.getAuditor();
  84 + if (CommonUtils.isNotEmpty(auditor_id)) {
  85 + ShyUsers user = new ShyUsers();
  86 + user.setUser_id(auditor_id);
  87 + user = usersService.select(user);
  88 + if (CommonUtils.isNotNull(user)) {
  89 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  90 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  91 + updater = userName ;
  92 + }
  93 + }
  94 + notspeak.setUpdater(updater);
  95 + if(null!=notspeak.getSp_id()){
  96 + //显示spid简称
  97 + ShySites shySites = sitesService.findspidDescByspid(notspeak.getSp_id());
  98 + if (CommonUtils.isNotNull(shySites)) {
  99 + notspeak.setSpid_desc(shySites.getName());
  100 + }
  101 + }else{
  102 + notspeak.setSpid_desc("sp无法显示");
  103 + }
  104 + }
  105 + }
  106 + model.addAttribute("pageSize", pageSize);
  107 + model.addAttribute("notspeakPage", shyNotspeakPage);
  108 + return "page/notspeak.html";
  109 + }
  110 +
  111 +
  112 + /**
  113 + * 禁言(通过评论进入)
  114 + * @param commentId
  115 + * @param type
  116 + * @param time
  117 + * @param session
  118 + * @return
  119 + */
  120 + @PostMapping("/notSpeakByComment")
  121 + @ResponseBody
  122 + public ResponseBean notSpeakByComment(Integer commentId,Integer time, HttpSession session) {
  123 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  124 + String userId = sessionUser.getUserId();
  125 + ResponseBean success = notSpeakService.notSpeakByComment(commentId, time,userId);
  126 + return success;
  127 + }
  128 + /**
  129 + * 查询禁言状态(通过评论进入)
  130 + * @param commentId
  131 + * @param type
  132 + * @param time
  133 + * @param session
  134 + * @return
  135 + */
  136 + @PostMapping("/querySpeakState")
  137 + @ResponseBody
  138 + public ResponseBean querySpeakState(Integer commentId, HttpSession session) {
  139 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  140 + String userId = sessionUser.getUserId();
  141 + ResponseBean success = notSpeakService.querySpeakState(commentId,userId);
  142 + return success;
  143 + }
  144 + /**
  145 + * 禁言(通过禁言管理进入)
  146 + * @param notSpeakId
  147 + * @param type
  148 + * @param time
  149 + * @param session
  150 + * @return
  151 + */
  152 + @PostMapping("/speak")
  153 + @ResponseBody
  154 + public ResponseBean speak(Integer notSpeakId,Integer type,Integer time, HttpSession session) {
  155 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  156 + String userId = sessionUser.getUserId();
  157 + ResponseBean success = notSpeakService.speak(notSpeakId,type, time,userId);
  158 + return success;
  159 + }
  160 +}
src/main/java/com/cnlive/shenhe/controller/SitesController.java
@@ -26,7 +26,7 @@ import java.util.List; @@ -26,7 +26,7 @@ import java.util.List;
26 */ 26 */
27 @Controller 27 @Controller
28 @RequestMapping("/sites") 28 @RequestMapping("/sites")
29 -public class SitesController { 29 +public class SitesController extends BaseController {
30 30
31 private static Logger logger = LoggerFactory.getLogger(SitesController.class); 31 private static Logger logger = LoggerFactory.getLogger(SitesController.class);
32 32
@@ -50,7 +50,8 @@ public class SitesController { @@ -50,7 +50,8 @@ public class SitesController {
50 } 50 }
51 Integer spid = sessionUser.getSpid(); 51 Integer spid = sessionUser.getSpid();
52 if (!sessionUser.isMaster() && spid != 0) { 52 if (!sessionUser.isMaster() && spid != 0) {
53 - return "page/error.html"; 53 + setmodel_site(model);
  54 + return "error.html";
54 } 55 }
55 if (spid == 0) spid = null; 56 if (spid == 0) spid = null;
56 if (CommonUtils.isNull(page)) page = 1; 57 if (CommonUtils.isNull(page)) page = 1;
@@ -79,12 +80,11 @@ public class SitesController { @@ -79,12 +80,11 @@ public class SitesController {
79 80
80 81
81 @PostMapping(value = "/write") 82 @PostMapping(value = "/write")
82 - public String write(Integer siteId, String[] write_business, HttpSession session, String redirect_url) { 83 + public String write(Model model,Integer siteId, String[] write_business, HttpSession session, String redirect_url) {
83 ShySites site = sitesService.get(siteId); 84 ShySites site = sitesService.get(siteId);
84 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 85 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
85 - Integer spid = sessionUser.getSpid();  
86 - if ((!sessionUser.isMaster() && spid != 0) ) {  
87 - return "page/error.html"; 86 + if(CommonUtils.isNull(sessionUser)){
  87 + return "redirect:/users/login";
88 } 88 }
89 String write = ""; 89 String write = "";
90 if (CommonUtils.isNotNull(write_business) && write_business.length > 0) { 90 if (CommonUtils.isNotNull(write_business) && write_business.length > 0) {
@@ -98,7 +98,8 @@ public class SitesController { @@ -98,7 +98,8 @@ public class SitesController {
98 if (success) { 98 if (success) {
99 return "redirect:" + redirect_url; 99 return "redirect:" + redirect_url;
100 } else { 100 } else {
101 - return "error.html"; 101 + setmodel_result(model);
  102 + return "error.html";
102 } 103 }
103 } 104 }
104 105
src/main/java/com/cnlive/shenhe/controller/TopicController.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.ShyComments;
  8 +import com.cnlive.shenhe.entity.ShyContent;
  9 +import com.cnlive.shenhe.entity.ShyLive;
  10 +import com.cnlive.shenhe.entity.ShySites;
  11 +import com.cnlive.shenhe.entity.ShyTopic;
  12 +import com.cnlive.shenhe.entity.ShyUsers;
  13 +import com.cnlive.shenhe.entity.ShyVideos;
  14 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  15 +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  16 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  17 +import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
  18 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  19 +import com.cnlive.shenhe.utils.AuditPass;
  20 +import com.cnlive.shenhe.utils.CommonConst;
  21 +import com.cnlive.shenhe.utils.CommonUtils;
  22 +import com.github.pagehelper.PageInfo;
  23 +
  24 +import org.apache.poi.xssf.usermodel.XSSFCell;
  25 +import org.apache.poi.xssf.usermodel.XSSFRow;
  26 +import org.apache.poi.xssf.usermodel.XSSFSheet;
  27 +import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  28 +import org.slf4j.Logger;
  29 +import org.slf4j.LoggerFactory;
  30 +import org.springframework.beans.factory.annotation.Autowired;
  31 +import org.springframework.stereotype.Controller;
  32 +import org.springframework.ui.Model;
  33 +import org.springframework.web.bind.annotation.*;
  34 +
  35 +import javax.servlet.ServletOutputStream;
  36 +import javax.servlet.http.HttpServletResponse;
  37 +import javax.servlet.http.HttpSession;
  38 +
  39 +import java.io.BufferedInputStream;
  40 +import java.io.BufferedOutputStream;
  41 +import java.io.ByteArrayInputStream;
  42 +import java.io.ByteArrayOutputStream;
  43 +import java.io.InputStream;
  44 +import java.util.Date;
  45 +import java.util.List;
  46 +
  47 +
  48 +@Controller
  49 +@RequestMapping("/topic")
  50 +public class TopicController extends BaseController {
  51 + private static Logger logger = LoggerFactory.getLogger(TopicController.class);
  52 + @Autowired
  53 + AuditPass Pass;
  54 + @Autowired
  55 + CommentsServiceImpl commentsService;
  56 + @Autowired
  57 + TopicServiceImpl topicService;
  58 + @Autowired
  59 + SitesServiceImpl sitesService;
  60 +
  61 + @Autowired
  62 + UsersServiceImpl usersService;
  63 +
  64 + /**
  65 + * 图文列表
  66 + *
  67 + * @param model
  68 + * @param title
  69 + * @param start_date
  70 + * @param end_date
  71 + * @param receive_status
  72 + * @param sp_desc
  73 + * @param page
  74 + * @param pageSize
  75 + * @param orderByClause
  76 + * @param session
  77 + * @return
  78 + */
  79 + @GetMapping("/page")
  80 + public String getPage(Model model, String topic_name,String topic_id, String topic_tag,
  81 + String start_date, String end_date, Integer shenhe_status, String sp_desc,
  82 + Integer page, Integer pageSize,Integer receive, String orderByClause, HttpSession session) {
  83 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  84 + if(CommonUtils.isNull(sessionUser)){
  85 + return "redirect:/users/login";
  86 + }
  87 + Integer spid = sessionUser.getSpid();
  88 + String userId = sessionUser.getUserId();
  89 + if (CommonUtils.isNull(page)) page = 1;
  90 + if (CommonUtils.isNull(pageSize)) pageSize = 10;
  91 + if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  92 + ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  93 + if(CommonUtils.isNotNull(shySite)){
  94 + spid = shySite.getSpid();
  95 + }else{
  96 + setmodel_site(model);
  97 + return "error.html";
  98 + }
  99 + } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  100 + spid = null;
  101 + }
  102 + Date sDate = null;
  103 + Date eDate = null;
  104 +
  105 + if (CommonUtils.isNotEmpty(start_date)) {
  106 + try {
  107 + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  108 + } catch (Exception e) {
  109 + }
  110 + }
  111 + if (CommonUtils.isNotEmpty(end_date)) {
  112 + try {
  113 + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  114 + } catch (Exception e) {
  115 + }
  116 + }
  117 + PageInfo<ShyTopic> topicPage = topicService.getPage( topic_name,topic_tag,topic_id, sDate, eDate, shenhe_status, null, page, pageSize, orderByClause, spid, userId,receive);
  118 + List<ShyTopic> list = topicPage.getList();
  119 + if (!list.isEmpty()) {
  120 + for (ShyTopic topic : list) {
  121 + if (topic.getShenhe_status() != CommonConst.AUDIT_INTT) {
  122 + String auditor_id = topic.getAuditor_id();
  123 + String updater = CommonUtils.isEmpty(topic.getUpdater()) || "null".equals(topic.getUpdater())? "白名单":topic.getUpdater();
  124 + updater =sitesService.getUpdater(updater,auditor_id);
  125 + topic.setUpdater(updater);
  126 + }
  127 + //显示spid简称
  128 + if(CommonUtils.isNotNull(topic.getSp_id())){
  129 + ShySites shySites = sitesService.findspidDescByspid(topic.getSp_id());
  130 + if (CommonUtils.isNotNull(shySites)) {
  131 + topic.setSp_desc(shySites.getName());
  132 + }
  133 + }else{
  134 + topic.setSp_desc("sp无法显示");
  135 + }
  136 + }
  137 + }
  138 + model.addAttribute("topicPage", topicPage);
  139 + model.addAttribute("pageSize", pageSize);
  140 + return "page/topic.html";
  141 + }
  142 +
  143 +
  144 + /**
  145 + * 审核通过
  146 + *
  147 + * @param ids
  148 + * @return
  149 + */
  150 + @PostMapping("/pass")
  151 + @ResponseBody
  152 + public ResponseBean pass(String ids, HttpSession session) {
  153 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  154 + String userId = sessionUser.getUserId();
  155 + boolean success =false;
  156 + String[] topicIds = ids.split(",");
  157 + for (String id : topicIds) {
  158 + success = topicService.callback(id,"审核通过", CommonConst.AUDIT_SUCCESS, userId,"");
  159 + if(!success){
  160 + return new ResponseBean(ErrorEnum.ERROR);
  161 + }
  162 + }
  163 + return new ResponseBean(ErrorEnum.SUCCESS);
  164 + }
  165 +
  166 + /**
  167 + * 审核拒绝
  168 + *
  169 + * @param ids
  170 + * @return
  171 + */
  172 + @PostMapping("/refuse")
  173 + @ResponseBody
  174 + public ResponseBean refuse(String ids,String msg, HttpSession session) {
  175 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  176 + String userId = sessionUser.getUserId();
  177 + boolean success =false;
  178 + String[] contentIds = ids.split(",");
  179 + for (String id : contentIds) {
  180 + success = topicService.callback(id,msg, CommonConst.AUDIT_REFUSE, userId,"");
  181 + if(!success){
  182 + return new ResponseBean(ErrorEnum.ERROR);
  183 + }
  184 + }
  185 + return new ResponseBean(ErrorEnum.SUCCESS);
  186 +
  187 + }
  188 +
  189 +
  190 + /**
  191 + * 根据条件导出excel
  192 + */
  193 +// @GetMapping("excel")
  194 +// public void getExcel( String title,String contentId, String content_tag,
  195 +// String start_date, String end_date, Integer receive_status, String sp_desc,
  196 +// Integer page, Integer pageSize, String orderByClause, HttpSession session,HttpServletResponse response) {
  197 +// SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  198 +// Integer spid = sessionUser.getSpid();
  199 +// String userId = sessionUser.getUserId();
  200 +// if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  201 +// ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  202 +// if(CommonUtils.isNotNull(shySite)){
  203 +// spid = shySite.getSpid();
  204 +// }
  205 +// }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  206 +// spid = null;
  207 +// }
  208 +// Date sDate = null;
  209 +// Date eDate = null;
  210 +//
  211 +// if (CommonUtils.isNotEmpty(start_date)) {
  212 +// try {
  213 +// sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  214 +// } catch (Exception e) {
  215 +// }
  216 +// }
  217 +// if (CommonUtils.isNotEmpty(end_date)) {
  218 +// try {
  219 +// eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  220 +// } catch (Exception e) {
  221 +// }
  222 +// }
  223 +// List<ShyContent> contentList = contentService.findByCondition(title,content_tag,contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid);
  224 +//
  225 +// String fileName = "图文数据";
  226 +//
  227 +// XSSFWorkbook wb = new XSSFWorkbook();
  228 +// ServletOutputStream out = null;
  229 +// BufferedInputStream bis = null;
  230 +// BufferedOutputStream bos = null;
  231 +// try {
  232 +// XSSFSheet sheetlist = wb.createSheet(fileName);
  233 +// XSSFRow row = sheetlist.createRow(0);//行
  234 +// XSSFCell cell = row.createCell(0);//列
  235 +// cell.setCellValue("id");
  236 +// cell = row.createCell(1);//列
  237 +// cell.setCellValue("sp昵称");
  238 +// cell = row.createCell(2);//列
  239 +// cell.setCellValue("图文id");
  240 +// cell = row.createCell(3);//列
  241 +// cell.setCellValue("内容标题");
  242 +// cell = row.createCell(4);//列
  243 +// cell.setCellValue("图文标签");
  244 +// cell = row.createCell(5);//列
  245 +// cell.setCellValue("审核类型");
  246 +// cell = row.createCell(6);//列
  247 +// cell.setCellValue("内容状态");
  248 +// cell = row.createCell(7);//列
  249 +// cell.setCellValue("图文创建时间");
  250 +// cell = row.createCell(8);//列
  251 +// cell.setCellValue("图文送审时间");
  252 +// cell = row.createCell(9);//列
  253 +// cell.setCellValue("领取状态");
  254 +// cell = row.createCell(10);//列
  255 +// cell.setCellValue("审核人");
  256 +// cell = row.createCell(11);//列
  257 +// cell.setCellValue("审核意见");
  258 +// cell = row.createCell(12);//列
  259 +// cell.setCellValue("来源(昵称)");
  260 +// cell = row.createCell(13);//列
  261 +// cell.setCellValue("作者(sid)");
  262 +// cell = row.createCell(14);//列
  263 +// cell.setCellValue("图文url");
  264 +//
  265 +// for (int i = 0; i < contentList.size(); i++) {
  266 +// row = sheetlist.createRow((short) (i + 1));//行
  267 +// cell = row.createCell(0);//列
  268 +// cell.setCellValue(contentList.get(i).getId());
  269 +// cell = row.createCell(1);//列
  270 +// cell.setCellValue(sitesService.findspidDescByspid(contentList.get(i).getSp_id()).getName());
  271 +// cell = row.createCell(2);//列
  272 +// cell.setCellValue(contentList.get(i).getContent_id());
  273 +// cell = row.createCell(3);//列
  274 +// cell.setCellValue(contentList.get(i).getTitle());
  275 +// /*状态需要处理成用户可读*/
  276 +// String contentTag = "";//图文标签 content:图文发布,moment:朋友圈
  277 +// if (contentList.get(i).getContent_tag().equals("content") ) {
  278 +// contentTag = "图文发布";
  279 +// } else if (contentList.get(i).getContent_tag().equals("moment")) {
  280 +// contentTag = "朋友圈";
  281 +// }
  282 +// cell = row.createCell(4);//列
  283 +// cell.setCellValue(contentTag);
  284 +//
  285 +// /*状态需要处理成用户可读*/
  286 +// String shenheType = "";//审核类型,1:免审,2:机审,3:人工审
  287 +// if (contentList.get(i).getShenhe_type() == 1) {
  288 +// shenheType = "免审";
  289 +// } else if (contentList.get(i).getShenhe_type() == 2) {
  290 +// shenheType = "机审";
  291 +// } else {
  292 +// shenheType = "人工审";
  293 +// }
  294 +// cell = row.createCell(5);//列
  295 +// cell.setCellValue(shenheType);
  296 +//
  297 +// /*状态需要处理成用户可读*/
  298 +// String contentStatus = "";//内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  299 +// if (contentList.get(i).getContent_status() == 0) {
  300 +// contentStatus = "待发布";
  301 +// } else if (contentList.get(i).getContent_status() == 1) {
  302 +// contentStatus = "已发布";
  303 +// } else if(contentList.get(i).getContent_status() == 2){
  304 +// contentStatus = "已下线";
  305 +// }else if(contentList.get(i).getContent_status() == 3){
  306 +// contentStatus = "已删除";
  307 +// }
  308 +//
  309 +// cell = row.createCell(6);//列
  310 +// cell.setCellValue(contentStatus);
  311 +// cell = row.createCell(7);//列
  312 +// cell.setCellValue(contentList.get(i).getContent_time()==null?"":CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss"));
  313 +// cell = row.createCell(8);//列
  314 +// cell.setCellValue(contentList.get(i).getCreate_date()==null?"":CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss"));
  315 +//
  316 +// /*状态需要处理成用户可读*/
  317 +// String receiveStatus = "";//领取状态。0:未领取;1:已领取,2:已审核
  318 +// if (contentList.get(i).getReceive_status() == 1) {
  319 +// receiveStatus = "已领取";
  320 +// } else if (contentList.get(i).getReceive_status() == 2) {
  321 +// receiveStatus = "已审核";
  322 +// } else {
  323 +// receiveStatus = "未领取";
  324 +// }
  325 +//
  326 +// cell = row.createCell(9);//列
  327 +// cell.setCellValue(receiveStatus);
  328 +//
  329 +// /* 审核员需要做处理*/
  330 +// String updater = "";//审核员名字
  331 +// if (contentList.get(i).getReceive_status() != CommonConst.RECEIVE_BEFORE) {
  332 +// updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater())? "自动通过":contentList.get(i).getUpdater();
  333 +// String auditor_id = contentList.get(i).getAuditor_id();
  334 +// if (CommonUtils.isNotEmpty(auditor_id)) {
  335 +// ShyUsers user = new ShyUsers();
  336 +// user.setUser_id(auditor_id);
  337 +// user = usersService.select(user);
  338 +// if (CommonUtils.isNotNull(user)) {
  339 +// String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  340 +// String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  341 +// updater = userName ;
  342 +// }
  343 +// }
  344 +// }
  345 +// cell = row.createCell(10);//列
  346 +// cell.setCellValue(updater);
  347 +//
  348 +//
  349 +//
  350 +// cell = row.createCell(11);//列
  351 +// cell.setCellValue(contentList.get(i).getShenhe_msg());
  352 +// cell = row.createCell(12);//列
  353 +// cell.setCellValue(contentList.get(i).getSource());
  354 +// cell = row.createCell(13);//列
  355 +// cell.setCellValue(contentList.get(i).getAuthor());
  356 +// cell = row.createCell(14);//列
  357 +// cell.setCellValue(contentList.get(i).getContent_url());
  358 +// }
  359 +//
  360 +// ByteArrayOutputStream os = new ByteArrayOutputStream();
  361 +// wb.write(os);
  362 +// byte[] content = os.toByteArray();
  363 +// InputStream is = new ByteArrayInputStream(content);
  364 +// response.setContentType("application/vnd.ms-excel;charset=utf-8");
  365 +// response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1"));
  366 +// out = response.getOutputStream();
  367 +// bis = new BufferedInputStream(is);
  368 +// bos = new BufferedOutputStream(out);
  369 +// byte[] buff = new byte[2048];
  370 +// int bytesRead;
  371 +// while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
  372 +// bos.write(buff, 0, bytesRead);
  373 +// }
  374 +// } catch (final Exception e) {
  375 +// e.printStackTrace();
  376 +// try {
  377 +// if (bis != null)
  378 +// bis.close();
  379 +// if (bos != null)
  380 +// bos.close();
  381 +// } catch (Exception e1) {
  382 +// e1.printStackTrace();
  383 +// }
  384 +// } finally {
  385 +// try {
  386 +// if (bis != null)
  387 +// bis.close();
  388 +// if (bos != null)
  389 +// bos.close();
  390 +// } catch (Exception e2) {
  391 +// e2.printStackTrace();
  392 +// }
  393 +// }
  394 +// }
  395 +}
src/main/java/com/cnlive/shenhe/controller/UsersController.java
@@ -38,7 +38,7 @@ import javax.servlet.http.HttpSession; @@ -38,7 +38,7 @@ import javax.servlet.http.HttpSession;
38 */ 38 */
39 @Controller 39 @Controller
40 @RequestMapping("/users") 40 @RequestMapping("/users")
41 -public class UsersController { 41 +public class UsersController extends BaseController {
42 42
43 @Autowired 43 @Autowired
44 UsersServiceImpl usersService; 44 UsersServiceImpl usersService;
@@ -92,9 +92,6 @@ public class UsersController { @@ -92,9 +92,6 @@ public class UsersController {
92 return "redirect:/users/login"; 92 return "redirect:/users/login";
93 } 93 }
94 Integer spid = sessionUser.getSpid(); 94 Integer spid = sessionUser.getSpid();
95 - if (!sessionUser.isMaster() && spid != 0) {  
96 - return "page/error.html";  
97 - }  
98 if (spid == 0) spid = null; 95 if (spid == 0) spid = null;
99 if (CommonUtils.isNull(page)) page = 1; 96 if (CommonUtils.isNull(page)) page = 1;
100 if (CommonUtils.isNull(pageSize)) pageSize = 10; 97 if (CommonUtils.isNull(pageSize)) pageSize = 10;
@@ -145,12 +142,12 @@ public class UsersController { @@ -145,12 +142,12 @@ public class UsersController {
145 142
146 143
147 @PostMapping(value = "/write") 144 @PostMapping(value = "/write")
148 - public String write(Integer userId, String[] write_notice, HttpSession session, String redirect_url) { 145 + public String write(Model model,Integer userId, String[] write_notice, HttpSession session, String redirect_url) {
149 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 146 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
150 - Integer spid = sessionUser.getSpid();  
151 - if (spid != 0) {  
152 - return "page/error.html";  
153 - } 147 +// Integer spid = sessionUser.getSpid();
  148 +// if (spid != 0) {
  149 +// return "page/error.html";
  150 +// }
154 ShyUsers user = usersService.get(userId); 151 ShyUsers user = usersService.get(userId);
155 String write = ""; 152 String write = "";
156 if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) { 153 if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) {
@@ -164,7 +161,8 @@ public class UsersController { @@ -164,7 +161,8 @@ public class UsersController {
164 if (success) { 161 if (success) {
165 return "redirect:" + redirect_url; 162 return "redirect:" + redirect_url;
166 } else { 163 } else {
167 - return "error.html"; 164 + setmodel_result(model);
  165 + return "error.html";
168 } 166 }
169 } 167 }
170 168
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
@@ -36,7 +36,7 @@ import javax.servlet.http.HttpSession; @@ -36,7 +36,7 @@ import javax.servlet.http.HttpSession;
36 */ 36 */
37 @Controller 37 @Controller
38 @RequestMapping("/usersFree") 38 @RequestMapping("/usersFree")
39 -public class UsersFreeController { 39 +public class UsersFreeController extends BaseController {
40 40
41 @Autowired 41 @Autowired
42 UsersfreeServiceImpl usersfreeService; 42 UsersfreeServiceImpl usersfreeService;
@@ -100,8 +100,9 @@ public class UsersFreeController { @@ -100,8 +100,9 @@ public class UsersFreeController {
100 100
101 101
102 @PostMapping(value = "/write") 102 @PostMapping(value = "/write")
103 - public String write(String userId,String userMobile,Integer spId, String[] write_business, HttpSession session, String redirect_url) { 103 + public String write(Model model,String userId,String userMobile,Integer spId, String[] write_business, HttpSession session, String redirect_url) {
104 if(CommonUtils.isEmpty(userId)&&CommonUtils.isEmpty(userMobile)){ 104 if(CommonUtils.isEmpty(userId)&&CommonUtils.isEmpty(userMobile)){
  105 + setmodel_param(model,"userId,userMobile不能为空!");
105 return "error.html"; 106 return "error.html";
106 } 107 }
107 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 108 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
@@ -116,6 +117,7 @@ public class UsersFreeController { @@ -116,6 +117,7 @@ public class UsersFreeController {
116 if (success) { 117 if (success) {
117 return "redirect:" + redirect_url; 118 return "redirect:" + redirect_url;
118 } else { 119 } else {
  120 + setmodel_result(model);
119 return "error.html"; 121 return "error.html";
120 } 122 }
121 } 123 }
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -129,7 +129,8 @@ public class VideosController extends BaseController { @@ -129,7 +129,8 @@ public class VideosController extends BaseController {
129 if(CommonUtils.isNotNull(shySite)){ 129 if(CommonUtils.isNotNull(shySite)){
130 spid = shySite.getSpid(); 130 spid = shySite.getSpid();
131 }else{ 131 }else{
132 - return "page/sitesError.html"; 132 + setmodel_site(model);
  133 + return "error.html";
133 } 134 }
134 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 135 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
135 spid = null; 136 spid = null;
src/main/java/com/cnlive/shenhe/entity/ShyComments.java
@@ -43,6 +43,16 @@ public class ShyComments { @@ -43,6 +43,16 @@ public class ShyComments {
43 */ 43 */
44 private Date comment_time; 44 private Date comment_time;
45 45
  46 + /**
  47 + * 评论类型,topic:话题
  48 + */
  49 + private String type;
  50 +
  51 + /**
  52 + * 评论的级别
  53 + */
  54 + private Integer level;
  55 +
46 private Integer spid; 56 private Integer spid;
47 57
48 /** 58 /**
@@ -260,6 +270,42 @@ public class ShyComments { @@ -260,6 +270,42 @@ public class ShyComments {
260 } 270 }
261 271
262 /** 272 /**
  273 + * 获取评论类型,topic:话题
  274 + *
  275 + * @return type - 评论类型,topic:话题
  276 + */
  277 + public String getType() {
  278 + return type;
  279 + }
  280 +
  281 + /**
  282 + * 设置评论类型,topic:话题
  283 + *
  284 + * @param type 评论类型,topic:话题
  285 + */
  286 + public void setType(String type) {
  287 + this.type = type;
  288 + }
  289 +
  290 + /**
  291 + * 获取评论的级别
  292 + *
  293 + * @return level - 评论的级别
  294 + */
  295 + public Integer getLevel() {
  296 + return level;
  297 + }
  298 +
  299 + /**
  300 + * 设置评论的级别
  301 + *
  302 + * @param level 评论的级别
  303 + */
  304 + public void setLevel(Integer level) {
  305 + this.level = level;
  306 + }
  307 +
  308 + /**
263 * @return spid 309 * @return spid
264 */ 310 */
265 public Integer getSpid() { 311 public Integer getSpid() {
src/main/java/com/cnlive/shenhe/entity/ShyNotspeak.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import java.util.Date;
  4 +import javax.persistence.*;
  5 +
  6 +@Table(name = "shy_notSpeak")
  7 +public class ShyNotspeak {
  8 + @Id
  9 + private Integer id;
  10 +
  11 + /**
  12 + * 用户昵称
  13 + */
  14 + private String user_name;
  15 +
  16 + /**
  17 + * 用户id
  18 + */
  19 + private Integer user_id;
  20 +
  21 + /**
  22 + * 用户头像
  23 + */
  24 + private String user_avatar;
  25 +
  26 + /**
  27 + * spId
  28 + */
  29 + private Integer sp_id;
  30 +
  31 + /**
  32 + * 当前状态 1:禁言 0:解禁
  33 + */
  34 + private Integer state;
  35 +
  36 + /**
  37 + * 禁言开始时间
  38 + */
  39 + private Date start_time;
  40 +
  41 + /**
  42 + * 禁言时长(分钟)
  43 + */
  44 + private Integer time;
  45 +
  46 + /**
  47 + * 禁言结束时间
  48 + */
  49 + private Date end_time;
  50 +
  51 + /**
  52 + * 禁言次数
  53 + */
  54 + private Integer count;
  55 +
  56 + /**
  57 + * 创建时间
  58 + */
  59 + private Date created_at;
  60 +
  61 + /**
  62 + * 更新时间
  63 + */
  64 + private Date updated_at;
  65 +
  66 + /**
  67 + * 更新着
  68 + */
  69 + private String updater;
  70 +
  71 + /**
  72 + * 审核员id
  73 + */
  74 + private String auditor;
  75 +
  76 + /**
  77 + * 禁言消息
  78 + */
  79 + private String msg;
  80 +
  81 + @Transient
  82 + private String spid_desc;
  83 +
  84 + /**
  85 + * @return id
  86 + */
  87 + public Integer getId() {
  88 + return id;
  89 + }
  90 +
  91 + /**
  92 + * @param id
  93 + */
  94 + public void setId(Integer id) {
  95 + this.id = id;
  96 + }
  97 +
  98 + /**
  99 + * 获取用户昵称
  100 + *
  101 + * @return user_name - 用户昵称
  102 + */
  103 + public String getUser_name() {
  104 + return user_name;
  105 + }
  106 +
  107 + /**
  108 + * 设置用户昵称
  109 + *
  110 + * @param user_name 用户昵称
  111 + */
  112 + public void setUser_name(String user_name) {
  113 + this.user_name = user_name;
  114 + }
  115 +
  116 + /**
  117 + * 获取用户id
  118 + *
  119 + * @return user_id - 用户id
  120 + */
  121 + public Integer getUser_id() {
  122 + return user_id;
  123 + }
  124 +
  125 + /**
  126 + * 设置用户id
  127 + *
  128 + * @param user_id 用户id
  129 + */
  130 + public void setUser_id(Integer user_id) {
  131 + this.user_id = user_id;
  132 + }
  133 +
  134 + /**
  135 + * 获取用户头像
  136 + *
  137 + * @return user_avatar - 用户头像
  138 + */
  139 + public String getUser_avatar() {
  140 + return user_avatar;
  141 + }
  142 +
  143 + /**
  144 + * 设置用户头像
  145 + *
  146 + * @param user_avatar 用户头像
  147 + */
  148 + public void setUser_avatar(String user_avatar) {
  149 + this.user_avatar = user_avatar;
  150 + }
  151 +
  152 + /**
  153 + * 获取spId
  154 + *
  155 + * @return sp_id - spId
  156 + */
  157 + public Integer getSp_id() {
  158 + return sp_id;
  159 + }
  160 +
  161 + /**
  162 + * 设置spId
  163 + *
  164 + * @param sp_id spId
  165 + */
  166 + public void setSp_id(Integer sp_id) {
  167 + this.sp_id = sp_id;
  168 + }
  169 +
  170 + /**
  171 + * 获取当前状态 1:禁言 0:解禁
  172 + *
  173 + * @return state - 当前状态 1:禁言 0:解禁
  174 + */
  175 + public Integer getState() {
  176 + return state;
  177 + }
  178 +
  179 + /**
  180 + * 设置当前状态 1:禁言 0:解禁
  181 + *
  182 + * @param state 当前状态 1:禁言 0:解禁
  183 + */
  184 + public void setState(Integer state) {
  185 + this.state = state;
  186 + }
  187 +
  188 + /**
  189 + * 获取禁言开始时间
  190 + *
  191 + * @return start_time - 禁言开始时间
  192 + */
  193 + public Date getStart_time() {
  194 + return start_time;
  195 + }
  196 +
  197 + /**
  198 + * 设置禁言开始时间
  199 + *
  200 + * @param start_time 禁言开始时间
  201 + */
  202 + public void setStart_time(Date start_time) {
  203 + this.start_time = start_time;
  204 + }
  205 +
  206 + /**
  207 + * 获取禁言时长(分钟)
  208 + *
  209 + * @return time - 禁言时长(分钟)
  210 + */
  211 + public Integer getTime() {
  212 + return time;
  213 + }
  214 +
  215 + /**
  216 + * 设置禁言时长(分钟)
  217 + *
  218 + * @param time 禁言时长(分钟)
  219 + */
  220 + public void setTime(Integer time) {
  221 + this.time = time;
  222 + }
  223 +
  224 + /**
  225 + * 获取禁言结束时间
  226 + *
  227 + * @return end_time - 禁言结束时间
  228 + */
  229 + public Date getEnd_time() {
  230 + return end_time;
  231 + }
  232 +
  233 + /**
  234 + * 设置禁言结束时间
  235 + *
  236 + * @param end_time 禁言结束时间
  237 + */
  238 + public void setEnd_time(Date end_time) {
  239 + this.end_time = end_time;
  240 + }
  241 +
  242 + /**
  243 + * 获取禁言次数
  244 + *
  245 + * @return count - 禁言次数
  246 + */
  247 + public Integer getCount() {
  248 + return count;
  249 + }
  250 +
  251 + /**
  252 + * 设置禁言次数
  253 + *
  254 + * @param count 禁言次数
  255 + */
  256 + public void setCount(Integer count) {
  257 + this.count = count;
  258 + }
  259 +
  260 + /**
  261 + * 获取创建时间
  262 + *
  263 + * @return created_at - 创建时间
  264 + */
  265 + public Date getCreated_at() {
  266 + return created_at;
  267 + }
  268 +
  269 + /**
  270 + * 设置创建时间
  271 + *
  272 + * @param created_at 创建时间
  273 + */
  274 + public void setCreated_at(Date created_at) {
  275 + this.created_at = created_at;
  276 + }
  277 +
  278 + /**
  279 + * 获取更新时间
  280 + *
  281 + * @return updated_at - 更新时间
  282 + */
  283 + public Date getUpdated_at() {
  284 + return updated_at;
  285 + }
  286 +
  287 + /**
  288 + * 设置更新时间
  289 + *
  290 + * @param updated_at 更新时间
  291 + */
  292 + public void setUpdated_at(Date updated_at) {
  293 + this.updated_at = updated_at;
  294 + }
  295 +
  296 + /**
  297 + * 获取更新着
  298 + *
  299 + * @return updater - 更新着
  300 + */
  301 + public String getUpdater() {
  302 + return updater;
  303 + }
  304 +
  305 + /**
  306 + * 设置更新着
  307 + *
  308 + * @param updater 更新着
  309 + */
  310 + public void setUpdater(String updater) {
  311 + this.updater = updater;
  312 + }
  313 +
  314 + /**
  315 + * 获取审核员id
  316 + *
  317 + * @return auditor - 审核员id
  318 + */
  319 + public String getAuditor() {
  320 + return auditor;
  321 + }
  322 +
  323 + /**
  324 + * 设置审核员id
  325 + *
  326 + * @param auditor 审核员id
  327 + */
  328 + public void setAuditor(String auditor) {
  329 + this.auditor = auditor;
  330 + }
  331 +
  332 + /**
  333 + * 获取禁言消息
  334 + *
  335 + * @return msg - 禁言消息
  336 + */
  337 + public String getMsg() {
  338 + return msg;
  339 + }
  340 +
  341 + /**
  342 + * 设置禁言消息
  343 + *
  344 + * @param msg 禁言消息
  345 + */
  346 + public void setMsg(String msg) {
  347 + this.msg = msg;
  348 + }
  349 +
  350 + public String getSpid_desc() {
  351 + return spid_desc;
  352 + }
  353 +
  354 + public void setSpid_desc(String spid_desc) {
  355 + this.spid_desc = spid_desc;
  356 + }
  357 +
  358 +}
0 \ No newline at end of file 359 \ No newline at end of file
src/main/java/com/cnlive/shenhe/entity/ShyTopic.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import java.util.Date;
  4 +import javax.persistence.*;
  5 +
  6 +@Table(name = "shy_topic")
  7 +public class ShyTopic {
  8 + /**
  9 + * id
  10 + */
  11 + @Id
  12 + private Integer id;
  13 +
  14 + /**
  15 + * 话题id
  16 + */
  17 + private String topic_id;
  18 +
  19 + /**
  20 + * spId
  21 + */
  22 + private Integer sp_id;
  23 +
  24 + /**
  25 + * 话题图片
  26 + */
  27 + private String topic_image;
  28 +
  29 + /**
  30 + * 话题标签
  31 + */
  32 + private String topic_tag;
  33 +
  34 + /**
  35 + * 话题url
  36 + */
  37 + private String topic_url;
  38 +
  39 + /**
  40 + * 话题创建时间
  41 + */
  42 + private String topic_time;
  43 +
  44 + /**
  45 + * 审核类型,1:免审,2:机审,3:人工审
  46 + */
  47 + private Integer shenhe_type;
  48 +
  49 + /**
  50 + * 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
  51 + */
  52 + private Integer shenhe_status;
  53 +
  54 + /**
  55 + * 送审时间
  56 + */
  57 + private Date create_date;
  58 +
  59 + /**
  60 + * 更新时间
  61 + */
  62 + private Date update_date;
  63 +
  64 + /**
  65 + * 审核人id
  66 + */
  67 + private String auditor_id;
  68 +
  69 + /**
  70 + * 更新人名称
  71 + */
  72 + private String updater;
  73 +
  74 + /**
  75 + * 审核意见
  76 + */
  77 + private String shenhe_msg;
  78 +
  79 + /**
  80 + * 话题标题
  81 + */
  82 + private String title;
  83 +
  84 + /**
  85 + * 话题内容
  86 + */
  87 + private String topic_text;
  88 +
  89 + /**
  90 + * sp名称
  91 + */
  92 + @Transient
  93 + private String sp_desc;
  94 +
  95 + /**
  96 + * 获取id
  97 + *
  98 + * @return id - id
  99 + */
  100 + public Integer getId() {
  101 + return id;
  102 + }
  103 +
  104 + /**
  105 + * 设置id
  106 + *
  107 + * @param id id
  108 + */
  109 + public void setId(Integer id) {
  110 + this.id = id;
  111 + }
  112 +
  113 + /**
  114 + * 获取话题id
  115 + *
  116 + * @return topic_id - 话题id
  117 + */
  118 + public String getTopic_id() {
  119 + return topic_id;
  120 + }
  121 +
  122 + /**
  123 + * 设置话题id
  124 + *
  125 + * @param topic_id 话题id
  126 + */
  127 + public void setTopic_id(String topic_id) {
  128 + this.topic_id = topic_id;
  129 + }
  130 +
  131 + /**
  132 + * 获取spId
  133 + *
  134 + * @return sp_id - spId
  135 + */
  136 + public Integer getSp_id() {
  137 + return sp_id;
  138 + }
  139 +
  140 + /**
  141 + * 设置spId
  142 + *
  143 + * @param sp_id spId
  144 + */
  145 + public void setSp_id(Integer sp_id) {
  146 + this.sp_id = sp_id;
  147 + }
  148 +
  149 + /**
  150 + * 获取话题图片
  151 + *
  152 + * @return topic_image - 话题图片
  153 + */
  154 + public String getTopic_image() {
  155 + return topic_image;
  156 + }
  157 +
  158 + /**
  159 + * 设置话题图片
  160 + *
  161 + * @param topic_image 话题图片
  162 + */
  163 + public void setTopic_image(String topic_image) {
  164 + this.topic_image = topic_image;
  165 + }
  166 +
  167 + /**
  168 + * 获取话题标签
  169 + *
  170 + * @return topic_tag - 话题标签
  171 + */
  172 + public String getTopic_tag() {
  173 + return topic_tag;
  174 + }
  175 +
  176 + /**
  177 + * 设置话题标签
  178 + *
  179 + * @param topic_tag 话题标签
  180 + */
  181 + public void setTopic_tag(String topic_tag) {
  182 + this.topic_tag = topic_tag;
  183 + }
  184 +
  185 + /**
  186 + * 获取话题url
  187 + *
  188 + * @return topic_url - 话题url
  189 + */
  190 + public String getTopic_url() {
  191 + return topic_url;
  192 + }
  193 +
  194 + /**
  195 + * 设置话题url
  196 + *
  197 + * @param topic_url 话题url
  198 + */
  199 + public void setTopic_url(String topic_url) {
  200 + this.topic_url = topic_url;
  201 + }
  202 +
  203 + /**
  204 + * 获取话题创建时间
  205 + *
  206 + * @return topic_time - 话题创建时间
  207 + */
  208 + public String getTopic_time() {
  209 + return topic_time;
  210 + }
  211 +
  212 + /**
  213 + * 设置话题创建时间
  214 + *
  215 + * @param topic_time 话题创建时间
  216 + */
  217 + public void setTopic_time(String topic_time) {
  218 + this.topic_time = topic_time;
  219 + }
  220 +
  221 + /**
  222 + * 获取审核类型,1:免审,2:机审,3:人工审
  223 + *
  224 + * @return shenhe_type - 审核类型,1:免审,2:机审,3:人工审
  225 + */
  226 + public Integer getShenhe_type() {
  227 + return shenhe_type;
  228 + }
  229 +
  230 + /**
  231 + * 设置审核类型,1:免审,2:机审,3:人工审
  232 + *
  233 + * @param shenhe_type 审核类型,1:免审,2:机审,3:人工审
  234 + */
  235 + public void setShenhe_type(Integer shenhe_type) {
  236 + this.shenhe_type = shenhe_type;
  237 + }
  238 +
  239 + /**
  240 + * 获取审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
  241 + *
  242 + * @return shenhe_status - 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
  243 + */
  244 + public Integer getShenhe_status() {
  245 + return shenhe_status;
  246 + }
  247 +
  248 + /**
  249 + * 设置审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
  250 + *
  251 + * @param shenhe_status 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
  252 + */
  253 + public void setShenhe_status(Integer shenhe_status) {
  254 + this.shenhe_status = shenhe_status;
  255 + }
  256 +
  257 + /**
  258 + * 获取送审时间
  259 + *
  260 + * @return create_date - 送审时间
  261 + */
  262 + public Date getCreate_date() {
  263 + return create_date;
  264 + }
  265 +
  266 + /**
  267 + * 设置送审时间
  268 + *
  269 + * @param create_date 送审时间
  270 + */
  271 + public void setCreate_date(Date create_date) {
  272 + this.create_date = create_date;
  273 + }
  274 +
  275 + /**
  276 + * 获取更新时间
  277 + *
  278 + * @return update_date - 更新时间
  279 + */
  280 + public Date getUpdate_date() {
  281 + return update_date;
  282 + }
  283 +
  284 + /**
  285 + * 设置更新时间
  286 + *
  287 + * @param update_date 更新时间
  288 + */
  289 + public void setUpdate_date(Date update_date) {
  290 + this.update_date = update_date;
  291 + }
  292 +
  293 + /**
  294 + * 获取审核人id
  295 + *
  296 + * @return auditor_id - 审核人id
  297 + */
  298 + public String getAuditor_id() {
  299 + return auditor_id;
  300 + }
  301 +
  302 + /**
  303 + * 设置审核人id
  304 + *
  305 + * @param auditor_id 审核人id
  306 + */
  307 + public void setAuditor_id(String auditor_id) {
  308 + this.auditor_id = auditor_id;
  309 + }
  310 +
  311 + /**
  312 + * 获取更新人名称
  313 + *
  314 + * @return updater - 更新人名称
  315 + */
  316 + public String getUpdater() {
  317 + return updater;
  318 + }
  319 +
  320 + /**
  321 + * 设置更新人名称
  322 + *
  323 + * @param updater 更新人名称
  324 + */
  325 + public void setUpdater(String updater) {
  326 + this.updater = updater;
  327 + }
  328 +
  329 + /**
  330 + * 获取审核意见
  331 + *
  332 + * @return shenhe_msg - 审核意见
  333 + */
  334 + public String getShenhe_msg() {
  335 + return shenhe_msg;
  336 + }
  337 +
  338 + /**
  339 + * 设置审核意见
  340 + *
  341 + * @param shenhe_msg 审核意见
  342 + */
  343 + public void setShenhe_msg(String shenhe_msg) {
  344 + this.shenhe_msg = shenhe_msg;
  345 + }
  346 +
  347 + /**
  348 + * 获取话题标题
  349 + *
  350 + * @return title - 话题标题
  351 + */
  352 + public String getTitle() {
  353 + return title;
  354 + }
  355 +
  356 + /**
  357 + * 设置话题标题
  358 + *
  359 + * @param title 话题标题
  360 + */
  361 + public void setTitle(String title) {
  362 + this.title = title;
  363 + }
  364 +
  365 + /**
  366 + * 获取话题内容
  367 + *
  368 + * @return topic_text - 话题内容
  369 + */
  370 + public String getTopic_text() {
  371 + return topic_text;
  372 + }
  373 +
  374 + /**
  375 + * 设置话题内容
  376 + *
  377 + * @param topic_text 话题内容
  378 + */
  379 + public void setTopic_text(String topic_text) {
  380 + this.topic_text = topic_text;
  381 + }
  382 +
  383 + public String getSp_desc() {
  384 + return sp_desc;
  385 + }
  386 +
  387 + public void setSp_desc(String sp_desc) {
  388 + this.sp_desc = sp_desc;
  389 + }
  390 +
  391 +}
0 \ No newline at end of file 392 \ No newline at end of file
src/main/java/com/cnlive/shenhe/job/NotSpeakJob.java 0 → 100644
  1 +package com.cnlive.shenhe.job;
  2 +
  3 +import com.cnlive.shenhe.bean.ResponseBean;
  4 +import com.cnlive.shenhe.entity.ShyComments;
  5 +import com.cnlive.shenhe.entity.ShyNotspeak;
  6 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  7 +import com.cnlive.shenhe.serviceImpl.NotspeakServiceImpl;
  8 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  9 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  10 +import com.cnlive.shenhe.utils.AuditPass;
  11 +import com.cnlive.shenhe.utils.CommonConst;
  12 +import com.cnlive.shenhe.utils.CommonUtils;
  13 +
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.scheduling.annotation.Scheduled;
  18 +import org.springframework.stereotype.Component;
  19 +
  20 +import java.util.List;
  21 +
  22 +@Component
  23 +public class NotSpeakJob {
  24 + private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class);
  25 + @Autowired
  26 + SitesServiceImpl sitesService;
  27 + @Autowired
  28 + AuditPass Pass;
  29 + @Autowired
  30 + CommentsServiceImpl commentsService;
  31 +
  32 + @Autowired
  33 + UsersServiceImpl usersService;
  34 +
  35 + @Autowired
  36 + NotspeakServiceImpl notSpeakService;
  37 +
  38 +
  39 + /**
  40 + * 自动解除禁言
  41 + */
  42 + @Scheduled(cron="0 0/1 * * * ? ")//每分钟一次
  43 + public void autoRetReceive() {
  44 + List<ShyNotspeak> shyNotspeakList = notSpeakService.getNotSpeakByTime();
  45 + if (shyNotspeakList.size() > 0) {
  46 + for (ShyNotspeak shyNotspeak : shyNotspeakList) {
  47 + logger.info("自动解除禁言的的speak_id:"+shyNotspeak.getId());
  48 + notSpeakService.speak(shyNotspeak.getId(), CommonConst.SPEAK_YES, 0, null);
  49 + }
  50 + }
  51 + }
  52 +
  53 +
  54 +
  55 +}
src/main/java/com/cnlive/shenhe/mapper/ShyNotspeakMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyNotspeak;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface ShyNotspeakMapper extends Mapper<ShyNotspeak> {
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
src/main/java/com/cnlive/shenhe/mapper/ShyTopicMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyTopic;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface ShyTopicMapper extends Mapper<ShyTopic> {
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -4,9 +4,8 @@ import com.alibaba.fastjson.JSONObject; @@ -4,9 +4,8 @@ import com.alibaba.fastjson.JSONObject;
4 import com.cnlive.shenhe.entity.ShyComments; 4 import com.cnlive.shenhe.entity.ShyComments;
5 import com.cnlive.shenhe.entity.ShySites; 5 import com.cnlive.shenhe.entity.ShySites;
6 import com.cnlive.shenhe.entity.ShyUsers; 6 import com.cnlive.shenhe.entity.ShyUsers;
7 -import com.cnlive.shenhe.entity.ShyUsersfree;  
8 -import com.cnlive.shenhe.entity.ShyVideos;  
9 import com.cnlive.shenhe.mapper.ShyCommentsMapper; 7 import com.cnlive.shenhe.mapper.ShyCommentsMapper;
  8 +import com.cnlive.shenhe.mapper.ShyNotspeakMapper;
10 import com.cnlive.shenhe.mapper.ShySitesMapper; 9 import com.cnlive.shenhe.mapper.ShySitesMapper;
11 import com.cnlive.shenhe.mapper.ShyUsersMapper; 10 import com.cnlive.shenhe.mapper.ShyUsersMapper;
12 import com.cnlive.shenhe.utils.AuditPass; 11 import com.cnlive.shenhe.utils.AuditPass;
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
@@ -112,7 +112,7 @@ public class LiveApplyServiceImpl { @@ -112,7 +112,7 @@ public class LiveApplyServiceImpl {
112 112
113 //=============== 113 //===============
114 public PageInfo<ShyLiveapply> getListLiveApply(String theme, String start_date, String end_date, 114 public PageInfo<ShyLiveapply> getListLiveApply(String theme, String start_date, String end_date,
115 - Integer business_model, Integer page, Integer pageSize, 115 + String business_model, Integer page, Integer pageSize,
116 Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) { 116 Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) {
117 Example example = new Example(ShyLiveapply.class); 117 Example example = new Example(ShyLiveapply.class);
118 Example.Criteria criteria = example.createCriteria(); 118 Example.Criteria criteria = example.createCriteria();
@@ -144,7 +144,7 @@ public class LiveApplyServiceImpl { @@ -144,7 +144,7 @@ public class LiveApplyServiceImpl {
144 } 144 }
145 145
146 if (CommonUtils.isNotNull(business_model)) { 146 if (CommonUtils.isNotNull(business_model)) {
147 - criteria.andEqualTo("business_model", business_model); 147 + criteria.andLike("organization", "%" + business_model + "%");
148 } 148 }
149 if (CommonUtils.isNotNull(spid)) { 149 if (CommonUtils.isNotNull(spid)) {
150 criteria.andEqualTo("sp_id", spid); 150 criteria.andEqualTo("sp_id", spid);
src/main/java/com/cnlive/shenhe/serviceImpl/NotspeakServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.cnlive.shenhe.bean.ResponseBean;
  6 +import com.cnlive.shenhe.entity.ShyComments;
  7 +import com.cnlive.shenhe.entity.ShyContent;
  8 +import com.cnlive.shenhe.entity.ShyLive;
  9 +import com.cnlive.shenhe.entity.ShyNotspeak;
  10 +import com.cnlive.shenhe.entity.ShySites;
  11 +import com.cnlive.shenhe.entity.ShyTopic;
  12 +import com.cnlive.shenhe.entity.ShyUsers;
  13 +import com.cnlive.shenhe.entity.ShyVideofilter;
  14 +import com.cnlive.shenhe.entity.ShyVideos;
  15 +import com.cnlive.shenhe.mapper.ShyCommentsMapper;
  16 +import com.cnlive.shenhe.mapper.ShyContentMapper;
  17 +import com.cnlive.shenhe.mapper.ShyNotspeakMapper;
  18 +import com.cnlive.shenhe.mapper.ShySitesMapper;
  19 +import com.cnlive.shenhe.mapper.ShyTopicMapper;
  20 +import com.cnlive.shenhe.mapper.ShyUsersMapper;
  21 +import com.cnlive.shenhe.utils.AntiFraudUtil;
  22 +import com.cnlive.shenhe.utils.AuditPass;
  23 +import com.cnlive.shenhe.utils.CommonConst;
  24 +import com.cnlive.shenhe.utils.CommonUtils;
  25 +import com.cnlive.shenhe.utils.TransitServiceUtils;
  26 +import com.github.pagehelper.PageHelper;
  27 +import com.github.pagehelper.PageInfo;
  28 +import org.apache.ibatis.session.RowBounds;
  29 +import org.slf4j.Logger;
  30 +import org.slf4j.LoggerFactory;
  31 +import org.springframework.beans.factory.annotation.Autowired;
  32 +import org.springframework.beans.factory.annotation.Value;
  33 +import org.springframework.stereotype.Service;
  34 +import tk.mybatis.mapper.entity.Example;
  35 +
  36 +import java.sql.Timestamp;
  37 +import java.text.ParseException;
  38 +import java.util.ArrayList;
  39 +import java.util.Date;
  40 +import java.util.HashMap;
  41 +import java.util.List;
  42 +import java.util.Map;
  43 +import java.util.UUID;
  44 +
  45 +/**
  46 + * @Auther: liwei
  47 + * @Date: 2019/1/2 11:30
  48 + * @Description:
  49 + */
  50 +@Service
  51 +public class NotspeakServiceImpl {
  52 +
  53 + private static Logger logger = LoggerFactory.getLogger(NotspeakServiceImpl.class);
  54 + @Autowired
  55 + ShyCommentsMapper shyCommentsMapper;
  56 + @Autowired
  57 + ShyNotspeakMapper shyNotspeakMapper;
  58 + @Autowired
  59 + ShySitesMapper shySitesMapper;
  60 + @Autowired
  61 + ShyUsersMapper shyUsersMapper;
  62 + @Autowired
  63 + TransitServiceUtils transitServiceUtils;
  64 + @Autowired
  65 + SitesServiceImpl sitesService;
  66 + @Autowired
  67 + VideosServiceImpl videosService;
  68 + @Autowired
  69 + VideofilterServiceImpl videofilterServiceImpl;
  70 + @Autowired
  71 + AuditPass Pass;
  72 +
  73 + @Value("${spring.localhost.url}")
  74 + String localhost_url;
  75 +
  76 + @Value("${speak_comment}")
  77 + String speak_comment;
  78 +
  79 + public ShyNotspeak getShySpeak(ShyNotspeak shyNotspeak) {
  80 + List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.select(shyNotspeak);
  81 + if(CommonUtils.isNotNull(shyNotspeakList)&&shyNotspeakList.size()>0){
  82 + return shyNotspeakList.get(0);
  83 + }
  84 + return new ShyNotspeak();
  85 + }
  86 +
  87 + //**************************************
  88 + public List<ShyNotspeak> findshyNotspeak(ShyNotspeak shyNotspeak) {
  89 +
  90 + return shyNotspeakMapper.selectByRowBounds(shyNotspeak, new RowBounds(0, 100));
  91 + }
  92 +
  93 + //***************************
  94 + public boolean updateshyNotspeak(ShyNotspeak shyNotspeak) {
  95 + int result = shyNotspeakMapper.updateByPrimaryKey(shyNotspeak);
  96 + if (result == 0) {
  97 + return false;
  98 + }
  99 + return true;
  100 + }
  101 +
  102 + //***************************
  103 + public boolean impotshyNotspeak(ShyNotspeak shyNotspeak) {
  104 + int result = shyNotspeakMapper.insertSelective(shyNotspeak);
  105 + if (result == 0) {
  106 + return false;
  107 + }
  108 + return true;
  109 + }
  110 +
  111 + public ResponseBean notSpeakByComment(Integer commentId,Integer time, String userId) {
  112 + ResponseBean success;
  113 + ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId);
  114 + JSONObject json = new JSONObject();
  115 + json.put("sid", comment.getComment_user_id().toString());
  116 + json.put("type", CommonConst.SPEAK_NOT);
  117 + json.put("minute", time);
  118 + JSONObject result = new JSONObject();
  119 + try {
  120 + result = Pass.commentSpeak(json, speak_comment);
  121 + } catch (Exception e) {
  122 + logger.error("评论禁言失败,comments_id:{}", comment.getId());
  123 + success=new ResponseBean(500,"评论禁言调用互动云服务器失败!");
  124 + return success;
  125 + }
  126 + if (result == null) {
  127 + logger.error("评论禁言错误,且无返回信息。comments_id:{}", comment.getId());
  128 + success=new ResponseBean(500,"评论禁言调用互动云返回结果为空!");
  129 + return success;
  130 + } else {
  131 + Integer errorCode = result.getInteger("errorCode");
  132 + String errorMessage = result.getString("errorMessage");
  133 + if (errorCode != 0) {
  134 + logger.error("评论禁言错误,comments_id:{},errorCode:{},errorMessage:{}", comment.getId(), errorCode, errorMessage);
  135 + success=new ResponseBean(500,"评论禁言调用互动云返回结果errorCode不为0!");
  136 + return success;
  137 + }
  138 + comment.setState(CommonConst.AUDIT_REFUSE);
  139 + comment.setMsg("评论禁言操作");
  140 + comment.setAuditor_id(userId);
  141 + comment.setReceive(1);//已领取
  142 + comment.setReceive_user_id(userId);
  143 + int i = shyCommentsMapper.updateByPrimaryKeySelective(comment);
  144 + if (i != 1) {
  145 + success=new ResponseBean(500,"评论禁言修改当前评论数据失败!");
  146 + return success;
  147 + }
  148 + boolean res =writeNotSpeakByComment(commentId,time,userId);
  149 + if(res==false){
  150 + success=new ResponseBean(500,"评论禁言修改禁言表失败!");
  151 + return success;
  152 + }
  153 + }
  154 + return new ResponseBean();
  155 + }
  156 +
  157 + public ResponseBean querySpeakState(Integer commentId, String userId) {
  158 + ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId);
  159 + ShyNotspeak shyNotspeak=new ShyNotspeak();
  160 + shyNotspeak.setUser_id(comment.getComment_user_id());
  161 + shyNotspeak.setState(CommonConst.SPEAK_NOT);
  162 + List<ShyNotspeak> shyNotspeakList = findshyNotspeak(shyNotspeak);
  163 + if(shyNotspeakList.size()>0){
  164 + shyNotspeak =shyNotspeakList.get(0);
  165 + return new ResponseBean(500,"当前用户已被禁言,禁言剩余时长:"+(shyNotspeak.getEnd_time().getTime()-new Date().getTime())/(1000*60)+"分钟,解禁时间:"+CommonUtils.formatDate(shyNotspeak.getEnd_time(), "yyyy-MM-dd HH:mm:ss"));
  166 + }
  167 + return new ResponseBean();
  168 + }
  169 + public ResponseBean speak(Integer notSpeakId, Integer type,Integer time, String userId) {
  170 + ResponseBean success;
  171 + ShyNotspeak shyNotspeak=selectByPrimaryKey(notSpeakId);
  172 + JSONObject json = new JSONObject();
  173 + json.put("sid", shyNotspeak.getUser_id().toString());
  174 + json.put("type", type);
  175 + json.put("minute", time);
  176 + JSONObject result = new JSONObject();
  177 + try {
  178 + result = Pass.commentSpeak(json, speak_comment);
  179 + } catch (Exception e) {
  180 + logger.error("评论禁言失败,shyNotspeak_id:{}", shyNotspeak.getId());
  181 + success=new ResponseBean(500,"评论禁言调用互动云服务器失败!");
  182 + return success;
  183 + }
  184 + if (result == null) {
  185 + logger.error("评论禁言错误,且无返回信息。shyNotspeak_id:{}", shyNotspeak.getId());
  186 + success=new ResponseBean(500,"评论禁言调用互动云返回结果为空!");
  187 + return success;
  188 + } else {
  189 + Integer errorCode = result.getInteger("errorCode");
  190 + String errorMessage = result.getString("errorMessage");
  191 + if (errorCode != 0) {
  192 + logger.error("评论禁言错误,shyNotspeak_id:{},errorCode:{},errorMessage:{}", shyNotspeak.getId(), errorCode, errorMessage);
  193 + success=new ResponseBean(500,"评论禁言调用互动云返回结果errorCode不为0!");
  194 + return success;
  195 + }
  196 + String msg=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")+"解除禁言";
  197 + shyNotspeak.setState(type);
  198 + if(type==CommonConst.SPEAK_NOT){
  199 + shyNotspeak.setStart_time(CommonUtils.getCurrentTime());
  200 + shyNotspeak.setTime(time);
  201 + shyNotspeak.setEnd_time(CommonUtils.getAddTime(time));
  202 + shyNotspeak.setCount(shyNotspeak.getCount()+1);
  203 + msg=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")+"开始禁言,禁言时长为"+time+"分钟,禁言管理里面禁言的";
  204 + }
  205 + if(CommonUtils.isNotEmpty(userId)){
  206 + shyNotspeak.setAuditor(userId);
  207 + shyNotspeak.setUpdater("");
  208 + }else{
  209 + shyNotspeak.setAuditor(null);
  210 + shyNotspeak.setUpdater("自动解除");
  211 + }
  212 + shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime());
  213 + shyNotspeak.setMsg(shyNotspeak.getMsg()+"\n"+msg);
  214 + boolean res =updateshyNotspeak(shyNotspeak);
  215 + if(res==false){
  216 + success=new ResponseBean(500,"评论禁言修改禁言表失败!");
  217 + return success;
  218 + }
  219 +
  220 + }
  221 + return new ResponseBean();
  222 + }
  223 +
  224 +
  225 + public boolean writeNotSpeakByComment(Integer commentId,Integer time, String userId){
  226 + boolean result=false;
  227 + ShyComments comment = shyCommentsMapper.selectByPrimaryKey(commentId);
  228 + ShyNotspeak shyNotspeak=new ShyNotspeak();
  229 + shyNotspeak.setUser_id(comment.getComment_user_id());
  230 + String msg=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")+"开始禁言,禁言时长为"+time+"分钟,禁言的评论为:'"+comment.getComment_content()+"'";
  231 +
  232 + List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.select(shyNotspeak);
  233 + if(CommonUtils.isNotNull(shyNotspeakList)&&shyNotspeakList.size()>0){
  234 + ShyNotspeak notspeak=shyNotspeakList.get(0);
  235 + notspeak.setUser_name(comment.getComment_user_name());
  236 + notspeak.setUser_avatar(comment.getComment_user_avatar());
  237 + notspeak.setSp_id(comment.getSpid());
  238 + notspeak.setState(CommonConst.SPEAK_NOT);
  239 + notspeak.setStart_time(CommonUtils.getCurrentTime());
  240 + notspeak.setTime(time);
  241 + notspeak.setEnd_time(CommonUtils.getAddTime(time));
  242 + notspeak.setUpdated_at(CommonUtils.getCurrentTime());
  243 + notspeak.setMsg(notspeak.getMsg()+"\n"+msg);
  244 + notspeak.setCount(notspeak.getCount()+1);
  245 + notspeak.setUpdater("");
  246 + notspeak.setAuditor(userId);
  247 + result=updateshyNotspeak(notspeak);
  248 + }else{
  249 + shyNotspeak.setUser_name(comment.getComment_user_name());
  250 + shyNotspeak.setUser_id(comment.getComment_user_id());
  251 + shyNotspeak.setUser_avatar(comment.getComment_user_avatar());
  252 + shyNotspeak.setSp_id(comment.getSpid());
  253 + shyNotspeak.setState(CommonConst.SPEAK_NOT);
  254 + shyNotspeak.setStart_time(CommonUtils.getCurrentTime());
  255 + shyNotspeak.setTime(time);
  256 + shyNotspeak.setEnd_time(CommonUtils.getAddTime(time));
  257 + shyNotspeak.setCreated_at(CommonUtils.getCurrentTime());
  258 + shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime());
  259 + shyNotspeak.setMsg(msg);
  260 + shyNotspeak.setCount(1);
  261 + shyNotspeak.setUpdater("");
  262 + shyNotspeak.setAuditor(userId);
  263 + result=impotshyNotspeak(shyNotspeak);
  264 +
  265 + }
  266 + return result;
  267 + }
  268 +
  269 + public PageInfo<ShyNotspeak> getPage( String user_name, Integer user_id,Integer state,
  270 + Integer page, Integer pageSize, String orderByClause) {
  271 + Example example = new Example(ShyNotspeak.class);
  272 + Example.Criteria criteria = example.createCriteria();
  273 + if (CommonUtils.isNotEmpty(orderByClause)) {
  274 + example.setOrderByClause(orderByClause);
  275 + } else {
  276 + example.setOrderByClause("state desc , updated_at desc");
  277 + }
  278 + if (CommonUtils.isNotEmpty(user_name)) {
  279 + criteria.andLike("user_name", "%" + user_name + "%");
  280 + }
  281 + if (CommonUtils.isNotNull(user_id)) {
  282 + criteria.andEqualTo("user_id", user_id);
  283 + }
  284 + if (CommonUtils.isNotNull(state)) {
  285 + criteria.andEqualTo("state", state);
  286 + }
  287 +
  288 + PageHelper.startPage(page, pageSize, true);
  289 + List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.selectByExample(example);
  290 + PageInfo<ShyNotspeak> pageInfo = new PageInfo<>(shyNotspeakList);
  291 + return pageInfo;
  292 + }
  293 +
  294 +
  295 + //**************************************
  296 + public ShyNotspeak selectByPrimaryKey(Integer id) {
  297 + ShyNotspeak shyNotspeak = shyNotspeakMapper.selectByPrimaryKey(id);
  298 + return shyNotspeak;
  299 + }
  300 +
  301 + public int updateByPrimaryKeySelective(ShyNotspeak shyNotspeak) {
  302 + return shyNotspeakMapper.updateByPrimaryKeySelective(shyNotspeak);
  303 + }
  304 +
  305 + public List<ShyNotspeak> getNotSpeakByTime() {
  306 + Example example = new Example(ShyNotspeak.class);
  307 + Example.Criteria criteria = example.createCriteria();
  308 + criteria.andEqualTo("state", CommonConst.SPEAK_NOT);
  309 + criteria.andLessThan("end_time", CommonUtils.getCurrentTime());
  310 +
  311 + List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.selectByExample(example);
  312 + return shyNotspeakList;
  313 + }
  314 +
  315 +
  316 +}
  317 +
  318 +
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.cnlive.shenhe.entity.ShyComments;
  6 +import com.cnlive.shenhe.entity.ShyContent;
  7 +import com.cnlive.shenhe.entity.ShyLive;
  8 +import com.cnlive.shenhe.entity.ShySites;
  9 +import com.cnlive.shenhe.entity.ShyTopic;
  10 +import com.cnlive.shenhe.entity.ShyUsers;
  11 +import com.cnlive.shenhe.entity.ShyVideofilter;
  12 +import com.cnlive.shenhe.entity.ShyVideos;
  13 +import com.cnlive.shenhe.mapper.ShyCommentsMapper;
  14 +import com.cnlive.shenhe.mapper.ShyContentMapper;
  15 +import com.cnlive.shenhe.mapper.ShySitesMapper;
  16 +import com.cnlive.shenhe.mapper.ShyTopicMapper;
  17 +import com.cnlive.shenhe.mapper.ShyUsersMapper;
  18 +import com.cnlive.shenhe.utils.AntiFraudUtil;
  19 +import com.cnlive.shenhe.utils.AuditPass;
  20 +import com.cnlive.shenhe.utils.CommonConst;
  21 +import com.cnlive.shenhe.utils.CommonUtils;
  22 +import com.cnlive.shenhe.utils.TransitServiceUtils;
  23 +import com.github.pagehelper.PageHelper;
  24 +import com.github.pagehelper.PageInfo;
  25 +import org.apache.ibatis.session.RowBounds;
  26 +import org.slf4j.Logger;
  27 +import org.slf4j.LoggerFactory;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.beans.factory.annotation.Value;
  30 +import org.springframework.stereotype.Service;
  31 +import tk.mybatis.mapper.entity.Example;
  32 +
  33 +import java.sql.Timestamp;
  34 +import java.text.ParseException;
  35 +import java.util.ArrayList;
  36 +import java.util.Date;
  37 +import java.util.HashMap;
  38 +import java.util.List;
  39 +import java.util.Map;
  40 +import java.util.UUID;
  41 +
  42 +/**
  43 + * @Auther: liwei
  44 + * @Date: 2019/5/20 17:30
  45 + * @Description:
  46 + */
  47 +@Service
  48 +public class TopicServiceImpl {
  49 +
  50 + private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class);
  51 + @Autowired
  52 + ShyCommentsMapper shyCommentsMapper;
  53 + @Autowired
  54 + ShyTopicMapper shyTopicMapper;
  55 + @Autowired
  56 + ShySitesMapper shySitesMapper;
  57 + @Autowired
  58 + ShyUsersMapper shyUsersMapper;
  59 + @Autowired
  60 + TransitServiceUtils transitServiceUtils;
  61 + @Autowired
  62 + SitesServiceImpl sitesService;
  63 + @Autowired
  64 + VideosServiceImpl videosService;
  65 + @Autowired
  66 + VideofilterServiceImpl videofilterServiceImpl;
  67 +
  68 + @Value("${spring.localhost.url}")
  69 + String localhost_url;
  70 +
  71 + public ShyTopic getShyTopic(ShyTopic shyTopic) {
  72 + List<ShyTopic> shyTopicList = shyTopicMapper.select(shyTopic);
  73 + if(CommonUtils.isNotNull(shyTopicList)&&shyTopicList.size()>0){
  74 + return shyTopicList.get(0);
  75 + }
  76 + return new ShyTopic();
  77 + }
  78 +
  79 + //**************************************
  80 + public List<ShyTopic> findshyTopic(ShyTopic shyTopic) {
  81 +
  82 + return shyTopicMapper.selectByRowBounds(shyTopic, new RowBounds(0, 100));
  83 + }
  84 +
  85 + //***************************
  86 + public boolean updateshyTopic(ShyTopic shyTopic) {
  87 + int result = shyTopicMapper.updateByPrimaryKey(shyTopic);
  88 + if (result == 0) {
  89 + return false;
  90 + }
  91 + return true;
  92 + }
  93 +
  94 + //***************************
  95 + public boolean impotshyTopic(ShyTopic shyTopic) {
  96 + int result = shyTopicMapper.insertSelective(shyTopic);
  97 + if (result == 0) {
  98 + return false;
  99 + }
  100 + return true;
  101 + }
  102 +
  103 + public int updateComment(Integer id, Integer state, String msg) {
  104 + ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id);
  105 + shyComments.setState(state);
  106 + shyComments.setMsg(msg);
  107 + return shyCommentsMapper.updateByPrimaryKeySelective(shyComments);
  108 + }
  109 +
  110 + public PageInfo<ShyTopic> getPage( String title,String topic_tag,String topicId, Date start_date, Date end_date, Integer shenhe_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId,Integer receive) {
  111 + Example example = new Example(ShyTopic.class);
  112 + Example.Criteria criteria = example.createCriteria();
  113 + if (CommonUtils.isNotEmpty(orderByClause)) {
  114 + example.setOrderByClause(orderByClause);
  115 + } else {
  116 + example.setOrderByClause("create_date desc");
  117 + }
  118 + if (CommonUtils.isNotNull(start_date) ) {
  119 + criteria.andGreaterThanOrEqualTo("create_date", start_date);
  120 + }
  121 + if ( CommonUtils.isNotNull(end_date)) {
  122 + criteria.andLessThanOrEqualTo("create_date", end_date);
  123 + }
  124 + if (CommonUtils.isNotEmpty(title)) {
  125 + criteria.andLike("title", "%" + title + "%");
  126 + }
  127 + if (CommonUtils.isNotEmpty(updater)) {
  128 + criteria.andEqualTo("updater", updater);
  129 + }
  130 + if (CommonUtils.isNotEmpty(topic_tag)) {
  131 + criteria.andEqualTo("topic_tag", topic_tag);
  132 + }
  133 + if (CommonUtils.isNotNull(spid)) {
  134 + criteria.andEqualTo("sp_id", spid);
  135 + }
  136 + if (CommonUtils.isNotEmpty(topicId)) {
  137 + criteria.andEqualTo("topic_id", topicId);
  138 + }
  139 + if (CommonUtils.isNotNull(receive)&&receive==CommonConst.RECEIVE_AFTER) {
  140 + criteria.andEqualTo("auditor_id", userId);
  141 + }
  142 + if (CommonUtils.isNotNull(shenhe_status) && shenhe_status != 3) {//不是 我的已审 进来的,只查一种状态
  143 + criteria.andEqualTo("shenhe_status", shenhe_status);
  144 + } else if (CommonUtils.isNotNull(shenhe_status) && shenhe_status == 3) {//是 我的已审,查通过和拒绝的两种状态
  145 + Example.Criteria criteria1 = example.createCriteria();
  146 + criteria1.orEqualTo("shenhe_status", 1);
  147 + criteria1.orEqualTo("shenhe_status", 2);
  148 + example.and(criteria1);
  149 + }
  150 +
  151 + PageHelper.startPage(page, pageSize, true);
  152 + List<ShyTopic> topicList = shyTopicMapper.selectByExample(example);
  153 + PageInfo<ShyTopic> pageInfo = new PageInfo<>(topicList);
  154 + return pageInfo;
  155 + }
  156 +
  157 + /**
  158 + * 根据条件导出数据excel
  159 + * @return
  160 + */
  161 + public List<ShyTopic> findByCondition(String title,String content_tag,String contentId, Date start_date,
  162 + Date end_date,Integer receive_status, Integer page,
  163 + Integer pageSize, String orderByClause, Integer spid) {
  164 +
  165 + Example example = new Example(ShyContent.class);
  166 + Example.Criteria criteria = example.createCriteria();
  167 + if (CommonUtils.isNotEmpty(orderByClause)) {
  168 + example.setOrderByClause(orderByClause);
  169 + } else {
  170 + example.setOrderByClause("create_date desc");
  171 + }
  172 + if (CommonUtils.isNotNull(start_date) ) {
  173 + criteria.andGreaterThanOrEqualTo("create_date", start_date);
  174 + }
  175 + if ( CommonUtils.isNotNull(end_date)) {
  176 + criteria.andLessThanOrEqualTo("create_date", end_date);
  177 + }
  178 + if (CommonUtils.isNotEmpty(title)) {
  179 + criteria.andLike("title", "%" + title + "%");
  180 + }
  181 + if (CommonUtils.isNotNull(spid)) {
  182 + criteria.andEqualTo("sp_id", spid);
  183 + }
  184 + if (CommonUtils.isNotEmpty(contentId)) {
  185 + criteria.andEqualTo("content_id", contentId);
  186 + }
  187 + if (CommonUtils.isNotEmpty(content_tag)) {
  188 + criteria.andEqualTo("content_tag", content_tag);
  189 + }
  190 + if (CommonUtils.isNotNull(receive_status)) {
  191 + criteria.andEqualTo("receive_status", receive_status);
  192 + }
  193 + List<ShyTopic> shyContentList = shyTopicMapper.selectByExample(example);
  194 + return shyContentList;
  195 + }
  196 +
  197 +
  198 +
  199 +
  200 + //**********************
  201 + public boolean callback(String id, String msg, Integer state, String userId,String updater) {
  202 + boolean success = true;
  203 + ShyTopic topic = shyTopicMapper.selectByPrimaryKey(Integer.parseInt(id));
  204 + JSONObject params = new JSONObject();
  205 + params.put("topic_id", topic.getTopic_id());
  206 + params.put("status", state+1);
  207 + params.put("msg", msg);
  208 + success = transitServiceUtils.send("cms","updateTopicStatus", true, params);
  209 + if(!success){
  210 + logger.error("话题审核回调失败,话题表id:{}", topic.getId());
  211 + return success;
  212 + }
  213 +
  214 + topic.setShenhe_status(state);// 设置话题状态为审核后的状态
  215 + topic.setShenhe_msg(msg);// 设置审核消息
  216 + if (CommonUtils.isNotEmpty(userId)) {
  217 + topic.setAuditor_id(userId);
  218 + topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 设置审核类型为人工
  219 + }else{
  220 + topic.setUpdater(updater);//设置更新人
  221 + }
  222 + topic.setUpdate_date(CommonUtils.getCurrentTime());
  223 + int i = shyTopicMapper.updateByPrimaryKeySelective(topic);
  224 + if (i != 1) {
  225 + success = false;
  226 + }
  227 +
  228 + return success;
  229 + }
  230 +
  231 +
  232 + //**************************************
  233 + public ShyTopic selectByPrimaryKey(Integer id) {
  234 + ShyTopic shyTopic = shyTopicMapper.selectByPrimaryKey(id);
  235 + return shyTopic;
  236 + }
  237 +
  238 + public int updateByPrimaryKeySelective(ShyTopic topic) {
  239 + return shyTopicMapper.updateByPrimaryKeySelective(topic);
  240 + }
  241 +
  242 + /**
  243 + * 获得审核类型
  244 + * @param spId
  245 + */
  246 + public Integer getShenheType(Integer spId){
  247 +
  248 + //获取图文免审sp
  249 + List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_TOPIC);
  250 + //初始化一个审核状态
  251 + Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
  252 + //如果当前sp是免审sp
  253 + if(sites.contains(spId)){
  254 + shenheType=1;//免审
  255 + }else{
  256 + shenheType=3;//人工审
  257 + }
  258 + return shenheType;
  259 + }
  260 +
  261 +
  262 +
  263 +}
  264 +
  265 +
src/main/java/com/cnlive/shenhe/utils/AuditPass.java
@@ -31,6 +31,19 @@ public class AuditPass { @@ -31,6 +31,19 @@ public class AuditPass {
31 31
32 @Value("${queryUserByUserId}") 32 @Value("${queryUserByUserId}")
33 private String queryUserByUserId;//用户云查网家家用户信息(通过用户id) 33 private String queryUserByUserId;//用户云查网家家用户信息(通过用户id)
  34 +
  35 + public static void main(String[] args) {
  36 + JSONObject map= new JSONObject();
  37 + map.put("platform","a" );
  38 + map.put("commentUserAvatar","http://yweb0.cnliveimg.com/images/headImg/2019/1129/1575022593286.jpg" );
  39 + map.put("appId","60#iqw7flx829" );
  40 + map.put("commentUserIP", null);
  41 + map.put("type", "topic");
  42 + map.put("activityId", "802:video:comets:604_ab79303bd0074a24965a92dd6514681a#20939");
  43 + HttpUtil httpUtil = HttpUtil.init();
  44 + httpUtil.setParam("param", map.toJSONString());
  45 + Map<String, String> post = httpUtil.post("http://test.shen.cnlive.com/api/comments/import");
  46 + }
34 47
35 /** 48 /**
36 * 点播视频回调 49 * 点播视频回调
@@ -135,6 +148,19 @@ public class AuditPass { @@ -135,6 +148,19 @@ public class AuditPass {
135 String result = HttpUtil.form(callBack, map); 148 String result = HttpUtil.form(callBack, map);
136 return JSONObject.parseObject(result); 149 return JSONObject.parseObject(result);
137 } 150 }
  151 + /**
  152 + * 评论禁言
  153 + * @param json
  154 + * @param callBack
  155 + * @return
  156 + */
  157 + public JSONObject commentSpeak(JSONObject json, String callBack) {
  158 + logger.info("评论禁言:param:{}", json);
  159 + Map<String, String> map = new HashMap<>();
  160 + map.put("param", json.toJSONString());
  161 + String result = HttpUtil.form(callBack, map);
  162 + return JSONObject.parseObject(result);
  163 + }
138 164
139 /** 165 /**
140 * 频道审核回调 166 * 频道审核回调
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
@@ -34,6 +34,14 @@ public class CommonConst { @@ -34,6 +34,14 @@ public class CommonConst {
34 * 审核类型:人工审 34 * 审核类型:人工审
35 */ 35 */
36 public static Integer AUDIT_TYPE_USER = 3; 36 public static Integer AUDIT_TYPE_USER = 3;
  37 + /**
  38 + * 禁言状态:禁言
  39 + */
  40 + public static Integer SPEAK_NOT = 1;
  41 + /**
  42 + * 禁言状态:解禁
  43 + */
  44 + public static Integer SPEAK_YES = 0;
37 45
38 /** 46 /**
39 * 审核状态:白名单通过回调失败 47 * 审核状态:白名单通过回调失败
@@ -100,9 +108,13 @@ public class CommonConst { @@ -100,9 +108,13 @@ public class CommonConst {
100 * 白名单业务:直播申请 108 * 白名单业务:直播申请
101 */ 109 */
102 public static Integer BUSINESS_LIVEAPPLY = 5; 110 public static Integer BUSINESS_LIVEAPPLY = 5;
  111 + /**
  112 + * 白名单业务:话题申请
  113 + */
  114 + public static Integer BUSINESS_TOPIC = 6;
103 115
104 //白名单设置 116 //白名单设置
105 - public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\"}"); 117 + public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\",\"6\":\"话题业务\"}");
106 118
107 /** 119 /**
108 * 弹窗消息:频道 120 * 弹窗消息:频道
@@ -171,9 +183,13 @@ public class CommonConst { @@ -171,9 +183,13 @@ public class CommonConst {
171 * 栏目分类,航空节 183 * 栏目分类,航空节
172 */ 184 */
173 public static String CATEGORY_AVIATION = "aviation"; 185 public static String CATEGORY_AVIATION = "aviation";
  186 + /**
  187 + * 栏目分类,话题
  188 + */
  189 + public static String CATEGORY_TOPIC = "topic";
174 190
175 191
176 - public static JSONObject CATEGORY = JSONObject.parseObject("{\"witness\":\"目击者\",\"moment\":\"朋友圈\",\"sub\":\"达人\",\"snow\":\"上冰雪\",\"aviation\":\"航空节\"}"); 192 + public static JSONObject CATEGORY = JSONObject.parseObject("{\"witness\":\"目击者\",\"moment\":\"朋友圈\",\"sub\":\"达人\",\"snow\":\"上冰雪\",\"aviation\":\"航空节\",\"topic\":\"话题\"}");
177 /** 193 /**
178 * 数美过滤器尺度状态:用户 194 * 数美过滤器尺度状态:用户
179 */ 195 */
src/main/java/com/cnlive/shenhe/utils/CommonUtils.java
@@ -42,6 +42,10 @@ public class CommonUtils { @@ -42,6 +42,10 @@ public class CommonUtils {
42 public static Timestamp getCurrentTime() { 42 public static Timestamp getCurrentTime() {
43 return new Timestamp(new Date().getTime()); 43 return new Timestamp(new Date().getTime());
44 } 44 }
  45 + //获取当前时间加上一个时间(分钟算)
  46 + public static Timestamp getAddTime(Integer addTime) {
  47 + return new Timestamp(new Date().getTime()+addTime*60*1000);
  48 + }
45 49
46 public static String getRandowUUID() { 50 public static String getRandowUUID() {
47 UUID uuid = UUID.randomUUID(); 51 UUID uuid = UUID.randomUUID();
src/main/java/com/cnlive/shenhe/utils/TransitServiceUtils.java 0 → 100644
  1 +package com.cnlive.shenhe.utils;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +
  5 +import org.springframework.amqp.core.AmqpTemplate;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +@Component
  10 +public class TransitServiceUtils {
  11 +
  12 + @Autowired
  13 + private AmqpTemplate rabbitTemplate;
  14 + private String exchange = "transitService";//交换机
  15 + private String routingKey = "audit";//路由
  16 +
  17 + /**
  18 + * MQ 生产者工具类
  19 + *
  20 + * @param calleeId 接收方 mall 电商 user 用户 daren 达人 cms cms 审核 audit
  21 + * @param cmdId 调用URL_ID
  22 + * @param isCallback 0需要回调 1不需要回调
  23 + * @param data 接口参数
  24 + */
  25 + public boolean send(String calleeId, String cmdId, Boolean isCallback, JSONObject data) {
  26 + boolean result=true;
  27 + try{
  28 + JSONObject json = new JSONObject();
  29 + json.put("callerId", "audit");
  30 + json.put("calleeId", calleeId);//
  31 + json.put("cmdId", cmdId);
  32 + if (isCallback) {
  33 + json.put("isCallback", "0");
  34 + } else {
  35 + json.put("isCallback", "1");
  36 + }
  37 + json.put("data", data);
  38 + this.rabbitTemplate.convertAndSend(exchange, routingKey, json.toString());
  39 + }
  40 + catch(Exception e){
  41 + result=false;
  42 + }
  43 + return result;
  44 + }
  45 +
  46 + public static void main(String[] args) {
  47 + JSONObject params = new JSONObject();
  48 + params.put("video_id", "11111");
  49 + params.put("state", "22222");
  50 + params.put("attr_tags", "33333");
  51 + params.put("msg", "4444");
  52 +// send("cms","/api/callback",true,params);
  53 + System.exit(0);
  54 + }
  55 +}
src/main/resources/application.properties
@@ -39,6 +39,28 @@ mybatis.mapper-locations=classpath:mapping/*.xml @@ -39,6 +39,28 @@ mybatis.mapper-locations=classpath:mapping/*.xml
39 mybatis.type-aliases-package=com.cnlive.shenhe.entity 39 mybatis.type-aliases-package=com.cnlive.shenhe.entity
40 server.port=81 40 server.port=81
41 41
  42 +#rabbitmq\u76f8\u5173\u914d\u7f6e
  43 +spring.rabbitmq.host=120.92.4.80
  44 +spring.rabbitmq.port=5672
  45 +spring.rabbitmq.username=test
  46 +spring.rabbitmq.password=password
  47 +# \u5f00\u542f\u53d1\u9001\u786e\u8ba4
  48 +spring.rabbitmq.publisher-confirms=true
  49 +# \u5f00\u542f\u53d1\u9001\u5931\u8d25\u9000\u56de
  50 +spring.rabbitmq.publisher-returns=true
  51 +# \u5f00\u542fACK
  52 +spring.rabbitmq.listener.direct.acknowledge-mode=manual
  53 +spring.rabbitmq.listener.simple.acknowledge-mode=manual
  54 +
  55 +#\u8bdd\u9898\u8bc4\u8bba\u5206\u4eabh5
  56 +topic_comment_shareH5=http://www.baidu.com?id=
  57 +
  58 +#\u5173\u95edspringboot\u63d0\u4f9b\u7684\u9ed8\u8ba4ico
  59 +spring.mvc.favicon.enabled = false
  60 +
  61 +#\u8bc4\u8bba\u7981\u8a00\u548c\u89e3\u7981\u4f7f\u7528API
  62 +speak_comment=http://comment.cnlive.com/services/commentForTopic/muted
  63 +
42 #logback\u65e5\u5fd7\u4e2d\u4f7f\u7528 64 #logback\u65e5\u5fd7\u4e2d\u4f7f\u7528
43 spring.application.name=cnlive_shenhe 65 spring.application.name=cnlive_shenhe
44 spring.application.home=/usr/local/cnlive_shenhe/log 66 spring.application.home=/usr/local/cnlive_shenhe/log
src/main/resources/mapper/ShyCommentsMapper.xml
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 <result column="platform" jdbcType="VARCHAR" property="platform" /> 13 <result column="platform" jdbcType="VARCHAR" property="platform" />
14 <result column="comment_title" jdbcType="VARCHAR" property="comment_title" /> 14 <result column="comment_title" jdbcType="VARCHAR" property="comment_title" />
15 <result column="comment_time" jdbcType="TIMESTAMP" property="comment_time" /> 15 <result column="comment_time" jdbcType="TIMESTAMP" property="comment_time" />
  16 + <result column="type" jdbcType="VARCHAR" property="type" />
  17 + <result column="level" jdbcType="INTEGER" property="level" />
16 <result column="spid" jdbcType="INTEGER" property="spid" /> 18 <result column="spid" jdbcType="INTEGER" property="spid" />
17 <result column="app_id" jdbcType="VARCHAR" property="app_id" /> 19 <result column="app_id" jdbcType="VARCHAR" property="app_id" />
18 <result column="comment_original_url" jdbcType="VARCHAR" property="comment_original_url" /> 20 <result column="comment_original_url" jdbcType="VARCHAR" property="comment_original_url" />
src/main/resources/mapper/ShyNotspeakMapper.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.ShyNotspeakMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyNotspeak">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="user_name" jdbcType="VARCHAR" property="user_name" />
  10 + <result column="user_id" jdbcType="INTEGER" property="user_id" />
  11 + <result column="user_avatar" jdbcType="VARCHAR" property="user_avatar" />
  12 + <result column="sp_id" jdbcType="INTEGER" property="sp_id" />
  13 + <result column="state" jdbcType="INTEGER" property="state" />
  14 + <result column="start_time" jdbcType="TIMESTAMP" property="start_time" />
  15 + <result column="time" jdbcType="INTEGER" property="time" />
  16 + <result column="end_time" jdbcType="TIMESTAMP" property="end_time" />
  17 + <result column="count" jdbcType="INTEGER" property="count" />
  18 + <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
  19 + <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
  20 + <result column="updater" jdbcType="VARCHAR" property="updater" />
  21 + <result column="auditor" jdbcType="VARCHAR" property="auditor" />
  22 + <result column="msg" jdbcType="LONGVARCHAR" property="msg" />
  23 + </resultMap>
  24 +</mapper>
0 \ No newline at end of file 25 \ No newline at end of file
src/main/resources/mapper/ShyTopicMapper.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.ShyTopicMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyTopic">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="topic_id" jdbcType="VARCHAR" property="topic_id" />
  10 + <result column="sp_id" jdbcType="INTEGER" property="sp_id" />
  11 + <result column="topic_image" jdbcType="VARCHAR" property="topic_image" />
  12 + <result column="topic_tag" jdbcType="VARCHAR" property="topic_tag" />
  13 + <result column="topic_url" jdbcType="VARCHAR" property="topic_url" />
  14 + <result column="topic_time" jdbcType="VARCHAR" property="topic_time" />
  15 + <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type" />
  16 + <result column="shenhe_status" jdbcType="INTEGER" property="shenhe_status" />
  17 + <result column="create_date" jdbcType="TIMESTAMP" property="create_date" />
  18 + <result column="update_date" jdbcType="TIMESTAMP" property="update_date" />
  19 + <result column="auditor_id" jdbcType="VARCHAR" property="auditor_id" />
  20 + <result column="updater" jdbcType="VARCHAR" property="updater" />
  21 + <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" />
  22 + <result column="title" jdbcType="LONGVARCHAR" property="title" />
  23 + <result column="topic_text" jdbcType="LONGVARCHAR" property="topic_text" />
  24 + </resultMap>
  25 +</mapper>
0 \ No newline at end of file 26 \ No newline at end of file
src/main/resources/static/favicon.ico 0 → 100644
No preview for this file type
src/main/resources/templates/common/frame.html
@@ -78,6 +78,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser. @@ -78,6 +78,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
78 <li><a href="/live/page?shenhe_state=0" id="/live/page"> 直播审核</a></li> 78 <li><a href="/live/page?shenhe_state=0" id="/live/page"> 直播审核</a></li>
79 <li><a href="/comments/page?state=0&receive=0" id="/comments/page"> 评论审核</a></li> 79 <li><a href="/comments/page?state=0&receive=0" id="/comments/page"> 评论审核</a></li>
80 <li><a href="/content/page?receive_status=0" id="/content/page"> 图文审核</a></li> 80 <li><a href="/content/page?receive_status=0" id="/content/page"> 图文审核</a></li>
  81 + <li><a href="/topic/page?shenhe_status=0&receive=0" id="/topic/page"> 话题审核</a></li>
81 <li><a href="/channel/page?shenhe_status=0&receive=0" id="/channel/page"> 频道审核</a></li> 82 <li><a href="/channel/page?shenhe_status=0&receive=0" id="/channel/page"> 频道审核</a></li>
82 <li><a href="/liveApply/page?shenhe_state=0&receive=0" id="/liveApply/page">直播申请审核</a></li> 83 <li><a href="/liveApply/page?shenhe_state=0&receive=0" id="/liveApply/page">直播申请审核</a></li>
83 </ul> 84 </ul>
@@ -90,8 +91,9 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser. @@ -90,8 +91,9 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
90 <ul class="treeview-menu"> 91 <ul class="treeview-menu">
91 <li><a href="/users/page" id="/users/page"> 审核云用户管理</a></li> 92 <li><a href="/users/page" id="/users/page"> 审核云用户管理</a></li>
92 <li><a href="/sites/page" id="/sites/page"> SP白名单管理</a></li> 93 <li><a href="/sites/page" id="/sites/page"> SP白名单管理</a></li>
93 - <li><a href="/usersFree/page" id="/usersFree/page"> 网++白名单管理</a></li>  
94 <li><a href="/email/page" id="/email/page"> 邮件消息管理</a></li> 94 <li><a href="/email/page" id="/email/page"> 邮件消息管理</a></li>
  95 + <li><a href="/usersFree/page" id="/usersFree/page"> 网++白名单管理</a></li>
  96 + <li><a href="/notSpeak/page" id="/notSpeak/page"> 网++禁言管理</a></li>
95 </ul> 97 </ul>
96 </li> 98 </li>
97 </ul> 99 </ul>
src/main/resources/templates/common/head.html
@@ -14,7 +14,8 @@ @@ -14,7 +14,8 @@
14 14
15 <!--JQuery--> 15 <!--JQuery-->
16 <script src="../../static/js/jquery.min.js"></script> 16 <script src="../../static/js/jquery.min.js"></script>
17 - 17 +<!-- <link rel="icon" href="http://app.shineup.com.cn/goldenline/play_sel.png" type="image/x-icon"> -->
  18 + <link rel="icon" href="/static/favicon.ico" type="image/x-icon">
18 <!--Bootstrap--> 19 <!--Bootstrap-->
19 <link href="../../static/css/bootstrap.min.css" rel="stylesheet"> 20 <link href="../../static/css/bootstrap.min.css" rel="stylesheet">
20 <script src="../../static/js/bootstrap.min.js"></script> 21 <script src="../../static/js/bootstrap.min.js"></script>
src/main/resources/templates/error.html
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 -<html>  
3 -<head>  
4 - <title>审核云平台</title> 2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
5 3
6 - <style>  
7 - html, body {  
8 - height: 100%;  
9 - }  
10 -  
11 - body {  
12 - margin: 0;  
13 - padding: 0;  
14 - width: 100%;  
15 - display: table;  
16 - font-weight: 100;  
17 - font-family: 'Lato', sans-serif;  
18 - }  
19 -  
20 - .container {  
21 - text-align: center;  
22 - display: table-cell;  
23 - vertical-align: middle;  
24 - } 4 +<head th:replace="../templates/common/head::head">
  5 +</head>
25 6
26 - .content {  
27 - text-align: center;  
28 - display: inline-block;  
29 - } 7 +<body class="skin-blue sidebar-mini">
30 8
31 - .title {  
32 - font-size: 40px;  
33 - }  
34 - </style>  
35 -</head>  
36 -<body>  
37 -<div class="container">  
38 - <div class="content">  
39 - <div class="title">出错了,请稍后再试!</div> 9 +<div class="wrapper">
  10 + <div th:replace="../templates/common/frame::frame"></div>
  11 + <div class="content-wrapper" style="min-height: 588px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 报错页面
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li>首页</li>
  18 + <li class="active">报错页面</li>
  19 + </ol>
  20 + </section>
  21 + <section class="content">
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <div class="box box-info">
  25 + <div class="box-body">
  26 + <div class="container" style="background-color:#FFF;padding:150px;text-align: center; display: table-cell; vertical-align: middle;">
  27 + <div class="content" style="text-align: center;display: inline-block;">
  28 + <div style="font-size: 40px;" th:utext="${errorMessage}">出错了,请稍后再试!</div>
  29 + <br>
  30 + <div style="font-size: 20px;color:red;" th:utext="${remindMessage}">出错了,请稍后再试!</div>
  31 + </div>
  32 + </div>
  33 +
  34 + </div>
  35 + </div>
  36 + </div>
  37 + </div>
  38 + </section>
40 </div> 39 </div>
41 -</div>  
42 -</body>  
43 -</html> 40 + <footer th:replace="../templates/common/foot::foot"></footer>
  41 + <!-- Add the sidebar's background. This div must be placed
  42 + immediately after the control sidebar -->
  43 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  44 +</div><!-- ./wrapper -->
  45 +<!-- AdminLTE App -->
  46 +<script src="../../static/js/app.min.js"></script>
  47 +<!-- AdminLTE for demo purposes -->
  48 +<script src="../../static/js/sidebar.js"></script>
44 49
  50 +</body>
  51 +</html>
45 \ No newline at end of file 52 \ No newline at end of file
src/main/resources/templates/error3.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<head>
  4 + <title>审核云平台</title>
  5 +
  6 + <style>
  7 + html, body {
  8 + height: 100%;
  9 + }
  10 +
  11 + body {
  12 + margin: 0;
  13 + padding: 0;
  14 + width: 100%;
  15 + display: table;
  16 + font-weight: 100;
  17 + font-family: 'Lato', sans-serif;
  18 + }
  19 +
  20 + .container {
  21 + text-align: center;
  22 + display: table-cell;
  23 + vertical-align: middle;
  24 + }
  25 +
  26 + .content {
  27 + text-align: center;
  28 + display: inline-block;
  29 + }
  30 +
  31 + .title {
  32 + font-size: 40px;
  33 + }
  34 + .remind {
  35 + font-size: 20px;
  36 + }
  37 + </style>
  38 +</head>
  39 +<body>
  40 +<div class="container">
  41 + <div class="content">
  42 + <div class="title" th:utext="${errorMessage}">出错了,请稍后再试!</div>
  43 + <br>
  44 + <div class="remind" th:utext="${remindMessage}">出错了,请稍后再试!</div>
  45 + </div>
  46 +</div>
  47 +</body>
  48 +</html>
  49 +
src/main/resources/templates/page/comment.html
@@ -193,7 +193,12 @@ @@ -193,7 +193,12 @@
193 </th> 193 </th>
194 <th style="text-align: center; width: 6%; " data-field="comment_user_ip" 194 <th style="text-align: center; width: 6%; " data-field="comment_user_ip"
195 tabindex="0"> 195 tabindex="0">
196 - <div class="th-inner ">用户IP</div> 196 + <div class="th-inner ">评论类型</div>
  197 + <div class="fht-cell"></div>
  198 + </th>
  199 + <th style="text-align: center; width: 4%; " data-field="is_hot_name"
  200 + tabindex="0">
  201 + <div class="th-inner ">层级</div>
197 <div class="fht-cell"></div> 202 <div class="fht-cell"></div>
198 </th> 203 </th>
199 <th style="text-align: center; width: 22%; " data-field="content" 204 <th style="text-align: center; width: 22%; " data-field="content"
@@ -214,11 +219,6 @@ @@ -214,11 +219,6 @@
214 <div class="fht-cell"></div> 219 <div class="fht-cell"></div>
215 </th> 220 </th>
216 221
217 - <th style="text-align: center; width: 4%; " data-field="is_hot_name"  
218 - tabindex="0">  
219 - <div class="th-inner ">热点</div>  
220 - <div class="fht-cell"></div>  
221 - </th>  
222 <th style="text-align: center; width: 5%; " 222 <th style="text-align: center; width: 5%; "
223 data-field="state_name_short" tabindex="0"> 223 data-field="state_name_short" tabindex="0">
224 <div class="th-inner ">状态 224 <div class="th-inner ">状态
@@ -256,7 +256,10 @@ @@ -256,7 +256,10 @@
256 alt="用户头像"></div> 256 alt="用户头像"></div>
257 </td> 257 </td>
258 <td style="text-align: center; width: 6%;" 258 <td style="text-align: center; width: 6%;"
259 - th:text="${comment.comment_user_ip}">114.242.177.100 259 + th:text="${comment.type}">114.242.177.100
  260 + </td>
  261 + <td style="text-align: center; width: 4%;"
  262 + th:text="${comment.level}">1级
260 </td> 263 </td>
261 <td style="text-align: center; width: 22%;"><a 264 <td style="text-align: center; width: 22%;"><a
262 th:title="${comment.comment_content}" 265 th:title="${comment.comment_content}"
@@ -279,9 +282,6 @@ @@ -279,9 +282,6 @@
279 <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}"> 282 <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}">
280 283
281 </td> 284 </td>
282 - <td style="text-align: center; width: 4%;"  
283 - th:if="${comment.is_hot!=2&&comment.is_hot!=1}">全部  
284 - </td>  
285 <td style="text-align: center; width: 5%;"> 285 <td style="text-align: center; width: 5%;">
286 <span class="btn btn-sm btn-warning" 286 <span class="btn btn-sm btn-warning"
287 th:if="${comment.state==0}">待审</span> 287 th:if="${comment.state==0}">待审</span>
@@ -296,7 +296,8 @@ @@ -296,7 +296,8 @@
296 2018-11-28 16:08:00 296 2018-11-28 16:08:00
297 </td> 297 </td>
298 <td style="text-align: center; width: 22%;"> 298 <td style="text-align: center; width: 22%;">
299 - <a class="detail" th:href="@{'/comments/details/'+${comment.id}}"> 299 + <a th:if="${comment.receive==1 and session.sessionUser.userId==comment.receive_user_id}"
  300 + class="detail" th:href="@{'/comments/details/'+${comment.id}}">
300 <button class="btn btn-info btn-sm">查看</button> 301 <button class="btn btn-info btn-sm">查看</button>
301 </a> 302 </a>
302 303
@@ -311,6 +312,9 @@ @@ -311,6 +312,9 @@
311 th:if="${comment.state==0 and comment.receive==1 and session.sessionUser.userId==comment.receive_user_id}"> 312 th:if="${comment.state==0 and comment.receive==1 and session.sessionUser.userId==comment.receive_user_id}">
312 <button class="btn btn-warning btn-sm">退领</button> 313 <button class="btn btn-warning btn-sm">退领</button>
313 </a> 314 </a>
  315 + <a th:href="@{'javascript:speakModal('+${comment.id}+',\''+${comment.comment_user_name}+'\',\''+${comment.spid_desc}+'\')'}">
  316 + <button class="btn btn-danger btn-sm">禁言</button>
  317 + </a>
314 318
315 <!-- <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span> --> 319 <!-- <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span> -->
316 <!-- <a class="pass_one" --> 320 <!-- <a class="pass_one" -->
@@ -398,7 +402,7 @@ @@ -398,7 +402,7 @@
398 </section><!-- /.content --> 402 </section><!-- /.content -->
399 </div> 403 </div>
400 <!-- /.content-wrapper --> 404 <!-- /.content-wrapper -->
401 - <!-- 模态框(Modal) --> 405 + <!-- 模态框,拒绝框(Modal) -->
402 <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 406 <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
403 <div class="modal-dialog"> 407 <div class="modal-dialog">
404 <div class="modal-content" style="margin-top: 30%;"> 408 <div class="modal-content" style="margin-top: 30%;">
@@ -421,6 +425,48 @@ @@ -421,6 +425,48 @@
421 </div><!-- /.modal-dialog --> 425 </div><!-- /.modal-dialog -->
422 </div> 426 </div>
423 <!-- /.modal --> 427 <!-- /.modal -->
  428 + <!-- 模态框,禁言框(Modal) -->
  429 +<div class="modal fade" id="speakModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  430 + <div class="modal-dialog">
  431 + <div class="modal-content" style="margin-top: 30%;">
  432 + <div class="modal-header">
  433 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  434 + <h4 class="modal-title" id="myModalLabel">禁言选项</h4>
  435 + </div>
  436 + <div class="modal-body">
  437 + <input type="text" name="comments_id" value="" class="hide" id="comments_id"/>
  438 + <div class="form-group">
  439 + <label class="control-label col-sm-3" style="font-size: 15px;" >用户昵称:</label>
  440 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  441 + <input class="form-control" readonly="readonly" style="width:40%;" type="text" value="" id="userName" name="userName">
  442 + </div>
  443 + </div>
  444 + <div class="form-group">
  445 + <label class="control-label col-sm-3" style="font-size: 15px;">发言平台:</label>
  446 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  447 + <input class="form-control" readonly="readonly" style="width:40%;" type="text" value="" id="sp_desc" name="sp_desc">
  448 + </div>
  449 + </div>
  450 + <div class="form-group">
  451 + <label class="control-label col-sm-3" style="font-size: 15px;">禁言时长:</label>
  452 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  453 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_days" name="noSpeak_days">
  454 + <span>&nbsp;&nbsp;天&nbsp;&nbsp;</span>
  455 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_hours" name="noSpeak_hours">
  456 + <span>&nbsp;&nbsp;时&nbsp;&nbsp;</span>
  457 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_minutes" name="noSpeak_minutes">
  458 + <span>&nbsp;&nbsp;分&nbsp;&nbsp;</span>
  459 + </div>
  460 + </div>
  461 + </div>
  462 + <div class="modal-footer">
  463 + <button type="button" class="btn btn-primary" onclick="javascript:submitSpeak();">提交</button>
  464 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  465 + </div>
  466 + </div><!-- /.modal-content -->
  467 + </div><!-- /.modal-dialog -->
  468 +</div>
  469 +<!-- /.modal -->
424 <script th:inline="javascript"> 470 <script th:inline="javascript">
425 $(function () { 471 $(function () {
426 //按钮颜色设置 472 //按钮颜色设置
@@ -750,6 +796,40 @@ @@ -750,6 +796,40 @@
750 alert("没有选中的数据!"); 796 alert("没有选中的数据!");
751 } 797 }
752 } 798 }
  799 + //禁言(弹窗)
  800 + function speakModal(comments_id,userName,sp_desc) {
  801 +
  802 + $.post("/notSpeak/querySpeakState?commentId=" + comments_id, function (data) {
  803 + if (data.errorCode != 0) {
  804 + alert(data.errorMessage);
  805 +// location.href = location.href;
  806 + } else {
  807 + $('#comments_id').val(comments_id);
  808 + $('#userName').val(userName);
  809 + $('#sp_desc').val(sp_desc);
  810 + $('#speakModal').modal('show');
  811 + }
  812 + })
  813 +
  814 + }
  815 +
  816 + //提交禁言
  817 + function submitSpeak() {
  818 + var comments_id = $("#comments_id").val();
  819 + var noSpeak_days = Number($("#noSpeak_days").val());
  820 + var noSpeak_hours = Number($("#noSpeak_hours").val());
  821 + var noSpeak_minutes = Number($("#noSpeak_minutes").val());
  822 + var time=noSpeak_days*24*60+noSpeak_hours*60+noSpeak_minutes;//单位为分钟
  823 +// alert(comments_id);
  824 + $.post("/notSpeak/notSpeakByComment?commentId=" + comments_id + "&time=" + time, function (data) {
  825 + if (data.errorCode == 0) {
  826 + alert(data.errorMessage);
  827 + location.href = location.href;
  828 + } else {
  829 + alert(data.errorMessage);
  830 + }
  831 + })
  832 + }
753 </script> 833 </script>
754 <script> 834 <script>
755 /*时间插件*/ 835 /*时间插件*/
src/main/resources/templates/page/error.html
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <body> 36 <body>
37 <div class="container"> 37 <div class="container">
38 <div class="content"> 38 <div class="content">
39 - <div class="title">抱歉!你没有审核云权限,请与视讯云用户中心管理员联系!</div> 39 + <div class="title">抱歉!你没有审核云账户未激活,请与视讯云用户中心管理员联系!</div>
40 </div> 40 </div>
41 </div> 41 </div>
42 </body> 42 </body>
src/main/resources/templates/page/liveApply.html
@@ -60,7 +60,6 @@ @@ -60,7 +60,6 @@
60 th:onclick="'javascript:quanbu()'" value="" id="quanbu"> 60 th:onclick="'javascript:quanbu()'" value="" id="quanbu">
61 全部 61 全部
62 </button> 62 </button>
63 - </button>  
64 <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen" 63 <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen"
65 th:onclick="'javascript:daishen()'" value="0">全部待领 64 th:onclick="'javascript:daishen()'" value="0">全部待领
66 </button> 65 </button>
@@ -76,19 +75,19 @@ @@ -76,19 +75,19 @@
76 </button> 75 </button>
77 </div> 76 </div>
78 <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;"> 77 <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;">
79 - <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 18%;float: left;"> 78 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 15%;float: left;">
80 <div class="col-md-6" style="padding: 0;width: 100%;"> 79 <div class="col-md-6" style="padding: 0;width: 100%;">
81 <label for="liveApply_theme" class="control-label cb-toolbar">直播主题:</label> 80 <label for="liveApply_theme" class="control-label cb-toolbar">直播主题:</label>
82 - <div class="col-sm-8" style="padding: 0;"> 81 + <div class="col-sm-7" style="padding: 0;">
83 <input class="form-control" type="text" value="" id="liveApply_theme"> 82 <input class="form-control" type="text" value="" id="liveApply_theme">
84 </div> 83 </div>
85 </div> 84 </div>
86 </div> 85 </div>
87 86
88 - <div class="btn-group margin-bottom col-md-6" style="padding-left:10px;width: 13%;float: left;"> 87 + <div class="btn-group margin-bottom col-md-6" style="padding-left:0px;width: 13%;float: left;">
89 <div class="col-md-5" style="padding: 0;width: 100%;"> 88 <div class="col-md-5" style="padding: 0;width: 100%;">
90 <label for="shenhe_state" class="control-label cb-toolbar">状态:</label> 89 <label for="shenhe_state" class="control-label cb-toolbar">状态:</label>
91 - <div class="col-sm-8" style="padding: 0;"> 90 + <div class="col-sm-7" style="padding: 0;">
92 <select class="form-control" id="shenhe_state" name="shenhe_state"> 91 <select class="form-control" id="shenhe_state" name="shenhe_state">
93 <option value="">全部</option> 92 <option value="">全部</option>
94 <option value="0">未审核</option> 93 <option value="0">未审核</option>
@@ -98,27 +97,35 @@ @@ -98,27 +97,35 @@
98 </div> 97 </div>
99 </div> 98 </div>
100 </div> 99 </div>
101 - <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 13%;float: left;">  
102 - <div class="col-md-5" style="padding: 0;width: 100%;">  
103 - <label for="business_model" class="control-label cb-toolbar">模式:</label>  
104 - <div class="col-sm-8" style="padding: 0;">  
105 - <select class="form-control" id="business_model" name="business_model">  
106 - <option value="">全部</option>  
107 - <option value="0">免费</option>  
108 - <option value="1">收费</option>  
109 - </select>  
110 - </div>  
111 - </div> 100 +<!-- <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 13%;float: left;"> -->
  101 +<!-- <div class="col-md-5" style="padding: 0;width: 100%;"> -->
  102 +<!-- <label for="business_model" class="control-label cb-toolbar">模式:</label> -->
  103 +<!-- <div class="col-sm-8" style="padding: 0;"> -->
  104 +<!-- <select class="form-control" id="business_model" name="business_model"> -->
  105 +<!-- <option value="">全部</option> -->
  106 +<!-- <option value="0">免费</option> -->
  107 +<!-- <option value="1">收费</option> -->
  108 +<!-- </select> -->
  109 +<!-- </div> -->
  110 +<!-- </div> -->
  111 +<!-- </div> -->
  112 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 15%;float: left;">
  113 + <div class="col-md-5" style="padding: 0;width: 100%;" >
  114 + <label for="business_model" class="control-label cb-toolbar">发起单位:</label>
  115 + <div class="col-sm-7" style="padding: 0;">
  116 + <input class="form-control" type="text" value="" id="business_model" name="business_model">
  117 + </div>
  118 + </div>
112 </div> 119 </div>
113 - <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 18%;float: left;"> 120 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 15%;float: left;">
114 <div class="col-md-6" style="padding: 0;width: 100%;" th:if="${session.sessionUser.spid==0}"> 121 <div class="col-md-6" style="padding: 0;width: 100%;" th:if="${session.sessionUser.spid==0}">
115 <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label> 122 <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label>
116 - <div class="col-sm-8" style="padding: 0;"> 123 + <div class="col-sm-7" style="padding: 0;">
117 <input class="form-control" type="text" value="" id="sp_desc"> 124 <input class="form-control" type="text" value="" id="sp_desc">
118 </div> 125 </div>
119 </div> 126 </div>
120 </div> 127 </div>
121 - <div class="btn-group margin-bottom col-md-6" style="padding-left: 10px;width: 20%;float: left;"> 128 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 20%;float: left;">
122 <div class="col-md-12" style="padding: 0;width: 100%;"> 129 <div class="col-md-12" style="padding: 0;width: 100%;">
123 <label for="start_date" class="control-label cb-toolbar">预计时间:</label> 130 <label for="start_date" class="control-label cb-toolbar">预计时间:</label>
124 <div class="input-group col-md-8 date"> 131 <div class="input-group col-md-8 date">
@@ -191,22 +198,27 @@ @@ -191,22 +198,27 @@
191 <div class="th-inner ">sp简称</div> 198 <div class="th-inner ">sp简称</div>
192 <div class="fht-cell"></div> 199 <div class="fht-cell"></div>
193 </th> 200 </th>
194 - <th style="text-align: center; width: 20%; " data-field="video_title" 201 + <th style="text-align: center; width: 18%; " data-field="video_title"
195 tabindex="0"> 202 tabindex="0">
196 <div class="th-inner ">直播主题</div> 203 <div class="th-inner ">直播主题</div>
197 <div class="fht-cell"></div> 204 <div class="fht-cell"></div>
198 </th> 205 </th>
199 - <th style="text-align: center; width: 3%; " data-field="is_hot_name" 206 + <th style="text-align: center; width: 6%; " data-field="sp_id_brief"
200 tabindex="0"> 207 tabindex="0">
201 - <div class="th-inner ">商务模式</div> 208 + <div class="th-inner ">发起单位</div>
202 <div class="fht-cell"></div> 209 <div class="fht-cell"></div>
203 </th> 210 </th>
  211 +<!-- <th style="text-align: center; width: 3%; " data-field="is_hot_name" -->
  212 +<!-- tabindex="0"> -->
  213 +<!-- <div class="th-inner ">商务模式</div> -->
  214 +<!-- <div class="fht-cell"></div> -->
  215 +<!-- </th> -->
204 <th style="text-align: center; width: 3%; " data-field="is_hot_name" 216 <th style="text-align: center; width: 3%; " data-field="is_hot_name"
205 tabindex="0"> 217 tabindex="0">
206 <div class="th-inner ">直播类型</div> 218 <div class="th-inner ">直播类型</div>
207 <div class="fht-cell"></div> 219 <div class="fht-cell"></div>
208 </th> 220 </th>
209 - <th style="text-align: center; width: 6%; " data-field="updater" 221 + <th style="text-align: center; width: 3%; " data-field="updater"
210 tabindex="0"> 222 tabindex="0">
211 <div class="th-inner ">审核员</div> 223 <div class="th-inner ">审核员</div>
212 <div class="fht-cell"></div> 224 <div class="fht-cell"></div>
@@ -221,7 +233,7 @@ @@ -221,7 +233,7 @@
221 <div class="th-inner ">审核类型</div> 233 <div class="th-inner ">审核类型</div>
222 <div class="fht-cell"></div> 234 <div class="fht-cell"></div>
223 </th> 235 </th>
224 - <th style="text-align: center; width: 5%; " data-field="state_name" 236 + <th style="text-align: center; width: 3%; " data-field="state_name"
225 tabindex="0"> 237 tabindex="0">
226 <div class="th-inner ">邮件通知</div> 238 <div class="th-inner ">邮件通知</div>
227 <div class="fht-cell"></div> 239 <div class="fht-cell"></div>
@@ -236,7 +248,7 @@ @@ -236,7 +248,7 @@
236 <div class="th-inner ">预计开播时间</div> 248 <div class="th-inner ">预计开播时间</div>
237 <div class="fht-cell"></div> 249 <div class="fht-cell"></div>
238 </th> 250 </th>
239 - <th style="text-align: center; width: 17%; " data-field="action" 251 + <th style="text-align: center; width: 20%; " data-field="action"
240 tabindex="0"> 252 tabindex="0">
241 <div class="th-inner ">操作</div> 253 <div class="th-inner ">操作</div>
242 <div class="fht-cell"></div> 254 <div class="fht-cell"></div>
@@ -254,9 +266,10 @@ @@ -254,9 +266,10 @@
254 <span th:text="${liveApply.theme}">邓建国正面PK冯小刚</span> 266 <span th:text="${liveApply.theme}">邓建国正面PK冯小刚</span>
255 </a> 267 </a>
256 </td> 268 </td>
257 - <td style="text-align: center; width: 3%;"  
258 - th:text="${liveApply.business_model=='1'?'收费':'免费'}">收费  
259 - </td> 269 + <td style="text-align: center; width: 6%;" th:text="${liveApply.organization}"></td>
  270 +<!-- <td style="text-align: center; width: 3%;" -->
  271 +<!-- th:text="${liveApply.business_model=='1'?'收费':'免费'}">收费 -->
  272 +<!-- </td> -->
260 <td style="text-align: center; width: 3%;" th:text="${liveApply.live_type}">直播分类</td> 273 <td style="text-align: center; width: 3%;" th:text="${liveApply.live_type}">直播分类</td>
261 <td style="text-align: center; width: 6%;" th:text="${liveApply.updater}">审核员 274 <td style="text-align: center; width: 6%;" th:text="${liveApply.updater}">审核员
262 </td> 275 </td>
src/main/resources/templates/page/notspeak.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-md-12">
  87 + <div class="box box-info">
  88 + <div class="box-body">
  89 + <div class="clearfix">
  90 + <div class="btn-group margin-bottom pull-right">
  91 + <div class="btn-group margin-bottom">
  92 + <button type="button" id="quanbu"
  93 + class="btn btn-sm margin-r-5 action_bottom"
  94 + th:onclick="'javascript:quanbu()'">全部
  95 + </button>
  96 + <button type="button" id="jinyan"
  97 + class="btn btn-sm margin-r-5 action_bottom"
  98 + >禁言中
  99 + </button>
  100 + <button type="button" id="jiejin"
  101 + class="btn btn-sm margin-r-5 action_bottom"
  102 + >已解禁
  103 + </button>
  104 +<!-- <button type="button" id="yishen" -->
  105 +<!-- class="btn btn-sm margin-r-5 action_bottom" -->
  106 +<!-- >我的已审 -->
  107 +<!-- </button> -->
  108 + </div>
  109 + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
  110 + onclick="openOrClose(&#39;forms&#39;)">高级查询
  111 + <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
  112 + </button>
  113 + </div>
  114 + </div>
  115 +
  116 +
  117 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;">
  118 + <form id="commentForm">
  119 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;">
  120 + <div class="col-md-5" style="padding: 0">
  121 + <label for="user_id" class="control-label cb-toolbar">用户id:</label>
  122 + <div class="col-sm-8" style="padding: 0;">
  123 + <input class="form-control" name="user_id" type="text"
  124 + id="user_id" >
  125 + </div>
  126 + </div>
  127 + <div class="col-md-5" style="padding: 0">
  128 + <label for="user_name" class="control-label cb-toolbar">用户昵称:</label>
  129 + <div class="col-sm-8" style="padding: 0;">
  130 + <input class="form-control" name="user_name" type="text" id="user_name" >
  131 + </div>
  132 + </div>
  133 +<!-- <div class="col-md-3" style="padding: 0"> -->
  134 +<!-- <label for="state" class="control-label cb-toolbar">状态:</label> -->
  135 +<!-- <div class="col-sm-6" style="padding: 0;"> -->
  136 +<!-- <select class="form-control col-sm-2" id="state" name="state"> -->
  137 +<!-- <option value="">全部</option> -->
  138 +<!-- <option value="0" >已解禁</option> -->
  139 +<!-- <option value="1" >禁言中</option> -->
  140 +<!-- </select> -->
  141 +<!-- </div> -->
  142 +<!-- </div> -->
  143 +
  144 + </div>
  145 +
  146 + </form>
  147 +
  148 + </div>
  149 +
  150 +
  151 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  152 + <div class="fixed-table-body">
  153 + <table data-toggle="table" data-pagination="true" data-search="false" data-show-refresh="true"
  154 + data-show-toggle="true" data-show-columns="true" data-toolbar="#toolbar" class="table table-hover">
  155 + <thead>
  156 + <tr>
  157 + <th style="text-align: center; width: 3%;" data-field="sp_id" tabindex="0">
  158 + <div class="th-inner ">用户ID</div>
  159 + <div class="fht-cell"></div>
  160 + </th>
  161 + <th style="text-align: center; width: 10%;" data-field="sp_id_brief" tabindex="0">
  162 + <div class="th-inner ">用户昵称</div>
  163 + <div class="fht-cell"></div>
  164 + </th>
  165 + <th style="text-align: center; width: 5%;" data-field="type" tabindex="0">
  166 + <div class="th-inner ">用户头像</div>
  167 + <div class="fht-cell"></div>
  168 + </th>
  169 + <th style="text-align: center; width: 3%;" data-field="type" tabindex="0">
  170 + <div class="th-inner ">使用平台</div>
  171 + <div class="fht-cell"></div>
  172 + </th>
  173 + <th style="text-align: center; width: 3%;" data-field="type" tabindex="0">
  174 + <div class="th-inner ">禁言状态</div>
  175 + <div class="fht-cell"></div>
  176 + </th>
  177 + <th style="text-align: center; width: 3%;" data-field="type" tabindex="0">
  178 + <div class="th-inner ">禁言次数</div>
  179 + <div class="fht-cell"></div>
  180 + </th>
  181 + <th style="text-align: center; width: 3%;" data-field="type" tabindex="0">
  182 + <div class="th-inner ">修改人</div>
  183 + <div class="fht-cell"></div>
  184 + </th>
  185 + <th style="text-align: center; width: 10%;" data-field="upload_time" tabindex="0">
  186 + <div class="th-inner ">禁言开始时间</div>
  187 + <div class="fht-cell"></div>
  188 + </th>
  189 + <th style="text-align: center; width: 10%;" data-field="updated_at" tabindex="0">
  190 + <div class="th-inner ">禁言结束时间</div>
  191 + <div class="fht-cell"></div>
  192 + </th>
  193 + <th style="text-align: center; width: 30%;" data-field="msg" tabindex="0">
  194 + <div class="th-inner ">禁言消息</div>
  195 + <div class="fht-cell"></div>
  196 + </th>
  197 +<!-- <th style="text-align: center; width: 10%;" data-field="action" tabindex="0"> -->
  198 +<!-- <div class="th-inner ">操作</div> -->
  199 +<!-- <div class="fht-cell"></div> -->
  200 +<!-- </th> -->
  201 + </tr>
  202 + </thead>
  203 + <tbody>
  204 + <tr th:data-index="${notspeakStat.index}" th:each="notspeak : ${notspeakPage.list}">
  205 + <td style="text-align: center; width: 5%;" th:text="${notspeak.user_id}">82</td>
  206 + <td style="text-align: center; width: 6%;" th:text="${notspeak.user_name}">视讯中国</td>
  207 + <td style="text-align: center; width: 6%;" >
  208 + <div style="width:60px;height:60px;"><img
  209 + th:src="@{${notspeak.user_avatar}}" width="60px"
  210 + alt="用户头像"></div>
  211 + </td>
  212 + <td style="text-align: center; width: 6%;" th:text="${notspeak.spid_desc}"></td>
  213 + <td style="text-align: center; width: 6%;" th:if="${notspeak.state==0}">
  214 + <label class="switch"><input type="checkbox" checked th:id="'id'+${notspeak.id}" th:user_name="${notspeak.user_name}" th:spid_desc="${notspeak.spid_desc}"><span class="slider round" th:id="${notspeak.id}"></span></label>
  215 + </td>
  216 + <td style="text-align: center; width: 6%;" th:if="${notspeak.state==1}">
  217 + <label class="switch"><input type="checkbox" th:id="'id'+${notspeak.id}" th:user_name="${notspeak.user_name}" th:spid_desc="${notspeak.spid_desc}"><span class="slider round" th:id="${notspeak.id}"></span></label>
  218 + </td>
  219 + <td style="text-align: center; width: 6%;" th:text="${notspeak.count}"></td>
  220 + <td style="text-align: center; width: 6%;" th:text="${notspeak.updater}"></td>
  221 + <td style="text-align: center; width: 10%;" th:text="${#dates.format(notspeak.start_time, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22
  222 + 23:08:48</td>
  223 + <td style="text-align: center; width: 10%;" th:text="${#dates.format(notspeak.end_time, 'yyyy-MM-dd HH:mm:ss')}">2016-08-03
  224 + 14:27:17</td>
  225 + <td style="text-align: center; width: 25%;" >
  226 +<!-- <span th:text="${notspeak.msg}"></span> -->
  227 + <textarea class="form-control" name="msg" cols="50" rows="3"
  228 + id="msg" th:text="${notspeak.msg}">禁言信息</textarea>
  229 + </td>
  230 +<!-- <td style="text-align: center; width: 10%;"> -->
  231 +<!-- <span>&nbsp;</span> -->
  232 +<!-- <a class="edit" th:href="'javascript:edit('+${notspeak.id}+',\''+${notspeak.user_name}+'\',\''+${notspeak.time}+'\',\''+${notspeak.time} +'\')'"> -->
  233 +<!-- <button class="btn btn-danger btn-xs">禁言</button> -->
  234 +<!-- </a><span> </span><span>&nbsp;</span> -->
  235 +<!-- <span>&nbsp;</span> -->
  236 +<!-- <a class="delete" th:href="'javascript:deleted('+${notspeak.id}+')'"> -->
  237 +<!-- <button class="btn btn-primary btn-xs">解除</button> -->
  238 +<!-- </a><span> </span><span>&nbsp;</span></td> -->
  239 + </tr>
  240 +
  241 + </tbody>
  242 + </table>
  243 + </div>
  244 +
  245 + <div class="fixed-table-pagination" style="display: block;">
  246 + <div class="pull-left pagination-detail">
  247 + <span class="pagination-info"
  248 + th:text="'共 '+${notspeakPage.total}+' 条记录,每页显示'">共 0 条记录</span>
  249 + <select class="" id="pageSize" name="pageSize"
  250 + onchange="selectPageSize()">
  251 + <option value="10" th:selected="${pageSize==10}">10</option>
  252 + <option value="20" th:selected="${pageSize==20}">20</option>
  253 + <option value="50" th:selected="${pageSize==50}">50</option>
  254 + <option value="100" th:selected="${pageSize==100}">100</option>
  255 + </select> <span class="pagination-info">条记录</span>
  256 + </div>
  257 + <div class="pull-right pagination">
  258 + <ul class="pagination" th:if="${notspeakPage.pages>1}">
  259 + <li class="page-pre"><a
  260 + th:href="'javascript:fanye(1);'">‹‹</a></li>
  261 + <li class="page-pre" th:if="${!notspeakPage.isFirstPage}"><a
  262 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum-1}+'\');'">‹</a>
  263 + </li>
  264 +
  265 + <li class="page-number" th:if="${notspeakPage.pageNum-3>=1}"><a
  266 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum-3}+'\');'"
  267 + th:text="${notspeakPage.pageNum-3}">2</a></li>
  268 + <li class="page-number" th:if="${notspeakPage.pageNum-2>=1}"><a
  269 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum-2}+'\');'"
  270 + th:text="${notspeakPage.pageNum-2}">2</a></li>
  271 + <li class="page-number" th:if="${notspeakPage.pageNum-1>=1}"><a
  272 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum-1}+'\');'"
  273 + th:text="${notspeakPage.pageNum-1}">2</a></li>
  274 + <li class="page-number active"><a
  275 + href="javaScript:void(0);" th:text="${notspeakPage.pageNum}">2</a></li>
  276 + <li class="page-number"
  277 + th:if="${notspeakPage.pageNum+1<=notspeakPage.pages}"><a
  278 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum+1}+'\');'"
  279 + th:text="${notspeakPage.pageNum+1}">2</a></li>
  280 + <li class="page-number"
  281 + th:if="${notspeakPage.pageNum+2<=notspeakPage.pages}"><a
  282 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum+2}+'\');'"
  283 + th:text="${notspeakPage.pageNum+2}">2</a></li>
  284 + <li class="page-number"
  285 + th:if="${notspeakPage.pageNum+3<=notspeakPage.pages}"><a
  286 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum+3}+'\');'"
  287 + th:text="${notspeakPage.pageNum+3}">2</a></li>
  288 +
  289 + <li class="page-next" th:if="${!notspeakPage.isLastPage}"><a
  290 + th:onclick="'javascript:fanye(\''+${notspeakPage.pageNum+1}+'\');'">›</a>
  291 + </li>
  292 + <li class="page-next"><a
  293 + th:onclick="'javascript:fanye(\''+${notspeakPage.pages}+'\');'">››</a>
  294 + </li>
  295 + </ul>
  296 + </div>
  297 + </div>
  298 + </div>
  299 + </div>
  300 + <div class="clearfix"></div>
  301 + </div>
  302 + </div>
  303 + </div>
  304 + </section>
  305 + </div>
  306 +
  307 +<!-- 模态框(Modal) -->
  308 +<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  309 + <div class="modal-dialog">
  310 + <div class="modal-content" style="margin-top: 30%;">
  311 + <div class="modal-header">
  312 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  313 + <h4 class="modal-title" id="myModalLabel">编辑邮件消息</h4>
  314 + </div>
  315 + <div class="modal-body">
  316 + <form action="/notspeak/write" method="post" id="editWrite">
  317 + <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
  318 + <div class="form-group hide">
  319 + <label class="control-label col-sm-3" style="font-size: 15px;" >Id:</label>
  320 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  321 + <input class="form-control" style="width:30%;" type="text" value="" id="id" name="id">
  322 + </div>
  323 + </div>
  324 + <div class="form-group">
  325 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件地址:</label>
  326 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  327 + <input class="form-control" style="width:40%;" type="text" value="" id="notspeak_edit" name="notspeak">
  328 + </div>
  329 + </div>
  330 + <div class="form-group">
  331 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件人:</label>
  332 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  333 + <input class="form-control" style="width:20%;" type="text" value="" id="remark_edit" name="remark">
  334 + </div>
  335 + </div>
  336 +
  337 + <div class="form-group">
  338 + <label class="control-label col-sm-3" style="font-size: 15px;">邮件类型:</label>
  339 + <div class="col-sm-9" style="float: left">
  340 + <div th:each="bu:${notspeak_message}" style="padding-right: 30px;" class="write_check">
  341 + <span th:text="${bu.value}" style="font-size: 15px"></span>
  342 + <input type="checkbox" name="write_business" th:value="${bu.key}" th:id="'write_check_'+${bu.key}">
  343 + </div>
  344 + </div>
  345 + </div>
  346 +
  347 + </form>
  348 + </div>
  349 + <div class="modal-footer">
  350 + <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交</button>
  351 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  352 + </div>
  353 + </div><!-- /.modal-content -->
  354 + </div><!-- /.modal-dialog -->
  355 +</div>
  356 +<!-- /.modal -->
  357 + <!-- 模态框,禁言框(Modal) -->
  358 +<div class="modal fade" id="speakModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  359 + <div class="modal-dialog">
  360 + <div class="modal-content" style="margin-top: 30%;">
  361 + <div class="modal-header">
  362 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  363 + <h4 class="modal-title" id="myModalLabel">禁言选项</h4>
  364 + </div>
  365 + <div class="modal-body">
  366 + <input type="text" name="speak_id" value="" class="hide" id="speak_id"/>
  367 + <div class="form-group">
  368 + <label class="control-label col-sm-3" style="font-size: 15px;" >用户昵称:</label>
  369 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  370 + <input class="form-control" readonly="readonly" style="width:40%;" type="text" value="" id="userName" name="userName">
  371 + </div>
  372 + </div>
  373 + <div class="form-group">
  374 + <label class="control-label col-sm-3" style="font-size: 15px;">发言平台:</label>
  375 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  376 + <input class="form-control" readonly="readonly" style="width:40%;" type="text" value="" id="sp_desc" name="sp_desc">
  377 + </div>
  378 + </div>
  379 + <div class="form-group">
  380 + <label class="control-label col-sm-3" style="font-size: 15px;">禁言时长:</label>
  381 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  382 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_days" name="noSpeak_days">
  383 + <span>&nbsp;&nbsp;天&nbsp;&nbsp;</span>
  384 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_hours" name="noSpeak_hours">
  385 + <span>&nbsp;&nbsp;时&nbsp;&nbsp;</span>
  386 + <input class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')" style="display:inline;width:10%;" type="text" value="0" id="noSpeak_minutes" name="noSpeak_minutes">
  387 + <span>&nbsp;&nbsp;分&nbsp;&nbsp;</span>
  388 + </div>
  389 + </div>
  390 + </div>
  391 + <div class="modal-footer">
  392 + <button type="button" class="btn btn-primary" onclick="javascript:submitSpeak();">提交</button>
  393 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  394 + </div>
  395 + </div><!-- /.modal-content -->
  396 + </div><!-- /.modal-dialog -->
  397 +</div>
  398 +<!-- /.modal -->
  399 + <script th:inline="javascript">
  400 + $(function () {
  401 + //按钮颜色设置
  402 + var state = [[${param.state}]] ? [[${param.state}]][0] : null;
  403 + var stateIsNull = $.trim(state) == "";
  404 + if ( stateIsNull) {
  405 + $("#quanbu").addClass("btn-success");
  406 + } else if (state == '1') {
  407 + $("#jinyan").addClass("btn-danger");
  408 + } else if (state == '0') {
  409 + $("#jiejin").addClass("btn-info");
  410 + }
  411 +// else if (!stateIsNull && state != '0' && receive == '1') {
  412 +// $("#yishen").addClass("btn-warning");
  413 +// }
  414 +
  415 + })
  416 +
  417 +
  418 + var user_id ="";//活动id
  419 + var user_name = "";//内容
  420 + var state ="";//状态
  421 + var count = "";//每页显示数量
  422 +
  423 + function query(){
  424 + user_id = $("#user_id").val();
  425 + user_name = $("#user_name").val();
  426 + count = $("#pageSize").val();
  427 + window.location.href = "/notSpeak/page?user_id=" + user_id + "&user_name=" + user_name + "&state=" + state + "&pageSize="+count;
  428 + }
  429 +
  430 + //全部
  431 + function quanbu() {
  432 + query();
  433 + }
  434 +
  435 + //禁言
  436 + $('#jinyan').click(function () {
  437 + state=1;
  438 + query();
  439 + });
  440 + //解禁
  441 + $('#jiejin').click(function () {
  442 + state=0;
  443 + query();
  444 + });
  445 +
  446 + //开关的点击事件
  447 + $(".slider").on('click',function(e){
  448 + var myId=$(this).prop("id");
  449 + // var myIndex = $(".slider").index($(this));
  450 + var checked=$("#id"+myId).prop("checked");//获取当前状态,下一个状态用!checked表示
  451 + var user_name=$("#id"+myId).attr("user_name");
  452 + var spid_desc=$("#id"+myId).attr("spid_desc");
  453 + if(checked){//当前用户没有被禁言,现在要执行禁言操作
  454 + speakModal(myId,user_name,spid_desc);
  455 + }else{//当前用户已被禁言,现在执行解除禁言操作
  456 + var r = confirm("您确定要解除当前用户的禁言操作吗?");
  457 + if (r == true) {
  458 + $.post("/notSpeak/speak?notSpeakId=" + myId+"&type=0&time=0", function (data) {
  459 + if (data.errorCode == 0) {
  460 + alert(data.errorMessage);
  461 + location.href = location.href;
  462 + } else {
  463 + alert(data.errorMessage);
  464 + location.href = location.href;
  465 + }
  466 + })
  467 + }
  468 + }
  469 + })
  470 +
  471 + //禁言(弹窗)
  472 + function speakModal(speak_id,userName,sp_desc) {
  473 + $('#speak_id').val(speak_id);
  474 + $('#userName').val(userName);
  475 + $('#sp_desc').val(sp_desc);
  476 + $('#speakModal').modal('show');
  477 + }
  478 +
  479 + //提交禁言
  480 + function submitSpeak() {
  481 + var speak_id = $("#speak_id").val();
  482 + var noSpeak_days = Number($("#noSpeak_days").val());
  483 + var noSpeak_hours = Number($("#noSpeak_hours").val());
  484 + var noSpeak_minutes = Number($("#noSpeak_minutes").val());
  485 + var time=noSpeak_days*24*60+noSpeak_hours*60+noSpeak_minutes;//单位为分钟
  486 + $.post("/notSpeak/speak?notSpeakId=" + speak_id + "&time=" + time+ "&type=1", function (data) {
  487 + if (data.errorCode == 0) {
  488 + alert(data.errorMessage);
  489 + location.href = location.href;
  490 + } else {
  491 + alert(data.errorMessage);
  492 + }
  493 + })
  494 + }
  495 +
  496 + //翻页函数
  497 + function fanye(page) {
  498 + var param = location.search;
  499 + if (param.indexOf("page=") != -1) {
  500 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  501 + var split = se.split("&");
  502 + var h = "";
  503 + for (var i = 0; i < split.length; i++) {
  504 + var s = split[i];
  505 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  506 + }
  507 + h = h.substring(1, h.length);
  508 + window.location.href = "/notSpeak/page?" + h + "&page=" + page;
  509 + } else {
  510 + param = param.substring(1, param.length);
  511 + window.location.href = "/notSpeak/page?" + param + "&page=" + page;
  512 + }
  513 + }
  514 +
  515 + //选择每页数量触发函数
  516 + function selectPageSize(){
  517 + var pageSize=$("#pageSize").val();
  518 + var param = location.search;
  519 + if (param.indexOf("pageSize=") != -1) {
  520 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  521 + var split = se.split("&");
  522 + var h = "";
  523 + for (var i = 0; i < split.length; i++) {
  524 + var s = split[i];
  525 + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
  526 + }
  527 + h = h.substring(1, h.length);
  528 + window.location.href = "/notSpeak/page?" + h + "&pageSize=" + pageSize;
  529 + } else {
  530 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  531 + var split = se.split("&");
  532 + var h = "";
  533 + for (var i = 0; i < split.length; i++) {
  534 + var s = split[i];
  535 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  536 + }
  537 + h = h.substring(1, h.length);
  538 + window.location.href = "/notSpeak/page?" + h + "&pageSize=" + pageSize;
  539 + }
  540 + }
  541 +
  542 +
  543 + //鼠标回车事件
  544 + $(document).keyup(function(event){
  545 + if(event.keyCode ==13){
  546 + quanbu();
  547 + }
  548 + });
  549 + //打开编辑窗口
  550 +// function edit(Id,notspeak,remark,write_business){
  551 +// $("#myModalLabel").text("编辑邮件消息");
  552 +// $("#id").val(Id);
  553 +// $("#notspeak_edit").val(notspeak);
  554 +// $("#notspeak_edit").attr("readonly","true");
  555 +// $("#remark_edit").val(remark);
  556 +// $("#redirect_url").val(location.pathname+location.search);
  557 +// $(".write_check input").prop("checked",false);
  558 +// if($.trim(write_business)!=''){
  559 +// var array = write_business.split(",")
  560 +// for (var i=0;i<array.length;i++){
  561 +// $("#write_check_"+array[i]).prop("checked",true);
  562 +// }
  563 +// }
  564 +// $('#editModal').modal('show');
  565 +// }
  566 +
  567 + //打开添加窗口
  568 +// function add(){
  569 +// $("#id").val("");
  570 +// $("#notspeak_edit").val("");
  571 +// $("#notspeak_edit").removeAttr("readonly");
  572 +// $("#remark_edit").val("");
  573 +// $(".write_check input").prop("checked",false);
  574 +
  575 +// $("#redirect_url").val(location.pathname+location.search);
  576 +// $("#myModalLabel").text("添加邮件消息");
  577 +// $('#editModal').modal('show');
  578 +// }
  579 +
  580 + //删除操作
  581 +// function deleted(id){
  582 +// var r = confirm("您确定删除本条内容吗?");
  583 +// if (r == true) {
  584 +// $.post("/notspeak/deleted?id=" + id, function (data) {
  585 +// if (data.errorCode == 0) {
  586 +// alert(data.errorMessage);
  587 +// location.href = location.href;
  588 +// } else {
  589 +// alert(data.errorMessage);
  590 +// }
  591 +// })
  592 +// }
  593 +// }
  594 +
  595 + /*查询样式*/
  596 + function openOrClose(id_name_str) {
  597 + var id_name = '#' + id_name_str;
  598 + if ($(id_name).css('display') == 'block') {
  599 + $(id_name).slideUp(350);
  600 + $('#a_up').show();
  601 + $('#a_down').hide();
  602 + } else {
  603 + $(id_name).slideDown(350);
  604 + $('#a_up').hide();
  605 + $('#a_down').show();
  606 + }
  607 + }
  608 + </script>
  609 +
  610 + <footer th:replace="../templates/common/foot::foot" ></footer>
  611 +
  612 +
  613 + <!-- Add the sidebar's background. This div must be placed
  614 + immediately after the control sidebar -->
  615 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  616 +
  617 +</div><!-- ./wrapper -->
  618 +
  619 +
  620 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  621 +<script type="text/javascript">
  622 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  623 +</script>
  624 +
  625 +<!-- AdminLTE App -->
  626 +<script src="../../static/js/app.min.js"></script>
  627 +<!-- AdminLTE for demo purposes -->
  628 +<script src="../../static/js/sidebar.js"></script>
  629 +
  630 +
  631 +</body>
  632 +</html>
0 \ No newline at end of file 633 \ No newline at end of file
src/main/resources/templates/page/topic.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<head th:replace="../templates/common/head::head"></head>
  4 +
  5 +<body class="skin-blue sidebar-mini">
  6 +
  7 +<div class="wrapper">
  8 +
  9 + <div th:replace="../templates/common/frame::frame"></div>
  10 +
  11 + <div class="content-wrapper" style="min-height: 788px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 话题审核
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li>首页</li>
  18 + <li class="active">话题审核</li>
  19 + </ol>
  20 + </section>
  21 + <section class="content">
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <div class="box box-info">
  25 + <div class="box-body">
  26 + <div class="clearfix">
  27 + <div class="btn-group margin-bottom pull-left">
  28 + <div class="btn-group margin-bottom hide" id="hide_select_area">
  29 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  30 + id="more_pass">批量通过
  31 + </button>
  32 + <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom"
  33 + id="more_reject">批量拒绝
  34 + </button>
  35 + </div>
  36 +
  37 + <div class="btn-group margin-bottom hide" id="receive_select">
  38 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  39 + onclick="receive(0);">认领
  40 + </button>
  41 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  42 + onclick="receive(10);">认领10条
  43 + </button>
  44 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  45 + onclick="receive(100);">认领100条
  46 + </button>
  47 + <button type="button" class="btn btn-warning btn-sm margin-r-5 action_bottom"
  48 + onclick="retReceive();">退领
  49 + </button>
  50 + <button type="button" class="btn btn-danger btn-sm margin-r-5 action claim"
  51 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  52 + data-target="#modal" onclick="repulse();">拒绝
  53 + </button>
  54 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  55 + id="morePass" onclick="morePass();">批量通过
  56 + </button>
  57 + </div>
  58 +
  59 + </div>
  60 +
  61 + <div class="btn-group margin-bottom pull-right">
  62 + <div class="btn-group margin-bottom">
  63 + <button type="button" id="quanbu"
  64 + class="btn btn-sm margin-r-5 action_bottom"
  65 + th:onclick="'javascript:quanbu()'">全部
  66 + </button>
  67 + <button type="button" id="daishen"
  68 + class="btn btn-sm margin-r-5 action_bottom"
  69 + >全部待领
  70 + </button>
  71 + <button type="button" id="Mydaishen"
  72 + class="btn btn-sm margin-r-5 action_bottom hide"
  73 + >我的待审
  74 + </button>
  75 + <button type="button" id="yishen"
  76 + class="btn btn-sm margin-r-5 action_bottom"
  77 + >我的已审
  78 + </button>
  79 + </div>
  80 + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
  81 + onclick="openOrClose(&#39;forms&#39;)">高级查询
  82 + <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
  83 + </button>
  84 + </div>
  85 + </div>
  86 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;">
  87 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 15%;float: left;">
  88 + <div class="col-md-6" style="padding: 0;width: 100%;">
  89 + <label for="topicId" class="control-label cb-toolbar">话题id:</label>
  90 + <div class="col-sm-7" style="padding: 0;">
  91 + <input class="form-control" type="text" value="" id="topicId" name="topicId">
  92 + </div>
  93 + </div>
  94 + </div>
  95 +
  96 + <div class="btn-group margin-bottom col-md-6" style="padding-left:0px;width: 13%;float: left;">
  97 + <div class="col-md-5" style="padding: 0;width: 100%;">
  98 + <label for="shenhe_status" class="control-label cb-toolbar">状态:</label>
  99 + <div class="col-sm-7" style="padding: 0;">
  100 + <select class="form-control" id="shenhe_status" name="shenhe_status">
  101 + <option value="">全部</option>
  102 + <option value="0">未审核</option>
  103 + <option value="1">已通过</option>
  104 + <option value="2">已拒绝</option>
  105 + </select>
  106 + </div>
  107 + </div>
  108 + </div>
  109 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 15%;float: left;">
  110 + <div class="col-md-5" style="padding: 0;width: 100%;" >
  111 + <label for="topic_name" class="control-label cb-toolbar">话题标题:</label>
  112 + <div class="col-sm-7" style="padding: 0;">
  113 + <input class="form-control" type="text" value="" id="topic_name" name="topic_name">
  114 + </div>
  115 + </div>
  116 + </div>
  117 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 15%;float: left;">
  118 + <div class="col-md-6" style="padding: 0;width: 100%;" th:if="${session.sessionUser.spid==0}">
  119 + <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label>
  120 + <div class="col-sm-7" style="padding: 0;">
  121 + <input class="form-control" type="text" value="" id="sp_desc">
  122 + </div>
  123 + </div>
  124 + </div>
  125 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 20%;float: left;">
  126 + <div class="col-md-12" style="padding: 0;width: 100%;">
  127 + <label for="start_date" class="control-label cb-toolbar">预计时间:</label>
  128 + <div class="input-group col-md-8 date">
  129 + <input class="form-control date" name="start_date" type="text"
  130 + id="start_date">
  131 + <span class="input-group-addon">
  132 + <span class="glyphicon glyphicon-calendar"></span>
  133 + </span>
  134 + </div>
  135 + </div>
  136 + </div>
  137 + <div class="btn-group margin-bottom col-md-6" style="padding-left: 0px;width: 18%;float: left;">
  138 + <div class="col-md-9" style="padding: 0;width: 100%;">
  139 + <label for="start_date" class="control-label cb-toolbar">至</label>
  140 + <div class="input-group col-md-8 date">
  141 + <input class="form-control date" name="end_date" type="text"
  142 + id="end_date">
  143 + <span class="input-group-addon">
  144 + <span class="glyphicon glyphicon-calendar"></span>
  145 + </span>
  146 + </div>
  147 + </div>
  148 + </div>
  149 + </div>
  150 +
  151 + <div class="bootstrap-table">
  152 + <div class="fixed-table-toolbar"></div>
  153 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  154 + <div class="fixed-table-header" style="display: none;">
  155 + <table></table>
  156 + </div>
  157 + <div class="fixed-table-body">
  158 + <table id="table" data-toggle="table"
  159 + class="table table-hover coma-base-table fixed_headers table-striped"
  160 + style="word-break:break-all;">
  161 + <thead>
  162 + <tr>
  163 + <th class="bs-checkbox " style="width: 3%; " data-field="state"
  164 + tabindex="0">
  165 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  166 + id="select_all">
  167 + </div>
  168 + <div class="fht-cell"></div>
  169 + </th>
  170 + <th style="text-align: center; width: 3%; "
  171 + data-field="topic_user_name" tabindex="0">
  172 + <div class="th-inner ">话题ID</div>
  173 + <div class="fht-cell"></div>
  174 + </th>
  175 + <th style="text-align: center; width: 6%; "
  176 + data-field="topic_user_name" tabindex="0">
  177 + <div class="th-inner ">sp名称</div>
  178 + <div class="fht-cell"></div>
  179 + </th>
  180 + <th style="text-align: center; width: 6%; " data-field="topic_user_ip"
  181 + tabindex="0">
  182 + <div class="th-inner ">话题图片</div>
  183 + <div class="fht-cell"></div>
  184 + </th>
  185 + <th style="text-align: center; width: 14%; "
  186 + data-field="topic_user_avatar" tabindex="0">
  187 + <div class="th-inner ">话题标题
  188 + </div>
  189 + <div class="fht-cell"></div>
  190 + </th>
  191 + <th style="text-align: center; width: 10%; " data-field="topic_user_ip"
  192 + tabindex="0">
  193 + <div class="th-inner ">话题描述</div>
  194 + <div class="fht-cell"></div>
  195 + </th>
  196 + <th style="text-align: center; width: 3%; " data-field="content"
  197 + tabindex="0">
  198 + <div class="th-inner ">审核类型
  199 + </div>
  200 + <div class="fht-cell"></div>
  201 + </th>
  202 + <th style="text-align: center; width: 3%; " data-field="updater"
  203 + tabindex="0">
  204 + <div class="th-inner ">审核状态</div>
  205 + <div class="fht-cell"></div>
  206 + </th>
  207 + <th style="text-align: center; width: 3%; " data-field="topic_title"
  208 + tabindex="0">
  209 + <div class="th-inner ">审核员
  210 + </div>
  211 + <div class="fht-cell"></div>
  212 + </th>
  213 +
  214 + <th style="text-align: center; width: 10%; " data-field="is_hot_name"
  215 + tabindex="0">
  216 + <div class="th-inner ">审核消息</div>
  217 + <div class="fht-cell"></div>
  218 + </th>
  219 + <th style="text-align: center ; width: 8%; " data-field="topic_time"
  220 + tabindex="0">
  221 + <div class="th-inner ">话题创建时间</div>
  222 + <div class="fht-cell"></div>
  223 + </th>
  224 + <th style="text-align: center; width: 8%; " data-field="topic_time"
  225 + tabindex="0">
  226 + <div class="th-inner ">话题送审时间</div>
  227 + <div class="fht-cell"></div>
  228 + </th>
  229 + <th style="text-align: center; width: 16%; " data-field="action"
  230 + tabindex="0">
  231 + <div class="th-inner ">操作
  232 + </div>
  233 + <div class="fht-cell"></div>
  234 + </th>
  235 + </tr>
  236 + </thead>
  237 + <tbody>
  238 + <tr th:data-index="${topicStat.index}"
  239 + th:each="topic : ${topicPage.list}">
  240 + <td class="bs-checkbox "
  241 + style="text-align: center; vertical-align:middle;width: 3%;">
  242 + <input data-index="0" name="btSelectItem" type="checkbox"
  243 + th:value="${topic.id}"></td>
  244 + <td style="text-align: center; vertical-align:middle;width: 3%;"
  245 + th:text="${topic.topic_id}">网加加
  246 + </td>
  247 + <td style="text-align: center; vertical-align:middle; width: 6%;"
  248 + th:text="${topic.sp_desc}">1083_00014
  249 + </td>
  250 + <td style="text-align: center; vertical-align:middle;width: 6%;">
  251 + <div width="60px" height="60px"><img
  252 + th:src="@{${topic.topic_image}}" width="60px" height="60px"
  253 + alt="话题图片" th:if="${topic.topic_image!=null and topic.topic_image!=''}"></div>
  254 + </td>
  255 + <td style="text-align: center; vertical-align:middle; width: 14%;"
  256 + th:text="${topic.title}">优秀传统文化与现代幼儿教育 教师研修班
  257 + </td>
  258 + <td style="text-align: center; vertical-align:middle; width: 10%;"
  259 + th:text="${topic.topic_text}">优秀传统文化与现代幼儿教育 教师研修班
  260 + </td>
  261 + <td style="text-align: center; vertical-align:middle; width: 3%;">
  262 + <span th:if="${topic.shenhe_type==1}">免审</span>
  263 + <span th:if="${topic.shenhe_type==2}">机审</span>
  264 + <span th:if="${topic.shenhe_type==3}">人工审</span>
  265 + </td>
  266 + <td style="text-align: center; vertical-align:middle; width: 3%;">
  267 + <span class="btn btn-sm btn-warning"
  268 + th:if="${topic.shenhe_status==0}">待审核</span>
  269 + <span class="btn btn-sm btn-success"
  270 + th:if="${topic.shenhe_status==1}">已通过</span>
  271 + <span class="btn btn-sm btn-danger"
  272 + th:if="${topic.shenhe_status==2}">已拒绝</span>
  273 + </td>
  274 + <td style="text-align: center; vertical-align:middle; width: 3%;" th:text="${topic.updater}">
  275 + openadmin9@cnlive.com
  276 + </td>
  277 + <td style="text-align: center; vertical-align:middle; width: 10%;"
  278 + th:text="${topic.shenhe_msg}">审核消息
  279 + </td>
  280 +<!-- <td style="text-align: center; width: 3%;"> -->
  281 +<!-- <span th:if="${topic.offline==0}">正常</span> -->
  282 +<!-- <span th:if="${topic.offline==1}">下线</span> -->
  283 +<!-- </td> -->
  284 + <td style="text-align: center; vertical-align:middle; width: 8%;"
  285 + th:text="${topic.topic_time}">
  286 + 2018-11-28 16:08:00
  287 + </td>
  288 + <td style="text-align: center; vertical-align:middle; width: 8%;"
  289 + th:text="${#dates.format(topic.create_date, 'yyyy-MM-dd HH:mm:ss')}">
  290 + 2018-11-28 16:08:00
  291 + </td>
  292 + <td style="text-align: center; vertical-align:middle; width: 16%;">
  293 + <span> &nbsp;</span>
  294 + <a class="pass_one" th:href="@{'javascript:topic('+${topic.id}+',1)'}">
  295 + <button class="btn btn-success btn-sm">通过</button>
  296 + </a>
  297 + <span> &nbsp;</span>
  298 + <a class="failed_one" th:href="@{'javascript:topic('+${topic.id}+',2)'}">
  299 + <button class="btn btn-danger btn-sm">拒绝</button>
  300 + </a>
  301 + </td>
  302 + </tr>
  303 + </tbody>
  304 + </table>
  305 + </div>
  306 + <div class="fixed-table-footer" style="display: none;">
  307 + <table>
  308 + <tbody>
  309 + <tr></tr>
  310 + </tbody>
  311 + </table>
  312 + </div>
  313 + <div class="fixed-table-pagination" style="display: block;">
  314 + <div class="pull-left pagination-detail">
  315 + <span class="pagination-info" th:text="'共 '+${topicPage.total}+' 条记录,每页显示'">总共 0 条记录</span>
  316 + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()">
  317 + <option value="10" th:selected="${pageSize==10}">10</option>
  318 + <option value="20" th:selected="${pageSize==20}">20</option>
  319 + <option value="50" th:selected="${pageSize==50}">50</option>
  320 + <option value="100" th:selected="${pageSize==100}">100</option>
  321 + </select>
  322 + <span class="pagination-info" >条记录</span>
  323 + </div>
  324 + <div class="pull-right pagination">
  325 + <ul class="pagination" th:if="${topicPage.pages>1}">
  326 + <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li>
  327 + <li class="page-pre" th:if="${!topicPage.isFirstPage}"><a
  328 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'">‹</a>
  329 + </li>
  330 +
  331 + <li class="page-number" th:if="${topicPage.pageNum-3>=1}"><a
  332 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-3}+'\');'"
  333 + th:text="${topicPage.pageNum-3}">2</a></li>
  334 + <li class="page-number" th:if="${topicPage.pageNum-2>=1}"><a
  335 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-2}+'\');'"
  336 + th:text="${topicPage.pageNum-2}">2</a></li>
  337 + <li class="page-number" th:if="${topicPage.pageNum-1>=1}"><a
  338 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'"
  339 + th:text="${topicPage.pageNum-1}">2</a></li>
  340 + <li class="page-number active"><a href="javaScript:void(0);"
  341 + th:text="${topicPage.pageNum}">2</a></li>
  342 + <li class="page-number" th:if="${topicPage.pageNum+1<=topicPage.pages}"><a
  343 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'"
  344 + th:text="${topicPage.pageNum+1}">2</a></li>
  345 + <li class="page-number" th:if="${topicPage.pageNum+2<=topicPage.pages}"><a
  346 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+2}+'\');'"
  347 + th:text="${topicPage.pageNum+2}">2</a></li>
  348 + <li class="page-number" th:if="${topicPage.pageNum+3<=topicPage.pages}"><a
  349 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+3}+'\');'"
  350 + th:text="${topicPage.pageNum+3}">2</a></li>
  351 +
  352 + <li class="page-next" th:if="${!topicPage.isLastPage}"><a
  353 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'">›</a>
  354 + </li>
  355 + <li class="page-next"><a
  356 + th:onclick="'javascript:fanye(\''+${topicPage.pages}+'\');'">››</a>
  357 + </li>
  358 + </ul>
  359 + </div>
  360 + </div>
  361 + </div>
  362 + </div>
  363 + <div class="clearfix"></div>
  364 +
  365 + </div>
  366 + </div>
  367 + </div>
  368 + </div>
  369 +
  370 +
  371 + </section><!-- /.content -->
  372 + </div>
  373 + <!-- /.content-wrapper -->
  374 + <!-- 模态框(Modal) -->
  375 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  376 + <input type="hidden" id="topic_id_hidden" name="topic_id_hidden">
  377 + <div class="modal-dialog">
  378 + <div class="modal-content" style="margin-top: 30%;">
  379 + <div class="modal-header">
  380 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  381 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  382 + </div>
  383 + <div class="modal-body">
  384 + <div class="form-group" style="margin-bottom: 0;">
  385 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  386 + </div>
  387 + <div class="form-group">
  388 + </div>
  389 + </div>
  390 + <div class="modal-footer">
  391 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  392 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  393 + </div>
  394 + </div><!-- /.modal-content -->
  395 + </div><!-- /.modal-dialog -->
  396 + </div>
  397 + <!-- /.modal -->
  398 + <script th:inline="javascript">
  399 + $(function () {
  400 + //按钮颜色设置
  401 + var state = [[${param.shenhe_status}]] ? [[${param.shenhe_status}]][0] : null;
  402 + var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
  403 + var stateIsNull = $.trim(state) == "";
  404 + var receiveIsNull = $.trim(receive) == "";
  405 + if ( receive == '0' &&state != '0') {
  406 + $("#quanbu").addClass("btn-info");
  407 + } else if (state == '0' && receive == '0') {
  408 + $("#daishen").addClass("btn-warning");
  409 + } else if (state != '0' && receive == '1') {
  410 + $("#yishen").addClass("btn-danger");
  411 + }
  412 +
  413 + })
  414 +
  415 + //选择每页数量触发函数
  416 + function selectPageSize(){
  417 + var pageSize=$("#pageSize").val();
  418 + var param = location.search;
  419 + if (param.indexOf("pageSize=") != -1) {
  420 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  421 + var split = se.split("&");
  422 + var h = "";
  423 + for (var i = 0; i < split.length; i++) {
  424 + var s = split[i];
  425 + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
  426 + }
  427 + h = h.substring(1, h.length);
  428 + window.location.href = "/topic/page?" + h + "&pageSize=" + pageSize;
  429 + } else {
  430 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  431 + var split = se.split("&");
  432 + var h = "";
  433 + for (var i = 0; i < split.length; i++) {
  434 + var s = split[i];
  435 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  436 + }
  437 + h = h.substring(1, h.length);
  438 + window.location.href = "/topic/page?" + h + "&pageSize=" + pageSize;
  439 + }
  440 + }
  441 +
  442 + //翻页函数
  443 + function fanye(page) {
  444 + var param = location.search;
  445 + if (param.indexOf("page=") != -1) {
  446 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  447 + var split = se.split("&");
  448 + var h = "";
  449 + for (var i = 0; i < split.length; i++) {
  450 + var s = split[i];
  451 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  452 + }
  453 + h = h.substring(1, h.length);
  454 + window.location.href = "/topic/page?" + h + "&page=" + page;
  455 + } else {
  456 + param = param.substring(1, param.length);
  457 + window.location.href = "/topic/page?" + param + "&page=" + page;
  458 + }
  459 + }
  460 +
  461 + var topic_id ="";//话题id
  462 + var topic_name = "";//话题标题
  463 + var shenhe_status ="";//审核状态
  464 + var start_date ="";//开始时间
  465 + var end_date = "";//结束时间
  466 + var count = "";//每页显示数量
  467 + var sp_desc = "";//sp昵称
  468 + var receive ="";//领取状态,用来区分是否是自己审核的内容
  469 +
  470 + function query(){
  471 + topic_id = $("#topicId").val();
  472 + topic_name = $("#topic_name").val();
  473 + start_date = $("#start_date").val();
  474 + end_date = $("#end_date").val();
  475 + count = $("#pageSize").val();
  476 + sp_desc = $("#sp_desc").val();
  477 + window.location.href = "/topic/page?topic_id=" + topic_id + "&start_date=" + start_date + "&end_date=" + end_date + "&topic_name=" + topic_name + "&pageSize="+count+"&shenhe_status="+shenhe_status+"&receive="+receive+"&sp_desc="+sp_desc;
  478 + }
  479 +
  480 + //全部
  481 + function quanbu() {
  482 + receive = 0;
  483 + shenhe_status = $("#shenhe_status").val();
  484 + query();
  485 + }
  486 +
  487 + //全部待领
  488 + $('#daishen').click(function () {
  489 + shenhe_status = $("#shenhe_status").val();
  490 + if($.trim(shenhe_status) == '') shenhe_status=0;
  491 + receive = 0;
  492 + query();
  493 + });
  494 + //我的已审核
  495 + $('#yishen').click(function () {
  496 + shenhe_status = $("#shenhe_status").val();
  497 + if($.trim(shenhe_status) == '') shenhe_status=3;//审核状态,3代表通过和拒绝都查询
  498 + receive = 1;
  499 + query();
  500 + });
  501 +
  502 +
  503 + //审核操作,status=1为通过
  504 + function topic(ids, status) {
  505 + if (status == 1) {
  506 + var r = confirm("您确定通过本条内容吗?");
  507 + if (r == true) {
  508 + $.post("/topic/pass?ids=" + ids, function (data) {
  509 + if (data.errorCode == 0) {
  510 + alert(data.errorMessage);
  511 + location.href = location.href;
  512 + } else {
  513 + alert(data.errorMessage);
  514 + }
  515 + })
  516 + }
  517 + } else {
  518 + var r = confirm("您确定要拒绝本条内容吗?");
  519 + if (r == true) {
  520 + $('#topic_id_hidden').val(ids);
  521 + $('#msgModal').modal('show');
  522 + }
  523 + }
  524 +
  525 + }
  526 +
  527 + //提交打回
  528 + function repulseSubmit() {
  529 + var ids = $('#topic_id_hidden').val();
  530 + var msg = $("#reviewMsg").val();
  531 + $.post("/topic/refuse?ids=" + ids + "&msg=" + msg, function (data) {
  532 + if (data.errorCode == 0) {
  533 + alert(data.errorMessage);
  534 + location.href = location.href;
  535 + } else {
  536 + alert(data.errorMessage);
  537 + }
  538 + })
  539 + }
  540 +
  541 + /*查询样式*/
  542 + function openOrClose(id_name_str) {
  543 + var id_name = '#' + id_name_str;
  544 + if ($(id_name).css('display') == 'block') {
  545 + $(id_name).slideUp(350);
  546 + $('#a_up').show();
  547 + $('#a_down').hide();
  548 + } else {
  549 + $(id_name).slideDown(350);
  550 + $('#a_up').hide();
  551 + $('#a_down').show();
  552 + }
  553 + }
  554 +
  555 + //===========================以下未使用===============================
  556 +
  557 +
  558 +
  559 + /*全选的操作*/
  560 + $('#select_all').click(function () {
  561 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  562 + $("#select_all").prop('checked', true);
  563 + $("[name=btSelectItem]:checkbox").each(function () {
  564 + $(this).prop('checked', true);
  565 + });
  566 + } else {
  567 + $("#select_all").prop('checked', false);
  568 + $("[name=btSelectItem]:checkbox").each(function () {
  569 + $(this).prop('checked', false);
  570 + });
  571 + }
  572 + });
  573 +
  574 + //批量通过
  575 + $('#more_pass').click(function () {
  576 + var rows = $("[name=btSelectItem]:checkbox:checked");
  577 + if (rows.length > 0) {
  578 + var r = confirm("您确定通过选中的" + rows.length + "条评论吗?");
  579 + if (r == true) {
  580 + var ids = "";
  581 + rows.each(function (i, e) {
  582 + ids = ids + "," + e.value;
  583 + })
  584 + ids = ids.substring(1);
  585 + topic(ids, 1);
  586 + }
  587 + } else {
  588 + alert("没有选中的数据!");
  589 + }
  590 +
  591 + });
  592 + //批量拒绝
  593 + $('#more_reject').click(function () {
  594 + var rows = $("[name=btSelectItem]:checkbox:checked");
  595 + if (rows.length > 0) {
  596 + var r = confirm("您确定拒绝选中的" + rows.length + "条评论吗?");
  597 + if (r == true) {
  598 + var ids = "";
  599 + rows.each(function (i, e) {
  600 + ids = ids + "," + e.value;
  601 + })
  602 + ids = ids.substring(1);
  603 + topic(ids, 2);
  604 + }
  605 + } else {
  606 + alert("没有选中的数据!");
  607 + }
  608 + });
  609 +
  610 + /**
  611 + * 认领
  612 + */
  613 + function receive(n) {
  614 + if (n > 0) {
  615 + applyReceiveNum(n);
  616 + } else {
  617 + var rows = $("[name=btSelectItem]:checkbox:checked");
  618 + if (rows.length > 0) {
  619 + var ids = "";
  620 + rows.each(function (i, e) {
  621 + ids = ids + "," + e.value;
  622 + })
  623 + ids = ids.substring(1);
  624 + applyReceive(ids);
  625 + } else {
  626 + alert("请选择要认领的内容!");
  627 + }
  628 + }
  629 + }
  630 +
  631 + //认领选中请求
  632 + function applyReceive(ids) {
  633 + $.post("/topics/receive?ids=" + ids, function (data) {
  634 + if (data.errorCode == 0) {
  635 + alert(data.errorMessage);
  636 + location.href = location.href;
  637 + } else {
  638 + alert(data.errorMessage);
  639 + }
  640 + })
  641 + }
  642 +
  643 + //认领多条请求
  644 + function applyReceiveNum(num) {
  645 + $.post("/topics/receive?num=" + num, function (data) {
  646 + if (data.errorCode == 0) {
  647 + alert(data.errorMessage);
  648 + location.href = location.href;
  649 + } else {
  650 + alert(data.errorMessage);
  651 + }
  652 + })
  653 + }
  654 +
  655 + //退领选中内容
  656 + function retReceive() {
  657 + var rows = $("[name=btSelectItem]:checkbox:checked");
  658 + if (rows.length > 0) {
  659 + var r = confirm("您确定退领选中的" + rows.length + "条评论吗?");
  660 + if (r == true) {
  661 + var ids = "";
  662 + rows.each(function (i, e) {
  663 + ids = ids + "," + e.value;
  664 + })
  665 + ids = ids.substring(1);
  666 + applyRetReceive(ids);
  667 + }
  668 + } else {
  669 + alert("没有选中的数据!");
  670 + }
  671 + }
  672 +
  673 + //退领
  674 + function applyRetReceive(ids) {
  675 + $.post("/topics/retReceive?ids=" + ids, function (data) {
  676 + if (data.errorCode == 0) {
  677 + alert(data.errorMessage);
  678 + location.href = location.href;
  679 + } else {
  680 + alert(data.errorMessage);
  681 + }
  682 + })
  683 + }
  684 +
  685 +
  686 + //批量提交
  687 + function morePass() {
  688 + var rows = $("[name=btSelectItem]:checkbox:checked");
  689 + if (rows.length > 0) {
  690 + var r = confirm("您确定通过选中的" + rows.length + "条内容吗?");
  691 + if (r == true) {
  692 + var ids = "";
  693 + rows.each(function (i, e) {
  694 + ids = ids + "," + e.value;
  695 + })
  696 + ids = ids.substring(1);
  697 + $.post("/topics/pass?ids=" + ids, function (data) {
  698 + if (data.errorCode == 0) {
  699 + alert(data.errorMessage);
  700 + location.href = location.href;
  701 + } else {
  702 + alert(data.errorMessage);
  703 + }
  704 + })
  705 + }
  706 + } else {
  707 + alert("没有选中的数据!");
  708 + }
  709 + }
  710 + </script>
  711 + <script>
  712 + /*时间插件*/
  713 + $('.date').datetimepicker({
  714 +// format: 'YYYY-MM-DD HH:mm:ss',
  715 + format: 'YYYY-MM-DD',
  716 + locale: "zh-CN",
  717 + toolbarPlacement: 'bottom',
  718 + showClear: true,
  719 + });
  720 + $(function () {
  721 + $("[data-toggle='tooltip']").tooltip();
  722 + });
  723 + </script>
  724 +
  725 + <footer th:replace="../templates/common/foot::foot"></footer>
  726 +
  727 + <!-- Add the sidebar's background. This div must be placed
  728 + immediately after the control sidebar -->
  729 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  730 +
  731 +</div><!-- ./wrapper -->
  732 +
  733 +
  734 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  735 +<script type="text/javascript">
  736 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  737 +</script>
  738 +
  739 +<!-- AdminLTE App -->
  740 +<script src="../../static/js/app.min.js"></script>
  741 +<!-- AdminLTE for demo purposes -->
  742 +<script src="../../static/js/sidebar.js"></script>
  743 +
  744 +
  745 +</body>
  746 +</html>
0 \ No newline at end of file 747 \ No newline at end of file