Commit 0436114b authored by msgroup's avatar msgroup Committed by mingsoft
Browse files

up: 5.4.5

parent 215940eb
Showing with 122 additions and 874 deletions
+122 -874
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mcms</artifactId>
<version>5.4.4</version>
<version>5.4.5</version>
<name>${project.groupId}:${project.artifactId}</name>
<!-- 打包war包,注意不启用(resources》resource》excludes的配置并注释掉maven-assembly-plugin 插件配置 -->
<!--<packaging>war</packaging>-->
......@@ -44,24 +44,24 @@
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-base</artifactId>
<version>2.2.7</version>
<version>2.2.8</version>
</dependency>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-basic</artifactId>
<version>2.2.7</version>
<version>2.2.8</version>
</dependency>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mdiy</artifactId>
<version>2.2.7</version>
<version>2.2.8</version>
</dependency>
<!--store入口依赖(源码不开发),如果不需要MStore可以直接去掉依赖-->
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>store-client</artifactId>
<version>2.2.7.1</version>
<version>2.2.8.1</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
......
......@@ -51,9 +51,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 文章管理控制层
......
......@@ -237,6 +237,7 @@ public class GeneraterAction extends BaseAction {
}
if (articleIdList.size() == 0) {
LOG.error("静态化单篇类型栏目异常:{} ,异常原因:没有文章", column.getCategoryTitle());
CategoryBean columnArticleIdBean = new CategoryBean();
CopyOptions copyOptions = CopyOptions.create();
copyOptions.setIgnoreError(true);
......
......@@ -23,6 +23,7 @@
package net.mingsoft.cms.action.web;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -30,26 +31,28 @@ import io.swagger.annotations.ApiOperation;
import net.mingsoft.base.entity.ResultData;
import net.mingsoft.basic.bean.EUListBean;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.biz.IHistoryLogBiz;
import net.mingsoft.cms.constant.e.CategoryTypeEnum;
import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.entity.HistoryLogEntity;
import net.mingsoft.mdiy.biz.IConfigBiz;
import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.biz.IModelBiz;
import net.mingsoft.mdiy.entity.ModelEntity;
import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
/**
* 文章管理控制层
......@@ -75,47 +78,67 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@Autowired
private IModelBiz modelBiz;
@Autowired
private IConfigBiz modelBiz1;
@Autowired
private IHistoryLogBiz historyLogBiz;
/**
* 查询文章列表接口
* @param content 文章
* @return
*/
@ApiOperation(value = "查询文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "文章id", required =false,paramType="query"),
@ApiImplicitParam(name = "contentTitle", value = "文章标题", required =false,paramType="query"),
@ApiImplicitParam(name = "contentShortTitle", value = "文章副标题", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "contentType", value = "文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =false,paramType="query"),
@ApiImplicitParam(name = "contentTags", value = "文章标签", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentOutLink", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "contentHit", value = "点击次数", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryType", value = "栏目类型", required =false,paramType="query"),
@ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"),
@ApiImplicitParam(name = "flag", value = "属性标记", required =false,paramType="query"),
@ApiImplicitParam(name = "noflag", value = "排除文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "hasDetailHtml", value = "文章是否被静态化", required =false,paramType="query"),
@ApiImplicitParam(name = "hasListHtml", value = "栏目是否被静态化", required =false,paramType="query"),
@ApiImplicitParam(name = "typeid", value = "所属栏目", required =true,paramType="query"),
@ApiImplicitParam(name = "pageNo", value = "页码", required =false,paramType="query"),
@ApiImplicitParam(name = "size", value = "一页显示数量", required =false,paramType="query"),
@ApiImplicitParam(name = "orderby", value = "排序", required =false,paramType="query"),
})
@RequestMapping(value = "/list",method = {RequestMethod.GET,RequestMethod.POST})
@GetMapping(value = "/list")
@ResponseBody
public ResultData list(@ModelAttribute @ApiIgnore ContentBean content) {
BasicUtil.startPage();
content.setSqlWhere("");
List contentList = contentBiz.query(content);
return ResultData.build().success(new EUListBean(contentList,(int)BasicUtil.endPage(contentList).getTotal()));
public ResultData list(HttpServletResponse response, HttpServletRequest request) {
//会将请求参数全部转换map
Map map = BasicUtil.assemblyRequestMap();
String typeid = (String) map.get("typeid");
if (StrUtil.isBlank(typeid)){
return ResultData.build().error(getResString("err.empty", this.getResString("content.category.id")));
}
ContentBean content = new ContentBean();
content.setCategoryType(CategoryTypeEnum.LIST.toString());
content.setContentDisplay("0");
content.setCategoryId(typeid);
List<CategoryBean> articleList = contentBiz.queryIdsByCategoryIdForParser(content);
PageBean page = new PageBean();
List filedStr = new ArrayList<>();
page.setPageNo(BasicUtil.getInt("pageNo",1));
page.setSize(BasicUtil.getInt("size",10));
map.put("ispaging","true");
map.putIfAbsent("size",page.getSize());
if (BasicUtil.getWebsiteApp() != null) {
map.put("appid", BasicUtil.getWebsiteApp().getId());
}
map.put(ParserUtil.PAGE, page);
if (typeid != null) {
CategoryEntity column = categoryBiz.getById(typeid);
// 获取表单类型的id
if (column != null && ObjectUtil.isNotNull(column.getMdiyModelId())) {
ModelEntity contentModel = (ModelEntity) modelBiz.getById(column.getMdiyModelId());
if (contentModel != null) {
// 保存自定义模型的数据
Map<String, String> fieldMap = contentModel.getFieldMap();
for (String s : fieldMap.keySet()) {
filedStr.add(fieldMap.get(s));
}
// 设置自定义模型表名,方便解析的时候关联表查询
map.put(ParserUtil.TABLE_NAME, contentModel.getModelTableName());
}
}
// 设置栏目,方便解析的时候关联表查询
map.put(ParserUtil.COLUMN, column);
}
//实际上list是需要参数,例如分页、栏目分类、属性等待,具体看标签arclist对应的参数
List contentList = contentBiz.list(map);
return ResultData.build().success(new EUListBean(contentList,articleList.size()));
}
......@@ -191,7 +214,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
entity.setHlIp(ip);
entity.setContentId(content.getId());
entity.setCreateDate(new Date());
historyLogBiz.saveEntity(entity);
historyLogBiz.save(entity);
return "document.write(" + content.getContentHit() + ")";
}
......
......@@ -37,7 +37,6 @@ import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.entity.HistoryLogEntity;
import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
......@@ -111,7 +110,7 @@ public class ContentAop extends BaseAop {
historyLog.setHlIsMobile(BasicUtil.isMobileDevice());
historyLog.setCreateDate(new Date());
//保存浏览记录
historyLogBiz.saveEntity(historyLog);
historyLogBiz.save(historyLog);
//更新点击数
if (content.getContentHit() == null) {
content.setContentHit(1);
......
......@@ -23,6 +23,7 @@
package net.mingsoft.cms.biz;
import net.mingsoft.base.biz.IBaseBiz;
import net.mingsoft.cms.entity.HistoryLogEntity;
/**
......@@ -31,6 +32,6 @@ import net.mingsoft.base.biz.IBaseBiz;
* 创建日期:2019-12-23 9:24:03<br/>
* 历史修订:<br/>
*/
public interface IHistoryLogBiz extends IBaseBiz {
public interface IHistoryLogBiz extends IBaseBiz<HistoryLogEntity> {
}
......@@ -28,6 +28,7 @@ import net.mingsoft.base.biz.impl.BaseBizImpl;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.cms.biz.IHistoryLogBiz;
import net.mingsoft.cms.dao.ICmsHistoryLogDao;
import net.mingsoft.cms.entity.HistoryLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -37,8 +38,8 @@ import org.springframework.stereotype.Service;
* 创建日期:2019-12-23 9:24:03<br/>
* 历史修订:<br/>
*/
@Service("cmshistoryLogBizImpl")
public class HistoryLogBizImpl extends BaseBizImpl implements IHistoryLogBiz {
@Service("cmsHistoryLogBizImpl")
public class HistoryLogBizImpl extends BaseBizImpl<ICmsHistoryLogDao, HistoryLogEntity> implements IHistoryLogBiz {
@Autowired
......
......@@ -23,6 +23,7 @@
package net.mingsoft.cms.dao;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.cms.entity.HistoryLogEntity;
/**
* 文章浏览记录持久层
......@@ -30,5 +31,5 @@ import net.mingsoft.base.dao.IBaseDao;
* 创建日期:2019-12-23 9:24:03<br/>
* 历史修订:<br/>
*/
public interface ICmsHistoryLogDao extends IBaseDao {
public interface ICmsHistoryLogDao extends IBaseDao<HistoryLogEntity> {
}
......@@ -322,7 +322,7 @@
ct.id article_id,ct.content_img litpic,c.*,ct.update_date as content_update_date
FROM cms_content ct
LEFT JOIN cms_category c ON ct.category_id = c.id
where ct.del=0 and ct.content_display=0 and c.category_display='enable'
where ct.del=0 and ct.content_display='0' and c.category_display='enable'
<!-- 查询子栏目数据 -->
<if test="categoryId!=null and categoryId!='' and categoryType== '1'.toString()">
......@@ -373,7 +373,7 @@
ct.id article_id,ct.content_img litpic,c.*
FROM cms_content ct
LEFT JOIN cms_category c ON ct.category_id = c.id
where ct.del=0 and ct.content_display=0 and c.category_display='enable'
where ct.del=0 and ct.content_display='0' and c.category_display='enable'
<!-- 查询子栏目数据 -->
<if test="categoryId!=null and categoryId!='' and categoryType== '1'.toString()">
......@@ -434,16 +434,16 @@
</if>
<where>
a.del=0
and a.content_display=0
and a.content_display='0'
and c.category_display='enable'
and c.category_is_search='enable'
<if test="categoryIds!=null and categoryIds!=''">
and
<foreach item="item" index="index" collection="categoryIds.split(',')" open="(" separator="or"
close=")">
a.category_id=${item}
a.category_id=#{item}
or a.category_id in (select id FROM cms_category where cms_category.del=0
and FIND_IN_SET(${item},CATEGORY_PARENT_IDS) > 0)
and FIND_IN_SET(#{item},CATEGORY_PARENT_IDS) > 0)
</foreach>
</if>
......
......@@ -22,6 +22,9 @@
package net.mingsoft.cms.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import net.mingsoft.base.entity.BaseEntity;
/**
* 文章浏览记录实体
......@@ -29,10 +32,23 @@ import net.mingsoft.base.entity.BaseEntity;
* 创建日期:2019-12-23 9:24:03<br/>
* 历史修订:<br/>
*/
@TableName("cms_history_log")
public class HistoryLogEntity extends BaseEntity {
private static final long serialVersionUID = 1577064243576L;
@TableId(type = IdType.AUTO)
private String id;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
/**
* 文章编号
*/
......
......@@ -14,7 +14,7 @@
<el-button type="primary" class="iconfont icon-baocun" size="default" @click="save()" :loading="saveDisabled">保存
</el-button>
</@shiro.hasPermission>
<el-button v-if="categoryType!='2' || id!=null" size="default" class="iconfont icon-fanhui" plain @click="back()">返回
<el-button v-if="categoryType!='2' || id!=null" size="default" class="iconfont icon-fanhui" plain @click="back()">返回
</el-button>
<el-button v-if="form.id && categoryType=='2'" size="default" type="danger" class="el-icon-delete" @click="del()" :disabled="!form.id" >删除
</el-button>
......@@ -559,7 +559,7 @@
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
var formData = that.form;
var formData = JSON.parse(JSON.stringify(that.form));
formData.contentImg = "";
formData.contentType = "";
formData.contentTags = "";
......
......@@ -80,7 +80,7 @@
this.$refs.treeRef.setCurrentKey(null);
return;
} else {
this.id = null;
this.action = 'form';
this.categoryId = data.id;
this.categoryType = data.categoryType;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment