From 47b8910a48e3085e3b758b47b7632399e10cc56e Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期二, 26 一月 2021 13:37:34 +0800 Subject: [PATCH] 一起议 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java | 12 +++ springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java | 4 + springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RichTextUtil.java | 54 +++++++++++++ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java | 3 springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml | 83 +++++++++++--------- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java | 5 + springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java | 6 + springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java | 3 springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class | 0 springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java | 11 ++ springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java | 10 ++ springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/RichTextUtil.class | 0 springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class | 0 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java | 2 15 files changed, 155 insertions(+), 41 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml b/springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml index e2227d2..2b977bc 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml @@ -23,8 +23,17 @@ </component> <component name="ChangeListManager"> <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment=""> + <change afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/utlis/RichTextUtil.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> - <change beforePath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java" afterDir="false" /> </list> <option name="SHOW_DIALOG" value="false" /> @@ -112,7 +121,7 @@ </set> </option> </component> - <component name="RunManager" selected="Application.UserServiceImpl"> + <component name="RunManager" selected="Application.PartyBuildingApi"> <configuration name="ComBpActivityServiceImpl" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <option name="MAIN_CLASS_NAME" value="com.panzhihua.service_dangjian.service.impl.ComBpActivityServiceImpl" /> <module name="service_partybuilding" /> @@ -126,8 +135,8 @@ <option name="Make" enabled="true" /> </method> </configuration> - <configuration name="CommonApi" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> - <option name="MAIN_CLASS_NAME" value="com.panzhihua.applets.api.CommonApi" /> + <configuration name="PartyBuildingApi" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="com.panzhihua.applets.api.PartyBuildingApi" /> <module name="applets" /> <extension name="coverage"> <pattern> @@ -139,8 +148,8 @@ <option name="Make" enabled="true" /> </method> </configuration> - <configuration name="IPUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> - <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.IPUtil" /> + <configuration name="RealNameUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.RealNameUtil" /> <module name="common" /> <extension name="coverage"> <pattern> @@ -152,8 +161,8 @@ <option name="Make" enabled="true" /> </method> </configuration> - <configuration name="RealNameUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> - <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.RealNameUtil" /> + <configuration name="RichTextUtil" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> + <option name="MAIN_CLASS_NAME" value="com.panzhihua.common.utlis.RichTextUtil" /> <module name="common" /> <extension name="coverage"> <pattern> @@ -269,9 +278,7 @@ </method> </configuration> <list> - <item itemvalue="Application.IPUtil" /> <item itemvalue="Application.UserServiceImpl" /> - <item itemvalue="Application.CommonApi" /> <item itemvalue="Application.RealNameUtil" /> <item itemvalue="Application.ComBpActivityServiceImpl" /> <item itemvalue="Spring Boot.AppletsApplication" /> @@ -285,14 +292,16 @@ <item itemvalue="Spring Boot.ZuulApplication" /> <item itemvalue="Spring Boot.ServiceCommunityApplication" /> <item itemvalue="Spring Boot.TimejobApplication" /> + <item itemvalue="Application.RichTextUtil" /> + <item itemvalue="Application.PartyBuildingApi" /> </list> <recent_temporary> <list> + <item itemvalue="Application.PartyBuildingApi" /> + <item itemvalue="Application.RichTextUtil" /> <item itemvalue="Application.UserServiceImpl" /> <item itemvalue="Application.ComBpActivityServiceImpl" /> <item itemvalue="Application.RealNameUtil" /> - <item itemvalue="Application.CommonApi" /> - <item itemvalue="Application.IPUtil" /> </list> </recent_temporary> </component> @@ -410,7 +419,7 @@ <workItem from="1611019208339" duration="94460000" /> <workItem from="1611365644515" duration="33195000" /> <workItem from="1611536010905" duration="21843000" /> - <workItem from="1611622682269" duration="7334000" /> + <workItem from="1611622682269" duration="10848000" /> </task> <servers /> </component> @@ -466,54 +475,54 @@ <screen x="0" y="0" width="1536" height="824" /> </state> <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1610606590056" /> - <state width="1031" height="417" key="GridCell.Tab.0.bottom" timestamp="1611629882001"> + <state width="1493" height="196" key="GridCell.Tab.0.bottom" timestamp="1611639050352"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.0.center" timestamp="1611629882001"> + <state width="1493" height="196" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611639050352" /> + <state width="1493" height="196" key="GridCell.Tab.0.center" timestamp="1611639050351"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.0.left" timestamp="1611629882001"> + <state width="1493" height="196" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1611639050351" /> + <state width="1493" height="196" key="GridCell.Tab.0.left" timestamp="1611639050351"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.0.right" timestamp="1611629882001"> + <state width="1493" height="196" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1611639050351" /> + <state width="1493" height="196" key="GridCell.Tab.0.right" timestamp="1611639050351"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.1.bottom" timestamp="1611629882001"> + <state width="1493" height="196" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1611639050351" /> + <state width="1031" height="417" key="GridCell.Tab.1.bottom" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.1.center" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.1.center" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.1.left" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.1.left" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.1.right" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.1.right" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.2.bottom" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.2.bottom" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.2.center" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.2.center" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.2.left" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.2.left" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> - <state width="1031" height="417" key="GridCell.Tab.2.right" timestamp="1611629882001"> + <state width="1031" height="417" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> + <state width="1031" height="417" key="GridCell.Tab.2.right" timestamp="1611631786566"> <screen x="0" y="0" width="1536" height="824" /> </state> - <state width="1031" height="417" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1611629882001" /> + <state width="1031" height="417" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1611631786566" /> <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124"> <screen x="0" y="0" width="1536" height="824" /> </state> diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java index 62f210b..bfe4ad8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java @@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Date; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -94,6 +95,7 @@ public R signActivity(@RequestBody @Validated(AddGroup.class) SignactivityVO signactivityVO){ Long userId = this.getUserId(); Long activityId = signactivityVO.getActivityId(); + Integer isVolunteer = signactivityVO.getIsVolunteer(); signactivityVO.setUserId(userId); R r = communityService.signActivity(signactivityVO); if (R.isOk(r)&&signactivityVO.getType().intValue()==1) { @@ -105,9 +107,11 @@ sysUserNoticeVO.setTitle("报名成功"); sysUserNoticeVO.setBusinessType(1); sysUserNoticeVO.setBusinessTitle(comActActivityVO.getActivityName()); - sysUserNoticeVO.setBusinessContent(String.format("活动将于%s开始,请按时参加",comActActivityVO.getBeginAt())); + Date beginAt = comActActivityVO.getBeginAt(); + sysUserNoticeVO.setBusinessContent(String.format("活动将于%tF %tT 开始,请按时参加", beginAt,beginAt)); sysUserNoticeVO.setBusinessId(activityId); sysUserNoticeVO.setStatus(0); + sysUserNoticeVO.setActivityType(isVolunteer.intValue()==1?1:2); sysUserNoticeVO.setBusinessStatus(2); R r1 = userService.addNotice(sysUserNoticeVO); if (R.isOk(r1)) { diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java index 27063c2..64e9037 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/PartyBuildingApi.java @@ -38,7 +38,7 @@ @Resource private UserService userService; - @ApiOperation(value = "分页党建动态/政策文件",response =PartyCommitteeVO.class ) + @ApiOperation(value = "分页党建动态/政策文件",response =PartyBuildingComPbDynVO.class ) @PostMapping("pagedynamic") public R pageYnamic(@RequestBody PartyBuildingComPbDynVO partyBuildingComPbDynVO){ Long communityId = this.getCommunityId(); @@ -140,7 +140,8 @@ sysUserNoticeVO.setTitle("报名成功"); sysUserNoticeVO.setBusinessType(2); sysUserNoticeVO.setBusinessTitle(partyBuildingActivityVO.getName()); - sysUserNoticeVO.setBusinessContent(String.format("活动将于%s开始,请按时参加",partyBuildingActivityVO.getActivityTimeBegin())); + Date activityTimeBegin = partyBuildingActivityVO.getActivityTimeBegin(); + sysUserNoticeVO.setBusinessContent(String.format("活动将于 %tF %tT 开始,请按时参加", activityTimeBegin,activityTimeBegin)); sysUserNoticeVO.setBusinessId(id); sysUserNoticeVO.setStatus(0); sysUserNoticeVO.setBusinessStatus(2); @@ -189,4 +190,9 @@ return partyBuildingService.pageServiceTeam(pageComPbServiceTeamDTO); } + public static void main(String[] args) { + Date date = new Date(); + String dateFormat = String.format("%tF %tT ", date, date); + System.out.println(dateFormat); + } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java index e74e3f0..c09a9aa 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActDynVO.java @@ -65,6 +65,9 @@ @ApiModelProperty("动态内容富文本") private String content; + @ApiModelProperty("动态内容富文本--纯文本") + private String contentText; + @ApiModelProperty(value = "社区名字") private String communityName; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java index d330d81..9e142ca 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.java @@ -65,6 +65,9 @@ @ApiModelProperty("社区id") private Long communityId; + @ApiModelProperty("动态内容富文本--纯文本") + private String contentText; + @ApiModelProperty(value = "是否增加 1 增加 0 不增加") private Integer isAdd; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RichTextUtil.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RichTextUtil.java new file mode 100644 index 0000000..e8a57dd --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RichTextUtil.java @@ -0,0 +1,54 @@ +package com.panzhihua.common.utlis; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @program: springcloud_k8s_panzhihuazhihuishequ + * @description: 富文本提取 + * @author: huang.hongfa weixin hhf9596 qq 959656820 + * @create: 2021-01-26 11:18 + **/ +public class RichTextUtil { + private static Pattern p_image= Pattern.compile("<img.*src\\s*=\\s*(.*?)[^>]*?>",Pattern.CASE_INSENSITIVE); + private static Pattern r_image=Pattern.compile("src\\s*=\\s*\"?(.*?)(\"|>|\\s+)"); + + /** + * 提取富文本中纯文本 + */ + public static String getText(String richText) { + String regx = "(<.+?>)|(</.+?>)"; + Matcher matcher = Pattern.compile(regx).matcher(richText); + while (matcher.find()) { + // 替换图片 + richText = matcher.replaceAll("").replace(" ", ""); + } + return richText; + } + + /** + * 提取富文本中图片地址 + */ + public static List<String> getImgStr(String richText) { + List<String> list = new ArrayList<>(); + Matcher pMatcher = p_image.matcher(richText); + while (pMatcher.find()) { + // 得到<img />数据 + String img = pMatcher.group(); + // 匹配<img>中的src数据 + Matcher rMatcher = r_image.matcher(img); + while (rMatcher.find()) { + list.add(rMatcher.group(1)); + } + } + return list; + } + + public static void main(String[] args) { + String s="<p class=\"ql-align-justify\">新年伊始,兴华办湖东社区党委开展了新年送福活动。2020年是不平凡的一年,一场突如其来的新冠肺炎开启了新年的第一天。在经历了疫情、双城创建、人口普查、疫情......更加彰显了党组织的凝聚力和战斗力。辖区党员在疫情防控阻击战中无私奉献、积极捐款、双城创建广大党员积极投身到创建一线、协助人口普查员入户走访、引导广大市民按时参加集中核酸检测......每一个战斗的场面都有共产党员的身影。湖东社区党委为了表达党组织对广大党员积极参与的感谢,激励广大党员不忘初心、牢记使命,为实现新时代党的历史使命不谢奋斗,在新年来临之际以“碗净福至”的含义为辖区党员送上新年祝福。此次送祝福活动共为辖区270名党员送去精美纪念品,收到纪念品的党员激动地说“2020年是我们共同的考验,感谢党组织的认可,我们也会继续发挥党员先锋模范作用。”</p><p class=\"ql-align-justify\"><img src=\"http://image.panzhihua.nhys.cdnhxx.com//idcard/f31fbe096b63f624ebcdee7a844009ff1b4ca3c7.jpg\"></p><p><br></p>"; + String text = RichTextUtil.getText(s); + System.out.println(text); + } +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class index dfc8509..83f89ce 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class +++ b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/community/ComActDynVO.class Binary files differ diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class index 7867f67..d1e417c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class +++ b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/partybuilding/PartyBuildingComPbDynVO.class Binary files differ diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/RichTextUtil.class b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/RichTextUtil.class new file mode 100644 index 0000000..537f72e --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/utlis/RichTextUtil.class Binary files differ diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java index ea38d06..910c8f9 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java @@ -166,7 +166,7 @@ "</script>") IPage<ComActDiscussCommentVO> pageDiscussCommentApplets(Page page, @Param("pageComActDiscussCommentDTO")PageComActDiscussCommentDTO pageComActDiscussCommentDTO); - @Select("select name from com_act where community_id=#{communityId}") + @Select("select name,address from com_act where community_id=#{communityId}") ComActVO selectCommunity(Long communityId); @Select("SELECT \n" + diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java index b2c1b58..03d5812 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDiscussDO.java @@ -1,6 +1,7 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.*; +import com.panzhihua.common.model.vos.community.ComActVO; import lombok.Data; import java.io.Serializable; @@ -68,4 +69,6 @@ * 投票标题 */ private String voteTitle; + + } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java index cd7ad2f..04bbbae 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java @@ -59,6 +59,11 @@ public R addDiscuss(ComActDiscussDTO comActDiscussDTO) { ComActDiscussDO comActDiscussDO=new ComActDiscussDO(); BeanUtils.copyProperties(comActDiscussDTO,comActDiscussDO); + ComActVO comActVO=comActDiscussDAO.selectCommunity(comActDiscussDTO.getCommunityId()); + String address = comActDiscussDO.getAddress(); + if (ObjectUtils.isEmpty(address)) { + comActDiscussDO.setAddress(comActVO.getAddress()); + } int insert = comActDiscussDAO.insert(comActDiscussDO); if (insert>0) { ComActDiscussDO comActDiscussDO1 = comActDiscussDAO.selectOne(new QueryWrapper<ComActDiscussDO>().lambda().eq(ComActDiscussDO::getDiscussSubject, comActDiscussDTO.getDiscussSubject()).eq(ComActDiscussDO::getUserId, comActDiscussDTO.getUserId()).last(" order by create_at desc limit 1 ")); diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java index 0436238..03d4b34 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDynServiceImpl.java @@ -7,6 +7,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.common.model.vos.community.ComActDynVO; +import com.panzhihua.common.utlis.RichTextUtil; import com.panzhihua.service_community.dao.ComActDAO; import com.panzhihua.service_community.dao.ComActDynDAO; import com.panzhihua.service_community.dao.ComActDynUserDAO; @@ -21,6 +22,7 @@ import javax.annotation.Resource; import java.util.Date; +import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -59,6 +61,16 @@ page.setSize(pageSize); page.setCurrent(pageNum); IPage<ComActDynVO> iPage = comActDynDAO.pageDynamic(page, comActDynVO); + List<ComActDynVO> records = iPage.getRecords(); + if (!ObjectUtils.isEmpty(records)) { + records.forEach(comActDynVO1 -> { + String content = comActDynVO1.getContent(); + if (!ObjectUtils.isEmpty(content)) { + String text = RichTextUtil.getText(content); + comActDynVO1.setContentText(text); + } + }); + } return R.ok(iPage); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java index 07b0db5..52e4afb 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java @@ -369,6 +369,10 @@ if (empty) { return R.ok(null,"已经取消"); }else{ + Long createBy = comPbActivityDO.getCreateBy(); + if (createBy.equals(userId)) { + return R.fail("发起者不能取消报名"); + } mum=comPbActivityMemberDAO.deleteById(comPbActivityMemberDO.getId()); } } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java index 3725ed4..c4dc849 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java @@ -8,6 +8,7 @@ import com.panzhihua.common.exceptions.PartyBuildingMemberException; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.partybuilding.*; +import com.panzhihua.common.utlis.RichTextUtil; import com.panzhihua.service_dangjian.dao.*; import com.panzhihua.service_dangjian.model.dos.*; import com.panzhihua.service_dangjian.service.ComPbMemberService; @@ -371,6 +372,16 @@ page.setSize(pageSize); page.setCurrent(pageNum); IPage<PartyBuildingComPbDynVO> iPage=comPbDynDAO.pageYnamic(page, partyBuildingComPbDynVO); + List<PartyBuildingComPbDynVO> records = iPage.getRecords(); + if (!(ObjectUtils.isEmpty(records))) { + records.forEach(partyBuildingComPbDynVO1 -> { + String content = partyBuildingComPbDynVO1.getContent(); + if (!ObjectUtils.isEmpty(content)) { + String text = RichTextUtil.getText(content); + partyBuildingComPbDynVO1.setContentText(text); + } + }); + } return R.ok(iPage); } -- Gitblit v1.7.1