Commit 6d0db2e1 by 郑永强

【1002957】原文资讯添加编号管理

parent 3ee3566b
......@@ -534,14 +534,10 @@ public class AppletNewsBizImpl implements AppletNewsBiz {
* * @param null
*/
public Boolean urlNumberExist(AppletNews appletNews) {
Boolean exist = false;
if (!IntroduceTypeEnum.web_introduct.code.equals(appletNews.getJumpType())) {//非外部链接
return exist;
if (StringUtil.isEmpty(appletNews.getUrlNumber())){
throw new BookBizException(BookBizException.ERROR,"资讯/外链编号不能为空");
}
if (!StringUtil.isEmpty(appletNews.getJumpUrl()) && !StringUtil.isEmpty(appletNews.getUrlNumber())) {
exist = appletNewsDao.urlNumberExist(appletNews.getJumpUrl(), appletNews.getUrlNumber(),appletNews.getId());
}
return exist;
return appletNewsDao.urlNumberExist(appletNews.getUrlNumber(),appletNews.getId());
}
@Override
......
......@@ -81,7 +81,7 @@ public interface AppletNewsDao extends BaseDao<AppletNews> {
* @date:2020/5/11 18:43
* * @param null
*/
Boolean urlNumberExist(String jumpUrl, String urlNumber, Long id);
Boolean urlNumberExist(String urlNumber, Long id);
Map<Long, AppletNewsDTO> getByIds(List<Long> appletNewsIds);
......
......@@ -110,9 +110,8 @@ public class AppletNewsDaoImpl extends BaseDaoImpl<AppletNews> implements Applet
}
@Override
public Boolean urlNumberExist(String jumpUrl, String urlNumber, Long id) {
public Boolean urlNumberExist(String urlNumber, Long id) {
Map<String, Object> map = new HashMap<>();
map.put("jumpUrl", jumpUrl);
map.put("urlNumber", urlNumber);
map.put("id", id);
return getSessionTemplate().selectOne(getStatement("urlNumberExist"), map);
......
......@@ -138,7 +138,7 @@
LEFT JOIN rights_setting_classify d ON n.rights_classify_id = d.id
WHERE 1=1
<if test="name != null">
AND n.news_name LIKE CONCAT("%",#{name},"%")
AND (n.news_name LIKE CONCAT("%",#{name},"%") OR n.url_number LIKE CONCAT("%",#{name},"%"))
</if>
<if test="newsClassifyId >0">
AND n.news_classify_id = #{newsClassifyId}
......@@ -324,8 +324,6 @@
FROM applet_news
WHERE
url_number = #{urlNumber}
AND jump_url != #{jumpUrl}
AND jump_type = 2
<if test="id>0">
AND id != #{id}
</if>
......
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