Commit 50b1dd92 authored by wujj's avatar wujj

Merge remote-tracking branch 'origin/master'

parents 527f2b27 fd764fdb
...@@ -123,9 +123,9 @@ public class ContentAction extends BaseAction { ...@@ -123,9 +123,9 @@ public class ContentAction extends BaseAction {
*/ */
@ApiOperation(value = "根据封面获取文章列表接口") @ApiOperation(value = "根据封面获取文章列表接口")
@ApiImplicitParam(name = "categoryId", value = "分类编号", required =true,paramType="query") @ApiImplicitParam(name = "categoryId", value = "分类编号", required =true,paramType="query")
@GetMapping("/getByFengMian") @GetMapping("/getFromFengMian")
@ResponseBody @ResponseBody
public ResultData getByFengMian(@ModelAttribute @ApiIgnore ContentEntity content){ public ResultData getFromFengMian(@ModelAttribute @ApiIgnore ContentEntity content){
if(content.getCategoryId() == null) { if(content.getCategoryId() == null) {
return ResultData.build().error(); return ResultData.build().error();
} }
......
...@@ -37,13 +37,7 @@ public class ContentBean extends ContentEntity { ...@@ -37,13 +37,7 @@ public class ContentBean extends ContentEntity {
*/ */
private String noflag; private String noflag;
// public String getStaticUrl() {
// return staticUrl;
// }
//
// public void setStaticUrl(String staticUrl) {
// this.staticUrl = staticUrl;
// }
public String getBeginTime() { public String getBeginTime() {
return beginTime; return beginTime;
......
...@@ -34,7 +34,6 @@ import net.mingsoft.cms.dao.ICategoryDao; ...@@ -34,7 +34,6 @@ import net.mingsoft.cms.dao.ICategoryDao;
import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity; import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.util.CmsParserUtil; import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.bean.AttributeBean;
import net.mingsoft.mdiy.bean.PageBean; import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.entity.ModelEntity; import net.mingsoft.mdiy.entity.ModelEntity;
import net.mingsoft.mdiy.util.ParserUtil; import net.mingsoft.mdiy.util.ParserUtil;
...@@ -122,7 +121,6 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp ...@@ -122,7 +121,6 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
// 网站风格物理路径 // 网站风格物理路径
List<CategoryBean> articleIdList = null; List<CategoryBean> articleIdList = null;
List<CategoryEntity> categoryList = null; List<CategoryEntity> categoryList = null;
AttributeBean attributeBean = new AttributeBean();
ContentBean contentBean = new ContentBean(); ContentBean contentBean = new ContentBean();
contentBean.setBeginTime(dateTime); contentBean.setBeginTime(dateTime);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
...@@ -145,12 +143,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp ...@@ -145,12 +143,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
LOG.error("模板不存在:{}",category.getCategoryUrl()); LOG.error("模板不存在:{}",category.getCategoryUrl());
continue; continue;
} }
// 获取文章列表表属性
ParserUtil.read(category.getCategoryListUrl(),map, page,attributeBean);
contentBean.setFlag(attributeBean.getFlag());
contentBean.setNoflag(attributeBean.getNoflag());
contentBean.setOrder(attributeBean.getOrder());
contentBean.setOrderBy(attributeBean.getOrderby());
} }
articleIdList = queryIdsByCategoryIdForParser(contentBean); articleIdList = queryIdsByCategoryIdForParser(contentBean);
// 有符合条件的就更新 // 有符合条件的就更新
...@@ -190,13 +183,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp ...@@ -190,13 +183,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
map.put(ParserUtil.HTML, ParserUtil.HTML); map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.URL, BasicUtil.getUrl());
map.put(ParserUtil.PAGE, page); map.put(ParserUtil.PAGE, page);
AttributeBean attributeBean = new AttributeBean();
// 获取文章列表模板标签属性
ParserUtil.read(column.getCategoryListUrl(), map, page, attributeBean);
contentBean.setFlag(attributeBean.getFlag());
contentBean.setNoflag(attributeBean.getNoflag());
contentBean.setOrder(attributeBean.getOrder());
contentBean.setOrderBy(attributeBean.getOrderby());
} }
articleIdList = contentDao.queryIdsByCategoryIdForParser(contentBean); articleIdList = contentDao.queryIdsByCategoryIdForParser(contentBean);
// 判断列表类型 // 判断列表类型
...@@ -242,7 +229,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp ...@@ -242,7 +229,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
if(BasicUtil.getWebsiteApp() !=null){ if(BasicUtil.getWebsiteApp() !=null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId()); map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
} }
String read = ParserUtil.read(templatePath, map); String read = ParserUtil.rendering(templatePath, map);
FileUtil.writeString(read, ParserUtil.buildHtmlPath(targetPath), net.mingsoft.base.constant.Const.UTF8); FileUtil.writeString(read, ParserUtil.buildHtmlPath(targetPath), net.mingsoft.base.constant.Const.UTF8);
} }
......
...@@ -391,14 +391,6 @@ private static final long serialVersionUID = 1574925152750L; ...@@ -391,14 +391,6 @@ private static final long serialVersionUID = 1574925152750L;
* 获取栏目图片 (标签使用) * 获取栏目图片 (标签使用)
*/ */
public String getTypelitpic() { public String getTypelitpic() {
if(StrUtil.isNotBlank(categoryImg)){ return categoryImg;
try{
JSONArray objects = JSON.parseArray(categoryImg);
return objects.getJSONObject(0).getString("path");
}catch (Exception e){
}
}
return "";
} }
} }
...@@ -11,7 +11,6 @@ import net.mingsoft.basic.util.BasicUtil; ...@@ -11,7 +11,6 @@ import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.basic.util.SpringUtil; import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.bean.CategoryBean; import net.mingsoft.cms.bean.CategoryBean;
import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.mdiy.bean.AttributeBean;
import net.mingsoft.mdiy.bean.PageBean; import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.biz.IModelBiz; import net.mingsoft.mdiy.biz.IModelBiz;
import net.mingsoft.mdiy.biz.impl.ModelBizImpl; import net.mingsoft.mdiy.biz.impl.ModelBizImpl;
...@@ -72,25 +71,36 @@ public class CmsParserUtil extends ParserUtil { ...@@ -72,25 +71,36 @@ public class CmsParserUtil extends ParserUtil {
throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException { throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException {
try{ try{
// 文章的栏目模型编号 // 文章的栏目模型编号
Integer columnContentModelId = column.getMdiyModelId();
PageBean page = new PageBean(); PageBean page = new PageBean();
page.setSize(10);
//获取分页数量
//获取列表页显示的文章数量 //获取列表中的size
//获取总数 page.setSize(ParserUtil.getPageSize(column.getCategoryListUrl(),20));
page.setRcount(articleIdTotal);
int totalPageSize = PageUtil.totalPage(articleIdTotal, page.getSize());
page.setTotal(totalPageSize);
//获取模板中列表标签中的条件
Map<String, Object> map = new HashMap<>();
if (BasicUtil.getWebsiteApp() != null) {
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl());
map.put(ParserUtil.PAGE, page);
String columnListPath; String columnListPath;
ModelEntity contentModel = null; ModelEntity contentModel = null;
// 判断当前栏目是否有自定义模型 // 判断当前栏目是否有自定义模型
if (columnContentModelId != null) { if (column.getMdiyModelId() != null) {
// 通过栏目模型编号获取自定义模型实体 // 通过栏目模型编号获取自定义模型实体
contentModel = (ModelEntity) SpringUtil.getBean(ModelBizImpl.class).getEntity(columnContentModelId); contentModel = (ModelEntity) SpringUtil.getBean(ModelBizImpl.class).getEntity(column.getMdiyModelId());
} }
int pageNo = 1;
//全局参数设置 //全局参数设置
Map<String, Object> parserParams = new HashMap<String, Object>(); Map<String, Object> parserParams = new HashMap<String, Object>();
parserParams.put(ParserUtil.PAGE, page);
parserParams.put(COLUMN, column); parserParams.put(COLUMN, column);
//标签中使用field获取当前栏目 //标签中使用field获取当前栏目
parserParams.put(FIELD, column); parserParams.put(FIELD, column);
...@@ -107,18 +117,15 @@ public class CmsParserUtil extends ParserUtil { ...@@ -107,18 +117,15 @@ public class CmsParserUtil extends ParserUtil {
if(ParserUtil.IS_SINGLE) { if(ParserUtil.IS_SINGLE) {
parserParams.put(ParserUtil.URL, BasicUtil.getUrl()); parserParams.put(ParserUtil.URL, BasicUtil.getUrl());
} }
parserParams.put(ParserUtil.PAGE, page);
AttributeBean attributeBean = new AttributeBean(); int pageNo = 1;
ParserUtil.read(File.separator + column.getCategoryListUrl(),parserParams, page,attributeBean);
int totalPageSize = PageUtil.totalPage(articleIdTotal, page.getSize());
page.setTotal(totalPageSize);
//文章列表页没有写文章列表标签,总数为0 //文章列表页没有写文章列表标签,总数为0
if (totalPageSize <= 0) { if (totalPageSize <= 0) {
// 数据库中第一页是从开始0*size // 数据库中第一页是从开始0*size
columnListPath = ParserUtil.buildHtmlPath(column.getCategoryPath() + File.separator + ParserUtil.INDEX); columnListPath = ParserUtil.buildHtmlPath(column.getCategoryPath() + File.separator + ParserUtil.INDEX);
// 设置分页的起始位置 // 设置分页的起始位置
page.setPageNo(pageNo); page.setPageNo(pageNo);
String read = ParserUtil.read(File.separator + column.getCategoryListUrl(), parserParams); String read = ParserUtil.rendering(File.separator + column.getCategoryListUrl(), parserParams);
FileUtil.writeString(read, columnListPath, Const.UTF8); FileUtil.writeString(read, columnListPath, Const.UTF8);
} else { } else {
...@@ -136,7 +143,7 @@ public class CmsParserUtil extends ParserUtil { ...@@ -136,7 +143,7 @@ public class CmsParserUtil extends ParserUtil {
} }
// 设置分页的起始位置 // 设置分页的起始位置
page.setPageNo(pageNo); page.setPageNo(pageNo);
String read = ParserUtil.read(File.separator + column.getCategoryListUrl(), parserParams); String read = ParserUtil.rendering(File.separator + column.getCategoryListUrl(), parserParams);
FileUtil.writeString(read, columnListPath, Const.UTF8); FileUtil.writeString(read, columnListPath, Const.UTF8);
pageNo++; pageNo++;
} }
......
...@@ -525,9 +525,9 @@ ...@@ -525,9 +525,9 @@
}); });
}, },
//根据封面获取当前文章 //根据封面获取当前文章
getByFengMian: function (categoryId) { getFromFengMian: function (categoryId) {
var that = this; var that = this;
ms.http.get(ms.manager + "/cms/content/getByFengMian.do", { ms.http.get(ms.manager + "/cms/content/getFromFengMian.do", {
"categoryId": categoryId "categoryId": categoryId
}).then(function (res) { }).then(function (res) {
if (res.result) { if (res.result) {
...@@ -680,7 +680,7 @@ ...@@ -680,7 +680,7 @@
this.get(this.form.id); this.get(this.form.id);
} }
if (this.type) { if (this.type) {
this.getByFengMian(this.form.categoryId); this.getFromFengMian(this.form.categoryId);
this.returnIsShow = false; this.returnIsShow = false;
} }
} }
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
#index .left-tree{ #index .left-tree{
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
width: 180px; width: 220px;
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
} }
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="栏目名" align="left" prop="categoryId" :formatter="contentCategoryIdFormat" width="100"> <el-table-column label="栏目名" align="left" prop="categoryId" :formatter="contentCategoryIdFormat" width="180">
</el-table-column> </el-table-column>
<el-table-column label="文章标题" align="left" prop="contentTitle" show-overflow-tooltip> <el-table-column label="文章标题" align="left" prop="contentTitle" show-overflow-tooltip>
</el-table-column> </el-table-column>
......
...@@ -328,7 +328,8 @@ ...@@ -328,7 +328,8 @@
}) })
if (sub.syncStoreUrl) { if (sub.syncStoreUrl) {
sub.modelUrl = sub.syncStoreUrl //sub.modelUrl = "http://store.web.i.mingsoft.net/#/?client=localhost:8080//ms";
sub.modelUrl = sub.syncStoreUrl;
sub.modelTitle = 'mstore'; sub.modelTitle = 'mstore';
sub.isStore = true; sub.isStore = true;
!result ? this.editableTabs.push(sub) : "" !result ? this.editableTabs.push(sub) : ""
......
Markdown is supported
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