From 888cde30f0527be605341aac0267c475047a82e9 Mon Sep 17 00:00:00 2001 From: liao Date: Mon, 6 Nov 2023 10:30:25 +0800 Subject: [PATCH] =?UTF-8?q?fix=2078143=20=E5=8A=A8=E6=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF-=E6=9C=AA=E5=8F=91=E5=B8=83=E5=B7=B2=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E7=8A=B6=E6=80=81=E7=9A=84=E6=95=B0=E6=8D=AE=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=9C=80=E8=A6=81=E5=86=8D=E6=98=8E=E7=A1=AE=E4=B8=80?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/laws/common/constant/DictCommon.java | 14 ++++++++++++++ .../common/constant/MessageTemplateCodeCommon.java | 14 ++++++++++++++ .../controller/LawsNewsFeedController.java | 9 +++++---- .../standard/mapper/xml/LawsNewsFeedMapper.xml | 2 +- .../service/impl/LawsNewsFeedServiceImpl.java | 6 ++++-- 5 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/common/constant/DictCommon.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/common/constant/MessageTemplateCodeCommon.java diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/constant/DictCommon.java b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/DictCommon.java new file mode 100644 index 00000000..bdbf9d59 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/DictCommon.java @@ -0,0 +1,14 @@ +package com.jero.modules.laws.common.constant; + +/** + * @Author: liao + * @Date: 2023/11/6 10:23 + * @Description: 字典常量 + */ +public class DictCommon { + + private DictCommon() {} + + public static final String DYNAMIC_NEWS_TYPE_ID = "1704331613726781442"; // 动态分类 dynamic_news_type + +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/constant/MessageTemplateCodeCommon.java b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/MessageTemplateCodeCommon.java new file mode 100644 index 00000000..c2fff036 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/constant/MessageTemplateCodeCommon.java @@ -0,0 +1,14 @@ +package com.jero.modules.laws.common.constant; + +/** + * @Author: liao + * @Date: 2023/11/6 10:28 + * @Description: 消息模板编码 + */ +public class MessageTemplateCodeCommon { + + private MessageTemplateCodeCommon() {} + + public static final String LAWS_NEWS_FEED = "laws_news_feed"; // 动态消息 + +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsNewsFeedController.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsNewsFeedController.java index 53bfe468..7403a59b 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsNewsFeedController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsNewsFeedController.java @@ -74,13 +74,14 @@ public class LawsNewsFeedController extends JeroController save(@Validated @RequestBody LawsNewsFeed lawsNewsFeed) { // 第一次保存,附上初值 if (Objects.isNull(lawsNewsFeed.getReleaseStatus())) { - lawsNewsFeed.setReleaseStatus(0); lawsNewsFeed.setReadCount(0); } - // 发布时间不为空(发布后的保存,发布时间更新) - if (!Objects.isNull(lawsNewsFeed.getReleaseTime())) { + // 未发布 + lawsNewsFeed.setReleaseStatus(0); + // 发布时间不为空(发布后的保存,发布时间更新)-不更新 + /*if (!Objects.isNull(lawsNewsFeed.getReleaseTime())) { lawsNewsFeed.setReleaseTime(new Date()); - } + }*/ lawsNewsFeedService.add(lawsNewsFeed, "save"); return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/mapper/xml/LawsNewsFeedMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/standard/mapper/xml/LawsNewsFeedMapper.xml index 274d413e..1eb15ab1 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/mapper/xml/LawsNewsFeedMapper.xml +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/mapper/xml/LawsNewsFeedMapper.xml @@ -32,6 +32,6 @@ AND lnf.dynamic_heading LIKE CONCAT('%', #{param.dynamicHeading}, '%') - ORDER BY create_time DESC + ORDER BY release_time DESC \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNewsFeedServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNewsFeedServiceImpl.java index 42d204a7..9b064fc4 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNewsFeedServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/service/impl/LawsNewsFeedServiceImpl.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jero.common.api.dto.message.SendMessageDTO; import com.jero.common.api.vo.SendMessageAPI; import com.jero.common.system.vo.LoginUser; +import com.jero.modules.laws.common.constant.DictCommon; import com.jero.modules.laws.common.constant.FieldCommon; +import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon; import com.jero.modules.laws.common.constant.ResultCommon; import com.jero.modules.laws.standard.entity.LawsNewsFeed; import com.jero.modules.laws.standard.entity.LawsPushRange; @@ -168,14 +170,14 @@ public class LawsNewsFeedServiceImpl extends ServiceImpl map = new HashMap<>(); map.put("title", lawsNewsFeed.getDynamicHeading()); LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(SysDictItem::getItemValue, lawsNewsFeed.getDynamicClassification()); - lambdaQueryWrapper.eq(SysDictItem::getDictId, "1704331613726781442"); + lambdaQueryWrapper.eq(SysDictItem::getDictId, DictCommon.DYNAMIC_NEWS_TYPE_ID); SysDictItem sysDictItem = sysDictItemService.getOne(lambdaQueryWrapper); map.put("type", sysDictItem.getItemText());