appid方法修改

This commit is contained in:
wujj 2020-11-06 16:32:27 +08:00
parent 12f5881619
commit f23d238cf7
7 changed files with 33 additions and 15 deletions

View File

@ -96,7 +96,7 @@ public class CategoryAction extends BaseAction {
*/
@GetMapping("/form")
public String form(@ModelAttribute CategoryEntity category, HttpServletResponse response, HttpServletRequest request, ModelMap model){
model.addAttribute("appId", BasicUtil.getAppId());
model.addAttribute("appId", BasicUtil.getApp().getAppId());
return "/cms/category/form";
}

View File

@ -98,7 +98,7 @@ public class ContentAction extends BaseAction {
*/
@GetMapping("/form")
public String form(@ModelAttribute ContentEntity content, HttpServletResponse response, HttpServletRequest request, ModelMap model){
model.addAttribute("appId", BasicUtil.getAppId());
model.addAttribute("appId", BasicUtil.getApp().getAppId());
return "/cms/content/form";
}
@ -176,7 +176,7 @@ public class ContentAction extends BaseAction {
}
/**
* @param content 文章实体
* @param contents 文章实体
*/
@ApiOperation(value = "批量删除文章列表接口")
@PostMapping("/delete")

View File

@ -182,7 +182,9 @@ public class GeneraterAction extends BaseAction {
}
//获取模板中列表标签中的条件
Map<String, Object> map = new HashMap<>();
map.put(ParserUtil.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
PageBean page = new PageBean();
map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl());
@ -238,7 +240,9 @@ public class GeneraterAction extends BaseAction {
ContentBean contentBean = new ContentBean();
contentBean.setBeginTime(dateTime);
Map<String, Object> map = new HashMap<>();
map.put(ParserUtil.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
PageBean page = new PageBean();
map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl());

View File

@ -132,7 +132,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
entity.setContentId(content.getId());
entity.setCreateDate(new Date());
historyLogBiz.saveEntity(entity);
if(content.getAppId() == null || content.getAppId() != BasicUtil.getAppId()){
if(content.getAppId() == null || content.getAppId() != BasicUtil.getApp().getAppId()){
return "document.write(0)";
}
return "document.write(" + content.getContentHit() + ")";

View File

@ -396,10 +396,12 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
});
//查询数量
int count= contentBiz.getSearchCount(contentModel,fieldValueList,searchMap,BasicUtil.getAppId(),categoryIds);
int count= contentBiz.getSearchCount(contentModel,fieldValueList,searchMap,BasicUtil.getApp().getAppId(),categoryIds);
map.put(ParserUtil.URL, url);
map.put(SEARCH, searchMap);
map.put(ParserUtil.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
map.put(ParserUtil.PAGE, page);
map.put(ParserUtil.HTML, ParserUtil.HTML);
//动态解析

View File

@ -83,7 +83,9 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
@Override
public List<CategoryBean> queryIdsByCategoryIdForParser(ContentBean contentBean) {
contentBean.setAppId(BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() !=null){
contentBean.setAppId( BasicUtil.getWebsiteApp().getAppId());
}
return this.contentDao.queryIdsByCategoryIdForParser(contentBean);
}
@ -103,7 +105,7 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
try {
//将任务采集传过来的appId导入到线程变量中
//当前线程使用appId时优先使用此数据
DataHolder.set(net.mingsoft.basic.constant.Const.APP_ID, appId);
DataHolder.set(ParserUtil.APP_ID, appId);
//调用三种静态化
genernateColumn();
generaterIndex(tmpFileName, generateFileName);
@ -127,7 +129,9 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
ContentBean contentBean = new ContentBean();
contentBean.setBeginTime(dateTime);
Map<String, Object> map = new HashMap<>();
map.put(net.mingsoft.basic.constant.Const.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
PageBean page = new PageBean();
map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl());
@ -166,7 +170,9 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
List<CategoryEntity> columns = new ArrayList<>();
// 获取所有的内容管理栏目
CategoryEntity categoryEntity=new CategoryEntity();
categoryEntity.setAppId(BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() !=null){
categoryEntity.setAppId( BasicUtil.getWebsiteApp().getAppId());
}
columns = categoryDao.query(categoryEntity);
List<CategoryBean> articleIdList = null;
// 1设置模板文件夹路径
@ -183,7 +189,9 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
}
//获取模板中列表标签中的条件
Map<String, Object> map = new HashMap<>();
map.put(net.mingsoft.basic.constant.Const.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
PageBean page = new PageBean();
map.put(ParserUtil.HTML, ParserUtil.HTML);
map.put(ParserUtil.URL, BasicUtil.getUrl());
@ -237,7 +245,9 @@ public class ContentBizImpl extends BaseBizImpl<IContentDao, ContentEntity> imp
//设置生成的路径
map.put(ParserUtil.HTML, ParserUtil.HTML);
//设置站点编号
map.put(Const.APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() !=null){
map.put(ParserUtil.APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
String read = ParserUtil.read(templatePath, map);
FileUtil.writeString(read, ParserUtil.buildHtmlPath(targetPath), net.mingsoft.base.constant.Const.UTF8);
}

View File

@ -96,7 +96,9 @@ public class CmsParserUtil extends ParserUtil {
parserParams.put(FIELD, column);
parserParams.put(IS_DO, false);
parserParams.put(HTML, HTML);
parserParams.put(APP_ID, BasicUtil.getAppId());
if(BasicUtil.getWebsiteApp() != null){
parserParams.put(APP_ID, BasicUtil.getWebsiteApp().getAppId());
}
if (contentModel!=null) {
// 将自定义模型编号设置为key值
parserParams.put(TABLE_NAME, contentModel.getModelTableName());