| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入articleoy") |
| | | public R<Article> detail(Article article) { |
| | | public R<Article> detail(ArticleVO article) { |
| | | Article detail = articleService.getArticleOne(article); |
| | | UpdateWrapper<Article> objectUpdateWrapper = new UpdateWrapper<>(); |
| | | objectUpdateWrapper.setSql("view_number = view_number + 1"); |
| | |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @NotNull(message = "标题不能为空") |
| | | // @NotNull(message = "标题不能为空") |
| | | private String title; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @NotNull(message = "类型") |
| | | // @NotNull(message = "类型") |
| | | private Integer type; |
| | | |
| | | /** |
| | |
| | | * @param article |
| | | * @return |
| | | */ |
| | | List<ArticleVO> selectArticlePageByApp(IPage page, ArticleVO article); |
| | | List<ArticleVO> selectArticlePageByApp(IPage page, @Param("article") ArticleVO article); |
| | | |
| | | /** |
| | | * 查询资讯分页信息 |
| | |
| | | |
| | | Boolean upcomment(String ids, String type); |
| | | |
| | | ArticleVO getArticleOne(Article article); |
| | | ArticleVO getArticleOne(ArticleVO article); |
| | | } |
| | |
| | | ja.update_user, |
| | | ja.create_user, |
| | | ja.is_deleted, |
| | | bdb.dict_value dictValue |
| | | bdb.dict_value dictValue, |
| | | jpd.id pdId, |
| | | jpd.event_type |
| | | from jczz_article ja LEFT JOIN blade_dict_biz bdb on ja.article_type = bdb.dict_key |
| | | LEFT JOIN jczz_public_discuss jpd on jpd.article_id=ja.id |
| | | where ja.is_deleted = 0 |
| | | and ja.publish = 1 |
| | | and bdb.parent_id = '1722966265111248897' |
| | | <if test="article.articleType != null and article.articleType != ''"> |
| | | and ja.article_type = #{article.articleType} |
| | | </if> |
| | | |
| | | <if test="article.eventType != null"> |
| | | and jpd.event_type = #{article.eventType} |
| | | </if> |
| | | order by ja.create_time desc |
| | | </select> |
| | | |
| | |
| | | |
| | | Boolean upcomment(String ids, String type); |
| | | |
| | | ArticleVO getArticleOne(Article article); |
| | | ArticleVO getArticleOne(ArticleVO article); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ArticleVO getArticleOne(Article article) { |
| | | public ArticleVO getArticleOne(ArticleVO article) { |
| | | ArticleVO articleVO = baseMapper.getArticleOne(article); |
| | | return articleVO; |
| | | } |
| | |
| | | |
| | | private String dictValue; |
| | | |
| | | private Integer pdId; |
| | | |
| | | private Integer eventType; |
| | | |
| | | } |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入publicDiscuss") |
| | | public R<PublicDiscussVO> detail(PublicDiscussEntity publicDiscuss) { |
| | | PublicDiscussEntity detail = publicDiscussService.getOne(Condition.getQueryWrapper(publicDiscuss)); |
| | | public R<PublicDiscussVO> detail(PublicDiscussVO publicDiscuss) { |
| | | PublicDiscussEntity detail = publicDiscussService.getDetail(publicDiscuss); |
| | | return R.data(PublicDiscussWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | |
| | | return R.status(topicsService.updateById(topics)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 议题表 修改 |
| | | */ |
| | | @PostMapping("/updateBath") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "批量更新", notes = "传入topics") |
| | | public R updateBath(@Valid @RequestBody List<TopicsEntity> topics) { |
| | | return R.status(topicsService.updateBatchById(topics)); |
| | | } |
| | | |
| | | /** |
| | | * 议题表 新增或修改 |
| | | */ |
| | |
| | | */ |
| | | package org.springblade.modules.discuss.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.discuss.entity.UserPublicEnrollEntity; |
| | | import org.springblade.modules.discuss.service.IUserPublicEnrollService; |
| | | import org.springblade.modules.discuss.vo.UserPublicEnrollVO; |
| | | import org.springblade.modules.discuss.wrapper.UserPublicEnrollWrapper; |
| | | import org.springblade.modules.discuss.service.IUserPublicEnrollService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 用户公益报名记录表 控制器 |
| | |
| | | UserPublicEnrollEntity detail = userPublicEnrollService.getOne(Condition.getQueryWrapper(userPublicEnroll)); |
| | | return R.data(UserPublicEnrollWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 用户公益报名记录表 分页 |
| | | */ |
| | |
| | | public R<IPage<UserPublicEnrollVO>> list(UserPublicEnrollEntity userPublicEnroll, Query query) { |
| | | IPage<UserPublicEnrollEntity> pages = userPublicEnrollService.page(Condition.getPage(query), Condition.getQueryWrapper(userPublicEnroll)); |
| | | return R.data(UserPublicEnrollWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 用户公益报名记录表 分页 |
| | | */ |
| | | @GetMapping("/count") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "分页", notes = "传入userPublicEnroll") |
| | | public R<Long> count(UserPublicEnrollEntity userPublicEnroll) { |
| | | long count = userPublicEnrollService.count(Wrappers.<UserPublicEnrollEntity>lambdaQuery() |
| | | .eq(UserPublicEnrollEntity::getPublicDiscussId, userPublicEnroll.getPublicDiscussId())); |
| | | return R.data(count); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入userPublicEnroll") |
| | | public R save(@Valid @RequestBody UserPublicEnrollEntity userPublicEnroll) { |
| | | userPublicEnroll.setUserId(AuthUtil.getUserId()); |
| | | return R.status(userPublicEnrollService.save(userPublicEnroll)); |
| | | } |
| | | |
| | |
| | | * 0:否 1 是 |
| | | */ |
| | | @ApiModelProperty(value = "0:否 1 是", example = "") |
| | | @TableField("delete_flag") |
| | | @TableField("deleted_flag") |
| | | @TableLogic |
| | | private Integer deleteFlag; |
| | | private Integer deletedFlag; |
| | | |
| | | /** |
| | | * 多房屋可重复投票 0否 1是 |
| | |
| | | @ApiModelProperty(value = "层级", example = "") |
| | | @TableField("level") |
| | | private Integer level; |
| | | |
| | | private String selected; |
| | | } |
| | | |
| | |
| | | |
| | | /** 0否 1是 */ |
| | | @ApiModelProperty(value = "0否 1是", example = "") |
| | | @TableField("delete_flag") |
| | | @TableField("deleted_flag") |
| | | @TableLogic |
| | | private Integer deleteFlag; |
| | | private Integer deletedFlag; |
| | | } |
| | | |
| | |
| | | */ |
| | | package org.springblade.modules.discuss.mapper; |
| | | |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.springblade.modules.discuss.dto.PublicDiscussDTO; |
| | | import org.springblade.modules.discuss.entity.PublicDiscussEntity; |
| | | import org.springblade.modules.discuss.vo.PublicDiscussVO; |
| | |
| | | public List<PublicDiscussDTO> selectPublicDiscussList(PublicDiscussDTO publicDiscussDTO); |
| | | |
| | | |
| | | /** |
| | | * 查询公益报名与议事表详情 |
| | | * |
| | | * @param publicDiscussVO 公益报名与议事表 |
| | | * @return 公益报名与议事表集合 |
| | | */ |
| | | public PublicDiscussVO selectPublicDiscuss(@Param("publicDiscuss") PublicDiscussVO publicDiscussVO); |
| | | |
| | | |
| | | } |
| | |
| | | <mapper namespace="org.springblade.modules.discuss.mapper.PublicDiscussMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="publicDiscussResultMap" type="org.springblade.modules.discuss.entity.PublicDiscussEntity"> |
| | | <resultMap id="publicDiscussResultMap" type="org.springblade.modules.discuss.vo.PublicDiscussVO"> |
| | | <result property="id" column="id" /> |
| | | <result property="title" column="title" /> |
| | | <result property="openFlag" column="open_flag" /> |
| | |
| | | <result property="articleId" column="article_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | <result property="deletedFlag" column="deleted_flag" /> |
| | | <result property="repeatVote" column="repeat_vote" /> |
| | | <result property="voteNumberPublic" column="vote_number_public" /> |
| | | <result property="appointUser" column="appoint_user" /> |
| | |
| | | article_id, |
| | | create_time, |
| | | update_time, |
| | | delete_flag, |
| | | deleted_flag, |
| | | repeat_vote, |
| | | vote_number_public, |
| | | appoint_user, |
| | |
| | | |
| | | |
| | | <select id="selectPublicDiscussPage" resultMap="publicDiscussResultMap"> |
| | | select * from jczz_public_discuss where deleted_flag = 0 |
| | | select id, |
| | | title, |
| | | open_flag, |
| | | number_restrictions, |
| | | vote_restrictions, |
| | | user_restrictions, |
| | | end_time, |
| | | article_id, |
| | | create_time, |
| | | update_time, |
| | | deleted_flag, |
| | | repeat_vote, |
| | | vote_number_public, |
| | | appoint_user, |
| | | user_ids, |
| | | event_type, |
| | | (SELECT count(1) FROM jczz_user_public_enroll where public_discuss_id = id) enrollCount, |
| | | (SELECT count(1) FROM jczz_user_topics where public_discuss_id = id) topsCount |
| | | from jczz_public_discuss |
| | | <where> |
| | | <if test="publicDiscuss.id != null "> and id = #{publicDiscuss.id}</if> |
| | | <if test="publicDiscuss.title != null and publicDiscuss.title != ''"> and title = #{publicDiscuss.title}</if> |
| | | <if test="publicDiscuss.openFlag != null "> and open_flag = #{publicDiscuss.openFlag}</if> |
| | | <if test="publicDiscuss.numberRestrictions != null "> and number_restrictions = #{publicDiscuss.numberRestrictions}</if> |
| | | <if test="publicDiscuss.voteRestrictions != null "> and vote_restrictions = #{publicDiscuss.voteRestrictions}</if> |
| | | <if test="publicDiscuss.userRestrictions != null "> and user_restrictions = #{publicDiscuss.userRestrictions}</if> |
| | | <if test="publicDiscuss.endTime != null "> and end_time = #{publicDiscuss.endTime}</if> |
| | | <if test="publicDiscuss.articleId != null "> and article_id = #{publicDiscuss.articleId}</if> |
| | | <if test="publicDiscuss.createTime != null "> and create_time = #{publicDiscuss.createTime}</if> |
| | | <if test="publicDiscuss.updateTime != null "> and update_time = #{publicDiscuss.updateTime}</if> |
| | | <if test="publicDiscuss.deletedFlag != null "> and deleted_flag = #{publicDiscuss.deletedFlag}</if> |
| | | <if test="publicDiscuss.repeatVote != null "> and repeat_vote = #{publicDiscuss.repeatVote}</if> |
| | | <if test="publicDiscuss.voteNumberPublic != null "> and vote_number_public = #{publicDiscuss.voteNumberPublic}</if> |
| | | <if test="publicDiscuss.appointUser != null "> and appoint_user = #{publicDiscuss.appointUser}</if> |
| | | <if test="publicDiscuss.userIds != null and publicDiscuss.userIds != ''"> and user_ids = #{publicDiscuss.userIds}</if> |
| | | <if test="publicDiscuss.eventType != null "> and event_type = #{publicDiscuss.eventType}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectPublicDiscussList" parameterType="org.springblade.modules.discuss.dto.PublicDiscussDTO" resultMap="publicDiscussResultMap"> |
| | |
| | | <if test="articleId != null "> and article_id = #{articleId}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | <if test="deletedFlag != null "> and deleted_flag = #{deletedFlag}</if> |
| | | <if test="repeatVote != null "> and repeat_vote = #{repeatVote}</if> |
| | | <if test="voteNumberPublic != null "> and vote_number_public = #{voteNumberPublic}</if> |
| | | <if test="appointUser != null "> and appoint_user = #{appointUser}</if> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPublicDiscuss" parameterType="org.springblade.modules.discuss.vo.PublicDiscussVO" resultMap="publicDiscussResultMap"> |
| | | select |
| | | jpd.id, |
| | | jpd.title, |
| | | jpd.open_flag, |
| | | jpd.number_restrictions, |
| | | jpd.vote_restrictions, |
| | | jpd.user_restrictions, |
| | | jpd.end_time, |
| | | jpd.article_id, |
| | | jpd.create_time, |
| | | jpd.update_time, |
| | | jpd.deleted_flag, |
| | | jpd.repeat_vote, |
| | | jpd.vote_number_public, |
| | | jpd.appoint_user, |
| | | jpd.user_ids, |
| | | jpd.event_type, |
| | | jupe.user_id userId |
| | | from |
| | | jczz_public_discuss jpd LEFT JOIN jczz_user_public_enroll jupe on jupe.public_discuss_id = jpd.id |
| | | <where> |
| | | <if test="id != null "> and jpd.id = #{id}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result property="publicDiscussId" column="public_discuss_id" /> |
| | | <result property="parentId" column="parent_id" /> |
| | | <result property="level" column="level" /> |
| | | <result property="selected" column="selected" /> |
| | | <collection property="children" column="id" javaType="list" ofType="org.springblade.modules.discuss.dto.TopicsDTO" select="selectStlCount"> |
| | | </collection> |
| | | |
| | |
| | | delete_flag, |
| | | public_discuss_id, |
| | | parent_id, |
| | | level |
| | | level, |
| | | selected |
| | | from |
| | | jczz_topics |
| | | </sql> |
| | |
| | | <mapper namespace="org.springblade.modules.discuss.mapper.UserPublicEnrollMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="userPublicEnrollResultMap" type="org.springblade.modules.discuss.entity.UserPublicEnrollEntity"> |
| | | <resultMap id="userPublicEnrollResultMap" type="org.springblade.modules.discuss.vo.UserPublicEnrollVO"> |
| | | <result property="id" column="id" /> |
| | | <result property="publicDiscussId" column="public_discuss_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | <result property="deletedFlag" column="deleted_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectUserPublicEnroll"> |
| | |
| | | user_id, |
| | | create_time, |
| | | update_time, |
| | | delete_flag |
| | | deleted_flag |
| | | from |
| | | jczz_user_public_enroll |
| | | </sql> |
| | |
| | | |
| | | |
| | | <select id="selectUserPublicEnrollPage" resultMap="userPublicEnrollResultMap"> |
| | | select * from jczz_user_public_enroll where deleted_flag = 0 |
| | | SELECT |
| | | jup.id, |
| | | jup.public_discuss_id, |
| | | jup.user_id, |
| | | jup.create_time, |
| | | jup.update_time, |
| | | jup.deleted_flag, |
| | | bu.avatar, |
| | | bu.`name`, |
| | | bu.phone, |
| | | jda.address_name, |
| | | jda.aoi_name |
| | | FROM |
| | | jczz_user_public_enroll jup |
| | | LEFT JOIN blade_user bu ON jup.user_id = bu.id |
| | | LEFT JOIN jczz_household jh ON jh.associated_user_id = jup.user_id |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | <where> |
| | | <if test="userPublicEnroll.id != null "> and jup.id = #{userPublicEnroll.id}</if> |
| | | <if test="userPublicEnroll.publicDiscussId != null "> and jup.public_discuss_id = #{userPublicEnroll.publicDiscussId}</if> |
| | | <if test="userPublicEnroll.userId != null "> and jup.user_id = #{userPublicEnroll.userId}</if> |
| | | <if test="userPublicEnroll.createTime != null "> and jup.create_time = #{userPublicEnroll.createTime}</if> |
| | | <if test="userPublicEnroll.updateTime != null "> and jup.update_time = #{userPublicEnroll.updateTime}</if> |
| | | <if test="userPublicEnroll.deletedFlag != null "> and jup.deleted_flag = #{userPublicEnroll.deletedFlag}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectUserPublicEnrollList" parameterType="org.springblade.modules.discuss.dto.UserPublicEnrollDTO" resultMap="userPublicEnrollResultMap"> |
| | |
| | | <if test="userId != null "> and user_id = #{userId}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if> |
| | | <if test="deletedFlag != null "> and deleted_flag = #{deletedFlag}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | |
| | | |
| | | <select id="selectUserTopicsPage" resultMap="userTopicsResultMap"> |
| | | select * from jczz_user_topics where deleted_flag = 0 |
| | | select * from jczz_user_topics |
| | | <where> |
| | | <if test="userTopics.id != null "> and id = #{userTopics.id}</if> |
| | | <if test="userTopics.userId != null "> and user_id = #{userTopics.userId}</if> |
| | | <if test="userTopics.topicsId != null "> and topics_id = #{userTopics.topicsId}</if> |
| | | <if test="userTopics.createTime != null "> and create_time = #{userTopics.createTime}</if> |
| | | <if test="userTopics.updateTime != null "> and update_time = #{userTopics.updateTime}</if> |
| | | <if test="userTopics.deleteFlag != null "> and delete_flag = #{userTopics.deleteFlag}</if> |
| | | <if test="userTopics.publicDiscussId != null "> and public_discuss_id = #{userTopics.publicDiscussId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectUserTopicsList" parameterType="org.springblade.modules.discuss.dto.UserTopicsDTO" resultMap="userTopicsResultMap"> |
| | |
| | | IPage<PublicDiscussVO> selectPublicDiscussPage(IPage<PublicDiscussVO> page, PublicDiscussVO publicDiscuss); |
| | | |
| | | |
| | | PublicDiscussVO getDetail(PublicDiscussVO publicDiscuss); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public PublicDiscussVO getDetail(PublicDiscussVO publicDiscuss) { |
| | | return baseMapper.selectPublicDiscuss(publicDiscuss); |
| | | } |
| | | } |
| | |
| | | public class PublicDiscussVO extends PublicDiscussEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Integer enrollCount; |
| | | |
| | | private Integer topsCount; |
| | | |
| | | private Long UserId; |
| | | |
| | | } |
| | |
| | | public class UserPublicEnrollVO extends UserPublicEnrollEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private String avatar; |
| | | |
| | | private String name; |
| | | |
| | | private String phone; |
| | | |
| | | private String addressName; |
| | | |
| | | private String aoiName; |
| | | |
| | | } |
| | |
| | | iterator.remove(); |
| | | } |
| | | } else { |
| | | if (next.getName().equals("标签报事")) { |
| | | if (next.getName().trim().equals("标签报事")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("取保候审")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("打金店")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("旅馆安全")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("二手车交易")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("二手手机维修")) { |
| | | iterator.remove(); |
| | | } |
| | | if (next.getName().trim().equals("校园安全")) { |
| | | iterator.remove(); |
| | | } |
| | | } |