文章管理
This commit is contained in:
parent
1c6f652642
commit
6f3dc068e2
|
|
@ -1,8 +1,13 @@
|
||||||
package com.ruoyi.content.controller;
|
package com.ruoyi.content.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.page.PageDomain;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.page.TableSupport;
|
||||||
|
import com.ruoyi.content.domain.BaseCodeTree;
|
||||||
import com.ruoyi.content.domain.PageDTO;
|
import com.ruoyi.content.domain.PageDTO;
|
||||||
import com.ruoyi.content.message.Message;
|
import com.ruoyi.content.message.Message;
|
||||||
|
import com.ruoyi.content.service.BaseCodeService;
|
||||||
import com.ruoyi.content.service.LibraryService;
|
import com.ruoyi.content.service.LibraryService;
|
||||||
import com.ruoyi.content.utils.CheckUtil;
|
import com.ruoyi.content.utils.CheckUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -10,14 +15,13 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 说明:文章管理
|
* 说明:文章管理
|
||||||
|
|
@ -28,11 +32,47 @@ import java.util.UUID;
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/article")
|
@RequestMapping("/article")
|
||||||
public class LibraryManageController {
|
public class LibraryManageController {
|
||||||
|
|
||||||
|
private String prefix = "content/article";
|
||||||
|
|
||||||
private final static Logger logger = LoggerFactory.getLogger(LibraryManageController.class);
|
private final static Logger logger = LoggerFactory.getLogger(LibraryManageController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private LibraryService libraryService;
|
private LibraryService libraryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CheckUtil checkUtil;
|
private CheckUtil checkUtil;
|
||||||
|
@Autowired
|
||||||
|
private BaseCodeService baseCodeService;
|
||||||
|
|
||||||
|
@GetMapping("manage")
|
||||||
|
public String articleList() {
|
||||||
|
return prefix + "/articleManage";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取栏目树
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/columnTree")
|
||||||
|
@ResponseBody
|
||||||
|
public Message columnTree(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||||
|
Message msg = new Message();
|
||||||
|
Map<String, Object> policyMap = new HashMap<String, Object>();
|
||||||
|
String codeCode = request.getParameter("codeCode");
|
||||||
|
// 查询栏目树
|
||||||
|
List<BaseCodeTree> columnList = new ArrayList<BaseCodeTree>();
|
||||||
|
columnList = baseCodeService.baseColumnTree(codeCode);
|
||||||
|
policyMap.put("columnList", columnList);
|
||||||
|
msg.setInfo("成功");
|
||||||
|
msg.setObject(policyMap);
|
||||||
|
msg.setResult(true);
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询文库信息
|
* 查询文库信息
|
||||||
|
|
@ -43,35 +83,31 @@ public class LibraryManageController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/libraryArry")
|
@RequestMapping("/libraryArry")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public PageDTO libraryArry(HttpServletRequest request, HttpServletResponse response) {
|
public TableDataInfo libraryArry(HttpServletRequest request, HttpServletResponse response) {
|
||||||
logger.info("查询文库列表的控制层方法开始!");
|
logger.info("查询文库列表的控制层方法开始!");
|
||||||
Thread.currentThread().setName(UUID.randomUUID().toString());
|
Thread.currentThread().setName(UUID.randomUUID().toString());
|
||||||
PageDTO pageDTO = new PageDTO();
|
TableDataInfo pageDTO = new TableDataInfo();
|
||||||
try {
|
try {
|
||||||
String rowsVal = request.getParameter("rows");
|
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||||
String page = request.getParameter("page");
|
Integer pageSize = pageDomain.getPageSize();
|
||||||
|
Integer pageNum = (pageDomain.getPageNum() - 1) * pageSize;
|
||||||
String articelName = request.getParameter("articelName");
|
String articelName = request.getParameter("articelName");
|
||||||
String articleThirdTypeInit = request.getParameter("articleThirdTypeInit");
|
String articleThirdTypeInit = request.getParameter("articleThirdTypeInit");
|
||||||
String channel = request.getParameter("channel");
|
String channel = request.getParameter("channel");
|
||||||
String special = request.getParameter("special");
|
String special = request.getParameter("special");
|
||||||
String articleState = request.getParameter("articleState");
|
String articleState = request.getParameter("articleState");
|
||||||
if (articleThirdTypeInit != null && !"".equals(articleThirdTypeInit.trim())) {
|
if(articleThirdTypeInit != null && !"".equals(articleThirdTypeInit.trim())) {
|
||||||
channel = articleThirdTypeInit;
|
channel = articleThirdTypeInit;
|
||||||
} else {
|
}else {
|
||||||
special = channel;
|
special = channel;
|
||||||
}
|
}
|
||||||
int rows = Integer.parseInt(rowsVal);
|
List<HashMap<String, Object>> list = libraryService.queryLibrary(pageNum, pageSize, articelName,
|
||||||
int startRow = rows * (Integer.parseInt(page) - 1);
|
|
||||||
List<HashMap<String, Object>> list = libraryService.queryLibrary(startRow, rows, articelName,
|
|
||||||
special, channel, articleState);
|
special, channel, articleState);
|
||||||
pageDTO.setPage(Integer.parseInt(page));
|
|
||||||
pageDTO.setStartRow(startRow);
|
|
||||||
pageDTO.setDataRows(list);
|
|
||||||
//int count = libraryService.countArticleInfoByState(articelName,special, channel, articleState);
|
//int count = libraryService.countArticleInfoByState(articelName,special, channel, articleState);
|
||||||
int count = libraryService.countArticleByParam(articelName, special, channel, articleState);
|
int count = libraryService.countArticleByParam(articelName, special, channel, articleState);
|
||||||
pageDTO.setTotal(count % rows == 0 ? count / rows : (count / rows + 1));
|
pageDTO.setCode(0);
|
||||||
pageDTO.setRecords(count);
|
pageDTO.setRows(list);
|
||||||
pageDTO.setPage(Integer.parseInt(page));
|
pageDTO.setTotal(count);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("查询当前用户发布的文章失败【{}】", e.getMessage());
|
logger.info("查询当前用户发布的文章失败【{}】", e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.core.page.TableSupport;
|
import com.ruoyi.common.core.page.TableSupport;
|
||||||
import com.ruoyi.content.domain.ClickTrackInfo;
|
import com.ruoyi.content.domain.ClickTrackInfo;
|
||||||
import com.ruoyi.content.domain.ClickUserInfo;
|
import com.ruoyi.content.domain.ClickUserInfo;
|
||||||
import com.ruoyi.content.domain.PageDTO;
|
|
||||||
import com.ruoyi.content.domain.UserInfo;
|
import com.ruoyi.content.domain.UserInfo;
|
||||||
import com.ruoyi.content.exception.BusinessException;
|
import com.ruoyi.content.exception.BusinessException;
|
||||||
import com.ruoyi.content.mapper.ArticlePublishTrackMapper;
|
import com.ruoyi.content.mapper.ArticlePublishTrackMapper;
|
||||||
import com.ruoyi.content.mapper.CmsSysUserExMapper;
|
import com.ruoyi.content.mapper.CmsSysUserExMapper;
|
||||||
import com.ruoyi.content.message.Message;
|
|
||||||
import com.ruoyi.content.service.StaffArticleManageService;
|
import com.ruoyi.content.service.StaffArticleManageService;
|
||||||
import com.ruoyi.content.utils.JsonUtil;
|
import com.ruoyi.content.utils.JsonUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -23,7 +21,10 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/article")
|
@RequestMapping("/article")
|
||||||
|
|
@ -119,7 +120,6 @@ public class StaffArticleManageController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo articleSharingTrackInfo(HttpServletRequest request) {
|
public TableDataInfo articleSharingTrackInfo(HttpServletRequest request) {
|
||||||
Thread.currentThread().setName(UUID.randomUUID().toString());
|
Thread.currentThread().setName(UUID.randomUUID().toString());
|
||||||
Message msg = new Message();
|
|
||||||
List<ClickUserInfo> clickUserInfos = new ArrayList<ClickUserInfo>();
|
List<ClickUserInfo> clickUserInfos = new ArrayList<ClickUserInfo>();
|
||||||
ClickTrackInfo clickTrackInfo = new ClickTrackInfo();
|
ClickTrackInfo clickTrackInfo = new ClickTrackInfo();
|
||||||
logger.info("查询用户查看分享文章轨迹信息的控制层方法开始!");
|
logger.info("查询用户查看分享文章轨迹信息的控制层方法开始!");
|
||||||
|
|
|
||||||
|
|
@ -98,5 +98,12 @@ public interface BaseCodeService {
|
||||||
*/
|
*/
|
||||||
public Message operateColumn(String columnId, String operateType);
|
public Message operateColumn(String columnId, String operateType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询栏目树
|
||||||
|
*
|
||||||
|
* @param codeCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BaseCodeTree> baseColumnTree(String codeCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -586,4 +586,46 @@ public class BaseCodeServiceImpl implements BaseCodeService {
|
||||||
logger.info("操作栏目排序业务层方法结束");
|
logger.info("操作栏目排序业务层方法结束");
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaseCodeTree> baseColumnTree(String codeCode) {
|
||||||
|
logger.info("进入查询栏目树的方法");
|
||||||
|
if (StringUtils.isBlank(codeCode)) {
|
||||||
|
logger.info("查询栏目树请求参数不正确codeCode【{}】", codeCode);
|
||||||
|
throw new ParameterException("创建失败,参数不足!");
|
||||||
|
}
|
||||||
|
String companyId = "1";
|
||||||
|
String branchId = "86";
|
||||||
|
String state = "0";
|
||||||
|
HashMap<String, String> parMap = new HashMap<>();
|
||||||
|
parMap.put("codeCode", codeCode);
|
||||||
|
parMap.put("companyId", companyId);
|
||||||
|
parMap.put("state", state);
|
||||||
|
if (!"86".equals(branchId)) {
|
||||||
|
parMap.put("branchId", branchId);
|
||||||
|
}
|
||||||
|
List<BaseCodeTree> list = baseCodeExMapper.columnTree(parMap);
|
||||||
|
recursionList(list);
|
||||||
|
logger.info("查询栏目树结束,查询到的结果为【{}】" + JsonUtil.objectToJackson(list));
|
||||||
|
logger.info("查询栏目信息的方法结束!");
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void recursionList(List<BaseCodeTree> baseCodeList) {
|
||||||
|
for (BaseCodeTree baseCode : baseCodeList) {
|
||||||
|
HashMap map = new HashMap();
|
||||||
|
map.put("CODE_CODE", baseCode.getCodeCode());
|
||||||
|
map.put("parentCompanyId", baseCode.getCompanyId());
|
||||||
|
map.put("parentState", baseCode.getState());
|
||||||
|
map.put("parentBranchId", baseCode.getBranchId());
|
||||||
|
List<BaseCodeTree> list = baseCodeExMapper.getNextNodeTree(map);
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
recursionList(list);
|
||||||
|
baseCode.setChild(list);
|
||||||
|
} else {
|
||||||
|
baseCode.setChild(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,6 @@ public class LibraryServiceImpl implements LibraryService {
|
||||||
if (StringUtils.isBlank(channel)) {
|
if (StringUtils.isBlank(channel)) {
|
||||||
channel = "";
|
channel = "";
|
||||||
}
|
}
|
||||||
//List<ArticleChannel> libraryList = articleChannelQueryMapper.selectAllWithLimit(companyId, branchId,list, startRow, rows,
|
|
||||||
//articelName, special, channel);
|
|
||||||
HashMap<String, Object> parMap = new HashMap<String, Object>();
|
HashMap<String, Object> parMap = new HashMap<String, Object>();
|
||||||
parMap.put("list", list);
|
parMap.put("list", list);
|
||||||
parMap.put("startRow", startRow);
|
parMap.put("startRow", startRow);
|
||||||
|
|
@ -115,12 +113,14 @@ public class LibraryServiceImpl implements LibraryService {
|
||||||
for (HashMap<String, Object> hashMap : resultMap) {
|
for (HashMap<String, Object> hashMap : resultMap) {
|
||||||
publishList.add((String) hashMap.get("publishId"));
|
publishList.add((String) hashMap.get("publishId"));
|
||||||
}
|
}
|
||||||
|
if (publishList.size() > 0) {
|
||||||
LOGGER.info("所有的publishId:++++++++++++" + publishList);
|
LOGGER.info("所有的publishId:++++++++++++" + publishList);
|
||||||
resultMap = articleChannelQueryMapper.selectByPublishList(publishList);
|
resultMap = articleChannelQueryMapper.selectByPublishList(publishList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (resultMap == null || resultMap.size() < 1) {
|
if (resultMap == null || resultMap.size() < 1) {
|
||||||
LOGGER.info("未查询到数据");
|
LOGGER.info("文库暂没有文章!");
|
||||||
throw new BusinessException("文库暂没有文章!");
|
return resultMap;
|
||||||
}
|
}
|
||||||
LOGGER.info("查询文库列表的业务层方法结束!");
|
LOGGER.info("查询文库列表的业务层方法结束!");
|
||||||
return resultMap;
|
return resultMap;
|
||||||
|
|
@ -639,22 +639,22 @@ public class LibraryServiceImpl implements LibraryService {
|
||||||
LOGGER.info("推送文章的业务层方法开始!");
|
LOGGER.info("推送文章的业务层方法开始!");
|
||||||
LOGGER.info("推送文章的业务层方法中拿到的文章的articleId【{}】,publishId[{}],agentCode[{}],sendType[{}],partyId[{}]", new Object[]{articleId, publishId, agentCode, sendType, partyId});
|
LOGGER.info("推送文章的业务层方法中拿到的文章的articleId【{}】,publishId[{}],agentCode[{}],sendType[{}],partyId[{}]", new Object[]{articleId, publishId, agentCode, sendType, partyId});
|
||||||
Message msg = new Message(true, "推送文章成功");
|
Message msg = new Message(true, "推送文章成功");
|
||||||
CmsSysUser userInfoDTO = null;
|
// CmsSysUser userInfoDTO = null;
|
||||||
String companyId = null;
|
String companyId = null;
|
||||||
String email = null;
|
String email = null;
|
||||||
ArticlePublishSend aps = null;
|
ArticlePublishSend aps = null;
|
||||||
if (sendId != null) {
|
if (sendId != null) {
|
||||||
aps = articlePublishSendMapper.selectByPrimaryKey(sendId);
|
aps = articlePublishSendMapper.selectByPrimaryKey(sendId);
|
||||||
String userId = aps.getOperateId();
|
// String userId = aps.getOperateId();
|
||||||
CmsSysUserExample user = new CmsSysUserExample();
|
// CmsSysUserExample user = new CmsSysUserExample();
|
||||||
user.createCriteria().andUserIdEqualTo(userId);
|
// user.createCriteria().andUserIdEqualTo(userId);
|
||||||
userInfoDTO = cmsSysUserMapper.selectByExample(user).get(0);
|
// userInfoDTO = cmsSysUserMapper.selectByExample(user).get(0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
userInfoDTO = (CmsSysUser) SecurityUtils.getSubject().getPrincipal();
|
// userInfoDTO = (CmsSysUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
}
|
}
|
||||||
companyId = userInfoDTO.getCompanyId();
|
companyId = "1";
|
||||||
email = userInfoDTO.getEmail();
|
email = "13152783264";
|
||||||
CmsSysUser cmsSysUser = this.cmsSysUserExMapper.queryLoginInfoByEmail(email);
|
CmsSysUser cmsSysUser = this.cmsSysUserExMapper.queryLoginInfoByEmail(email);
|
||||||
String userId = cmsSysUser.getUserId();
|
String userId = cmsSysUser.getUserId();
|
||||||
String sysUserName = cmsSysUser.getName();
|
String sysUserName = cmsSysUser.getName();
|
||||||
|
|
@ -859,9 +859,8 @@ public class LibraryServiceImpl implements LibraryService {
|
||||||
LOGGER.info("查询文章列表总数的业务层方法开始!");
|
LOGGER.info("查询文章列表总数的业务层方法开始!");
|
||||||
LOGGER.info("拿到的参数 文章名称【{}】,一级分类【{}】,二级分类【{}】,文章状态【{}】", articelName,
|
LOGGER.info("拿到的参数 文章名称【{}】,一级分类【{}】,二级分类【{}】,文章状态【{}】", articelName,
|
||||||
special, channel, articleState);
|
special, channel, articleState);
|
||||||
CmsSysUser userInfoDTO = (CmsSysUser) SecurityUtils.getSubject().getPrincipal();
|
String companyId = "1";// 公司id
|
||||||
String companyId = userInfoDTO.getCompanyId();// 公司id
|
String branchId = "86";
|
||||||
String branchId = userInfoDTO.getBranchId();
|
|
||||||
CmsSysUserExample example = new CmsSysUserExample();
|
CmsSysUserExample example = new CmsSysUserExample();
|
||||||
CmsSysUserExample.Criteria criteria = example.createCriteria();
|
CmsSysUserExample.Criteria criteria = example.createCriteria();
|
||||||
criteria.andCompanyIdEqualTo(companyId);
|
criteria.andCompanyIdEqualTo(companyId);
|
||||||
|
|
@ -896,8 +895,8 @@ public class LibraryServiceImpl implements LibraryService {
|
||||||
parMap.put("userlist", userlist);
|
parMap.put("userlist", userlist);
|
||||||
List<HashMap<String, Object>> resultMap = articleChannelQueryMapper.selectCountByParam(parMap);
|
List<HashMap<String, Object>> resultMap = articleChannelQueryMapper.selectCountByParam(parMap);
|
||||||
if (resultMap == null || resultMap.size() < 1) {
|
if (resultMap == null || resultMap.size() < 1) {
|
||||||
LOGGER.info("未查询到数据【{}】", JsonUtil.objectToJackson(userInfoDTO));
|
LOGGER.info("文库暂没有文章!");
|
||||||
throw new BusinessException("文库暂没有文章!");
|
return 0;
|
||||||
}
|
}
|
||||||
LOGGER.info("查询文库列表的业务层方法结束!");
|
LOGGER.info("查询文库列表的业务层方法结束!");
|
||||||
return resultMap.size();
|
return resultMap.size();
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@
|
||||||
IFNULL(l.ARTICLE_NAME,info.ARTICLE_NAME) "articleName",
|
IFNULL(l.ARTICLE_NAME,info.ARTICLE_NAME) "articleName",
|
||||||
group_concat(l.channel,"-",l.special separator ',') channelSpecial,
|
group_concat(l.channel,"-",l.special separator ',') channelSpecial,
|
||||||
MAX(t.ARTICLE_VERSION),
|
MAX(t.ARTICLE_VERSION),
|
||||||
max(concat(t.CREATE_DATE, ' ', T.CREATE_TIME)) publishDate,
|
max(concat(t.CREATE_DATE, ' ', t.CREATE_TIME)) publishDate,
|
||||||
max(concat(l.UPDATE_DATE, ' ', l.UPDATE_TIME)) updateDate,
|
max(concat(l.UPDATE_DATE, ' ', l.UPDATE_TIME)) updateDate,
|
||||||
t.PUBLISH_ID publishId,
|
t.PUBLISH_ID publishId,
|
||||||
(select min(f.PUBLISH_DATE) from article_publish_send f where f.PUBLISH_ID = t.PUBLISH_ID and f.SEND_STATE='2') oPbulishTime
|
(select min(f.PUBLISH_DATE) from article_publish_send f where f.PUBLISH_ID = t.PUBLISH_ID and f.SEND_STATE='2') oPbulishTime
|
||||||
|
|
@ -301,7 +301,7 @@
|
||||||
IFNULL(l.ARTICLE_NAME,info.ARTICLE_NAME) "articleName",
|
IFNULL(l.ARTICLE_NAME,info.ARTICLE_NAME) "articleName",
|
||||||
group_concat(l.channel,"-",l.special separator ',') channelSpecial,
|
group_concat(l.channel,"-",l.special separator ',') channelSpecial,
|
||||||
MAX(t.ARTICLE_VERSION),
|
MAX(t.ARTICLE_VERSION),
|
||||||
max(concat(t.CREATE_DATE, ' ', T.CREATE_TIME)) publishDate,
|
max(concat(t.CREATE_DATE, ' ', t.CREATE_TIME)) publishDate,
|
||||||
max(concat(l.UPDATE_DATE, ' ', l.UPDATE_TIME)) updateDate,
|
max(concat(l.UPDATE_DATE, ' ', l.UPDATE_TIME)) updateDate,
|
||||||
t.PUBLISH_ID publishId
|
t.PUBLISH_ID publishId
|
||||||
FROM
|
FROM
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,437 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('文库管理')"/>
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>文章名称:</label>
|
||||||
|
<input type="text" name="articelName"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label style="width: 95px;">二级栏目名称:</label>
|
||||||
|
<select name="channel" th:id="channel" onchange="autoChangeInitThirdType(value)">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label style="width: 95px;">三级栏目名称:</label>
|
||||||
|
<select name="articleThirdTypeInit" th:id="articleThirdTypeInit">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
||||||
|
class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||||
|
class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-primary" onclick="">
|
||||||
|
<i class="fa fa-plus"></i> 批量收录
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger single disabled" style="margin-left: 15px;" onclick="$.operate.edit()">
|
||||||
|
<i class="fa fa-remove"></i> 批量移除
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped" style="overflow-x: scroll;">
|
||||||
|
<table id="bootstrap-table" style="border-collapse: collapse;"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
|
||||||
|
var path = ctx;
|
||||||
|
var prefix = ctx + "article";
|
||||||
|
|
||||||
|
var baseDataList = [];
|
||||||
|
var baseDataListSecond = [];
|
||||||
|
var cloumnTree = [];
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
setFirstQuery();
|
||||||
|
autoChangeInitType("ARTICLE");
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/libraryArry",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
fixedColumns: true,
|
||||||
|
modalName: "文章",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'articleId',
|
||||||
|
title: '文章ID',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'articleName',
|
||||||
|
title: '文章名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'orderNo',
|
||||||
|
title: '置顶状态',
|
||||||
|
visible: false,
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
if (row.orderNo === '1') {
|
||||||
|
actions.push('已置顶');
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'channelSpecial',
|
||||||
|
title: '二级分类',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
var data = queryCnameBySpecialChannel(row.channelSpecial, "ARTICLE", "2");
|
||||||
|
if (data == null) {
|
||||||
|
actions.push('未收录');
|
||||||
|
} else {
|
||||||
|
actions.push(data);
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'channelSpecial',
|
||||||
|
title: '三级分类',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
var data = queryCnameBySecAndThird(row.channelSpecial, "ARTICLE", "2");
|
||||||
|
if (data === '') {
|
||||||
|
actions.push('未收录');
|
||||||
|
} else {
|
||||||
|
actions.push(data);
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'articleVersion',
|
||||||
|
title: '文章版本',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'articleState',
|
||||||
|
title: '状态',
|
||||||
|
visible: false,
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
if (row.articleState === '0') {
|
||||||
|
actions.push('展示(已发布)');
|
||||||
|
} else if (row.articleState === '2') {
|
||||||
|
actions.push('未发布');
|
||||||
|
} else {
|
||||||
|
actions.push('');
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createUser',
|
||||||
|
title: '创建人',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'publishDate',
|
||||||
|
title: '发布时间',
|
||||||
|
width: '8',
|
||||||
|
widthUnit: '%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updateDate',
|
||||||
|
title: '更新时间',
|
||||||
|
width: '8',
|
||||||
|
widthUnit: '%'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'companyId',
|
||||||
|
title: '公司id',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'publishId',
|
||||||
|
title: '发布id',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '推送个人(验证)',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.articleId + '\')">推送个人(验证)</a> ');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '推送企业号',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.articleId + '\')">推送企业号</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '定时推送',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.articleId + '\')">定时推送</a> ');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '展示链路',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="articleLinkUrl(\'1\',\'' + row.articleId + '\',\'' + row.publishId + '\');"><i class="fa fa-clone"></i> 展示链路</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '预览文章',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="articleLinkUrl(\'' + row.articleId + '\',\'' + row.publishId + '\');"><i class="fa fa-eye"></i> 预览文章</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '删除',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteArticle(\'' + row.publishId + '\');"><i class="fa fa-remove"></i> 删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
|
||||||
|
cloumnTreeInit();
|
||||||
|
});
|
||||||
|
|
||||||
|
function queryCnameBySpecialChannel(id, type, num) {
|
||||||
|
if (baseDataListSecond == null) {
|
||||||
|
articleTypeInit(type, num);
|
||||||
|
}
|
||||||
|
if (id == null || id == "undefined") {
|
||||||
|
return "未收录"
|
||||||
|
}
|
||||||
|
var arr = id.split(",");
|
||||||
|
var returnValue = "";
|
||||||
|
var list = baseDataListSecond.length;
|
||||||
|
for (var j = 0; j < arr.length; j++) {
|
||||||
|
var arrVal = arr[j].split("-");
|
||||||
|
for (var i = 0; i < list; i++) {
|
||||||
|
if (arrVal[1] == "ARTICLE") {
|
||||||
|
if (arrVal[0] == baseDataListSecond[i].codeCode) {
|
||||||
|
if (returnValue.indexOf(baseDataListSecond[i].codeCname) == -1) {
|
||||||
|
returnValue = returnValue + baseDataListSecond[i].codeCname + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (arrVal[1] == baseDataListSecond[i].codeCode) {
|
||||||
|
if (returnValue.indexOf(baseDataListSecond[i].codeCname) == -1) {
|
||||||
|
returnValue = returnValue + baseDataListSecond[i].codeCname + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** **查询公共数据** */
|
||||||
|
function articleTypeInit(type, num) {
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: path + 'column/queryBasicData',
|
||||||
|
data: {
|
||||||
|
"bType": type
|
||||||
|
},
|
||||||
|
async: false,
|
||||||
|
success: function (data) {
|
||||||
|
if (data.result) {// 跳转到列表页面
|
||||||
|
if (num == "1") {
|
||||||
|
baseDataList = data.object.baseList;
|
||||||
|
} else {
|
||||||
|
baseDataListSecond = data.object.baseList;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//二三级菜单名称显示
|
||||||
|
function queryCnameBySecAndThird(id) {
|
||||||
|
if (cloumnTree == null || cloumnTree.length == 0) {
|
||||||
|
cloumnTreeInit();
|
||||||
|
}
|
||||||
|
var child = [];
|
||||||
|
if (id == null || id == "undefined") {
|
||||||
|
return "未收录"
|
||||||
|
}
|
||||||
|
var arr = id.split(",");
|
||||||
|
var list = cloumnTree.length;
|
||||||
|
var returnValue = "";
|
||||||
|
for (var k = 0; k < arr.length; k++) {
|
||||||
|
var arrVal = arr[k];
|
||||||
|
if (arrVal.indexOf("ARTICLE") == -1) {
|
||||||
|
var split = arrVal.split("-");
|
||||||
|
for (var i = 0; i < list; i++) {
|
||||||
|
child = cloumnTree[i].child;
|
||||||
|
for (var j = 0; j < child.length; j++) {
|
||||||
|
if (child[j].codeCode == split[0]) {
|
||||||
|
if (returnValue.indexOf(cloumnTree[i].codeCname + "-" + child[j].codeCname) == -1) {
|
||||||
|
returnValue = returnValue + cloumnTree[i].codeCname + "-" + child[j].codeCname + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cloumnTreeInit() {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/columnTree",
|
||||||
|
data: {
|
||||||
|
codeCode: "ARTICLE"
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
type: "get",
|
||||||
|
cache: false,
|
||||||
|
success: function (data) {
|
||||||
|
cloumnTree = data.object.columnList[0].child
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//给一级搜索框赋值
|
||||||
|
function setFirstQuery() {
|
||||||
|
articleTypeInit("FIRST_COLUMN", "1")
|
||||||
|
// $("#special option").remove();
|
||||||
|
// var obj = baseDataList;
|
||||||
|
// var secondObj;
|
||||||
|
// $("#special").append("<option value=''>请选择</option>");
|
||||||
|
// for (var i = 0; i < obj.length; i++) {
|
||||||
|
// if (obj[i].codeCode == "ARTICLE") {
|
||||||
|
// $("#special").append("<option value='" + obj[i].codeCode + "'>" + obj[i].codeCname + "</option>");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
//搜索时根据选择的一级分类加载二级分类
|
||||||
|
function autoChangeInitType(value) {
|
||||||
|
articleTypeInit(value, "2");
|
||||||
|
$("#channel option").remove();
|
||||||
|
var obj = baseDataListSecond;
|
||||||
|
$("#channel").append("<option value=''>请选择</option>");
|
||||||
|
for (var i = 0; i < obj.length; i++) {
|
||||||
|
$("#channel").append("<option value='" + obj[i].codeCode + "'>" + obj[i].codeCname + "</option>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//选择二级加载三级
|
||||||
|
function autoChangeInitThirdType(value) {
|
||||||
|
$("#articleThirdTypeInit option").remove();
|
||||||
|
var obj = cloumnTree;
|
||||||
|
$("#articleThirdTypeInit").append("<option value=''>请选择</option>");
|
||||||
|
for (var i = 0; i < obj.length; i++) {
|
||||||
|
if (obj[i].codeCode == value) {
|
||||||
|
var children = obj[i].child;
|
||||||
|
for (var j = 0; j < children.length; j++) {
|
||||||
|
$("#articleThirdTypeInit").append("<option value='" + children[j].codeCode + "'>" + obj[i].codeCname + "-" + children[j].codeCname + "</option>");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** **获取文章推送链接** */
|
||||||
|
function articleLinkUrl(sendType, articleId, publishId, agentCode, partyId) {
|
||||||
|
$.ajax({
|
||||||
|
url: path + "article/articleSend",
|
||||||
|
data: {
|
||||||
|
"articleId": articleId,
|
||||||
|
"publishId": publishId,
|
||||||
|
"agentCode": agentCode,
|
||||||
|
"sendType": sendType,
|
||||||
|
"partyId": partyId
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
type: "post",
|
||||||
|
cache: false,
|
||||||
|
success: function (data) {
|
||||||
|
if (data.result) {
|
||||||
|
if (sendType == "0") {
|
||||||
|
$.modal.alertSuccess("文章推送成功");
|
||||||
|
}
|
||||||
|
if (sendType == "1") {
|
||||||
|
$.modal.alertSuccess(data.object);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$.modal.alertWarning(data.info);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (textStatus, e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteArticle(id) {
|
||||||
|
$.ajax({
|
||||||
|
url: prefix + "/delLibrary",
|
||||||
|
data: {
|
||||||
|
ids: id
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
type: "post",
|
||||||
|
cache: false,
|
||||||
|
success: function (data) {
|
||||||
|
if (data.result) {
|
||||||
|
$.modal.alertSuccess("删除成功!");
|
||||||
|
$.table.search();
|
||||||
|
} else {
|
||||||
|
$.modal.alertSuccess("删除失败!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (textStatus, e) {
|
||||||
|
$.modal.alertSuccess('系统异常,请稍后重试!');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue