Commit b1a7bfe565fc7d79ec4082ade799f078c479859d

Authored by liwei2917
1 parent b4b380ed

增加话题审核

src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
1 1 package com.cnlive.shenhe.api;
2 2  
3   -import com.alibaba.fastjson.JSONArray;
4 3 import com.alibaba.fastjson.JSONObject;
5 4 import com.cnlive.shenhe.bean.ErrorEnum;
6 5 import com.cnlive.shenhe.bean.ResponseBean;
7   -import com.cnlive.shenhe.entity.ShyComments;
8   -import com.cnlive.shenhe.entity.ShyContent;
  6 +import com.cnlive.shenhe.entity.ShyTopic;
9 7 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
10   -import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  8 +import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
11 9 import com.cnlive.shenhe.utils.AuditPass;
12 10 import com.cnlive.shenhe.utils.CommonConst;
13 11 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -15,19 +13,12 @@ import org.slf4j.Logger;
15 13 import org.slf4j.LoggerFactory;
16 14 import org.springframework.beans.factory.annotation.Autowired;
17 15 import org.springframework.stereotype.Controller;
18   -import org.springframework.ui.Model;
19   -import org.springframework.web.bind.annotation.GetMapping;
20   -import org.springframework.web.bind.annotation.PathVariable;
21 16 import org.springframework.web.bind.annotation.PostMapping;
22 17 import org.springframework.web.bind.annotation.RequestBody;
23 18 import org.springframework.web.bind.annotation.RequestMapping;
24 19 import org.springframework.web.bind.annotation.ResponseBody;
25 20  
26   -import java.util.Date;
27 21 import java.util.List;
28   -import java.util.Map;
29   -
30   -import javax.servlet.http.HttpSession;
31 22  
32 23 @Controller
33 24 @RequestMapping("/api/topic")
... ... @@ -38,7 +29,7 @@ public class TopicControllerApi {
38 29 @Autowired
39 30 CommentsServiceImpl commentsService;
40 31 @Autowired
41   - ContentServiceImpl contentService;
  32 + TopicServiceImpl topicService;
42 33  
43 34 /**
44 35 * @author liwei
... ... @@ -47,45 +38,44 @@ public class TopicControllerApi {
47 38 */
48 39 @PostMapping("/import")
49 40 @ResponseBody
50   - public ResponseBean impotTopic(String param) {
  41 + public ResponseBean impotTopic(@RequestBody String param) {
51 42 logger.info("话题入库,param=====" + param);
52 43 JSONObject json = JSONObject.parseObject(param);
  44 +
  45 + //获取所有参数
  46 + String topic_id = json.getString("topic_id");//话题id
  47 + Integer spId = Integer.parseInt(json.getString("spId"));//spId
  48 + String topicTitle = json.getString("topicTitle");//话题标题
  49 + String topicPic = json.getString("topicPic");//话题图片
  50 + String topic_text = json.getString("topic_text");//话题内容
  51 + String topic_tag = json.getString("topic_tag");//话题标签
  52 + String topic_url = json.getString("topic_url");//话题url
  53 + String topic_time = json.getString("createTime");//话题创建时间
  54 +
53 55 //判断是否存在
54   - ShyContent shyContent=new ShyContent();
55   - shyContent.setContent_id(json.getString("contentId"));
56   - shyContent.setContent_tag("content");//图文标签
57   - List<ShyContent> contentList = contentService.findshyContent(shyContent);
  56 + ShyTopic shyTopic=new ShyTopic();
  57 + shyTopic.setTopic_id(topic_id);
  58 + List<ShyTopic> topicList = topicService.findshyTopic(shyTopic);
58 59  
59 60 //获取审核类型
60   - Integer shenheType = contentService.getShenheType(json.getInteger("spId"),"content");
  61 + Integer shenheType = topicService.getShenheType(spId);
61 62 //存在则更新
62   - if (contentList.size() > 0) {
63   - ShyContent shyContent1 = contentList.get(0);
64   - shyContent1.setTitle(json.getString("title"));//标题
65   - shyContent1.setTitle_image(json.getString("titleImage"));//标题图片
66   - shyContent1.setShenhe_type(shenheType);//审核类型
67   - shyContent1.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
68   - shyContent1.setSource(json.getString("source"));//来源
69   - shyContent1.setAuthor(json.getString("author"));//作者
70   - shyContent1.setContent_text(json.getString("content_text"));//图文内容
71   - String contentTime = json.getString("contentTime");//图文创建时间
72   - if (CommonUtils.isNotEmpty(contentTime)) {
73   - Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
74   - shyContent1.setContent_time(timestamp);
75   -
76   - }
77   - shyContent1.setCreate_date(CommonUtils.getCurrentTime());
78   - shyContent1.setCallback(json.getString("callback"));//回调地址
79   - shyContent1.setContent_url(json.getString("contentUrl"));//图文发布h5的url
80   - shyContent1.setContent_pc_url(json.getString("contentPCUrl"));//图文发布pc的url
81   - shyContent1.setSp_id(json.getInteger("spId"));//spid
82   - shyContent1.setContent_tag("content");//图文标签
83   - shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
84   - shyContent1.setLast_update(CommonUtils.getCurrentTime());//最后一次更新时间
  63 + if (topicList.size() > 0) {
  64 + ShyTopic shyTopic1 = topicList.get(0);
  65 + shyTopic1.setTitle(topicTitle);//话题标题
  66 + shyTopic1.setTopic_image(topicPic);//话题图片
  67 + shyTopic1.setShenhe_type(shenheType);//审核类型
  68 + shyTopic1.setTopic_text(topic_text);//话题内容
  69 + shyTopic1.setTopic_tag(topic_tag);//话题标签
  70 + shyTopic1.setTopic_url(topic_url);//话题url
  71 + shyTopic1.setTopic_time(topic_time);//话题创建时间
  72 + shyTopic1.setSp_id(spId);//spid
  73 + shyTopic1.setShenhe_status(CommonConst.AUDIT_INTT);;//当前话题的审核状态
  74 + shyTopic1.setUpdate_date(CommonUtils.getCurrentTime());//最后一次更新时间
85 75  
86 76  
87 77  
88   - boolean YorN = contentService.updateshyContent(shyContent1);
  78 + boolean YorN = topicService.updateshyTopic(shyTopic1);
89 79 if (YorN == true) {
90 80 return new ResponseBean(ErrorEnum.SUCCESS);
91 81 } else {
... ... @@ -93,27 +83,18 @@ public class TopicControllerApi {
93 83 }
94 84 }
95 85 //如果不存在直接插入
96   - shyContent.setTitle(json.getString("title"));//标题
97   - shyContent.setTitle_image(json.getString("titleImage"));//标题图片
98   - shyContent.setShenhe_type(shenheType);//审核类型
99   - shyContent.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
100   - shyContent.setSource(json.getString("source"));//来源
101   - shyContent.setAuthor(json.getString("author"));//作者
102   - shyContent.setContent_text(json.getString("content_text"));//图文内容
103   - String contentTime = json.getString("contentTime");//创建时间
104   - if (CommonUtils.isNotEmpty(contentTime)) {
105   - Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
106   - shyContent.setContent_time(timestamp);
107   -
108   - }
109   - shyContent.setCreate_date(CommonUtils.getCurrentTime());
110   - shyContent.setCallback(json.getString("callback"));//回调地址
111   - shyContent.setContent_url(json.getString("contentUrl"));//图文发布h5的url
112   - shyContent.setContent_pc_url(json.getString("contentPCUrl"));//图文发布pc的url
113   - shyContent.setSp_id(json.getInteger("spId"));//spid
114   - shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
115   - shyContent.setLast_update(CommonUtils.getCurrentTime());//最后一次更新时间
116   - boolean YorN = contentService.impotContent(shyContent);
  86 + shyTopic.setTitle(topicTitle);//话题标题
  87 + shyTopic.setTopic_image(topicPic);//话题图片
  88 + shyTopic.setShenhe_type(shenheType);//审核类型
  89 + shyTopic.setTopic_text(topic_text);//话题内容
  90 + shyTopic.setTopic_tag(topic_tag);//话题标签
  91 + shyTopic.setTopic_url(topic_url);//话题url
  92 + shyTopic.setTopic_time(topic_time);//话题创建时间
  93 + shyTopic.setSp_id(spId);//spid
  94 + shyTopic.setShenhe_status(CommonConst.AUDIT_INTT);;//当前话题的审核状态
  95 + shyTopic.setUpdate_date(CommonUtils.getCurrentTime());//最后一次更新时间
  96 + shyTopic.setCreate_date(CommonUtils.getCurrentTime());//送审时间
  97 + boolean YorN = topicService.impotshyTopic(shyTopic);
117 98 if (YorN == true) {
118 99 return new ResponseBean(ErrorEnum.SUCCESS);
119 100 } else {
... ... @@ -121,109 +102,5 @@ public class TopicControllerApi {
121 102 }
122 103 }
123 104  
124   -
125   - /**
126   - * @author liwei
127   - * @Date: 2019/05/15 11:17
128   - * @Description: 朋友圈送审接口
129   - */
130   - @PostMapping("/importMoment")
131   - @ResponseBody
132   - public ResponseBean impotMoment(@RequestBody String param) {
133   - logger.info("朋友圈入库,param=====" + param);
134   - JSONObject json = JSONObject.parseObject(param);
135   - //判断是否存在
136   - ShyContent shyContent=new ShyContent();
137   - shyContent.setContent_id(json.getString("momentId"));//朋友圈id
138   - shyContent.setContent_tag("moment");//朋友圈标签
139   - List<ShyContent> contentList = contentService.findshyContent(shyContent);
140   - //获取审核类型
141   - Integer shenheType = contentService.getShenheType(json.getInteger("spId"),"moment");
142   -
143   - //获取生活圈内容的类型 1:图片 2:视频 3:分享
144   - Integer contentType = json.getInteger("contentType");
145   - String contentImageUrl="";//内容图片地址
146   - if(contentType!=null&&contentType==1){
147   - JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl"));//朋友圈分享的内容的url
148   - for(int i=0;i<contentImageUrlList.size();i++){
149   - JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i);
150   - contentImageUrl+=contentImageUrlMap.getString("imageUrl")+",";
151   - }
152   - contentImageUrl=contentImageUrl.substring(0, contentImageUrl.length()-1);//去掉最后一个逗号
153   - }else{
154   - contentImageUrl=json.getString("contentImageUrl");
155   - }
156   -
157   - //存在则更新
158   - if (contentList.size() > 0) {
159   - ShyContent shyContent1 = contentList.get(0);
160   - shyContent1.setTitle(json.getString("title"));//标题
161   - shyContent1.setTitle_image(json.getString("image"));//用户头像
162   - shyContent1.setShenhe_type(shenheType);//审核类型
163   - String contentTime = json.getString("createTime");//朋友圈内容创建时间
164   - if (CommonUtils.isNotEmpty(contentTime)) {
165   -// Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
166   - shyContent1.setContent_time(new Date(Long.valueOf(contentTime)));
167   -
168   - }
169   - shyContent1.setCreate_date(CommonUtils.getCurrentTime());
170   - shyContent1.setCallback(json.getString("callbackUrl"));//回调地址
171   - shyContent1.setContent_url(json.getString("pageUrl"));//朋友圈分享的url
172   - shyContent1.setContent_pc_url(contentImageUrl);//朋友圈分享的内容的url,以逗号分隔
173   - shyContent1.setSp_id(json.getInteger("spId"));//spid
174   - shyContent1.setAuthor(json.getString("userId"));//用户id
175   - shyContent1.setSource(json.getString("nickName"));//用户昵称
176   - shyContent1.setVideo_id(json.getString("videoId"));//关联videoId
177   - shyContent1.setContent_tag("moment");//图文标签
178   - shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
179   - shyContent1.setLast_update(CommonUtils.getCurrentTime());//最后一次更新时间
180   -
181   -
182   -
183   - boolean YorN = contentService.updateshyContent(shyContent1);
184   - if (YorN == true) {
185   - return new ResponseBean(ErrorEnum.SUCCESS);
186   - } else {
187   - return new ResponseBean(ErrorEnum.ERROR);
188   - }
189   - }
190   - //如果不存在直接插入
191   - shyContent.setTitle(json.getString("title"));//标题
192   - shyContent.setTitle_image(json.getString("image"));//用户头像
193   - shyContent.setShenhe_type(shenheType);//审核类型
194   - shyContent.setContent_status(1);//当前朋友圈内容的审核状态,先发后审
195   - String contentTime = json.getString("createTime");//创建时间
196   - if (CommonUtils.isNotEmpty(contentTime)) {
197   -// Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
198   - shyContent.setContent_time(new Date(Long.valueOf(contentTime)));
199   -
200   - }
201   - shyContent.setCreate_date(CommonUtils.getCurrentTime());
202   - shyContent.setCallback(json.getString("callbackUrl"));//回调地址
203   - shyContent.setContent_url(json.getString("pageUrl"));//朋友圈分享的url
204   - shyContent.setContent_pc_url(contentImageUrl);//朋友圈分享的内容的url,以逗号分隔
205   - shyContent.setSp_id(json.getInteger("spId"));//spid
206   - shyContent.setAuthor(json.getString("userId"));//用户id
207   - shyContent.setSource(json.getString("nickName"));//用户昵称
208   - shyContent.setVideo_id(json.getString("videoId"));//关联videoId
209   - shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
210   - shyContent.setLast_update(CommonUtils.getCurrentTime());//最后一次更新时间
211   - boolean YorN = contentService.impotContent(shyContent);
212   - if (YorN == true) {
213   - return new ResponseBean(ErrorEnum.SUCCESS);
214   - } else {
215   - return new ResponseBean(ErrorEnum.ERROR);
216   - }
217   - }
218   -
219   - @GetMapping("/detail/{id}.html")
220   - public Object getContentDetail(Model model, @PathVariable Integer id) {
221   - System.out.println("数美送审页面开始进入");
222   - ShyContent content = contentService.selectByPrimaryKey(id);
223   - model.addAttribute("contentText", content.getContent_text());
224   - model.addAttribute("contentTitle", content.getTitle());
225   - return "html/contentPage.html";
226   - }
227   -
228   -
  105 +
229 106 }
... ...
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 {
  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, 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 + return "page/sitesError.html";
  97 + }
  98 + } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  99 + spid = null;
  100 + }
  101 + Date sDate = null;
  102 + Date eDate = null;
  103 +
  104 + if (CommonUtils.isNotEmpty(start_date)) {
  105 + try {
  106 + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  107 + } catch (Exception e) {
  108 + }
  109 + }
  110 + if (CommonUtils.isNotEmpty(end_date)) {
  111 + try {
  112 + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  113 + } catch (Exception e) {
  114 + }
  115 + }
  116 + PageInfo<ShyTopic> topicPage = topicService.getPage( topic_name,topic_tag,topic_id, sDate, eDate, shenhe_status, null, page, pageSize, orderByClause, spid, userId);
  117 + List<ShyTopic> list = topicPage.getList();
  118 + if (!list.isEmpty()) {
  119 + for (ShyTopic topic : list) {
  120 + if (topic.getShenhe_status() != CommonConst.AUDIT_INTT) {
  121 + String auditor_id = topic.getAuditor_id();
  122 + String updater = CommonUtils.isEmpty(topic.getUpdater()) || "null".equals(topic.getUpdater())? "白名单":topic.getUpdater();
  123 + updater =sitesService.getUpdater(updater,auditor_id);
  124 + topic.setUpdater(updater);
  125 + }
  126 + //显示spid简称
  127 + ShySites shySites = sitesService.findspidDescByspid(topic.getSp_id());
  128 + if (CommonUtils.isNotNull(shySites)) {
  129 + topic.setSp_desc(shySites.getName());
  130 + }
  131 + }
  132 + }
  133 + model.addAttribute("topicPage", topicPage);
  134 + model.addAttribute("pageSize", pageSize);
  135 + return "page/topic.html";
  136 + }
  137 +
  138 +
  139 + /**
  140 + * 审核通过
  141 + *
  142 + * @param ids
  143 + * @return
  144 + */
  145 +// @PostMapping("/pass")
  146 +// @ResponseBody
  147 +// public ResponseBean pass(String ids, HttpSession session) {
  148 +// SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  149 +// String userId = sessionUser.getUserId();
  150 +// boolean success =false;
  151 +// String[] contentIds = ids.split(",");
  152 +// for (String contentId : contentIds) {
  153 +// success = contentService.callback(contentId,"审核通过", CommonConst.AUDIT_SUCCESS, userId,"");
  154 +// }
  155 +// if (success) {
  156 +// return new ResponseBean();
  157 +// } else {
  158 +// return new ResponseBean(ErrorEnum.ERROR);
  159 +// }
  160 +// }
  161 +
  162 + /**
  163 + * 审核拒绝
  164 + *
  165 + * @param ids
  166 + * @return
  167 + */
  168 +// @PostMapping("/refuse")
  169 +// @ResponseBody
  170 +// public ResponseBean refuse(String ids,String msg, HttpSession session) {
  171 +// SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  172 +// String userId = sessionUser.getUserId();
  173 +// boolean success =false;
  174 +// String[] contentIds = ids.split(",");
  175 +// for (String contentId : contentIds) {
  176 +// success = contentService.callback(contentId,msg, CommonConst.AUDIT_REFUSE, userId,"");
  177 +// }
  178 +// if (success) {
  179 +// return new ResponseBean();
  180 +// } else {
  181 +// return new ResponseBean(ErrorEnum.ERROR);
  182 +// }
  183 +//
  184 +// }
  185 +
  186 +
  187 + /**
  188 + * 根据条件导出excel
  189 + */
  190 +// @GetMapping("excel")
  191 +// public void getExcel( String title,String contentId, String content_tag,
  192 +// String start_date, String end_date, Integer receive_status, String sp_desc,
  193 +// Integer page, Integer pageSize, String orderByClause, HttpSession session,HttpServletResponse response) {
  194 +// SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  195 +// Integer spid = sessionUser.getSpid();
  196 +// String userId = sessionUser.getUserId();
  197 +// if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  198 +// ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  199 +// if(CommonUtils.isNotNull(shySite)){
  200 +// spid = shySite.getSpid();
  201 +// }
  202 +// }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  203 +// spid = null;
  204 +// }
  205 +// Date sDate = null;
  206 +// Date eDate = null;
  207 +//
  208 +// if (CommonUtils.isNotEmpty(start_date)) {
  209 +// try {
  210 +// sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  211 +// } catch (Exception e) {
  212 +// }
  213 +// }
  214 +// if (CommonUtils.isNotEmpty(end_date)) {
  215 +// try {
  216 +// eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  217 +// } catch (Exception e) {
  218 +// }
  219 +// }
  220 +// List<ShyContent> contentList = contentService.findByCondition(title,content_tag,contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid);
  221 +//
  222 +// String fileName = "图文数据";
  223 +//
  224 +// XSSFWorkbook wb = new XSSFWorkbook();
  225 +// ServletOutputStream out = null;
  226 +// BufferedInputStream bis = null;
  227 +// BufferedOutputStream bos = null;
  228 +// try {
  229 +// XSSFSheet sheetlist = wb.createSheet(fileName);
  230 +// XSSFRow row = sheetlist.createRow(0);//行
  231 +// XSSFCell cell = row.createCell(0);//列
  232 +// cell.setCellValue("id");
  233 +// cell = row.createCell(1);//列
  234 +// cell.setCellValue("sp昵称");
  235 +// cell = row.createCell(2);//列
  236 +// cell.setCellValue("图文id");
  237 +// cell = row.createCell(3);//列
  238 +// cell.setCellValue("内容标题");
  239 +// cell = row.createCell(4);//列
  240 +// cell.setCellValue("图文标签");
  241 +// cell = row.createCell(5);//列
  242 +// cell.setCellValue("审核类型");
  243 +// cell = row.createCell(6);//列
  244 +// cell.setCellValue("内容状态");
  245 +// cell = row.createCell(7);//列
  246 +// cell.setCellValue("图文创建时间");
  247 +// cell = row.createCell(8);//列
  248 +// cell.setCellValue("图文送审时间");
  249 +// cell = row.createCell(9);//列
  250 +// cell.setCellValue("领取状态");
  251 +// cell = row.createCell(10);//列
  252 +// cell.setCellValue("审核人");
  253 +// cell = row.createCell(11);//列
  254 +// cell.setCellValue("审核意见");
  255 +// cell = row.createCell(12);//列
  256 +// cell.setCellValue("来源(昵称)");
  257 +// cell = row.createCell(13);//列
  258 +// cell.setCellValue("作者(sid)");
  259 +// cell = row.createCell(14);//列
  260 +// cell.setCellValue("图文url");
  261 +//
  262 +// for (int i = 0; i < contentList.size(); i++) {
  263 +// row = sheetlist.createRow((short) (i + 1));//行
  264 +// cell = row.createCell(0);//列
  265 +// cell.setCellValue(contentList.get(i).getId());
  266 +// cell = row.createCell(1);//列
  267 +// cell.setCellValue(sitesService.findspidDescByspid(contentList.get(i).getSp_id()).getName());
  268 +// cell = row.createCell(2);//列
  269 +// cell.setCellValue(contentList.get(i).getContent_id());
  270 +// cell = row.createCell(3);//列
  271 +// cell.setCellValue(contentList.get(i).getTitle());
  272 +// /*状态需要处理成用户可读*/
  273 +// String contentTag = "";//图文标签 content:图文发布,moment:朋友圈
  274 +// if (contentList.get(i).getContent_tag().equals("content") ) {
  275 +// contentTag = "图文发布";
  276 +// } else if (contentList.get(i).getContent_tag().equals("moment")) {
  277 +// contentTag = "朋友圈";
  278 +// }
  279 +// cell = row.createCell(4);//列
  280 +// cell.setCellValue(contentTag);
  281 +//
  282 +// /*状态需要处理成用户可读*/
  283 +// String shenheType = "";//审核类型,1:免审,2:机审,3:人工审
  284 +// if (contentList.get(i).getShenhe_type() == 1) {
  285 +// shenheType = "免审";
  286 +// } else if (contentList.get(i).getShenhe_type() == 2) {
  287 +// shenheType = "机审";
  288 +// } else {
  289 +// shenheType = "人工审";
  290 +// }
  291 +// cell = row.createCell(5);//列
  292 +// cell.setCellValue(shenheType);
  293 +//
  294 +// /*状态需要处理成用户可读*/
  295 +// String contentStatus = "";//内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  296 +// if (contentList.get(i).getContent_status() == 0) {
  297 +// contentStatus = "待发布";
  298 +// } else if (contentList.get(i).getContent_status() == 1) {
  299 +// contentStatus = "已发布";
  300 +// } else if(contentList.get(i).getContent_status() == 2){
  301 +// contentStatus = "已下线";
  302 +// }else if(contentList.get(i).getContent_status() == 3){
  303 +// contentStatus = "已删除";
  304 +// }
  305 +//
  306 +// cell = row.createCell(6);//列
  307 +// cell.setCellValue(contentStatus);
  308 +// cell = row.createCell(7);//列
  309 +// cell.setCellValue(contentList.get(i).getContent_time()==null?"":CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss"));
  310 +// cell = row.createCell(8);//列
  311 +// cell.setCellValue(contentList.get(i).getCreate_date()==null?"":CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss"));
  312 +//
  313 +// /*状态需要处理成用户可读*/
  314 +// String receiveStatus = "";//领取状态。0:未领取;1:已领取,2:已审核
  315 +// if (contentList.get(i).getReceive_status() == 1) {
  316 +// receiveStatus = "已领取";
  317 +// } else if (contentList.get(i).getReceive_status() == 2) {
  318 +// receiveStatus = "已审核";
  319 +// } else {
  320 +// receiveStatus = "未领取";
  321 +// }
  322 +//
  323 +// cell = row.createCell(9);//列
  324 +// cell.setCellValue(receiveStatus);
  325 +//
  326 +// /* 审核员需要做处理*/
  327 +// String updater = "";//审核员名字
  328 +// if (contentList.get(i).getReceive_status() != CommonConst.RECEIVE_BEFORE) {
  329 +// updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater())? "自动通过":contentList.get(i).getUpdater();
  330 +// String auditor_id = contentList.get(i).getAuditor_id();
  331 +// if (CommonUtils.isNotEmpty(auditor_id)) {
  332 +// ShyUsers user = new ShyUsers();
  333 +// user.setUser_id(auditor_id);
  334 +// user = usersService.select(user);
  335 +// if (CommonUtils.isNotNull(user)) {
  336 +// String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  337 +// String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  338 +// updater = userName ;
  339 +// }
  340 +// }
  341 +// }
  342 +// cell = row.createCell(10);//列
  343 +// cell.setCellValue(updater);
  344 +//
  345 +//
  346 +//
  347 +// cell = row.createCell(11);//列
  348 +// cell.setCellValue(contentList.get(i).getShenhe_msg());
  349 +// cell = row.createCell(12);//列
  350 +// cell.setCellValue(contentList.get(i).getSource());
  351 +// cell = row.createCell(13);//列
  352 +// cell.setCellValue(contentList.get(i).getAuthor());
  353 +// cell = row.createCell(14);//列
  354 +// cell.setCellValue(contentList.get(i).getContent_url());
  355 +// }
  356 +//
  357 +// ByteArrayOutputStream os = new ByteArrayOutputStream();
  358 +// wb.write(os);
  359 +// byte[] content = os.toByteArray();
  360 +// InputStream is = new ByteArrayInputStream(content);
  361 +// response.setContentType("application/vnd.ms-excel;charset=utf-8");
  362 +// response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1"));
  363 +// out = response.getOutputStream();
  364 +// bis = new BufferedInputStream(is);
  365 +// bos = new BufferedOutputStream(out);
  366 +// byte[] buff = new byte[2048];
  367 +// int bytesRead;
  368 +// while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
  369 +// bos.write(buff, 0, bytesRead);
  370 +// }
  371 +// } catch (final Exception e) {
  372 +// e.printStackTrace();
  373 +// try {
  374 +// if (bis != null)
  375 +// bis.close();
  376 +// if (bos != null)
  377 +// bos.close();
  378 +// } catch (Exception e1) {
  379 +// e1.printStackTrace();
  380 +// }
  381 +// } finally {
  382 +// try {
  383 +// if (bis != null)
  384 +// bis.close();
  385 +// if (bos != null)
  386 +// bos.close();
  387 +// } catch (Exception e2) {
  388 +// e2.printStackTrace();
  389 +// }
  390 +// }
  391 +// }
  392 +}
... ...
src/main/java/com/cnlive/shenhe/entity/ShyTopic.java
... ... @@ -37,14 +37,9 @@ public class ShyTopic {
37 37 private String topic_url;
38 38  
39 39 /**
40   - * 回调地址
41   - */
42   - private String callback;
43   -
44   - /**
45 40 * 话题创建时间
46 41 */
47   - private Date topic_time;
  42 + private String topic_time;
48 43  
49 44 /**
50 45 * 审核类型,1:免审,2:机审,3:人工审
... ... @@ -52,9 +47,9 @@ public class ShyTopic {
52 47 private Integer shenhe_type;
53 48  
54 49 /**
55   - * 话题状态.0:未审核 1:审核中 2:通过 3:拒绝
  50 + * 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
56 51 */
57   - private Integer topic_status;
  52 + private Integer shenhe_status;
58 53  
59 54 /**
60 55 * 送审时间
... ... @@ -67,11 +62,6 @@ public class ShyTopic {
67 62 private Date update_date;
68 63  
69 64 /**
70   - * 领取状态。0:未领取;1:已领取,2:已审核
71   - */
72   - private Integer receive_status;
73   -
74   - /**
75 65 * 审核人id
76 66 */
77 67 private String auditor_id;
... ... @@ -95,6 +85,12 @@ public class ShyTopic {
95 85 * 话题内容
96 86 */
97 87 private String topic_text;
  88 +
  89 + /**
  90 + * sp名称
  91 + */
  92 + @Transient
  93 + private String sp_desc;
98 94  
99 95 /**
100 96 * 获取id
... ... @@ -205,29 +201,11 @@ public class ShyTopic {
205 201 }
206 202  
207 203 /**
208   - * 获取回调地址
209   - *
210   - * @return callback - 回调地址
211   - */
212   - public String getCallback() {
213   - return callback;
214   - }
215   -
216   - /**
217   - * 设置回调地址
218   - *
219   - * @param callback 回调地址
220   - */
221   - public void setCallback(String callback) {
222   - this.callback = callback;
223   - }
224   -
225   - /**
226 204 * 获取话题创建时间
227 205 *
228 206 * @return topic_time - 话题创建时间
229 207 */
230   - public Date getTopic_time() {
  208 + public String getTopic_time() {
231 209 return topic_time;
232 210 }
233 211  
... ... @@ -236,7 +214,7 @@ public class ShyTopic {
236 214 *
237 215 * @param topic_time 话题创建时间
238 216 */
239   - public void setTopic_time(Date topic_time) {
  217 + public void setTopic_time(String topic_time) {
240 218 this.topic_time = topic_time;
241 219 }
242 220  
... ... @@ -259,21 +237,21 @@ public class ShyTopic {
259 237 }
260 238  
261 239 /**
262   - * 获取话题状态.0:未审核 1:审核中 2:通过 3:拒绝
  240 + * 获取审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
263 241 *
264   - * @return topic_status - 话题状态.0:未审核 1:审核中 2:通过 3:拒绝
  242 + * @return shenhe_status - 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
265 243 */
266   - public Integer getTopic_status() {
267   - return topic_status;
  244 + public Integer getShenhe_status() {
  245 + return shenhe_status;
268 246 }
269 247  
270 248 /**
271   - * 设置话题状态.0:未审核 1:审核中 2:通过 3:拒绝
  249 + * 设置审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
272 250 *
273   - * @param topic_status 话题状态.0:未审核 1:审核中 2:通过 3:拒绝
  251 + * @param shenhe_status 审核状态.0:未审核(未领取) 1:审核中(已领未审) 2:通过 3:拒绝
274 252 */
275   - public void setTopic_status(Integer topic_status) {
276   - this.topic_status = topic_status;
  253 + public void setShenhe_status(Integer shenhe_status) {
  254 + this.shenhe_status = shenhe_status;
277 255 }
278 256  
279 257 /**
... ... @@ -313,24 +291,6 @@ public class ShyTopic {
313 291 }
314 292  
315 293 /**
316   - * 获取领取状态。0:未领取;1:已领取,2:已审核
317   - *
318   - * @return receive_status - 领取状态。0:未领取;1:已领取,2:已审核
319   - */
320   - public Integer getReceive_status() {
321   - return receive_status;
322   - }
323   -
324   - /**
325   - * 设置领取状态。0:未领取;1:已领取,2:已审核
326   - *
327   - * @param receive_status 领取状态。0:未领取;1:已领取,2:已审核
328   - */
329   - public void setReceive_status(Integer receive_status) {
330   - this.receive_status = receive_status;
331   - }
332   -
333   - /**
334 294 * 获取审核人id
335 295 *
336 296 * @return auditor_id - 审核人id
... ... @@ -419,4 +379,13 @@ public class ShyTopic {
419 379 public void setTopic_text(String topic_text) {
420 380 this.topic_text = topic_text;
421 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 +
422 391 }
423 392 \ No newline at end of file
... ...
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.github.pagehelper.PageHelper;
  23 +import com.github.pagehelper.PageInfo;
  24 +import org.apache.ibatis.session.RowBounds;
  25 +import org.slf4j.Logger;
  26 +import org.slf4j.LoggerFactory;
  27 +import org.springframework.beans.factory.annotation.Autowired;
  28 +import org.springframework.beans.factory.annotation.Value;
  29 +import org.springframework.stereotype.Service;
  30 +import tk.mybatis.mapper.entity.Example;
  31 +
  32 +import java.sql.Timestamp;
  33 +import java.text.ParseException;
  34 +import java.util.ArrayList;
  35 +import java.util.Date;
  36 +import java.util.HashMap;
  37 +import java.util.List;
  38 +import java.util.Map;
  39 +import java.util.UUID;
  40 +
  41 +/**
  42 + * @Auther: liwei
  43 + * @Date: 2019/5/20 17:30
  44 + * @Description:
  45 + */
  46 +@Service
  47 +public class TopicServiceImpl {
  48 +
  49 + private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class);
  50 + @Autowired
  51 + ShyCommentsMapper shyCommentsMapper;
  52 + @Autowired
  53 + ShyTopicMapper shyTopicMapper;
  54 + @Autowired
  55 + ShySitesMapper shySitesMapper;
  56 + @Autowired
  57 + ShyUsersMapper shyUsersMapper;
  58 + @Autowired
  59 + AuditPass Pass;
  60 + @Autowired
  61 + SitesServiceImpl sitesService;
  62 + @Autowired
  63 + VideosServiceImpl videosService;
  64 + @Autowired
  65 + VideofilterServiceImpl videofilterServiceImpl;
  66 +
  67 + @Value("${spring.localhost.url}")
  68 + String localhost_url;
  69 +
  70 + public ShyTopic getShyContent(ShyTopic shyTopic) {
  71 + List<ShyTopic> shyTopicList = shyTopicMapper.select(shyTopic);
  72 + if(CommonUtils.isNotNull(shyTopicList)&&shyTopicList.size()>0){
  73 + return shyTopicList.get(0);
  74 + }
  75 + return new ShyTopic();
  76 + }
  77 +
  78 + //**************************************
  79 + public List<ShyTopic> findshyTopic(ShyTopic shyTopic) {
  80 +
  81 + return shyTopicMapper.selectByRowBounds(shyTopic, new RowBounds(0, 100));
  82 + }
  83 +
  84 + //***************************
  85 + public boolean updateshyTopic(ShyTopic shyTopic) {
  86 + int result = shyTopicMapper.updateByPrimaryKey(shyTopic);
  87 + if (result == 0) {
  88 + return false;
  89 + }
  90 + return true;
  91 + }
  92 +
  93 + //***************************
  94 + public boolean impotshyTopic(ShyTopic shyTopic) {
  95 + int result = shyTopicMapper.insertSelective(shyTopic);
  96 + if (result == 0) {
  97 + return false;
  98 + }
  99 + return true;
  100 + }
  101 +
  102 + public int updateComment(Integer id, Integer state, String msg) {
  103 + ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id);
  104 + shyComments.setState(state);
  105 + shyComments.setMsg(msg);
  106 + return shyCommentsMapper.updateByPrimaryKeySelective(shyComments);
  107 + }
  108 +
  109 + 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) {
  110 + Example example = new Example(ShyTopic.class);
  111 + Example.Criteria criteria = example.createCriteria();
  112 + if (CommonUtils.isNotEmpty(orderByClause)) {
  113 + example.setOrderByClause(orderByClause);
  114 + } else {
  115 + example.setOrderByClause("create_date desc");
  116 + }
  117 + if (CommonUtils.isNotNull(start_date) ) {
  118 + criteria.andGreaterThanOrEqualTo("create_date", start_date);
  119 + }
  120 + if ( CommonUtils.isNotNull(end_date)) {
  121 + criteria.andLessThanOrEqualTo("create_date", end_date);
  122 + }
  123 + if (CommonUtils.isNotEmpty(title)) {
  124 + criteria.andLike("title", "%" + title + "%");
  125 + }
  126 + if (CommonUtils.isNotEmpty(updater)) {
  127 + criteria.andEqualTo("updater", updater);
  128 + }
  129 + if (CommonUtils.isNotEmpty(topic_tag)) {
  130 + criteria.andEqualTo("topic_tag", topic_tag);
  131 + }
  132 + if (CommonUtils.isNotNull(spid)) {
  133 + criteria.andEqualTo("sp_id", spid);
  134 + }
  135 + if (CommonUtils.isNotEmpty(topicId)) {
  136 + criteria.andEqualTo("topic_id", topicId);
  137 + }
  138 + if (CommonUtils.isNotNull(shenhe_status)) {
  139 + criteria.andEqualTo("shenhe_status", shenhe_status);
  140 + if (shenhe_status!=CommonConst.AUDIT_INTT) {
  141 + criteria.andEqualTo("auditor_id", userId);
  142 + }
  143 + }
  144 +
  145 + PageHelper.startPage(page, pageSize, true);
  146 + List<ShyTopic> topicList = shyTopicMapper.selectByExample(example);
  147 + PageInfo<ShyTopic> pageInfo = new PageInfo<>(topicList);
  148 + return pageInfo;
  149 + }
  150 +
  151 + /**
  152 + * 根据条件导出数据excel
  153 + * @return
  154 + */
  155 + public List<ShyTopic> findByCondition(String title,String content_tag,String contentId, Date start_date,
  156 + Date end_date,Integer receive_status, Integer page,
  157 + Integer pageSize, String orderByClause, Integer spid) {
  158 +
  159 + Example example = new Example(ShyContent.class);
  160 + Example.Criteria criteria = example.createCriteria();
  161 + if (CommonUtils.isNotEmpty(orderByClause)) {
  162 + example.setOrderByClause(orderByClause);
  163 + } else {
  164 + example.setOrderByClause("create_date desc");
  165 + }
  166 + if (CommonUtils.isNotNull(start_date) ) {
  167 + criteria.andGreaterThanOrEqualTo("create_date", start_date);
  168 + }
  169 + if ( CommonUtils.isNotNull(end_date)) {
  170 + criteria.andLessThanOrEqualTo("create_date", end_date);
  171 + }
  172 + if (CommonUtils.isNotEmpty(title)) {
  173 + criteria.andLike("title", "%" + title + "%");
  174 + }
  175 + if (CommonUtils.isNotNull(spid)) {
  176 + criteria.andEqualTo("sp_id", spid);
  177 + }
  178 + if (CommonUtils.isNotEmpty(contentId)) {
  179 + criteria.andEqualTo("content_id", contentId);
  180 + }
  181 + if (CommonUtils.isNotEmpty(content_tag)) {
  182 + criteria.andEqualTo("content_tag", content_tag);
  183 + }
  184 + if (CommonUtils.isNotNull(receive_status)) {
  185 + criteria.andEqualTo("receive_status", receive_status);
  186 + }
  187 + List<ShyTopic> shyContentList = shyTopicMapper.selectByExample(example);
  188 + return shyContentList;
  189 + }
  190 +
  191 +
  192 + //******************************
  193 + public ShyTopic getDetailsContent(Integer id) {
  194 + ShyTopic content = shyTopicMapper.selectByPrimaryKey(id);
  195 + if (content.getShenhe_status() != CommonConst.RECEIVE_AUDIT) {
  196 + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater();
  197 + String auditor_id = content.getAuditor_id();
  198 + if (CommonUtils.isNotEmpty(auditor_id)) {
  199 + ShyUsers user = new ShyUsers();
  200 + user.setUser_id(auditor_id);
  201 + user = shyUsersMapper.selectOne(user);
  202 + String email = CommonUtils.isEmpty(user.getEmail())|| "null".equals(user.getEmail()) ? "" : user.getEmail();
  203 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  204 + updater = userName ;
  205 + }
  206 + content.setUpdater(updater);
  207 + }
  208 + ShySites shySite=sitesService.findspidDescByspid(content.getSp_id());
  209 + if(CommonUtils.isNotNull(shySite)){
  210 + content.setSp_desc(shySite.getName());
  211 + }
  212 + return content;
  213 + }
  214 +
  215 + //**********************
  216 +// public boolean callback(String contentId, String msg, Integer state, String userId,String updater) {
  217 +// boolean success = true;
  218 +// ShyTopic content = shyTopicMapper.selectByPrimaryKey(Integer.parseInt(contentId));
  219 +// JSONObject result = new JSONObject();
  220 +// try {
  221 +// if(CommonUtils.isNotEmpty(content.getContent_tag())&&content.getContent_tag().equals("content")){
  222 +// result = Pass.contentPass(content.getContent_id(), state+"", msg, content.getCallback());
  223 +// }else if(CommonUtils.isNotEmpty(content.getContent_tag())&&content.getContent_tag().equals("moment")){
  224 +// result = Pass.momentPass(content.getContent_id(), state, msg, content.getCallback(),content.getAuthor());
  225 +// }
  226 +// } catch (Exception e) {
  227 +// logger.error("图文审核回调失败,图文id:{}", content.getId());
  228 +// success = false;
  229 +// return success;
  230 +// }
  231 +// if (result == null) {
  232 +// logger.error("图文回调错误,且无返回信息。图文id:{}", content.getId());
  233 +// success = false;
  234 +// return success;
  235 +// } else {
  236 +// Integer code = result.getInteger("errorCode");
  237 +// if (code != 0) {
  238 +// logger.error("图文回调错误,图文id:{},errorCode:{},errorMessage:{}", content.getId(), code,
  239 +// result.getString("errorMessage"));
  240 +// success = false;
  241 +// return success;
  242 +// }
  243 +//
  244 +// //如果当前图文是朋友圈的视频,通知点播云
  245 +// if(CommonUtils.isNotEmpty(content.getContent_tag())
  246 +// &&content.getContent_tag().equals("moment")
  247 +// &&CommonUtils.isNotEmpty(content.getVideo_id())
  248 +// &&state==CommonConst.AUDIT_REFUSE){
  249 +// ShyVideos shyVideos1 = new ShyVideos();
  250 +// shyVideos1.setVideo_id(content.getVideo_id());
  251 +// List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1);
  252 +// if (listshyVideos.size() > 0) {
  253 +// ShyVideos shyVideos = listshyVideos.get(0);
  254 +// String showMsg = videosService.repulse(shyVideos.getId().toString(), msg, userId);
  255 +// if (CommonUtils.isNotEmpty(showMsg)) {
  256 +// success = false;
  257 +// return success;
  258 +// }
  259 +// }
  260 +// }
  261 +//
  262 +// content.setContent_status(state);// 设置图文状态为审核后的状态
  263 +// content.setReceive_status(CommonConst.RECEIVE_AUDIT);// 领取状态为已审核
  264 +// content.setShenhe_msg(msg);// 设置审核消息
  265 +// if (CommonUtils.isNotEmpty(userId)) {
  266 +// content.setAuditor_id(userId);
  267 +// content.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 设置审核类型为人工
  268 +// }else{
  269 +// content.setUpdater(updater);//设置更新人
  270 +// }
  271 +// content.setLast_update(CommonUtils.getCurrentTime());
  272 +// int i = shyContentMapper.updateByPrimaryKeySelective(content);
  273 +// if (i != 1) {
  274 +// success = false;
  275 +// }
  276 +// }
  277 +//
  278 +// return success;
  279 +// }
  280 +
  281 + //**********************************
  282 +// public Integer receive(String ids, Integer num, String userId, Integer spid) {
  283 +// Integer n = 0;
  284 +// if (CommonUtils.isNotEmpty(ids)) {
  285 +// String[] cids = ids.split(",");
  286 +// for (String cid : cids) {
  287 +// ShyContent shyContent = shyContentMapper.selectByPrimaryKey(Integer.parseInt(cid));
  288 +// if (CommonUtils.isNotNull(shyContent) && shyContent.getReceive_status() == CommonConst.RECEIVE_BEFORE ) {
  289 +// shyContent.setAuditor_id(userId);
  290 +// shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);
  291 +// shyContent.setLast_update(CommonUtils.getCurrentTime());
  292 +// shyContentMapper.updateByPrimaryKeySelective(shyContent);
  293 +// n++;
  294 +// }
  295 +// }
  296 +// } else if (CommonUtils.isNotNull(num) && num > 0) {
  297 +// Example example = new Example(ShyContent.class);
  298 +// example.setOrderByClause("create_date desc");
  299 +// example.and().andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE);
  300 +//// example.and().andEqualTo("receive", CommonConst.RECEIVE_AFTER);
  301 +// if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid);
  302 +// List<ShyContent> shyContentList = shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num));
  303 +// if (!shyContentList.isEmpty()) {
  304 +// for (ShyContent shyContent : shyContentList) {
  305 +// shyContent.setAuditor_id(userId);
  306 +// shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);
  307 +// shyContent.setLast_update(CommonUtils.getCurrentTime());
  308 +// shyContentMapper.updateByPrimaryKeySelective(shyContent);
  309 +// n++;
  310 +// }
  311 +// }
  312 +// }
  313 +// return n;
  314 +// }
  315 +
  316 + //***************************************
  317 +// public Integer retReceive(String ids, String userId) {
  318 +// Integer n = 0;
  319 +// String[] cids = ids.split(",");
  320 +// for (String cid : cids) {
  321 +// ShyContent shyContent = shyContentMapper.selectByPrimaryKey(Integer.parseInt(cid));
  322 +// if (shyContent.getReceive_status() == CommonConst.RECEIVE_AFTER && userId.equals(shyContent.getAuditor_id())) {
  323 +// shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);
  324 +// shyContent.setAuditor_id(null);
  325 +// shyContent.setLast_update(CommonUtils.getCurrentTime());
  326 +// int i = shyContentMapper.updateByPrimaryKeySelective(shyContent);
  327 +// if (i == 1) n++;
  328 +// }
  329 +// }
  330 +// return n;
  331 +// }
  332 + //**************************************
  333 +// public ShyContent selectByPrimaryKey(Integer id) {
  334 +// ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id);
  335 +// return shyContent;
  336 +// }
  337 +// public int updateByPrimaryKeySelective(ShyContent content) {
  338 +// return shyContentMapper.updateByPrimaryKeySelective(content);
  339 +// }
  340 +
  341 + /**
  342 + * 获得审核类型
  343 + * @param spId
  344 + */
  345 + public Integer getShenheType(Integer spId){
  346 +
  347 + //获取图文免审sp
  348 + List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_TOPIC);
  349 + //初始化一个审核状态
  350 + Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
  351 + //如果当前sp是免审sp
  352 + if(sites.contains(spId)){
  353 + shenheType=1;//免审
  354 + }else{
  355 + shenheType=3;//人工审
  356 + }
  357 + return shenheType;
  358 + }
  359 +
  360 + /**
  361 + * 数美视频(图片)过滤
  362 + * @param cid 审核云中图文id
  363 + * @param channel 尺度
  364 + * @return
  365 + */
  366 +// public int contentFilter(ShyContent shyContent,String channel){
  367 +//
  368 +// JSONObject result = null;//数美返回结果
  369 +// String type="";//数美返回结果的类型
  370 +// String desc="";//数美失败结果的详情
  371 +// String Token_id=UUID.randomUUID().toString();
  372 +// String contentUrl=localhost_url+"/api/content/detail/"+shyContent.getId()+".html";
  373 +// logger.info("数美送审图文url:"+contentUrl);
  374 +// try{
  375 +// //调用数美接口
  376 +// result = AntiFraudUtil.filterArticle(Token_id,contentUrl,channel);
  377 +// type=result.getString("riskLevel");
  378 +// desc=result.getString("desc");//数美失败结果的详情
  379 +// }catch(Exception e){
  380 +// type=CommonConst.REJECT;//报错就给一个拒绝状态
  381 +// desc="数美审核报错了";
  382 +// }
  383 +// if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过
  384 +// desc="数美审核通过了";
  385 +// shyContent.setShenhe_msg(desc);
  386 +// //修改图文状态
  387 +// callback(shyContent.getId().toString(),desc,CommonConst.AUDIT_SUCCESS,"","机审通过");
  388 +// }else if(type.toLowerCase().equals(CommonConst.REJECT)||type.toLowerCase().equals(CommonConst.REVIEW)){//数美拒绝
  389 +// shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型改为人工审核
  390 +// shyContent.setShenhe_msg(desc);//拒绝原因
  391 +// updateshyContent(shyContent);
  392 +//// videosService.updateDianboAndShenhe(shyVideos,4);
  393 +// }
  394 +// ShyVideofilter videofilter=new ShyVideofilter();
  395 +// videofilter.setChannel(channel);
  396 +// videofilter.setDesc_msg(desc);
  397 +// videofilter.setResult_type(type);
  398 +// videofilter.setToken_id(Token_id);
  399 +// videofilter.setVideos_id(shyContent.getId());
  400 +// videofilter.setDuration(-1);
  401 +// videofilter.setCreated_at(CommonUtils.getCurrentTime());
  402 +// videofilterServiceImpl.impotVideofilter(videofilter);
  403 +//
  404 +// return 0;
  405 +// }
  406 +
  407 +}
  408 +
  409 +
... ...
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
... ... @@ -100,9 +100,13 @@ public class CommonConst {
100 100 * 白名单业务:直播申请
101 101 */
102 102 public static Integer BUSINESS_LIVEAPPLY = 5;
  103 + /**
  104 + * 白名单业务:话题申请
  105 + */
  106 + public static Integer BUSINESS_TOPIC = 6;
103 107  
104 108 //白名单设置
105   - public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\"}");
  109 + public static JSONObject BUSINESS = JSONObject.parseObject("{\"1\":\"点播业务\",\"2\":\"评论业务\",\"3\":\"图文业务\",\"4\":\"频道业务\",\"5\":\"直播申请业务\",\"6\":\"话题业务\"}");
106 110  
107 111 /**
108 112 * 弹窗消息:频道
... ...
src/main/resources/mapper/ShyTopicMapper.xml
... ... @@ -11,13 +11,11 @@
11 11 <result column="topic_image" jdbcType="VARCHAR" property="topic_image" />
12 12 <result column="topic_tag" jdbcType="VARCHAR" property="topic_tag" />
13 13 <result column="topic_url" jdbcType="VARCHAR" property="topic_url" />
14   - <result column="callback" jdbcType="VARCHAR" property="callback" />
15   - <result column="topic_time" jdbcType="TIMESTAMP" property="topic_time" />
  14 + <result column="topic_time" jdbcType="VARCHAR" property="topic_time" />
16 15 <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type" />
17   - <result column="topic_status" jdbcType="INTEGER" property="topic_status" />
  16 + <result column="shenhe_status" jdbcType="INTEGER" property="shenhe_status" />
18 17 <result column="create_date" jdbcType="TIMESTAMP" property="create_date" />
19 18 <result column="update_date" jdbcType="TIMESTAMP" property="update_date" />
20   - <result column="receive_status" jdbcType="INTEGER" property="receive_status" />
21 19 <result column="auditor_id" jdbcType="VARCHAR" property="auditor_id" />
22 20 <result column="updater" jdbcType="VARCHAR" property="updater" />
23 21 <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" />
... ...
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 78 <li><a href="/live/page?shenhe_state=0" id="/live/page"> 直播审核</a></li>
79 79 <li><a href="/comments/page?state=0&receive=0" id="/comments/page"> 评论审核</a></li>
80 80 <li><a href="/content/page?receive_status=0" id="/content/page"> 图文审核</a></li>
  81 + <li><a href="/topic/page?shenhe_status=0&receive=0" id="/topic/page"> 话题审核</a></li>
81 82 <li><a href="/channel/page?shenhe_status=0&receive=0" id="/channel/page"> 频道审核</a></li>
82 83 <li><a href="/liveApply/page?shenhe_state=0&receive=0" id="/liveApply/page">直播申请审核</a></li>
83 84 </ul>
... ...
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 +
  87 +
  88 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;">
  89 + <form id="topicForm">
  90 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;">
  91 + <div class="col-md-5" style="padding: 0">
  92 + <label for="topicId" class="control-label cb-toolbar">话题id:</label>
  93 + <div class="col-sm-8" style="padding: 0;">
  94 + <input class="form-control" name="topicId" type="text"
  95 + id="topicId" >
  96 + </div>
  97 + </div>
  98 + <div class="col-md-4" style="padding: 0">
  99 + <label for="topic_name" class="control-label cb-toolbar">话题标题:</label>
  100 + <div class="col-sm-8" style="padding: 0;">
  101 + <input class="form-control" name="topic_name" type="text" id="topic_name"
  102 + >
  103 + </div>
  104 + </div>
  105 + <div class="col-md-4" style="padding: 0">
  106 + <label for="sp_desc" class="control-label cb-toolbar">sp名称:</label>
  107 + <div class="col-sm-8" style="padding: 0;">
  108 + <input class="form-control" name="sp_desc" type="text" id="sp_desc"
  109 + >
  110 + </div>
  111 + </div>
  112 + <div class="col-md-3" style="padding: 0">
  113 + <label for="shenhe_status" class="control-label cb-toolbar">审核状态:</label>
  114 + <div class="col-sm-6" style="padding: 0;">
  115 + <select class="form-control col-sm-2" id="shenhe_status" name="shenhe_status">
  116 + <option value="">全部</option>
  117 + <option value="0" >未审核</option>
  118 + <option value="1" >已通过</option>
  119 + <option value="2" >已拒绝</option>
  120 + </select>
  121 + </div>
  122 + </div>
  123 + </div>
  124 +
  125 + <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0">
  126 + <div class="col-md-11" style="width: 88%;padding: 0;">
  127 + <div class="col-md-6" style="padding: 0;width: 45%;">
  128 + <label for="start_date" class="control-label cb-toolbar">时间:</label>
  129 + <div class="input-group col-md-9 date">
  130 + <input class="form-control date" name="start_date" type="text" id="start_date" >
  131 + <span class="input-group-addon">
  132 + <span class="glyphicon glyphicon-calendar"></span>
  133 + </span>
  134 + </div>
  135 + </div>
  136 + <div class="col-md-6" style="padding: 0;width: 45%;">
  137 + <label for="start_date" class="control-label cb-toolbar">至</label>
  138 + <div class="input-group col-md-9 date">
  139 + <input class="form-control date" name="end_date" type="text"
  140 + id="end_date" >
  141 + <span class="input-group-addon">
  142 + <span class="glyphicon glyphicon-calendar"></span>
  143 + </span>
  144 + </div>
  145 + </div>
  146 + </div>
  147 + </div>
  148 + </form>
  149 +
  150 + </div>
  151 +
  152 + <div class="bootstrap-table">
  153 + <div class="fixed-table-toolbar"></div>
  154 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  155 + <div class="fixed-table-header" style="display: none;">
  156 + <table></table>
  157 + </div>
  158 + <div class="fixed-table-body">
  159 + <table id="table" data-toggle="table"
  160 + class="table table-hover coma-base-table fixed_headers table-striped"
  161 + style="word-break:break-all;">
  162 + <thead>
  163 + <tr>
  164 + <th class="bs-checkbox " style="width: 3%; " data-field="state"
  165 + tabindex="0">
  166 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  167 + id="select_all">
  168 + </div>
  169 + <div class="fht-cell"></div>
  170 + </th>
  171 + <th style="text-align: center; width: 6%; "
  172 + data-field="topic_user_name" tabindex="0">
  173 + <div class="th-inner ">话题ID</div>
  174 + <div class="fht-cell"></div>
  175 + </th>
  176 + <th style="text-align: center; width: 6%; "
  177 + data-field="topic_user_name" tabindex="0">
  178 + <div class="th-inner ">sp名称</div>
  179 + <div class="fht-cell"></div>
  180 + </th>
  181 + <th style="text-align: center; width: 6%; " data-field="topic_user_ip"
  182 + tabindex="0">
  183 + <div class="th-inner ">话题图片</div>
  184 + <div class="fht-cell"></div>
  185 + </th>
  186 + <th style="text-align: center; width: 14%; "
  187 + data-field="topic_user_avatar" tabindex="0">
  188 + <div class="th-inner ">话题标题
  189 + </div>
  190 + <div class="fht-cell"></div>
  191 + </th>
  192 + <th style="text-align: center; width: 6%; " data-field="topic_user_ip"
  193 + tabindex="0">
  194 + <div class="th-inner ">话题描述</div>
  195 + <div class="fht-cell"></div>
  196 + </th>
  197 + <th style="text-align: center; width: 3%; " data-field="content"
  198 + tabindex="0">
  199 + <div class="th-inner ">审核类型
  200 + </div>
  201 + <div class="fht-cell"></div>
  202 + </th>
  203 + <th style="text-align: center; width: 3%; " data-field="updater"
  204 + tabindex="0">
  205 + <div class="th-inner ">审核状态</div>
  206 + <div class="fht-cell"></div>
  207 + </th>
  208 + <th style="text-align: center; width: 4%; " data-field="topic_title"
  209 + tabindex="0">
  210 + <div class="th-inner ">审核员
  211 + </div>
  212 + <div class="fht-cell"></div>
  213 + </th>
  214 +
  215 + <th style="text-align: center; width: 10%; " data-field="is_hot_name"
  216 + tabindex="0">
  217 + <div class="th-inner ">审核消息</div>
  218 + <div class="fht-cell"></div>
  219 + </th>
  220 +<!-- <th style="text-align: center; width: 5%; " -->
  221 +<!-- data-field="state_name_short" tabindex="0"> -->
  222 +<!-- <div class="th-inner ">是否下线 -->
  223 +<!-- </div> -->
  224 +<!-- <div class="fht-cell"></div> -->
  225 +<!-- </th> -->
  226 + <th style="text-align: center ; width: 8%; " data-field="topic_time"
  227 + tabindex="0">
  228 + <div class="th-inner ">话题创建时间</div>
  229 + <div class="fht-cell"></div>
  230 + </th>
  231 + <th style="text-align: center; width: 8%; " data-field="topic_time"
  232 + tabindex="0">
  233 + <div class="th-inner ">话题送审时间</div>
  234 + <div class="fht-cell"></div>
  235 + </th>
  236 + <th style="text-align: center; width: 12%; " data-field="action"
  237 + tabindex="0">
  238 + <div class="th-inner ">操作
  239 + </div>
  240 + <div class="fht-cell"></div>
  241 + </th>
  242 + </tr>
  243 + </thead>
  244 + <tbody>
  245 + <tr th:data-index="${topicStat.index}"
  246 + th:each="topic : ${topicPage.list}">
  247 + <td class="bs-checkbox "
  248 + style="text-align: center; vertical-align:middle;width: 3%;">
  249 + <input data-index="0" name="btSelectItem" type="checkbox"
  250 + th:value="${topic.id}"></td>
  251 + <td style="text-align: center; vertical-align:middle;width: 6%;"
  252 + th:text="${topic.topic_id}">网加加
  253 + </td>
  254 + <td style="text-align: center; vertical-align:middle; width: 6%;"
  255 + th:text="${topic.sp_desc}">1083_00014
  256 + </td>
  257 + <td style="text-align: center; vertical-align:middle;width: 6%;">
  258 + <div width="60px" height="60px"><img
  259 + th:src="@{${topic.topic_image}}" width="60px" height="60px"
  260 + alt="话题图片"></div>
  261 + </td>
  262 + <td style="text-align: center; vertical-align:middle; width: 14%;"
  263 + th:text="${topic.title}">优秀传统文化与现代幼儿教育 教师研修班
  264 + </td>
  265 + <td style="text-align: center; vertical-align:middle; width: 14%;"
  266 + th:text="${topic.topic_text}">优秀传统文化与现代幼儿教育 教师研修班
  267 + </td>
  268 + <td style="text-align: center; vertical-align:middle; width: 3%;">
  269 + <span th:if="${topic.shenhe_type==1}">免审</span>
  270 + <span th:if="${topic.shenhe_type==2}">机审</span>
  271 + <span th:if="${topic.shenhe_type==3}">人工审</span>
  272 + </td>
  273 + <td style="text-align: center; vertical-align:middle; width: 3%;">
  274 + <span class="btn btn-sm btn-warning"
  275 + th:if="${topic.shenhe_status==0}">待审核</span>
  276 + <span class="btn btn-sm btn-success"
  277 + th:if="${topic.shenhe_status==1}">已通过</span>
  278 + <span class="btn btn-sm btn-danger"
  279 + th:if="${topic.shenhe_status==2}">已拒绝</span>
  280 + </td>
  281 + <td style="text-align: center; vertical-align:middle; width: 4%;" th:text="${topic.updater}">
  282 + openadmin9@cnlive.com
  283 + </td>
  284 + <td style="text-align: center; vertical-align:middle; width: 10%;"
  285 + th:text="${topic.shenhe_msg}">审核消息
  286 + </td>
  287 +<!-- <td style="text-align: center; width: 3%;"> -->
  288 +<!-- <span th:if="${topic.offline==0}">正常</span> -->
  289 +<!-- <span th:if="${topic.offline==1}">下线</span> -->
  290 +<!-- </td> -->
  291 + <td style="text-align: center; vertical-align:middle; width: 8%;"
  292 + th:text="${topic.topic_time}">
  293 + 2018-11-28 16:08:00
  294 + </td>
  295 + <td style="text-align: center; vertical-align:middle; width: 8%;"
  296 + th:text="${#dates.format(topic.create_date, 'yyyy-MM-dd HH:mm:ss')}">
  297 + 2018-11-28 16:08:00
  298 + </td>
  299 + <td style="text-align: center; vertical-align:middle; width: 12%;">
  300 + <span> &nbsp;</span>
  301 + <a class="pass_one" th:href="@{'javascript:topic('+${topic.id}+',1)'}">
  302 + <button class="btn btn-success btn-sm">通过</button>
  303 + </a>
  304 + <span> &nbsp;</span>
  305 + <a class="failed_one" th:href="@{'javascript:topic('+${topic.id}+',2)'}">
  306 + <button class="btn btn-danger btn-sm">拒绝</button>
  307 + </a>
  308 + </td>
  309 + </tr>
  310 + </tbody>
  311 + </table>
  312 + </div>
  313 + <div class="fixed-table-footer" style="display: none;">
  314 + <table>
  315 + <tbody>
  316 + <tr></tr>
  317 + </tbody>
  318 + </table>
  319 + </div>
  320 + <div class="fixed-table-pagination" style="display: block;">
  321 + <div class="pull-left pagination-detail">
  322 + <span class="pagination-info" th:text="'共 '+${topicPage.total}+' 条记录,每页显示'">总共 0 条记录</span>
  323 + <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()">
  324 + <option value="10" th:selected="${pageSize==10}">10</option>
  325 + <option value="20" th:selected="${pageSize==20}">20</option>
  326 + <option value="50" th:selected="${pageSize==50}">50</option>
  327 + <option value="100" th:selected="${pageSize==100}">100</option>
  328 + </select>
  329 + <span class="pagination-info" >条记录</span>
  330 + </div>
  331 + <div class="pull-right pagination">
  332 + <ul class="pagination" th:if="${topicPage.pages>1}">
  333 + <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li>
  334 + <li class="page-pre" th:if="${!topicPage.isFirstPage}"><a
  335 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'">‹</a>
  336 + </li>
  337 +
  338 + <li class="page-number" th:if="${topicPage.pageNum-3>=1}"><a
  339 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-3}+'\');'"
  340 + th:text="${topicPage.pageNum-3}">2</a></li>
  341 + <li class="page-number" th:if="${topicPage.pageNum-2>=1}"><a
  342 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-2}+'\');'"
  343 + th:text="${topicPage.pageNum-2}">2</a></li>
  344 + <li class="page-number" th:if="${topicPage.pageNum-1>=1}"><a
  345 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'"
  346 + th:text="${topicPage.pageNum-1}">2</a></li>
  347 + <li class="page-number active"><a href="javaScript:void(0);"
  348 + th:text="${topicPage.pageNum}">2</a></li>
  349 + <li class="page-number" th:if="${topicPage.pageNum+1<=topicPage.pages}"><a
  350 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'"
  351 + th:text="${topicPage.pageNum+1}">2</a></li>
  352 + <li class="page-number" th:if="${topicPage.pageNum+2<=topicPage.pages}"><a
  353 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+2}+'\');'"
  354 + th:text="${topicPage.pageNum+2}">2</a></li>
  355 + <li class="page-number" th:if="${topicPage.pageNum+3<=topicPage.pages}"><a
  356 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+3}+'\');'"
  357 + th:text="${topicPage.pageNum+3}">2</a></li>
  358 +
  359 + <li class="page-next" th:if="${!topicPage.isLastPage}"><a
  360 + th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'">›</a>
  361 + </li>
  362 + <li class="page-next"><a
  363 + th:onclick="'javascript:fanye(\''+${topicPage.pages}+'\');'">››</a>
  364 + </li>
  365 + </ul>
  366 + </div>
  367 + </div>
  368 + </div>
  369 + </div>
  370 + <div class="clearfix"></div>
  371 +
  372 + </div>
  373 + </div>
  374 + </div>
  375 + </div>
  376 +
  377 +
  378 + </section><!-- /.content -->
  379 + </div>
  380 + <!-- /.content-wrapper -->
  381 + <!-- 模态框(Modal) -->
  382 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  383 + <input type="hidden" id="topic_id_hidden" name="topic_id_hidden">
  384 + <div class="modal-dialog">
  385 + <div class="modal-content" style="margin-top: 30%;">
  386 + <div class="modal-header">
  387 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  388 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  389 + </div>
  390 + <div class="modal-body">
  391 + <div class="form-group" style="margin-bottom: 0;">
  392 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  393 + </div>
  394 + <div class="form-group">
  395 + </div>
  396 + </div>
  397 + <div class="modal-footer">
  398 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  399 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  400 + </div>
  401 + </div><!-- /.modal-content -->
  402 + </div><!-- /.modal-dialog -->
  403 + </div>
  404 + <!-- /.modal -->
  405 + <script th:inline="javascript">
  406 + $(function () {
  407 + //按钮颜色设置
  408 + var state = [[${param.shenhe_status}]] ? [[${param.shenhe_status}]][0] : null;
  409 + var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
  410 + var stateIsNull = $.trim(state) == "";
  411 + var receiveIsNull = $.trim(receive) == "";
  412 + if ( receive == '0' &&state != '0') {
  413 + $("#quanbu").addClass("btn-info");
  414 + } else if (state == '0' && receive == '0') {
  415 + $("#daishen").addClass("btn-warning");
  416 + } else if (state != '0' && receive == '1') {
  417 + $("#yishen").addClass("btn-danger");
  418 + }
  419 +
  420 + })
  421 +
  422 + //选择每页数量触发函数
  423 + function selectPageSize(){
  424 + var pageSize=$("#pageSize").val();
  425 + var param = location.search;
  426 + if (param.indexOf("pageSize=") != -1) {
  427 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  428 + var split = se.split("&");
  429 + var h = "";
  430 + for (var i = 0; i < split.length; i++) {
  431 + var s = split[i];
  432 + if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
  433 + }
  434 + h = h.substring(1, h.length);
  435 + window.location.href = "/topic/page?" + h + "&pageSize=" + pageSize;
  436 + } else {
  437 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  438 + var split = se.split("&");
  439 + var h = "";
  440 + for (var i = 0; i < split.length; i++) {
  441 + var s = split[i];
  442 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  443 + }
  444 + h = h.substring(1, h.length);
  445 + window.location.href = "/topic/page?" + h + "&pageSize=" + pageSize;
  446 + }
  447 + }
  448 +
  449 + //翻页函数
  450 + function fanye(page) {
  451 + var param = location.search;
  452 + if (param.indexOf("page=") != -1) {
  453 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  454 + var split = se.split("&");
  455 + var h = "";
  456 + for (var i = 0; i < split.length; i++) {
  457 + var s = split[i];
  458 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  459 + }
  460 + h = h.substring(1, h.length);
  461 + window.location.href = "/topic/page?" + h + "&page=" + page;
  462 + } else {
  463 + param = param.substring(1, param.length);
  464 + window.location.href = "/topic/page?" + param + "&page=" + page;
  465 + }
  466 + }
  467 +
  468 + var topic_id ="";//话题id
  469 + var topic_name = "";//话题标题
  470 + var shenhe_status ="";//审核状态
  471 + var start_date ="";//开始时间
  472 + var end_date = "";//结束时间
  473 + var count = "";//每页显示数量
  474 + var sp_desc = "";//sp昵称
  475 + var receive ="";//领取状态,用来区分是否是自己审核的内容
  476 +
  477 + function query(){
  478 + topic_id = $("#topicId").val();
  479 + topic_name = $("#topic_name").val();
  480 + start_date = $("#start_date").val();
  481 + end_date = $("#end_date").val();
  482 + count = $("#pageSize").val();
  483 + sp_desc = $("#sp_desc").val();
  484 + 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;
  485 + }
  486 +
  487 + //全部
  488 + function quanbu() {
  489 + receive = 0;
  490 + shenhe_status = $("#shenhe_status").val();
  491 + query();
  492 + }
  493 +
  494 + //全部待领
  495 + $('#daishen').click(function () {
  496 + shenhe_status = $("#shenhe_status").val();
  497 + if($.trim(shenhe_status) == '') shenhe_status=0;
  498 + receive = 0;
  499 + query();
  500 + });
  501 + //我的已审核
  502 + $('#yishen').click(function () {
  503 + shenhe_status = $("#shenhe_status").val();
  504 + if($.trim(shenhe_status) == '') shenhe_status=3;//审核状态,3代表通过和拒绝都查询
  505 + receive = 1;
  506 + query();
  507 + });
  508 +
  509 +
  510 + //审核操作,status=1为通过
  511 + function topic(ids, status) {
  512 + if (status == 1) {
  513 + var r = confirm("您确定通过本条内容吗?");
  514 + if (r == true) {
  515 + $.post("/topic/pass?ids=" + ids, function (data) {
  516 + if (data.errorCode == 0) {
  517 + alert(data.errorMessage);
  518 + location.href = location.href;
  519 + } else {
  520 + alert(data.errorMessage);
  521 + }
  522 + })
  523 + }
  524 + } else {
  525 + var r = confirm("您确定要拒绝本条内容吗?");
  526 + if (r == true) {
  527 + $('#topic_id_hidden').val(ids);
  528 + $('#msgModal').modal('show');
  529 + }
  530 + }
  531 +
  532 + }
  533 +
  534 + //提交打回
  535 + function repulseSubmit() {
  536 + var ids = $('#topic_id_hidden').val();
  537 + var msg = $("#reviewMsg").val();
  538 + $.post("/topic/refuse?ids=" + ids + "&msg=" + msg, function (data) {
  539 + if (data.errorCode == 0) {
  540 + alert(data.errorMessage);
  541 + location.href = location.href;
  542 + } else {
  543 + alert(data.errorMessage);
  544 + }
  545 + })
  546 + }
  547 +
  548 + /*查询样式*/
  549 + function openOrClose(id_name_str) {
  550 + var id_name = '#' + id_name_str;
  551 + if ($(id_name).css('display') == 'block') {
  552 + $(id_name).slideUp(350);
  553 + $('#a_up').show();
  554 + $('#a_down').hide();
  555 + } else {
  556 + $(id_name).slideDown(350);
  557 + $('#a_up').hide();
  558 + $('#a_down').show();
  559 + }
  560 + }
  561 +
  562 + //===========================以下未使用===============================
  563 +
  564 +
  565 +
  566 + /*全选的操作*/
  567 + $('#select_all').click(function () {
  568 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  569 + $("#select_all").prop('checked', true);
  570 + $("[name=btSelectItem]:checkbox").each(function () {
  571 + $(this).prop('checked', true);
  572 + });
  573 + } else {
  574 + $("#select_all").prop('checked', false);
  575 + $("[name=btSelectItem]:checkbox").each(function () {
  576 + $(this).prop('checked', false);
  577 + });
  578 + }
  579 + });
  580 +
  581 + //批量通过
  582 + $('#more_pass').click(function () {
  583 + var rows = $("[name=btSelectItem]:checkbox:checked");
  584 + if (rows.length > 0) {
  585 + var r = confirm("您确定通过选中的" + rows.length + "条评论吗?");
  586 + if (r == true) {
  587 + var ids = "";
  588 + rows.each(function (i, e) {
  589 + ids = ids + "," + e.value;
  590 + })
  591 + ids = ids.substring(1);
  592 + topic(ids, 1);
  593 + }
  594 + } else {
  595 + alert("没有选中的数据!");
  596 + }
  597 +
  598 + });
  599 + //批量拒绝
  600 + $('#more_reject').click(function () {
  601 + var rows = $("[name=btSelectItem]:checkbox:checked");
  602 + if (rows.length > 0) {
  603 + var r = confirm("您确定拒绝选中的" + rows.length + "条评论吗?");
  604 + if (r == true) {
  605 + var ids = "";
  606 + rows.each(function (i, e) {
  607 + ids = ids + "," + e.value;
  608 + })
  609 + ids = ids.substring(1);
  610 + topic(ids, 2);
  611 + }
  612 + } else {
  613 + alert("没有选中的数据!");
  614 + }
  615 + });
  616 +
  617 + /**
  618 + * 认领
  619 + */
  620 + function receive(n) {
  621 + if (n > 0) {
  622 + applyReceiveNum(n);
  623 + } else {
  624 + var rows = $("[name=btSelectItem]:checkbox:checked");
  625 + if (rows.length > 0) {
  626 + var ids = "";
  627 + rows.each(function (i, e) {
  628 + ids = ids + "," + e.value;
  629 + })
  630 + ids = ids.substring(1);
  631 + applyReceive(ids);
  632 + } else {
  633 + alert("请选择要认领的内容!");
  634 + }
  635 + }
  636 + }
  637 +
  638 + //认领选中请求
  639 + function applyReceive(ids) {
  640 + $.post("/topics/receive?ids=" + ids, function (data) {
  641 + if (data.errorCode == 0) {
  642 + alert(data.errorMessage);
  643 + location.href = location.href;
  644 + } else {
  645 + alert(data.errorMessage);
  646 + }
  647 + })
  648 + }
  649 +
  650 + //认领多条请求
  651 + function applyReceiveNum(num) {
  652 + $.post("/topics/receive?num=" + num, function (data) {
  653 + if (data.errorCode == 0) {
  654 + alert(data.errorMessage);
  655 + location.href = location.href;
  656 + } else {
  657 + alert(data.errorMessage);
  658 + }
  659 + })
  660 + }
  661 +
  662 + //退领选中内容
  663 + function retReceive() {
  664 + var rows = $("[name=btSelectItem]:checkbox:checked");
  665 + if (rows.length > 0) {
  666 + var r = confirm("您确定退领选中的" + rows.length + "条评论吗?");
  667 + if (r == true) {
  668 + var ids = "";
  669 + rows.each(function (i, e) {
  670 + ids = ids + "," + e.value;
  671 + })
  672 + ids = ids.substring(1);
  673 + applyRetReceive(ids);
  674 + }
  675 + } else {
  676 + alert("没有选中的数据!");
  677 + }
  678 + }
  679 +
  680 + //退领
  681 + function applyRetReceive(ids) {
  682 + $.post("/topics/retReceive?ids=" + ids, function (data) {
  683 + if (data.errorCode == 0) {
  684 + alert(data.errorMessage);
  685 + location.href = location.href;
  686 + } else {
  687 + alert(data.errorMessage);
  688 + }
  689 + })
  690 + }
  691 +
  692 +
  693 + //批量提交
  694 + function morePass() {
  695 + var rows = $("[name=btSelectItem]:checkbox:checked");
  696 + if (rows.length > 0) {
  697 + var r = confirm("您确定通过选中的" + rows.length + "条内容吗?");
  698 + if (r == true) {
  699 + var ids = "";
  700 + rows.each(function (i, e) {
  701 + ids = ids + "," + e.value;
  702 + })
  703 + ids = ids.substring(1);
  704 + $.post("/topics/pass?ids=" + ids, function (data) {
  705 + if (data.errorCode == 0) {
  706 + alert(data.errorMessage);
  707 + location.href = location.href;
  708 + } else {
  709 + alert(data.errorMessage);
  710 + }
  711 + })
  712 + }
  713 + } else {
  714 + alert("没有选中的数据!");
  715 + }
  716 + }
  717 + </script>
  718 + <script>
  719 + /*时间插件*/
  720 + $('.date').datetimepicker({
  721 +// format: 'YYYY-MM-DD HH:mm:ss',
  722 + format: 'YYYY-MM-DD',
  723 + locale: "zh-CN",
  724 + toolbarPlacement: 'bottom',
  725 + showClear: true,
  726 + });
  727 + $(function () {
  728 + $("[data-toggle='tooltip']").tooltip();
  729 + });
  730 + </script>
  731 +
  732 + <footer th:replace="../templates/common/foot::foot"></footer>
  733 +
  734 + <!-- Add the sidebar's background. This div must be placed
  735 + immediately after the control sidebar -->
  736 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  737 +
  738 +</div><!-- ./wrapper -->
  739 +
  740 +
  741 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  742 +<script type="text/javascript">
  743 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  744 +</script>
  745 +
  746 +<!-- AdminLTE App -->
  747 +<script src="../../static/js/app.min.js"></script>
  748 +<!-- AdminLTE for demo purposes -->
  749 +<script src="../../static/js/sidebar.js"></script>
  750 +
  751 +
  752 +</body>
  753 +</html>
0 754 \ No newline at end of file
... ...