Commit 10db27f692476260942b37aff756185d58f31d3e

Authored by liwei2917
1 parent f413ebd9

图文审核内容

src/main/java/com/cnlive/shenhe/api/ContentControllerApi.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.ShyComments;
  7 +import com.cnlive.shenhe.entity.ShyContent;
  8 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  9 +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  10 +import com.cnlive.shenhe.utils.AuditPass;
  11 +import com.cnlive.shenhe.utils.CommonConst;
  12 +import com.cnlive.shenhe.utils.CommonUtils;
  13 +import org.slf4j.Logger;
  14 +import org.slf4j.LoggerFactory;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.stereotype.Controller;
  17 +import org.springframework.web.bind.annotation.PostMapping;
  18 +import org.springframework.web.bind.annotation.RequestMapping;
  19 +import org.springframework.web.bind.annotation.ResponseBody;
  20 +
  21 +import java.util.Date;
  22 +import java.util.List;
  23 +
  24 +@Controller
  25 +@RequestMapping("/api/content")
  26 +public class ContentControllerApi {
  27 + private static Logger logger = LoggerFactory.getLogger(ContentControllerApi.class);
  28 + @Autowired
  29 + AuditPass Pass;
  30 + @Autowired
  31 + CommentsServiceImpl commentsService;
  32 + @Autowired
  33 + ContentServiceImpl contentService;
  34 +
  35 + /**
  36 + * @author liwei
  37 + * @Date: 2019/05/15 11:17
  38 + * @Description: 图文送审接口
  39 + */
  40 + @PostMapping("/import")
  41 + @ResponseBody
  42 + public ResponseBean impotComment(String param) {
  43 + logger.info("图文入库,param=====" + param);
  44 + JSONObject json = JSONObject.parseObject(param);
  45 + //判断是否存在
  46 + ShyContent shyContent=new ShyContent();
  47 + shyContent.setContent_id(json.getString("contentId"));
  48 + List<ShyContent> contentList = contentService.findshyContent(shyContent);
  49 + //存在则更新
  50 + if (contentList.size() > 0) {
  51 + ShyContent shyContent1 = contentList.get(0);
  52 + shyContent1.setTitle(json.getString("title"));//标题
  53 + shyContent1.setTitle_image(json.getString("titleImage"));//标题图片
  54 + shyContent1.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型是人工
  55 + shyContent1.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
  56 + shyContent1.setSource(json.getString("source"));//来源
  57 + shyContent1.setAuthor(json.getString("author"));//作者
  58 + String contentTime = json.getString("contentTime");//创建时间
  59 + if (CommonUtils.isNotEmpty(contentTime)) {
  60 + Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
  61 + shyContent1.setCreate_date(timestamp);
  62 +
  63 + }
  64 + shyContent1.setCallback(json.getString("callback"));//回调地址
  65 + shyContent1.setContent_url(json.getString("contentUrl"));//图文发布的url
  66 + shyContent1.setSp_id(json.getInteger("spId"));//spid
  67 + shyContent1.setContent_tag(json.getString("contentTag"));//图文标签
  68 + shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
  69 +
  70 +
  71 +
  72 + boolean YorN = contentService.updateshyContent(shyContent1);
  73 + if (YorN == true) {
  74 + return new ResponseBean(ErrorEnum.SUCCESS);
  75 + } else {
  76 + return new ResponseBean(ErrorEnum.ERROR);
  77 + }
  78 + }
  79 + //如果不存在直接插入
  80 + shyContent.setTitle(json.getString("title"));//标题
  81 + shyContent.setTitle_image(json.getString("titleImage"));//标题图片
  82 + shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型是人工
  83 + shyContent.setContent_status(json.getInteger("contentStatus"));//当前图文的审核状态
  84 + shyContent.setSource(json.getString("source"));//来源
  85 + shyContent.setAuthor(json.getString("author"));//作者
  86 + String contentTime = json.getString("contentTime");//创建时间
  87 + if (CommonUtils.isNotEmpty(contentTime)) {
  88 + Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
  89 + shyContent.setCreate_date(timestamp);
  90 +
  91 + }
  92 + shyContent.setCallback(json.getString("callback"));//回调地址
  93 + shyContent.setContent_url(json.getString("contentUrl"));//图文发布的url
  94 + shyContent.setSp_id(json.getInteger("spId"));//spid
  95 + shyContent.setContent_tag(json.getString("contentTag"));//图文标签
  96 + shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);//领取状态
  97 + boolean YorN = contentService.impotContent(shyContent);
  98 + if (YorN == true) {
  99 + return new ResponseBean(ErrorEnum.SUCCESS);
  100 + } else {
  101 + return new ResponseBean(ErrorEnum.ERROR);
  102 + }
  103 + }
  104 +
  105 +}
... ...
src/main/java/com/cnlive/shenhe/controller/ContentController.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.ShySites;
  10 +import com.cnlive.shenhe.entity.ShyUsers;
  11 +import com.cnlive.shenhe.entity.ShyVideos;
  12 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  13 +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  14 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  15 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  16 +import com.cnlive.shenhe.utils.AuditPass;
  17 +import com.cnlive.shenhe.utils.CommonConst;
  18 +import com.cnlive.shenhe.utils.CommonUtils;
  19 +import com.github.pagehelper.PageInfo;
  20 +import org.slf4j.Logger;
  21 +import org.slf4j.LoggerFactory;
  22 +import org.springframework.beans.factory.annotation.Autowired;
  23 +import org.springframework.stereotype.Controller;
  24 +import org.springframework.ui.Model;
  25 +import org.springframework.web.bind.annotation.*;
  26 +
  27 +import javax.servlet.http.HttpSession;
  28 +import java.util.Date;
  29 +import java.util.List;
  30 +
  31 +
  32 +@Controller
  33 +@RequestMapping("/content")
  34 +public class ContentController {
  35 + private static Logger logger = LoggerFactory.getLogger(ContentController.class);
  36 + @Autowired
  37 + AuditPass Pass;
  38 + @Autowired
  39 + CommentsServiceImpl commentsService;
  40 + @Autowired
  41 + ContentServiceImpl contentService;
  42 + @Autowired
  43 + SitesServiceImpl sitesService;
  44 +
  45 + @Autowired
  46 + UsersServiceImpl usersService;
  47 +
  48 + /**
  49 + * 图文列表
  50 + *
  51 + * @param model
  52 + * @param title
  53 + * @param start_date
  54 + * @param end_date
  55 + * @param receive_status
  56 + * @param sp_desc
  57 + * @param page
  58 + * @param pageSize
  59 + * @param orderByClause
  60 + * @param session
  61 + * @return
  62 + */
  63 + @GetMapping("/page")
  64 + public String getPage(Model model, String title,
  65 + String start_date, String end_date, Integer receive_status, String sp_desc,
  66 + Integer page, Integer pageSize, String orderByClause, HttpSession session) {
  67 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  68 + if(CommonUtils.isNull(sessionUser)){
  69 + return "redirect:/users/login";
  70 + }
  71 + Integer spid = sessionUser.getSpid();
  72 + String userId = sessionUser.getUserId();
  73 + if (CommonUtils.isNull(page)) page = 1;
  74 + if (CommonUtils.isNull(pageSize)) pageSize = 10;
  75 + if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
  76 + ShySites shySite=sitesService.findspidBySpdesc(sp_desc);
  77 + if(CommonUtils.isNotNull(shySite)){
  78 + spid = shySite.getSpid();
  79 + }else{
  80 + return "page/sitesError.html";
  81 + }
  82 + } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
  83 + spid = null;
  84 + }
  85 + Date sDate = null;
  86 + Date eDate = null;
  87 +
  88 + if (CommonUtils.isNotEmpty(start_date)) {
  89 + try {
  90 + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  91 + } catch (Exception e) {
  92 + }
  93 + }
  94 + if (CommonUtils.isNotEmpty(end_date)) {
  95 + try {
  96 + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
  97 + } catch (Exception e) {
  98 + }
  99 + }
  100 + PageInfo<ShyContent> contentPage = contentService.getPage( title, sDate, eDate, receive_status, null, page, pageSize, orderByClause, spid, userId);
  101 + List<ShyContent> list = contentPage.getList();
  102 + if (!list.isEmpty()) {
  103 + for (ShyContent content : list) {
  104 + if (content.getReceive_status() == CommonConst.RECEIVE_AUDIT) {
  105 + String auditor_id = content.getAuditor_id();
  106 + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater();
  107 + updater =sitesService.getUpdater(updater,auditor_id);
  108 + content.setUpdater(updater);
  109 + }
  110 + //显示spid简称
  111 + ShySites shySites = sitesService.findspidDescByspid(content.getSp_id());
  112 + if (CommonUtils.isNotNull(shySites)) {
  113 + content.setSp_desc(shySites.getName());
  114 + }
  115 + }
  116 + }
  117 + model.addAttribute("contentPage", contentPage);
  118 + return "page/content.html";
  119 + }
  120 +
  121 + /**
  122 + * 图文详情
  123 + *
  124 + * @param id
  125 + * @return
  126 + */
  127 + @GetMapping("/details/{id}")
  128 + public String getDetailsComments(@PathVariable Integer id, Model model) {
  129 + ShyContent content = contentService.getDetailsContent(id);
  130 + if (content.getReceive_status() != CommonConst.RECEIVE_BEFORE) {
  131 + String auditor_id = content.getAuditor_id();
  132 + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater();
  133 + updater =sitesService.getUpdater(updater,auditor_id);
  134 + content.setUpdater(updater);
  135 + }
  136 + model.addAttribute("content", content);
  137 + return "page/contentDetail.html";
  138 + }
  139 +
  140 +
  141 + /**
  142 + * 审核通过
  143 + *
  144 + * @param ids
  145 + * @return
  146 + */
  147 + @PostMapping("/pass")
  148 + @ResponseBody
  149 + public ResponseBean pass(String ids, HttpSession session) {
  150 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  151 + String userId = sessionUser.getUserId();
  152 + boolean success = contentService.updateState(ids,"", CommonConst.AUDIT_SUCCESS, userId);
  153 + if (success) {
  154 + return new ResponseBean();
  155 + } else {
  156 + return new ResponseBean(ErrorEnum.ERROR);
  157 + }
  158 + }
  159 +
  160 + /**
  161 + * 审核拒绝
  162 + *
  163 + * @param ids
  164 + * @return
  165 + */
  166 + @PostMapping("/refuse")
  167 + @ResponseBody
  168 + public ResponseBean refuse(String ids,String msg, HttpSession session) {
  169 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  170 + String userId = sessionUser.getUserId();
  171 + boolean success = contentService.updateState(ids,msg, CommonConst.AUDIT_REFUSE, userId);
  172 + if (success) {
  173 + return new ResponseBean();
  174 + } else {
  175 + return new ResponseBean(ErrorEnum.ERROR);
  176 + }
  177 +
  178 + }
  179 +
  180 +
  181 + /**
  182 + * 认领
  183 + *
  184 + * @param ids 根据id认领
  185 + * @param num 认领条数
  186 + * @param session
  187 + * @return
  188 + */
  189 + @PostMapping("/receive")
  190 + @ResponseBody
  191 + public ResponseBean receive(String ids, Integer num, HttpSession session) {
  192 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  193 + String userId = sessionUser.getUserId();
  194 + Integer spid = sessionUser.getSpid();
  195 + Integer n = contentService.receive(ids, num, userId, spid);
  196 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "认领到" + n + "条内容");
  197 + }
  198 +
  199 +
  200 + @PostMapping("/retReceive")
  201 + @ResponseBody
  202 + public ResponseBean retReceive(String ids, HttpSession session) {
  203 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  204 + String userId = sessionUser.getUserId();
  205 + Integer n = contentService.retReceive(ids, userId);
  206 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "退领了" + n + "条内容");
  207 + }
  208 +
  209 +
  210 +}
... ...
src/main/java/com/cnlive/shenhe/entity/ShyContent.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import java.util.Date;
  4 +import javax.persistence.*;
  5 +
  6 +@Table(name = "shy_content")
  7 +public class ShyContent {
  8 + @Id
  9 + private Integer id;
  10 +
  11 + /**
  12 + * 内容ID(发布云)
  13 + */
  14 + private String content_id;
  15 +
  16 + /**
  17 + * spId
  18 + */
  19 + private Integer sp_id;
  20 +
  21 + /**
  22 + * 内容标题
  23 + */
  24 + private String title;
  25 +
  26 + /**
  27 + * 标题图片
  28 + */
  29 + private String title_image;
  30 +
  31 + /**
  32 + * 图文标签
  33 + */
  34 + private String content_tag;
  35 +
  36 + /**
  37 + * 图文发布的url
  38 + */
  39 + private String content_url;
  40 +
  41 + /**
  42 + * 审核类型,1:免审,2:机审,3:人工审
  43 + */
  44 + private Integer shenhe_type;
  45 +
  46 + /**
  47 + * 内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  48 + */
  49 + private Integer content_status;
  50 +
  51 + /**
  52 + * 回调地址
  53 + */
  54 + private String callback;
  55 +
  56 + /**
  57 + * 来源
  58 + */
  59 + private String source;
  60 +
  61 + /**
  62 + * 作者
  63 + */
  64 + private String author;
  65 +
  66 + /**
  67 + * 创建时间
  68 + */
  69 + private Date create_date;
  70 +
  71 + /**
  72 + * 最后一次更新时间
  73 + */
  74 + private Date last_update;
  75 +
  76 + /**
  77 + * 领取状态。0:未领取;1:已领取,2:已审核
  78 + */
  79 + private Integer receive_status;
  80 +
  81 + /**
  82 + * 审核人id
  83 + */
  84 + private String auditor_id;
  85 +
  86 + /**
  87 + * 更新人名称
  88 + */
  89 + private String updater;
  90 +
  91 + /**
  92 + * 审核意见
  93 + */
  94 + private String shenhe_msg;
  95 +
  96 + /**
  97 + * sp名称
  98 + */
  99 + @Transient
  100 + private String sp_desc;
  101 +
  102 + /**
  103 + * @return id
  104 + */
  105 + public Integer getId() {
  106 + return id;
  107 + }
  108 +
  109 + /**
  110 + * @param id
  111 + */
  112 + public void setId(Integer id) {
  113 + this.id = id;
  114 + }
  115 +
  116 + /**
  117 + * 获取内容ID(发布云)
  118 + *
  119 + * @return content_id - 内容ID(发布云)
  120 + */
  121 + public String getContent_id() {
  122 + return content_id;
  123 + }
  124 +
  125 + /**
  126 + * 设置内容ID(发布云)
  127 + *
  128 + * @param content_id 内容ID(发布云)
  129 + */
  130 + public void setContent_id(String content_id) {
  131 + this.content_id = content_id;
  132 + }
  133 +
  134 + /**
  135 + * 获取spId
  136 + *
  137 + * @return sp_id - spId
  138 + */
  139 + public Integer getSp_id() {
  140 + return sp_id;
  141 + }
  142 +
  143 + /**
  144 + * 设置spId
  145 + *
  146 + * @param sp_id spId
  147 + */
  148 + public void setSp_id(Integer sp_id) {
  149 + this.sp_id = sp_id;
  150 + }
  151 +
  152 + /**
  153 + * 获取内容标题
  154 + *
  155 + * @return title - 内容标题
  156 + */
  157 + public String getTitle() {
  158 + return title;
  159 + }
  160 +
  161 + /**
  162 + * 设置内容标题
  163 + *
  164 + * @param title 内容标题
  165 + */
  166 + public void setTitle(String title) {
  167 + this.title = title;
  168 + }
  169 +
  170 + /**
  171 + * 获取标题图片
  172 + *
  173 + * @return title_image - 标题图片
  174 + */
  175 + public String getTitle_image() {
  176 + return title_image;
  177 + }
  178 +
  179 + /**
  180 + * 设置标题图片
  181 + *
  182 + * @param title_image 标题图片
  183 + */
  184 + public void setTitle_image(String title_image) {
  185 + this.title_image = title_image;
  186 + }
  187 +
  188 + /**
  189 + * 获取图文标签
  190 + *
  191 + * @return content_tag - 图文标签
  192 + */
  193 + public String getContent_tag() {
  194 + return content_tag;
  195 + }
  196 +
  197 + /**
  198 + * 设置图文标签
  199 + *
  200 + * @param content_tag 图文标签
  201 + */
  202 + public void setContent_tag(String content_tag) {
  203 + this.content_tag = content_tag;
  204 + }
  205 +
  206 + /**
  207 + * 获取图文发布的url
  208 + *
  209 + * @return content_url - 图文发布的url
  210 + */
  211 + public String getContent_url() {
  212 + return content_url;
  213 + }
  214 +
  215 + /**
  216 + * 设置图文发布的url
  217 + *
  218 + * @param content_url 图文发布的url
  219 + */
  220 + public void setContent_url(String content_url) {
  221 + this.content_url = content_url;
  222 + }
  223 +
  224 + /**
  225 + * 获取内容类型:0:免审,1:机审,2:人工审
  226 + *
  227 + * @return shenhe_type - 内容类型:0:免审,1:机审,2:人工审
  228 + */
  229 + public Integer getShenhe_type() {
  230 + return shenhe_type;
  231 + }
  232 +
  233 + /**
  234 + * 设置内容类型:0:免审,1:机审,2:人工审
  235 + *
  236 + * @param shenhe_type 内容类型:0:免审,1:机审,2:人工审
  237 + */
  238 + public void setShenhe_type(Integer shenhe_type) {
  239 + this.shenhe_type = shenhe_type;
  240 + }
  241 +
  242 + /**
  243 + * 获取内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  244 + *
  245 + * @return content_status - 内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  246 + */
  247 + public Integer getContent_status() {
  248 + return content_status;
  249 + }
  250 +
  251 + /**
  252 + * 设置内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  253 + *
  254 + * @param content_status 内容状态:0:待发布,1:已发布,2:已下线,3:已删除
  255 + */
  256 + public void setContent_status(Integer content_status) {
  257 + this.content_status = content_status;
  258 + }
  259 +
  260 + /**
  261 + * 获取回调地址
  262 + *
  263 + * @return callback - 回调地址
  264 + */
  265 + public String getCallback() {
  266 + return callback;
  267 + }
  268 +
  269 + /**
  270 + * 设置回调地址
  271 + *
  272 + * @param callback 回调地址
  273 + */
  274 + public void setCallback(String callback) {
  275 + this.callback = callback;
  276 + }
  277 +
  278 + /**
  279 + * 获取来源
  280 + *
  281 + * @return source - 来源
  282 + */
  283 + public String getSource() {
  284 + return source;
  285 + }
  286 +
  287 + /**
  288 + * 设置来源
  289 + *
  290 + * @param source 来源
  291 + */
  292 + public void setSource(String source) {
  293 + this.source = source;
  294 + }
  295 +
  296 + /**
  297 + * 获取作者
  298 + *
  299 + * @return author - 作者
  300 + */
  301 + public String getAuthor() {
  302 + return author;
  303 + }
  304 +
  305 + /**
  306 + * 设置作者
  307 + *
  308 + * @param author 作者
  309 + */
  310 + public void setAuthor(String author) {
  311 + this.author = author;
  312 + }
  313 +
  314 + /**
  315 + * 获取创建时间
  316 + *
  317 + * @return create_date - 创建时间
  318 + */
  319 + public Date getCreate_date() {
  320 + return create_date;
  321 + }
  322 +
  323 + /**
  324 + * 设置创建时间
  325 + *
  326 + * @param create_date 创建时间
  327 + */
  328 + public void setCreate_date(Date create_date) {
  329 + this.create_date = create_date;
  330 + }
  331 +
  332 + /**
  333 + * 获取最后一次更新时间
  334 + *
  335 + * @return last_update - 最后一次更新时间
  336 + */
  337 + public Date getLast_update() {
  338 + return last_update;
  339 + }
  340 +
  341 + /**
  342 + * 设置最后一次更新时间
  343 + *
  344 + * @param last_update 最后一次更新时间
  345 + */
  346 + public void setLast_update(Date last_update) {
  347 + this.last_update = last_update;
  348 + }
  349 +
  350 + /**
  351 + * 获取领取状态。0:未领取;1:已领取,2:已审核
  352 + *
  353 + * @return receive_status - 领取状态。0:未领取;1:已领取,2:已审核
  354 + */
  355 + public Integer getReceive_status() {
  356 + return receive_status;
  357 + }
  358 +
  359 + /**
  360 + * 设置领取状态。0:未领取;1:已领取,2:已审核
  361 + *
  362 + * @param receive_status 领取状态。0:未领取;1:已领取,2:已审核
  363 + */
  364 + public void setReceive_status(Integer receive_status) {
  365 + this.receive_status = receive_status;
  366 + }
  367 +
  368 + /**
  369 + * 获取审核人id
  370 + *
  371 + * @return auditor_id - 审核人id
  372 + */
  373 + public String getAuditor_id() {
  374 + return auditor_id;
  375 + }
  376 +
  377 + /**
  378 + * 设置审核人id
  379 + *
  380 + * @param auditor_id 审核人id
  381 + */
  382 + public void setAuditor_id(String auditor_id) {
  383 + this.auditor_id = auditor_id;
  384 + }
  385 +
  386 + /**
  387 + * 获取更新人名称
  388 + *
  389 + * @return updater - 更新人名称
  390 + */
  391 + public String getUpdater() {
  392 + return updater;
  393 + }
  394 +
  395 + /**
  396 + * 设置更新人名称
  397 + *
  398 + * @param updater 更新人名称
  399 + */
  400 + public void setUpdater(String updater) {
  401 + this.updater = updater;
  402 + }
  403 +
  404 + /**
  405 + * 获取审核意见
  406 + *
  407 + * @return shenhe_msg - 审核意见
  408 + */
  409 + public String getShenhe_msg() {
  410 + return shenhe_msg;
  411 + }
  412 +
  413 + /**
  414 + * 设置审核意见
  415 + *
  416 + * @param shenhe_msg 审核意见
  417 + */
  418 + public void setShenhe_msg(String shenhe_msg) {
  419 + this.shenhe_msg = shenhe_msg;
  420 + }
  421 +
  422 + public String getSp_desc() {
  423 + return sp_desc;
  424 + }
  425 +
  426 + public void setSp_desc(String sp_desc) {
  427 + this.sp_desc = sp_desc;
  428 + }
  429 +
  430 +}
0 431 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/job/ContentJob.java 0 → 100644
  1 +package com.cnlive.shenhe.job;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyContent;
  4 +import com.cnlive.shenhe.entity.ShyVideos;
  5 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  6 +import com.cnlive.shenhe.serviceImpl.ContentServiceImpl;
  7 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
  8 +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
  9 +import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
  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 ContentJob {
  24 + private static Logger logger = LoggerFactory.getLogger(ContentJob.class);
  25 + @Autowired
  26 + SitesServiceImpl sitesService;
  27 + @Autowired
  28 + AuditPass Pass;
  29 + @Autowired
  30 + CommentsServiceImpl commentsService;
  31 + @Autowired
  32 + UsersServiceImpl usersService;
  33 + @Autowired
  34 + VideosServiceImpl videosService;
  35 + @Autowired
  36 + ContentServiceImpl contentService;
  37 +
  38 +
  39 + /**
  40 + * 白名单sp图文通过
  41 + */
  42 +// @Scheduled(fixedRate = 60 * 1000)
  43 + public void updateVideos() {
  44 + ShyContent shyContent = new ShyContent();
  45 + shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);// 审核类型为免审
  46 + shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);// 领取状态为未领取
  47 + List<ShyContent> shyContentList = contentService.findshyContent(shyContent);
  48 + if (shyContentList.size() > 0) {
  49 + for (ShyContent content : shyContentList) {
  50 + logger.info("当前白名单通过的content_id:"+content.getId());
  51 + content.setUpdater("白名单");
  52 + // 更新点播和审核的视频状态
  53 + contentService.updateState(content.getId()+"","白名单审核通过", 1,"");
  54 + }
  55 + }
  56 + }
  57 +
  58 + /**
  59 + * 定时发送数美检测视频
  60 + */
  61 +// @Scheduled(cron="0 0/1 10-23 * * ? ")//每天10点到23点执行,每分钟一次
  62 + public void videofilter() {
  63 + ShyContent shyContent = new ShyContent();
  64 + shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);//审核类型为机审
  65 + shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);//待审核状态
  66 + List<ShyContent> shyContentList = contentService.findshyContent(shyContent);
  67 + if (shyContentList.size() > 0) {
  68 + for (ShyContent content : shyContentList) {
  69 + logger.info("定时发送数美检测的content_id:"+content.getId());
  70 + //数美图片过滤
  71 +// videosService.videoFilter(video.getId(),CommonConst.DYNAMIC_USER);
  72 + }
  73 + }
  74 + }
  75 +
  76 +
  77 + /**
  78 + * 自动退领
  79 + */
  80 + @Scheduled(cron="0 0 0 * * ? ")//每天0点执行
  81 + public void autoRetReceive() {
  82 + logger.info("图文自动退领的进入.....");
  83 + ShyContent shyContent = new ShyContent();
  84 + shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);//领取状态为,已领
  85 + List<ShyContent> shyContentList = contentService.findshyContent(shyContent);
  86 + if(shyContentList.size()>0){
  87 + for (ShyContent shyContent2 : shyContentList) {
  88 + logger.info("自动退领的content_id:"+shyContent2.getId());
  89 + shyContent2.setReceive_status(CommonConst.RECEIVE_BEFORE);//未领取
  90 + shyContent2.setAuditor_id(null);
  91 + contentService.updateshyContent(shyContent2);
  92 + }
  93 + }
  94 + }
  95 +
  96 +}
... ...
src/main/java/com/cnlive/shenhe/mapper/ShyContentMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyContent;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface ShyContentMapper extends Mapper<ShyContent> {
  7 +}
0 8 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.entity.ShyComments;
  5 +import com.cnlive.shenhe.entity.ShyContent;
  6 +import com.cnlive.shenhe.entity.ShySites;
  7 +import com.cnlive.shenhe.entity.ShyUsers;
  8 +import com.cnlive.shenhe.entity.ShyVideos;
  9 +import com.cnlive.shenhe.mapper.ShyCommentsMapper;
  10 +import com.cnlive.shenhe.mapper.ShyContentMapper;
  11 +import com.cnlive.shenhe.mapper.ShySitesMapper;
  12 +import com.cnlive.shenhe.mapper.ShyUsersMapper;
  13 +import com.cnlive.shenhe.utils.AuditPass;
  14 +import com.cnlive.shenhe.utils.CommonConst;
  15 +import com.cnlive.shenhe.utils.CommonUtils;
  16 +import com.github.pagehelper.PageHelper;
  17 +import com.github.pagehelper.PageInfo;
  18 +import org.apache.ibatis.session.RowBounds;
  19 +import org.slf4j.Logger;
  20 +import org.slf4j.LoggerFactory;
  21 +import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.stereotype.Service;
  23 +import tk.mybatis.mapper.entity.Example;
  24 +
  25 +import java.util.Date;
  26 +import java.util.List;
  27 +
  28 +/**
  29 + * @Auther: chenhao
  30 + * @Date: 2018/12/4 17:30
  31 + * @Description:
  32 + */
  33 +@Service
  34 +public class ContentServiceImpl {
  35 +
  36 + private static Logger logger = LoggerFactory.getLogger(ContentServiceImpl.class);
  37 + @Autowired
  38 + ShyCommentsMapper shyCommentsMapper;
  39 + @Autowired
  40 + ShyContentMapper shyContentMapper;
  41 + @Autowired
  42 + ShySitesMapper shySitesMapper;
  43 + @Autowired
  44 + ShyUsersMapper shyUsersMapper;
  45 + @Autowired
  46 + AuditPass Pass;
  47 + @Autowired
  48 + SitesServiceImpl sitesService;
  49 +
  50 + public List<ShySites> getBusiness(ShySites shySites) {
  51 + List<ShySites> sitesList = shySitesMapper.select(shySites);
  52 + return sitesList;
  53 + }
  54 +
  55 + //**************************************
  56 + public List<ShyContent> findshyContent(ShyContent shyContent) {
  57 +
  58 + return shyContentMapper.selectByRowBounds(shyContent, new RowBounds(0, 100));
  59 + }
  60 +
  61 + //***************************
  62 + public boolean updateshyContent(ShyContent shyContent) {
  63 + int result = shyContentMapper.updateByPrimaryKey(shyContent);
  64 + if (result == 0) {
  65 + return false;
  66 + }
  67 + return true;
  68 + }
  69 +
  70 + //***************************
  71 + public boolean impotContent(ShyContent shyContent) {
  72 + int result = shyContentMapper.insertSelective(shyContent);
  73 + if (result == 0) {
  74 + return false;
  75 + }
  76 + return true;
  77 + }
  78 +
  79 + public int updateComment(Integer id, Integer state, String msg) {
  80 + ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id);
  81 + shyComments.setState(state);
  82 + shyComments.setMsg(msg);
  83 + return shyCommentsMapper.updateByPrimaryKeySelective(shyComments);
  84 + }
  85 +
  86 + public PageInfo<ShyContent> getPage( String title, Date start_date, Date end_date, Integer receive_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) {
  87 + Example example = new Example(ShyContent.class);
  88 + Example.Criteria criteria = example.createCriteria();
  89 + if (CommonUtils.isNotEmpty(orderByClause)) {
  90 + example.setOrderByClause(orderByClause);
  91 + } else {
  92 + example.setOrderByClause("create_date desc");
  93 + }
  94 + if (CommonUtils.isNotNull(start_date) && CommonUtils.isNotNull(end_date)) {
  95 + criteria.andGreaterThanOrEqualTo("create_date", start_date);
  96 + criteria.andLessThanOrEqualTo("create_date", end_date);
  97 + }
  98 + if (CommonUtils.isNotEmpty(title)) {
  99 + criteria.andLike("title", "%" + title + "%");
  100 + }
  101 + if (CommonUtils.isNotEmpty(updater)) {
  102 + criteria.andEqualTo("updater", updater);
  103 + }
  104 + if (CommonUtils.isNotNull(spid)) {
  105 + criteria.andEqualTo("spid", spid);
  106 + }
  107 +// if (CommonUtils.isNotNull(is_hot)) {
  108 +// criteria.andEqualTo("is_hot", is_hot);
  109 +// }
  110 +// if (CommonUtils.isNotEmpty(activity_id)) {
  111 +// criteria.andLike("auditor_id", "%" + activity_id + "%");
  112 +// }
  113 + if (CommonUtils.isNotNull(receive_status)) {
  114 + criteria.andEqualTo("receive_status", receive_status);
  115 + if (receive_status!=CommonConst.RECEIVE_BEFORE) {
  116 + criteria.andEqualTo("auditor_id", userId);
  117 + }
  118 + }
  119 +
  120 +// if (CommonUtils.isNotEmpty(states)) {
  121 +// Example.Criteria criteria1 = example.createCriteria();
  122 +// String[] stas = states.split(",");
  123 +// for (String s : stas) {
  124 +// criteria1.orEqualTo("state", Integer.parseInt(s));
  125 +// }
  126 +// example.and(criteria1);
  127 +// }
  128 +
  129 + PageHelper.startPage(page, pageSize, true);
  130 + List<ShyContent> contentList = shyContentMapper.selectByExample(example);
  131 + PageInfo<ShyContent> pageInfo = new PageInfo<>(contentList);
  132 + return pageInfo;
  133 + }
  134 +
  135 + //******************************
  136 + public ShyContent getDetailsContent(Integer id) {
  137 + ShyContent content = shyContentMapper.selectByPrimaryKey(id);
  138 + if (content.getReceive_status() == CommonConst.RECEIVE_AUDIT) {
  139 + String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater())? "白名单":content.getUpdater();
  140 + String auditor_id = content.getAuditor_id();
  141 + if (CommonUtils.isNotEmpty(auditor_id)) {
  142 + ShyUsers user = new ShyUsers();
  143 + user.setUser_id(auditor_id);
  144 + user = shyUsersMapper.selectOne(user);
  145 + String email = CommonUtils.isEmpty(user.getEmail())|| "null".equals(user.getEmail()) ? "" : user.getEmail();
  146 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  147 + updater = userName ;
  148 + }
  149 + content.setUpdater(updater);
  150 + }
  151 + ShySites shySite=sitesService.findspidDescByspid(content.getSp_id());
  152 + if(CommonUtils.isNotNull(shySite)){
  153 + content.setSp_desc(shySite.getName());
  154 + }
  155 + return content;
  156 + }
  157 +
  158 + //**********************
  159 + public boolean updateState(String ids,String msg, Integer state, String userId) {
  160 + boolean success = true;
  161 + String[] contentIds = ids.split(",");
  162 + for (String contentId : contentIds) {
  163 + ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId));
  164 + JSONObject json = new JSONObject();
  165 + json.put("auditor_id", content.getAuditor_id());
  166 + json.put("state", state);
  167 + json.put("attr_tags", "");
  168 + json.put("msg", msg);
  169 +// JSONObject result = new JSONObject();
  170 +// try {
  171 +// result = Pass.commentPass(json, content.getCallback());
  172 +// } catch (Exception e) {
  173 +// logger.error("评论回调失败,auditor_id:{}", content.getAuditor_id());
  174 +// success = false;
  175 +// break;
  176 +// }
  177 +// if (result == null) {
  178 +// logger.error("评论回调错误,且无返回信息。auditor_id:{}", content.getAuditor_id());
  179 +// success = false;
  180 +// break;
  181 +// } else {
  182 +// Integer code = result.getInteger("errorCode");
  183 +// if (code != 0) {
  184 +// logger.error("评论回调错误,auditor_id:{},errorCode:{},errorMessage:{}", content.getAuditor_id(), code, result.getString("errorMessage"));
  185 +// success = false;
  186 +// break;
  187 +// }
  188 + content.setContent_status(state);//设置图文状态为审核后的状态
  189 + content.setReceive_status(CommonConst.RECEIVE_AUDIT);//领取状态为已审核
  190 + content.setShenhe_msg(msg);//设置审核消息
  191 + if(CommonUtils.isNotEmpty(userId)){
  192 + content.setAuditor_id(userId);
  193 + content.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//设置审核类型为人工
  194 + }
  195 + int i = shyContentMapper.updateByPrimaryKeySelective(content);
  196 + if (i != 1) {
  197 + success = false;
  198 + }
  199 +// }
  200 +
  201 + }
  202 + return success;
  203 + }
  204 +
  205 + //**********************************
  206 + public Integer receive(String ids, Integer num, String userId, Integer spid) {
  207 + Integer n = 0;
  208 + if (CommonUtils.isNotEmpty(ids)) {
  209 + String[] cids = ids.split(",");
  210 + for (String cid : cids) {
  211 + ShyContent shyContent = shyContentMapper.selectByPrimaryKey(Integer.parseInt(cid));
  212 + if (CommonUtils.isNotNull(shyContent) && shyContent.getReceive_status() == CommonConst.RECEIVE_BEFORE ) {
  213 + shyContent.setAuditor_id(userId);
  214 + shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);
  215 + shyContentMapper.updateByPrimaryKeySelective(shyContent);
  216 + n++;
  217 + }
  218 + }
  219 + } else if (CommonUtils.isNotNull(num) && num > 0) {
  220 + Example example = new Example(ShyContent.class);
  221 + example.setOrderByClause("create_date desc");
  222 + example.and().andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE);
  223 +// example.and().andEqualTo("receive", CommonConst.RECEIVE_AFTER);
  224 + if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid);
  225 + List<ShyContent> shyContentList = shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num));
  226 + if (!shyContentList.isEmpty()) {
  227 + for (ShyContent shyContent : shyContentList) {
  228 + shyContent.setAuditor_id(userId);
  229 + shyContent.setReceive_status(CommonConst.RECEIVE_AFTER);
  230 + shyContentMapper.updateByPrimaryKeySelective(shyContent);
  231 + n++;
  232 + }
  233 + }
  234 + }
  235 + return n;
  236 + }
  237 +
  238 + //***************************************
  239 + public Integer retReceive(String ids, String userId) {
  240 + Integer n = 0;
  241 + String[] cids = ids.split(",");
  242 + for (String cid : cids) {
  243 + ShyContent shyContent = shyContentMapper.selectByPrimaryKey(Integer.parseInt(cid));
  244 + if (shyContent.getReceive_status() == CommonConst.RECEIVE_AFTER && userId.equals(shyContent.getAuditor_id())) {
  245 + shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);
  246 + shyContent.setAuditor_id(null);
  247 + int i = shyContentMapper.updateByPrimaryKeySelective(shyContent);
  248 + if (i == 1) n++;
  249 + }
  250 + }
  251 + return n;
  252 + }
  253 + //**************************************
  254 + public ShyContent selectByPrimaryKey(Integer id) {
  255 + ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id);
  256 + return shyContent;
  257 + }
  258 + public int updateByPrimaryKeySelective(ShyContent content) {
  259 + return shyContentMapper.updateByPrimaryKeySelective(content);
  260 + }
  261 +
  262 +}
  263 +
  264 +
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
1 1 package com.cnlive.shenhe.serviceImpl;
2 2  
3 3 import com.cnlive.shenhe.entity.ShySites;
  4 +import com.cnlive.shenhe.entity.ShyUsers;
4 5 import com.cnlive.shenhe.mapper.ShySitesMapper;
5 6 import com.cnlive.shenhe.utils.CommonConst;
6 7 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -23,6 +24,8 @@ import java.util.List;
23 24 public class SitesServiceImpl {
24 25 @Autowired
25 26 ShySitesMapper shySitesMapper;
  27 + @Autowired
  28 + UsersServiceImpl usersService;
26 29  
27 30 public PageInfo<ShySites> getPage(Integer page, Integer pageSize, String orderByClause, String key, Integer spId) {
28 31 Example example = new Example(ShySites.class);
... ... @@ -98,4 +101,18 @@ public class SitesServiceImpl {
98 101 return sites;
99 102 }
100 103  
  104 + public String getUpdater(String updater,String auditor_id){
  105 +
  106 + if (CommonUtils.isNotEmpty(auditor_id)) {
  107 + ShyUsers user = new ShyUsers();
  108 + user.setUser_id(auditor_id);
  109 + user = usersService.select(user);
  110 + if (CommonUtils.isNotNull(user)) {
  111 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
  112 + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
  113 + updater = userName ;
  114 + }
  115 + }
  116 + return updater;
  117 + }
101 118 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -108,6 +108,7 @@ public class VideosServiceImpl {
108 108 if(CommonUtils.isNotEmpty(auditor_id)){
109 109 shyVideos.setReceive(CommonConst.RECEIVE_AFTER);
110 110 shyVideos.setReceive_user_id(auditor_id);
  111 + shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER);
111 112 }
112 113 return shyVideosMapper.updateByPrimaryKey(shyVideos);
113 114 }
... ...
src/main/resources/mapper/ShyContentMapper.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.ShyContentMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyContent">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="content_id" jdbcType="VARCHAR" property="content_id" />
  10 + <result column="sp_id" jdbcType="INTEGER" property="sp_id" />
  11 + <result column="title" jdbcType="VARCHAR" property="title" />
  12 + <result column="title_image" jdbcType="VARCHAR" property="title_image" />
  13 + <result column="content_tag" jdbcType="VARCHAR" property="content_tag" />
  14 + <result column="content_url" jdbcType="VARCHAR" property="content_url" />
  15 + <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type" />
  16 + <result column="content_status" jdbcType="INTEGER" property="content_status" />
  17 + <result column="callback" jdbcType="VARCHAR" property="callback" />
  18 + <result column="source" jdbcType="VARCHAR" property="source" />
  19 + <result column="author" jdbcType="VARCHAR" property="author" />
  20 + <result column="create_date" jdbcType="TIMESTAMP" property="create_date" />
  21 + <result column="last_update" jdbcType="TIMESTAMP" property="last_update" />
  22 + <result column="receive_status" jdbcType="INTEGER" property="receive_status" />
  23 + <result column="auditor_id" jdbcType="VARCHAR" property="auditor_id" />
  24 + <result column="updater" jdbcType="VARCHAR" property="updater" />
  25 + <result column="shenhe_msg" jdbcType="VARCHAR" property="shenhe_msg" />
  26 + </resultMap>
  27 +</mapper>
0 28 \ No newline at end of file
... ...
src/main/resources/templates/common/frame.html
... ... @@ -62,7 +62,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
62 62 <ul class="treeview-menu">
63 63 <li class="active"><a href="/videos/page?state=0&receive=0" id="/videos/page"></i> 点播审核</a></li>
64 64 <li><a href="/comments/page?state=0&receive=0" id="/comments/page"> 评论审核</a></li>
65   -<!-- <li><a href="/content/page?state=0&receive=0" id="/content/page"> 图文审核</a></li> -->
  65 + <li><a href="/content/page?receive_status=0" id="/content/page"> 图文审核</a></li>
66 66 </ul>
67 67 </li>
68 68 <li class="treeview" th:if="${session.sessionUser.spid==0 or session.sessionUser.master}">
... ...
src/main/resources/templates/page/content.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +
  4 +<head th:replace="../templates/common/head::head">
  5 +</head>
  6 +
  7 +<body class="skin-blue sidebar-mini">
  8 +
  9 +<div class="wrapper">
  10 + <div th:replace="../templates/common/frame::frame"></div>
  11 + <div class="content-wrapper" style="min-height: 788px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 图文审核
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li>首页</li>
  18 + <li class="active">图文审核</li>
  19 + </ol>
  20 + </section>
  21 + <section class="content">
  22 + <div class="row">
  23 + <div class="col-md-12">
  24 + <div class="box box-info">
  25 + <div class="box-body">
  26 +
  27 + <div class="btn-group margin-bottom pull-left">
  28 + <input type="hidden" name="state" id="state" value=""/>
  29 + <div class="btn-group margin-bottom" id="hide_select_area_2" style=>
  30 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  31 + value="2" data="claim" id="claim" data-toggle="modal"
  32 + data-target="#modal" onclick="receive(0);">认领
  33 + </button>
  34 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  35 + value="2" data="claim100" id="claim100" data-toggle="modal"
  36 + data-target="#modal" onclick="receive(10);">认领10条
  37 + </button>
  38 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  39 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  40 + data-target="#modal" onclick="receive(100);">认领100条
  41 + </button>
  42 + <button type="button" class="btn btn-warning btn-sm margin-r-5 action claim"
  43 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  44 + data-target="#modal" onclick="retReceive();">退领
  45 + </button>
  46 + <button type="button" class="btn btn-danger btn-sm margin-r-5 action claim"
  47 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  48 + data-target="#modal" onclick="repulse();">拒绝
  49 + </button>
  50 + </div>
  51 + </div>
  52 +
  53 +
  54 + <div class="btn-group margin-bottom pull-right">
  55 + <button type="button" class="btn btn-success btn-sm margin-r-5 filter "
  56 + th:onclick="'javascript:daochu()'" value="" id="excel">
  57 + 导出excel
  58 + </button>
  59 + <button type="button" class="btn btn-sm margin-r-5 filter "
  60 + th:onclick="'javascript:quanbu()'" value="" id="quanbu">
  61 + 全部
  62 + </button>
  63 + </button>
  64 + <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen"
  65 + th:onclick="'javascript:daishen()'" value="0">全部待领
  66 + </button>
  67 + <button type="button" class="btn btn-sm margin-r-5 filter " id="Mydaishen"
  68 + th:onclick="'javascript:Mydaishen()'" value="0">我的待审
  69 + </button>
  70 + <button type="button" class="btn btn-sm margin-r-5 filter " id="yishen"
  71 + th:onclick="'javascript:yishen()'" value="1">我的已审
  72 + </button>
  73 + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
  74 + onclick="openOrClose(&#39;forms&#39;)">查询
  75 + <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
  76 + </button>
  77 + </div>
  78 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;">
  79 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 15%;float: left;">
  80 + <div class="col-md-5" style="padding: 0;width: 100%;">
  81 + <label for="video_titleID" class="control-label cb-toolbar">标题:</label>
  82 + <div class="col-sm-9" style="padding: 0;">
  83 + <input class="form-control" type="text" value="" id="video_titleID">
  84 + </div>
  85 + </div>
  86 + </div>
  87 +
  88 +<!-- <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 10%;float: left;"> -->
  89 +<!-- <div class="col-md-5" style="padding: 0;width: 100%;"> -->
  90 +<!-- <label for="video_priority" class="control-label cb-toolbar">热点:</label> -->
  91 +<!-- <div class="col-sm-8" style="padding: 0;"> -->
  92 +<!-- <select class="form-control" id="video_priority" name="video_priority"> -->
  93 +<!-- <option value="">全部</option> -->
  94 +<!-- <option value="1">是</option> -->
  95 +<!-- <option value="0">否</option> -->
  96 +<!-- </select> -->
  97 +<!-- <input class="form-control" name="video_priority" type="text" id="video_priority"> -->
  98 +<!-- </div> -->
  99 +<!-- </div> -->
  100 +<!-- </div> -->
  101 +
  102 + <div class="btn-group margin-bottom col-md-6 pull-right"
  103 + style="position: relative;width: 75%;float: left !important;">
  104 + <div class="col-md-18" style="width: 100%;padding: 0;">
  105 + <div class="col-md-10" style="padding: 0;width: 25%;">
  106 + <label for="start_date" class="control-label cb-toolbar">时间:</label>
  107 + <div class="input-group col-md-9 date">
  108 + <input class="form-control date" name="start_date" type="text"
  109 + id="start_date">
  110 + <span class="input-group-addon">
  111 + <span class="glyphicon glyphicon-calendar"></span>
  112 + </span>
  113 + </div>
  114 + </div>
  115 + <div class="col-md-10" style="padding: 0;width: 25%;">
  116 + <label for="start_date" class="control-label cb-toolbar">至</label>
  117 + <div class="input-group col-md-9 date">
  118 + <input class="form-control date" name="end_date" type="text"
  119 + id="end_date">
  120 + <span class="input-group-addon">
  121 + <span class="glyphicon glyphicon-calendar"></span>
  122 + </span>
  123 + </div>
  124 + </div>
  125 +
  126 + <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">
  127 + <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label>
  128 + <div class="col-sm-9" style="padding: 0;">
  129 + <input class="form-control" type="text" value="" id="sp_desc">
  130 + </div>
  131 + </div>
  132 + <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}">
  133 + <label for="count" class="control-label cb-toolbar">每页条数:</label>
  134 + <div class="col-sm-5" style="padding: 0;">
  135 + <input class="form-control" type="text" value="" id="count">
  136 + </div>
  137 + </div>
  138 + </div>
  139 + </div>
  140 +<!-- <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 1%;float: left;"> -->
  141 +<!-- <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;"> -->
  142 +<!-- <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询 -->
  143 +<!-- </button> -->
  144 +<!-- </div> -->
  145 +<!-- </div> -->
  146 + </div>
  147 +
  148 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  149 + <div class="fixed-table-body">
  150 + <table id="table" data-toggle="table" class="table table-hover table-striped"
  151 + style="margin-bottom: 0; ">
  152 + <thead>
  153 + <tr>
  154 + <th class="bs-checkbox " style="width: 5%; " data-field="state"
  155 + tabindex="0">
  156 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  157 + id="select_all">
  158 + </div>
  159 + <div class="fht-cell"></div>
  160 + </th>
  161 + <th style="text-align: center; width: 6%; " data-field="sp_id_brief"
  162 + tabindex="0">
  163 + <div class="th-inner ">sp简称</div>
  164 + <div class="fht-cell"></div>
  165 + </th>
  166 + <th style="text-align: center; width: 20%; " data-field="title"
  167 + tabindex="0">
  168 + <div class="th-inner ">标题</div>
  169 + <div class="fht-cell"></div>
  170 + </th>
  171 + <th style="text-align: center; width: 3%; " data-field="content_tag"
  172 + tabindex="0">
  173 + <div class="th-inner ">标签</div>
  174 + <div class="fht-cell"></div>
  175 + </th>
  176 + <th style="text-align: center; width: 3%; " data-field="content_status"
  177 + 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="receive_status"
  182 + tabindex="0">
  183 + <div class="th-inner ">审核状态</div>
  184 + <div class="fht-cell"></div>
  185 + </th>
  186 + <th style="text-align: center; width: 6%; " data-field="updater"
  187 + tabindex="0">
  188 + <div class="th-inner ">审核员</div>
  189 + <div class="fht-cell"></div>
  190 + </th>
  191 + <th style="text-align: center; width: 3%; " data-field="shenhe_type"
  192 + tabindex="0">
  193 + <div class="th-inner ">审核类型</div>
  194 + <div class="fht-cell"></div>
  195 + </th>
  196 +<!-- <th style="text-align: center; width: 10%; " data-field="upload_time" -->
  197 +<!-- tabindex="0"> -->
  198 +<!-- <div class="th-inner ">视频上传时间</div> -->
  199 +<!-- <div class="fht-cell"></div> -->
  200 +<!-- </th> -->
  201 + <th style="text-align: center; width: 10%; " data-field="created_at"
  202 + tabindex="0">
  203 + <div class="th-inner ">送审时间</div>
  204 + <div class="fht-cell"></div>
  205 + </th>
  206 + <th style="text-align: center; width: 17%; " data-field="action"
  207 + tabindex="0">
  208 + <div class="th-inner ">操作</div>
  209 + <div class="fht-cell"></div>
  210 + </th>
  211 + </tr>
  212 + </thead>
  213 + <tbody>
  214 + <tr data-index="0" th:each="content : ${contentPage.list}">
  215 + <td class="bs-checkbox ">
  216 + <input data-index="0" name="btSelectItem" type="checkbox" th:value="${content.id}"></td>
  217 + <td style="text-align: center; width: 6%;" th:text="${content.sp_desc}"></td>
  218 + <td style="text-align: center; width: 20%;" >
  219 + <a class="detail" th:href="@{'/content/details/?id='+${content.id}}">
  220 + <span th:text="${content.title}">邓建国正面PK冯小刚</span>
  221 + </a>
  222 + </td>
  223 + <td style="text-align: center; width: 3%;"
  224 + th:text="${content.content_tag}">图文
  225 + </td>
  226 + <td style="text-align: center; width: 3%;">
  227 + <span class="btn btn-sm btn-warning" th:if="${content.content_status==0}">待发布</span>
  228 + <span class="btn btn-sm btn-success" th:if="${content.content_status==1}">已发布</span>
  229 + <span class="btn btn-sm btn-danger" th:if="${content.content_status==2}">已下线</span>
  230 + <span class="btn btn-sm btn-danger" th:if="${content.content_status==3}">已删除</span>
  231 + </td>
  232 + <td style="text-align: center; width: 3%;">
  233 + <span th:if="${content.receive_status==0}">未领取</span>
  234 + <span th:if="${content.receive_status==1}">已领取</span>
  235 + <span th:if="${content.receive_status==2}">已审核</span>
  236 + </td>
  237 + <td style="text-align: center; width: 6%;" th:text="${content.updater}">审核员
  238 + </td>
  239 + <td style="text-align: center; width: 3%;">
  240 + <span th:if="${content.shenhe_type==1}">免审</span>
  241 + <span th:if="${content.shenhe_type==2}">机审</span>
  242 + <span th:if="${content.shenhe_type==3}">人工审</span>
  243 + </td>
  244 + <td style="text-align: center; width: 10%;"
  245 + th:text="${#dates.format(content.create_date, 'yyyy-MM-dd HH:mm:ss')}">
  246 + 2018-03-07 16:56:20
  247 + </td>
  248 + <td style="text-align: center; width: 17%;">
  249 + <a class="detail" th:href="@{'/content/details/'+${content.id}}">
  250 + <!--th:if="${ (video.receive==true and session.sessionUser.userId==video.receive_user_id) or (video.state==1 or video.state==2) }"-->
  251 + <button class="btn btn-info btn-sm" >查看</button>
  252 + </a>
  253 + <span th:if="${content.receive_status==0 }"> &nbsp;</span>
  254 + <a th:href="@{'javascript:applyReceive('+${content.id}+')'}"
  255 + th:if="${content.receive_status==0}">
  256 + <button class="btn btn-primary btn-sm">认领</button>
  257 + </a>
  258 + <span th:if="${content.receive_status==1 and session.sessionUser.userId==content.auditor_id}"> &nbsp;</span>
  259 + <a th:href="@{'javascript:applyRetReceive('+${content.id}+')'}"
  260 + th:if="${content.receive_status==1 and session.sessionUser.userId==content.auditor_id}">
  261 + <button class="btn btn-warning btn-sm">退领</button>
  262 + </a>
  263 + </td>
  264 + </tr>
  265 + </tbody>
  266 + </table>
  267 + </div>
  268 +
  269 +
  270 + <!--分页处理-->
  271 + <div class="fixed-table-pagination" style="display: block;">
  272 + <div class="pull-left pagination-detail"><span class="pagination-info"
  273 + th:text="'共 '+${contentPage.total}+' 条记录'">共 0 条记录</span>
  274 + </div>
  275 + <div class="pull-right pagination">
  276 + <ul class="pagination" th:if="${contentPage.pages>1}">
  277 + <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li>
  278 + <li class="page-pre" th:if="${!contentPage.isFirstPage}"><a
  279 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum-1}+'\');'">‹</a>
  280 + </li>
  281 +
  282 + <li class="page-number" th:if="${contentPage.pageNum-3>=1}"><a
  283 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum-3}+'\');'"
  284 + th:text="${contentPage.pageNum-3}">2</a></li>
  285 + <li class="page-number" th:if="${contentPage.pageNum-2>=1}"><a
  286 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum-2}+'\');'"
  287 + th:text="${contentPage.pageNum-2}">2</a></li>
  288 + <li class="page-number" th:if="${contentPage.pageNum-1>=1}"><a
  289 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum-1}+'\');'"
  290 + th:text="${contentPage.pageNum-1}">2</a></li>
  291 + <li class="page-number active"><a href="javaScript:void(0);"
  292 + th:text="${contentPage.pageNum}">2</a></li>
  293 + <li class="page-number" th:if="${contentPage.pageNum+1<=contentPage.pages}"><a
  294 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum+1}+'\');'"
  295 + th:text="${contentPage.pageNum+1}">2</a></li>
  296 + <li class="page-number" th:if="${contentPage.pageNum+2<=contentPage.pages}"><a
  297 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum+2}+'\');'"
  298 + th:text="${contentPage.pageNum+2}">2</a></li>
  299 + <li class="page-number" th:if="${contentPage.pageNum+3<=contentPage.pages}"><a
  300 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum+3}+'\');'"
  301 + th:text="${contentPage.pageNum+3}">2</a></li>
  302 +
  303 + <li class="page-next" th:if="${!contentPage.isLastPage}"><a
  304 + th:onclick="'javascript:fanye(\''+${contentPage.pageNum+1}+'\');'">›</a>
  305 + </li>
  306 + <li class="page-next"><a
  307 + th:onclick="'javascript:fanye(\''+${contentPage.pages}+'\');'">››</a>
  308 + </li>
  309 + </ul>
  310 + </div>
  311 + </div>
  312 + </div>
  313 + </div>
  314 + </div>
  315 + </div>
  316 + </div>
  317 + </section>
  318 + </div>
  319 + <script th:inline="javascript">
  320 + $(function () {
  321 + //按钮颜色设置
  322 + var receive_status = [[${param.receive_status}]] ? [[${param.receive_status}]][0] : null;
  323 +// var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
  324 + var stateIsNull = $.trim(state) == "";
  325 +// var receiveIsNull = $.trim(receive) == "";
  326 + if (stateIsNull) {
  327 + $("#quanbu").addClass("btn-info");
  328 + } else if (receive_status == '0') {
  329 + $("#daishen").addClass("btn-warning");
  330 + } else if ( receive_status == '1') {
  331 + $("#Mydaishen").addClass("btn-success");
  332 + } else if ( receive_status == '2') {
  333 + $("#yishen").addClass("btn-danger");
  334 + }
  335 +
  336 + })
  337 +
  338 + //翻页函数
  339 + function fanye(page) {
  340 + var param = location.search;
  341 + if (param.indexOf("page=") != -1) {
  342 + if (page < 10) {
  343 + param = param.substring(1, param.length - 7);
  344 + } else if (page < 100) {
  345 + param = param.substring(1, param.length - 8);
  346 + } else if (page < 1000) {
  347 + param = param.substring(1, param.length - 9);
  348 + } else if (page < 10000) {
  349 + param = param.substring(1, param.length - 10);
  350 + }
  351 + window.location.href = "/content/page?" + param + "&page=" + page;
  352 + } else {
  353 + param = param.substring(1, param.length);
  354 + window.location.href = "/content/page?" + param + "&page=" + page;
  355 + }
  356 + }
  357 +
  358 + //导出excel
  359 + function daochu() {
  360 + var param = location.search;
  361 + window.location.href = "/content/excel" + param;
  362 + }
  363 +
  364 + //全部
  365 + function quanbu() {
  366 +// var video_priority = $("#video_priority").val();
  367 + var title = $("#video_titleID").val();
  368 + var start_date = $("#start_date").val();
  369 + var end_date = $("#end_date").val();
  370 + var sp_desc = $("#sp_desc").val();
  371 + var count = $("#count").val();
  372 +// window.location.href = "/videos/page?video_title=&start_date=&end_date=&state=&receive=&video_priority=";
  373 + window.location.href = "/content/page?title=" + title + "&start_date=" + start_date + "&end_date=" + end_date + "&sp_desc=" + sp_desc+"&pageSize="+count;
  374 + }
  375 +
  376 + //全部待领
  377 + $('#daishen').click(function () {
  378 + var receive_status = 0;
  379 +// var receive = 0;
  380 +// var video_priority = $("#video_priority").val();
  381 + var title = $("#video_titleID").val();
  382 + var start_date = $("#start_date").val();
  383 + var end_date = $("#end_date").val();
  384 + var sp_desc = $("#sp_desc").val();
  385 + var count = $("#count").val();
  386 + window.location.href = "/content/page?title=" + title + "&start_date=" + start_date + "&end_date=" + end_date + "&receive_status=" + receive_status + "&sp_desc=" + sp_desc+"&pageSize="+count;
  387 + });
  388 + //我的待审核
  389 + $('#Mydaishen').click(function () {
  390 + var receive_status = 1;
  391 +// var receive = 1;
  392 +// var video_priority = $("#video_priority").val();
  393 + var title = $("#video_titleID").val();
  394 + var start_date = $("#start_date").val();
  395 + var end_date = $("#end_date").val();
  396 + var sp_desc = $("#sp_desc").val();
  397 + var count = $("#count").val();
  398 + window.location.href = "/content/page?title=" + title + "&start_date=" + start_date + "&end_date=" + end_date + "&receive_status=" + receive_status + "&sp_desc=" + sp_desc+"&pageSize="+count;
  399 + });
  400 + //我的已审核
  401 + $('#yishen').click(function () {
  402 + var receive_status = 2;
  403 +// var receive = 1;
  404 +// var video_priority = $("#video_priority").val();
  405 + var title = $("#video_titleID").val();
  406 + var start_date = $("#start_date").val();
  407 + var end_date = $("#end_date").val();
  408 + var sp_desc = $("#sp_desc").val();
  409 + var count = $("#count").val();
  410 + window.location.href = "/content/page?title=" + title + "&start_date=" + start_date + "&end_date=" + end_date + "&receive_status=" + receive_status + "&sp_desc=" + sp_desc+"&pageSize="+count;
  411 + });
  412 +
  413 +
  414 + //查询
  415 + $('#videos_query').click(function () {
  416 +// var video_priority = $("#video_priority").val();
  417 + var title = $("#video_titleID").val();
  418 + var start_date = $("#start_date").val();
  419 + var end_date = $("#end_date").val();
  420 + var sp_desc = $("#sp_desc").val();
  421 + var count = $("#count").val();
  422 + window.location.href = "/content/page?title=" + title + "&start_date=" + start_date + "&end_date=" + end_date + "&receive_status=" + "&sp_desc=" + sp_desc+"&pageSize="+count;
  423 + });
  424 + /*全选的操作*/
  425 + $('#select_all').click(function () {
  426 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  427 + $("#select_all").prop('checked', true);
  428 + $("[name=btSelectItem]:checkbox").each(function () {
  429 + $(this).prop('checked', true);
  430 + });
  431 + } else {
  432 + $("#select_all").prop('checked', false);
  433 + $("[name=btSelectItem]:checkbox").each(function () {
  434 + $(this).prop('checked', false);
  435 + });
  436 + }
  437 + });
  438 +
  439 + /**
  440 + * 认领
  441 + */
  442 + function receive(n) {
  443 + if (n > 0) {
  444 + applyReceiveNum(n);
  445 + } else {
  446 + var rows = $("[name=btSelectItem]:checkbox:checked");
  447 + if (rows.length > 0) {
  448 + var ids = "";
  449 + rows.each(function (i, e) {
  450 + ids = ids + "," + e.value;
  451 + })
  452 + ids = ids.substring(1);
  453 + applyReceive(ids);
  454 + } else {
  455 + alert("请选择要认领的内容!");
  456 + }
  457 + }
  458 + }
  459 +
  460 + //认领选中请求
  461 + function applyReceive(ids) {
  462 + $.post("/content/receive?ids=" + ids, function (data) {
  463 + if (data.errorCode == 0) {
  464 + alert(data.errorMessage);
  465 + location.href = location.href;
  466 + } else {
  467 + alert(data.errorMessage);
  468 + }
  469 + })
  470 + }
  471 +
  472 + //认领多条请求
  473 + function applyReceiveNum(num) {
  474 + $.post("/content/receive?num=" + num, function (data) {
  475 + if (data.errorCode == 0) {
  476 + alert(data.errorMessage);
  477 + location.href = location.href;
  478 + } else {
  479 + alert(data.errorMessage);
  480 + }
  481 + })
  482 + }
  483 +
  484 + //退领选中内容
  485 + function retReceive() {
  486 + var rows = $("[name=btSelectItem]:checkbox:checked");
  487 + if (rows.length > 0) {
  488 + var r = confirm("您确定退领选中的" + rows.length + "条内容吗?");
  489 + if (r == true) {
  490 + var ids = "";
  491 + rows.each(function (i, e) {
  492 + ids = ids + "," + e.value;
  493 + })
  494 + ids = ids.substring(1);
  495 + applyRetReceive(ids);
  496 + }
  497 + } else {
  498 + alert("没有选中的数据!");
  499 + }
  500 + }
  501 +
  502 + //退领
  503 + function applyRetReceive(ids) {
  504 + $.post("/content/retReceive?ids=" + ids, function (data) {
  505 + if (data.errorCode == 0) {
  506 + alert(data.errorMessage);
  507 + location.href = location.href;
  508 + } else {
  509 + alert(data.errorMessage);
  510 + }
  511 + })
  512 + }
  513 +
  514 + //拒绝(打回)
  515 + function repulse() {
  516 + var rows = $("[name=btSelectItem]:checkbox:checked");
  517 + if (rows.length > 0) {
  518 + var r = confirm("您确定拒绝选中的" + rows.length + "条内容吗?");
  519 + if (r == true) {
  520 + $('#msgModal').modal('show');
  521 + }
  522 + } else {
  523 + alert("没有选中的数据!");
  524 + }
  525 + }
  526 +
  527 + //提交打回
  528 + function repulseSubmit() {
  529 + var rows = $("[name=btSelectItem]:checkbox:checked");
  530 + var ids = "";
  531 + rows.each(function (i, e) {
  532 + ids = ids + "," + e.value;
  533 + })
  534 + ids = ids.substring(1);
  535 + var msg = $("#reviewMsg").val();
  536 + $.post("/content/refuse?ids=" + ids + "&msg=" + msg, function (data) {
  537 + if (data.errorCode == 0) {
  538 + alert(data.errorMessage);
  539 + location.href = location.href;
  540 + } else {
  541 + alert(data.errorMessage);
  542 + }
  543 + })
  544 + }
  545 + </script>
  546 + <!-- 模态框(Modal) -->
  547 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  548 + <div class="modal-dialog">
  549 + <div class="modal-content" style="margin-top: 30%;">
  550 + <div class="modal-header">
  551 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  552 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  553 + </div>
  554 + <div class="modal-body">
  555 + <div class="form-group" style="margin-bottom: 0;">
  556 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  557 + </div>
  558 + <div class="form-group">
  559 + </div>
  560 + </div>
  561 + <div class="modal-footer">
  562 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  563 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  564 + </div>
  565 + </div><!-- /.modal-content -->
  566 + </div><!-- /.modal-dialog -->
  567 + </div>
  568 + <!-- /.modal -->
  569 +
  570 + <!--保留之前的样式代码-->
  571 + <script>
  572 + $('#a_down').hide();
  573 +
  574 + /*查询样式*/
  575 + function openOrClose(id_name_str) {
  576 + var id_name = '#' + id_name_str;
  577 + if ($(id_name).css('display') == 'block') {
  578 + $(id_name).slideUp(350);
  579 + $('#a_up').show();
  580 + $('#a_down').hide();
  581 + } else {
  582 + $(id_name).slideDown(350);
  583 + $('#a_up').hide();
  584 + $('#a_down').show();
  585 + }
  586 + }
  587 +
  588 + /*时间插件*/
  589 + $('.date').datetimepicker({
  590 +// format: 'YYYY-MM-DD HH:mm:ss',
  591 + format: 'YYYY-MM-DD',
  592 + locale: "zh-CN",
  593 + toolbarPlacement: 'bottom',
  594 + showClear: true,
  595 + });
  596 + </script>
  597 + <footer th:replace="../templates/common/foot::foot"></footer>
  598 + <!-- Add the sidebar's background. This div must be placed
  599 + immediately after the control sidebar -->
  600 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  601 +</div><!-- ./wrapper -->
  602 +
  603 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  604 +<script type="text/javascript">
  605 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  606 +</script>
  607 +
  608 +<!-- AdminLTE App -->
  609 +<script src="./../../static/js/app.min.js"></script>
  610 +<!-- AdminLTE for demo purposes -->
  611 +<script src="./../../static/js/sidebar.js"></script>
  612 +</body>
  613 +</html>
0 614 \ No newline at end of file
... ...
src/main/resources/templates/page/contentDetail.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<head th:replace="../templates/common/head::head"></head>
  4 +
  5 +<body class="skin-blue sidebar-mini">
  6 +
  7 +<div class="wrapper">
  8 +
  9 + <div th:replace="../templates/common/frame::frame"></div>
  10 +
  11 + <div class="content-wrapper" style="min-height: 788px;">
  12 + <section class="content-header">
  13 + <h1>
  14 + 图文详情
  15 + </h1>
  16 + <ol class="breadcrumb">
  17 + <li> 首页</li>
  18 + <li class="active">图文审核</li>
  19 + </ol>
  20 + </section>
  21 +
  22 + <section class="content">
  23 + <div class="row">
  24 + <div class="col-xs-12">
  25 + <div class="box box-info">
  26 + <div class="box-body form-horizontal">
  27 + <div id="tabContents" class="tab-content">
  28 +
  29 + <div id="tabHome" class="tab-pane fade in active padding-t-15 ">
  30 + <div class="col-sm-6">
  31 +
  32 + <iframe src="http://sports.china.com.cn/tiyuzhongguowangjiajia/detail2_2019_04/29/1150648.html"
  33 + th:src="${content.content_url}"
  34 + frameborder="0" width="100%" scrolling="auto"
  35 + height="800" leftmargin="0" topmargin="0" allowTransparency="true" >
  36 + </iframe>
  37 +
  38 +<!-- <div class="form-group"> -->
  39 +<!-- <label for="comment_title" class="control-label col-sm-2">评论标题:</label> -->
  40 +<!-- <div class="col-sm-10"> -->
  41 +<!-- <h5 style="font-size:1.5em; font-weight: bold;" -->
  42 +<!-- th:text="${content.comment_title}"></h5> -->
  43 +<!-- </div> -->
  44 +<!-- </div> -->
  45 +<!-- <div class="form-group"> -->
  46 +
  47 +<!-- <label for="content" class="control-label col-sm-2">评论内容:</label> -->
  48 +<!-- <div class="col-sm-8"> -->
  49 +<!-- <textarea class="form-control" name="content" cols="50" rows="10" -->
  50 +<!-- id="content" -->
  51 +<!-- th:text="${comment.comment_content}">哈哈哈</textarea> -->
  52 +<!-- </div> -->
  53 +
  54 +<!-- </div> -->
  55 +
  56 + <hr>
  57 +
  58 + <!-- <div class="form-group">
  59 + <label class="control-label col-sm-2" for="attr_tags">常用审核意见:</label>
  60 + <div class="col-sm-8">
  61 + <select class="form-control select2 select2-hidden-accessible" multiple="" data-placeholder="选择常用审核意见,可多选" name="attr_tags[]" id="attr_tags" style="width: 100%;" tabindex="-1" aria-hidden="true">
  62 + </select><span class="select2 select2-container select2-container&#45;&#45;default" dir="ltr" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection&#45;&#45;multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0"><ul class="select2-selection__rendered"><li class="select2-search select2-search&#45;&#45;inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" placeholder="选择常用审核意见,可多选" style="width: 509px;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
  63 + </div>
  64 + </div>-->
  65 +
  66 +
  67 +
  68 + </div>
  69 + <div class="col-sm-6">
  70 + <div class="form-group">
  71 + <label for="program_id" class="control-label col-sm-2">图文id:</label>
  72 + <div class="col-sm-10">
  73 + <h5 th:text="${content.id}">604</h5>
  74 + </div>
  75 + </div>
  76 + <div class="form-group">
  77 + <label for="comment_user_id" class="control-label col-sm-2">发布站点:</label>
  78 + <div class="col-sm-10">
  79 + <h5 th:text="${content.sp_id}+':'+${content.sp_desc}">821403</h5>
  80 + </div>
  81 + </div>
  82 +
  83 +
  84 + <div class="form-group">
  85 + <label for="activity_id" class="control-label col-sm-2">图文标题:</label>
  86 + <div class="col-sm-10">
  87 + <h5 th:text="${content.title}">
  88 + 769:video:comets:604_902dce9848ac482eb433f15c2cb0c401#3025</h5>
  89 + </div>
  90 + </div>
  91 + <div class="form-group">
  92 + <label for="comment_user_avatar"
  93 + class="control-label col-sm-2">标题图片:</label>
  94 + <div class="col-sm-10">
  95 + <h5><img width="160px" th:src="@{${content.title_image}}"
  96 + alt="标题图片"></h5>
  97 +
  98 + </div>
  99 + </div>
  100 +
  101 + <div class="form-group">
  102 + <label for="comment_user_name" class="control-label col-sm-2">图文标签:</label>
  103 + <div class="col-sm-10">
  104 + <h5 th:text="${content.content_tag}">鱼</h5>
  105 + </div>
  106 + </div>
  107 +
  108 + <div class="form-group ">
  109 + <label for="username" class="control-label col-sm-2">审核类型:</label>
  110 + <div class="col-sm-10 ">
  111 + <h5 class="status" th:if="${content.shenhe_type==1}">免审</h5>
  112 + <h5 class="status" th:if="${content.shenhe_type==2}">机审</h5>
  113 + <h5 class="status" th:if="${content.shenhe_type==3}">人工审</h5>
  114 + </div>
  115 + </div>
  116 +
  117 + <div class="form-group ">
  118 + <label for="username" class="control-label col-sm-2">图文状态:</label>
  119 + <div class="col-sm-10 ">
  120 + <h5 class="status" th:if="${content.content_status==0}">待发布</h5>
  121 + <h5 class="status" th:if="${content.content_status==1}">已发布</h5>
  122 + <h5 class="status" th:if="${content.content_status==2}">已下线</h5>
  123 + <h5 class="status" th:if="${content.content_status==3}">已删除</h5>
  124 + </div>
  125 + </div>
  126 +
  127 + <div class="form-group">
  128 + <label for="comment_user_ip"
  129 + class="control-label col-sm-2">来源:</label>
  130 + <div class="col-sm-10">
  131 + <h5 th:text="${content.source}">114.242.177.100</h5>
  132 + </div>
  133 + </div>
  134 +
  135 + <div class="form-group">
  136 + <label for="app_id" class="control-label col-sm-2">作者:</label>
  137 + <div class="col-sm-10">
  138 + <h5 th:text="${content.author}">769_jetj7bq525</h5>
  139 + </div>
  140 + </div>
  141 +
  142 +<!-- <div class="form-group"> -->
  143 +<!-- <label for="platform" class="control-label col-sm-2">平台:</label> -->
  144 +<!-- <div class="col-sm-10"> -->
  145 +<!-- <h5 th:if="${content.platform=='i'}">苹果</h5> -->
  146 +<!-- <h5 th:if="${content.platform=='a'}">安卓</h5> -->
  147 +<!-- <h5 th:if="${content.platform=='w'}">网页</h5> -->
  148 +<!-- </div> -->
  149 +<!-- </div> -->
  150 +
  151 + <div class="form-group" th:if="${content.receive_status!=0}">
  152 + <label for="updater" class="control-label col-sm-2">审核员:</label>
  153 + <div class="col-sm-10">
  154 + <h5 th:text="${content.updater}">发布
  155 + openadmin9@cnlive.com</h5>
  156 + </div>
  157 + </div>
  158 +
  159 + <div class="form-group">
  160 + <label for="claimed_at" class="control-label col-sm-2">送审时间:</label>
  161 + <div class="col-sm-10">
  162 + <h5 th:text="${#dates.format(content.last_update, 'yyyy-MM-dd HH:mm:ss')}">
  163 + 2018-11-29 10:04:35</h5>
  164 + </div>
  165 + </div>
  166 +
  167 + <div class="form-group" th:if="${content.receive_status==2}">
  168 + <label for="claimed_at" class="control-label col-sm-2">审核时间:</label>
  169 + <div class="col-sm-10">
  170 + <h5 th:text="${#dates.format(content.last_update, 'yyyy-MM-dd HH:mm:ss')}">
  171 + 2018-11-29 10:04:35</h5>
  172 + </div>
  173 + </div>
  174 +
  175 + <div class="form-group">
  176 + <label for="msg" class="control-label col-sm-2">审核备注:</label>
  177 + <div class="col-sm-8">
  178 + <textarea class="form-control" name="msg" cols="50" rows="5"
  179 + id="msg" th:text="${content.shenhe_msg}">审核备注</textarea>
  180 + </div>
  181 + </div>
  182 +
  183 + </div>
  184 +
  185 + </div>
  186 + <hr>
  187 + </div>
  188 +
  189 + <div class="form-group">
  190 + <input type="text" hidden="hidden" id="content_id" value="13097">
  191 + </div>
  192 +
  193 +
  194 + <div class="box-footer">
  195 + <div class="col-sm-5">
  196 + <button type="button" class="btn btn-danger pull-right" onclick="content(2);">拒 绝
  197 + </button>
  198 + </div>
  199 +
  200 + <div class="col-sm-1" style="margin-right:26px;">
  201 + <button type="button" class="btn btn-primary pull-right" onclick="content(1);">通 过
  202 + </button>
  203 + </div>
  204 +
  205 + <div class="col-sm-1">
  206 + <button type="button" class="btn btn-info pull-right"
  207 + onclick="self.location=document.referrer;">返回列表
  208 + </button>
  209 + </div>
  210 + </div>
  211 + <script th:inline="javascript">
  212 + var contentId = [[${content.id}]];
  213 +
  214 + //审核操作,status=1为通过
  215 + function content(status) {
  216 + var msg = $('#msg').val(); //获取审核msg
  217 + if (status == 1) {
  218 + $.post("/content/pass?ids=" + contentId, function (data) {
  219 + if (data.errorCode == 0) {
  220 + //location.href = history.back();
  221 + self.location = document.referrer;
  222 + } else {
  223 + alert(data.errorMessage);
  224 + }
  225 + })
  226 + } else {
  227 + if ( msg == '') {
  228 + alert('请输入审核备注!');
  229 + return false;
  230 + }
  231 + $.post("/content/refuse?ids=" + contentId+"&msg="+msg, function (data) {
  232 + if (data.errorCode == 0) {
  233 + //location.href = history.back();
  234 + self.location = document.referrer;
  235 + } else {
  236 + alert(data.errorMessage);
  237 + }
  238 + })
  239 + }
  240 + }
  241 +
  242 + </script>
  243 + <!--<script src="../../static/js/select2.full.min.js"></script>
  244 + <link rel="stylesheet" href="../../static/css/select2.min.css">
  245 + <link rel="stylesheet" href="../../static/css/AdminLTE.min.css">-->
  246 +
  247 +
  248 + </div>
  249 + </div>
  250 + </div>
  251 + </div>
  252 +
  253 + </section>
  254 + </div>
  255 +
  256 +
  257 + <footer th:replace="../templates/common/foot::foot"></footer>
  258 +
  259 + <!-- Add the sidebar's background. This div must be placed
  260 + immediately after the control sidebar -->
  261 + <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>
  262 +
  263 +</div><!-- ./wrapper -->
  264 +
  265 +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  266 +<script type="text/javascript">
  267 + $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
  268 +</script>
  269 +
  270 +<!-- AdminLTE App -->
  271 +<script src="../../static/js/app.min.js"></script>
  272 +<!-- AdminLTE for demo purposes -->
  273 +<script src="../../static/js/sidebar.js"></script>
  274 +
  275 +
  276 +</body>
  277 +</html>
0 278 \ No newline at end of file
... ...