|
@@ -56,7 +56,7 @@ public class HelpArticleModel {
|
|
public Integer saveArticle(ArticleAddDTO articleAddDTO, Admin admin) throws Exception {
|
|
public Integer saveArticle(ArticleAddDTO articleAddDTO, Admin admin) throws Exception {
|
|
//根据文章标题查重
|
|
//根据文章标题查重
|
|
HelpArticleExample articleExample = new HelpArticleExample();
|
|
HelpArticleExample articleExample = new HelpArticleExample();
|
|
- articleExample.setWebSite(articleAddDTO.getWebSite());
|
|
|
|
|
|
+ articleExample.setWebSite("1");
|
|
articleExample.setTitle(articleAddDTO.getTitle());
|
|
articleExample.setTitle(articleAddDTO.getTitle());
|
|
List<StoreCmsArticle> list = helpArticleReadMapper.listByExample(articleExample);
|
|
List<StoreCmsArticle> list = helpArticleReadMapper.listByExample(articleExample);
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
@@ -64,6 +64,7 @@ public class HelpArticleModel {
|
|
}
|
|
}
|
|
StoreCmsArticle articleInsert = new StoreCmsArticle();
|
|
StoreCmsArticle articleInsert = new StoreCmsArticle();
|
|
PropertyUtils.copyProperties(articleInsert, articleAddDTO);
|
|
PropertyUtils.copyProperties(articleInsert, articleAddDTO);
|
|
|
|
+ articleInsert.setWebSite("1");
|
|
articleInsert.setCreateTime(new Date());
|
|
articleInsert.setCreateTime(new Date());
|
|
articleInsert.setCreateId(admin.getAdminId());
|
|
articleInsert.setCreateId(admin.getAdminId());
|
|
int count = helpArticleWriteMapper.insert(articleInsert);
|
|
int count = helpArticleWriteMapper.insert(articleInsert);
|
|
@@ -140,7 +141,7 @@ public class HelpArticleModel {
|
|
//根据文章标题查重
|
|
//根据文章标题查重
|
|
HelpArticleExample articleExample = new HelpArticleExample();
|
|
HelpArticleExample articleExample = new HelpArticleExample();
|
|
articleExample.setArticleIdNotEquals(articleUpdateDTO.getArticleId());
|
|
articleExample.setArticleIdNotEquals(articleUpdateDTO.getArticleId());
|
|
- articleExample.setWebSite(articleUpdateDTO.getWebSite());
|
|
|
|
|
|
+ articleExample.setWebSite("1");
|
|
articleExample.setTitle(articleUpdateDTO.getTitle());
|
|
articleExample.setTitle(articleUpdateDTO.getTitle());
|
|
List<StoreCmsArticle> list = helpArticleReadMapper.listByExample(articleExample);
|
|
List<StoreCmsArticle> list = helpArticleReadMapper.listByExample(articleExample);
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
@@ -148,6 +149,7 @@ public class HelpArticleModel {
|
|
}
|
|
}
|
|
StoreCmsArticle articleUpdate = new StoreCmsArticle();
|
|
StoreCmsArticle articleUpdate = new StoreCmsArticle();
|
|
PropertyUtils.copyProperties(articleUpdate, articleUpdateDTO);
|
|
PropertyUtils.copyProperties(articleUpdate, articleUpdateDTO);
|
|
|
|
+ articleUpdate.setWebSite("1");
|
|
articleUpdate.setUpdateTime(new Date());
|
|
articleUpdate.setUpdateTime(new Date());
|
|
int count = helpArticleWriteMapper.updateByPrimaryKeySelective(articleUpdate);
|
|
int count = helpArticleWriteMapper.updateByPrimaryKeySelective(articleUpdate);
|
|
if (count == 0) {
|
|
if (count == 0) {
|