springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/NeighborApi.java
@@ -1,9 +1,7 @@ package com.panzhihua.applets.api; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; import com.panzhihua.common.model.dtos.neighbor.*; import com.panzhihua.common.model.dtos.shop.*; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; @@ -68,6 +66,60 @@ return communityService.neighborDetailByApp(neighborCircleAppDTO); } @ApiOperation(value = "分页查询用户邻里圈列表" , response = ComActNeighborCircleAppVO.class) @PostMapping("neighbor/user/page") public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { Long userId = this.getLoginUserInfo().getUserId(); if(userId == null){ return R.fail("请先登录"); } neighborCircleAppDTO.setUserId(userId); return communityService.neighborExamineByApp(neighborCircleAppDTO); } @ApiOperation(value = "邻里圈点赞") @PostMapping("neighbor/fabulous") public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { Long userId = this.getLoginUserInfo().getUserId(); if(userId == null){ return R.fail("请先登录"); } fabulousAppDTO.setUserId(userId); return communityService.neighborFabulousByApp(fabulousAppDTO); } @ApiOperation(value = "邻里圈转发") @PostMapping("neighbor/forward") public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { Long userId = this.getLoginUserInfo().getUserId(); if(userId == null){ return R.fail("请先登录"); } forwardAppDTO.setUserId(userId); return communityService.neighborForwardByApp(forwardAppDTO); } @ApiOperation(value = "邻里圈评论") @PostMapping("neighbor/comment") public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { Long userId = this.getLoginUserInfo().getUserId(); if(userId == null){ return R.fail("请先登录"); } commentAppDTO.setUserId(userId); return communityService.neighborCommentByApp(commentAppDTO); } @ApiOperation(value = "邻里圈回复") @PostMapping("neighbor/reply") public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { Long userId = this.getLoginUserInfo().getUserId(); if(userId == null){ return R.fail("请先登录"); } replyAppDTO.setUserId(userId); return communityService.neighborReplyByApp(replyAppDTO); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleAppDTO.java
@@ -25,4 +25,7 @@ @ApiModelProperty(value = "社区id",hidden = true) private Long communityId; @ApiModelProperty(value = "用户id",hidden = true) private Long userId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleDetailAppDTO.java
@@ -25,4 +25,7 @@ @ApiModelProperty(value = "评论分页-每页记录数",example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "评论排序方式(1.倒序 2.顺序)",example = "10") private Integer order = 1; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCommentAppDTO.java
New file @@ -0,0 +1,27 @@ package com.panzhihua.common.model.dtos.neighbor; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @auther lyq * @create 2021-04-14 15:02:14 * @describe 邻里圈评论请求参数 */ @Data @ApiModel("邻里圈评论请求参数") public class ComActNeighborCommentAppDTO { @ApiModelProperty("邻里圈id") private Long circleId; @ApiModelProperty("邻里圈评论内容") private String content; @ApiModelProperty(value = "用户id",hidden = true) private Long userId; @ApiModelProperty(value = "用户手机号",hidden = true) private String phone; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborFabulousAppDTO.java
New file @@ -0,0 +1,33 @@ package com.panzhihua.common.model.dtos.neighbor; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @auther lyq * @create 2021-04-14 15:02:14 * @describe 邻里圈点赞请求参数 */ @Data @ApiModel("邻里圈点赞请求参数") public class ComActNeighborFabulousAppDTO { @ApiModelProperty("邻里圈点赞类型(1.邻里圈 2.评论 3.回复)") private Integer type = 1; @ApiModelProperty("邻里圈点赞业务id") private Long serviceId; @ApiModelProperty(value = "用户id",hidden = true) private Long userId; /** * 邻里圈点赞类型(1.邻里圈 2.评论 3.回复) */ public interface type{ int llq = 1; int pl = 2; int hf = 3; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborForwardAppDTO.java
New file @@ -0,0 +1,21 @@ package com.panzhihua.common.model.dtos.neighbor; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @auther lyq * @create 2021-04-14 15:02:14 * @describe 邻里圈转发请求参数 */ @Data @ApiModel("邻里圈转发请求参数") public class ComActNeighborForwardAppDTO { @ApiModelProperty("邻里圈id") private Long circleId; @ApiModelProperty(value = "用户id",hidden = true) private Long userId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborReplyAppDTO.java
New file @@ -0,0 +1,41 @@ package com.panzhihua.common.model.dtos.neighbor; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @auther lyq * @create 2021-04-14 15:02:14 * @describe 邻里圈回复请求参数 */ @Data @ApiModel("邻里圈回复请求参数") public class ComActNeighborReplyAppDTO { @ApiModelProperty("邻里圈id") private Long circleId; @ApiModelProperty("回复类型(1.评论 2.回复)") private Integer type; @ApiModelProperty("业务id(当type为1时,这里是评论的id,当type=2时,这里是回复的id)") private Long serviceId; @ApiModelProperty("邻里圈回复内容") private String content; @ApiModelProperty(value = "用户id",hidden = true) private Long userId; @ApiModelProperty(value = "用户手机号",hidden = true) private String phone; /** * 回复类型(1.评论 2.回复) */ public interface type{ int pl = 1; int hf = 2; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActWorkGuideVO.java
@@ -27,7 +27,7 @@ private String title; @ApiModelProperty("办事指南内容") @NotNull(groups = {AddGroup.class}, message = "内容不能为空") @NotBlank(groups = {AddGroup.class}, message = "内容不能为空") @Length(groups = {AddGroup.class}, max = 500) private String content; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ComActNeighborCircleAppVO.java
@@ -69,4 +69,10 @@ @ApiModelProperty("近3天浏览量") private Integer lastViewsNum; /** * 驳回原因 */ @ApiModelProperty("驳回原因") private String refuseReason; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/ComActNeighborCircleCommentReplyAppVO.java
@@ -28,6 +28,9 @@ @ApiModelProperty("回复用户名称") private Long userName; @ApiModelProperty("回复用户头像url") private Long userHeadUrl; @ApiModelProperty("回复内容") private String replyContent; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -6,6 +6,11 @@ import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; import com.panzhihua.common.model.dtos.community.*; import com.panzhihua.common.model.dtos.neighbor.*; import com.panzhihua.common.model.dtos.neighbor.*; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; import com.panzhihua.common.model.dtos.shop.*; import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; @@ -2322,6 +2327,53 @@ /** * 用户查询邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ @PostMapping("/neighbor/neighborExamineByApp") R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO); /** * 邻里圈点赞 * @param fabulousAppDTO 请求参数 * @return 点赞结果 */ @PostMapping("/neighbor/neighborFabulousByApp") R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO); /** * 邻里圈转发 * @param forwardAppDTO 请求参数 * @return 转发结果 */ @PostMapping("/neighbor/neighborForwardByApp") R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO); /** * 邻里圈评论 * @param commentAppDTO 请求参数 * @return 评论结果 */ @PostMapping("/neighbor/neighborCommentByApp") R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO); /** * 邻里圈回复 * @param replyAppDTO 请求参数 * @return 回复结果 */ @PostMapping("/neighbor/neighborReplyByApp") R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO); /** * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 * @return 执行结果 */ @PostMapping("/neighbor/timeTaskCircleFlow") R timedTaskNeighborCircleRecord(); /** * 邻里圈评论回复_分页 * @param dto 参数 */ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/NeighborApi.java
@@ -28,8 +28,8 @@ /** * 分页查询邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ @PostMapping("pageNeighborByApp") public R pageNeighbor(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { @@ -38,8 +38,8 @@ /** * 用户发布邻里圈审核 * @param addNeighborCircleAppDTO 邻里圈请求参数 * @return 发布结果 * @param addNeighborCircleAppDTO 邻里圈请求参数 * @return 发布结果 */ @PostMapping("addNeighborByApp") public R addNeighborByApp(@RequestBody AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { @@ -93,6 +93,65 @@ } /** * 用户查询邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ @PostMapping("neighborExamineByApp") public R neighborExamineByApp(@RequestBody ComActNeighborCircleAppDTO neighborCircleAppDTO) { return comActNeighborCircleService.neighborExamineByApp(neighborCircleAppDTO); } /** * 邻里圈点赞 * @param fabulousAppDTO 请求参数 * @return 点赞结果 */ @PostMapping("neighborFabulousByApp") public R neighborFabulousByApp(@RequestBody ComActNeighborFabulousAppDTO fabulousAppDTO) { return comActNeighborCircleService.neighborFabulousByApp(fabulousAppDTO); } /** * 邻里圈转发 * @param forwardAppDTO 请求参数 * @return 转发结果 */ @PostMapping("neighborForwardByApp") public R neighborForwardByApp(@RequestBody ComActNeighborForwardAppDTO forwardAppDTO) { return comActNeighborCircleService.neighborForwardByApp(forwardAppDTO); } /** * 邻里圈评论 * @param commentAppDTO 请求参数 * @return 评论结果 */ @PostMapping("neighbor/comment") public R neighborCommentByApp(@RequestBody ComActNeighborCommentAppDTO commentAppDTO) { return comActNeighborCircleService.neighborCommentByApp(commentAppDTO); } /** * 邻里圈回复 * @param replyAppDTO 请求参数 * @return 回复结果 */ @PostMapping("neighbor/reply") public R neighborReplyByApp(@RequestBody ComActNeighborReplyAppDTO replyAppDTO) { return comActNeighborCircleService.neighborReplyByApp(replyAppDTO); } /** * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 * @return 执行结果 */ @PostMapping("neighbor/timeTaskCircleFlow") public R timeTaskCircleFlow() { return comActNeighborCircleService.timeTaskCircleFlow(); } /** * 查看邻里圈基础_详情 * @param id 邻里圈id * @return 邻里圈列表 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleCommentDAO.java
@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentAppVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentByAdminVO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentDO; @@ -24,9 +27,15 @@ ",cancc.create_at,cancc.is_release,su.nick_name as userName,su.image_url as userHeadUrl " + " from com_act_neighbor_circle_comment as cancc " + " left join sys_user as su on su.user_id = cancc.user_id" + " where cancc.circle_id = #{circleId} order by cancc.create_at desc" + " where cancc.circle_id = #{neighborCircleAppDTO.circleId} and cancc.status = 1" + "<if test='neighborCircleAppDTO.order != null and neighborCircleAppDTO.order == 1'>" + " order by cancc.create_at desc" + " </if> " + "<if test='neighborCircleAppDTO.order != null and neighborCircleAppDTO.order == 2'>" + " order by cancc.create_at asc" + " </if> " + " </script>") IPage<ComActNeighborCircleCommentAppVO> pageNeighborCommentByApp(Page page, @Param("circleId") Long circleId); IPage<ComActNeighborCircleCommentAppVO> pageNeighborCommentByApp(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleDetailAppDTO neighborCircleAppDTO); @Select("<script> " + "select nc.*,u.name as userName from com_act_neighbor_circle_comment nc left join sys_user u on nc.user_id=u.user_id " + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleCommentReplyDAO.java
@@ -4,9 +4,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyByAdminVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentReplyAppVO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; /** * @auther lyq @@ -17,6 +22,17 @@ public interface ComActNeighborCircleCommentReplyDAO extends BaseMapper<ComActNeighborCircleCommentReplyDO> { @Select("<script> " + "select reply.id,reply.comment_id, reply.reply_content,reply.fabulous_num " + ",reply.create_at,reply.is_release,su1.nick_name as userName " + ",su1.image_url as userHeadUrl,su2.nick_name as parentUserName " + " from com_act_neighbor_circle_comment_reply as reply" + " left join sys_user su1 on su1.user_id = reply.user_id " + " left join sys_user su2 on su2.user_id = reply.parent_user_id " + " where reply.comment_id = #{commentId} order by create_at desc limit 2" + " </script>") List<ComActNeighborCircleCommentReplyAppVO> getCircleCommentReplyList(@Param("commentId") Long commentId); @Select("<script> " + "select cr.*,u.name as userName from com_act_neighbor_circle_comment_reply cr left join sys_user u on cr.user_id=u.user_id " + "<where>"+ "<if test='dto.id != null and pageActWorkGuideDTO.dto!= 0l'>" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java
@@ -86,4 +86,11 @@ @Select("select * from sys_user where user_id=#{userId}") AdministratorsUserVO selectUserByUserId(@Param("userId") Long userId); @Select("<script> " + "select id,release_content,release_images,status,create_at,comment_num,fabulous_num,forward_num,views_num,refuse_reason " + " from com_act_neighbor_circle as canc " + " where canc.release_id = #{userId} order by create_at desc" + " </script>") IPage<ComActNeighborCircleAppVO> neighborExamineByApp(Page page,@Param("userId") Long userId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActNeighborCircleCommentDO.java
@@ -66,6 +66,14 @@ */ private Integer isRelease; /** * 是否是作者评论(1.是 2.否) */ public interface isRelease{ int yes = 1; int no = 2; } @Override public String toString() { return "ComActNeighborCircleCommentDO{" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActNeighborCircleCommentReplyDO.java
@@ -38,7 +38,7 @@ /** * 上级回复id */ private Long panentId; private Long parentId; /** * 上级回复用户id @@ -82,7 +82,7 @@ "id=" + id + ", circleId=" + circleId + ", commentId=" + commentId + ", panentId=" + panentId + ", parentId=" + parentId + ", parentUserId=" + parentUserId + ", userId=" + userId + ", replyContent=" + replyContent + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActNeighborCircleDO.java
@@ -111,6 +111,16 @@ */ private Integer lastViewsNum; /** * 发布状态(1.待审核 2.显示 3.隐藏 4.驳回) */ public interface status{ int dsh = 1; int xs = 2; int yc = 3; int bh = 4; } @Override public String toString() { return "ComActNeighborCircleDO{" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActNeighborCircleFabulousDO.java
@@ -1,8 +1,6 @@ package com.panzhihua.service_community.model.dos; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import java.io.Serializable; @@ -33,6 +31,11 @@ private Integer type; /** * 邻里圈id */ private Long circleId; /** * 点赞上级id */ private Long parentId; @@ -50,13 +53,23 @@ /** * 点赞时间 */ @TableField(fill = FieldFill.INSERT) private Date createAt; /** * 修改时间 */ @TableField(fill = FieldFill.UPDATE) private Date updateAt; /** * 有效状态(1.有效 2.取消) */ public interface isEffective{ int yes = 1; int no = 2; } @Override public String toString() { return "ComActNeighborCircleFabulousDO{" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActNeighborCircleService.java
@@ -113,4 +113,45 @@ */ R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO); /** * 用户查询邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO); /** * 邻里圈点赞 * @param fabulousAppDTO 请求参数 * @return 点赞结果 */ R neighborFabulousByApp(ComActNeighborFabulousAppDTO fabulousAppDTO); /** * 邻里圈转发 * @param forwardAppDTO 请求参数 * @return 转发结果 */ R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO); /** * 邻里圈评论 * @param commentAppDTO 请求参数 * @return 评论结果 */ R neighborCommentByApp(ComActNeighborCommentAppDTO commentAppDTO); /** * 邻里圈回复 * @param replyAppDTO 请求参数 * @return 回复结果 */ R neighborReplyByApp(ComActNeighborReplyAppDTO replyAppDTO); /** * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 * @return 执行结果 */ R timeTaskCircleFlow(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -2,6 +2,7 @@ import java.util.Date; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -9,11 +10,18 @@ import com.panzhihua.common.model.dtos.neighbor.*; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.neighbor.*; import com.panzhihua.common.model.vos.neighbor.*; import com.panzhihua.common.utlis.DateUtils; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO; import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.service_community.dao.ComActNeighborCircleCommentReplyDAO; import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; import com.panzhihua.service_community.dao.ComActNeighborCircleFabulousDAO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentDO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyDO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleFabulousDO; import com.panzhihua.service_community.service.ComActNeighborCircleBrowseService; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.model.dos.*; @@ -23,6 +31,11 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; /** * @auther lyq @@ -50,12 +63,11 @@ /** * 分页查询邻里圈列表 * * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ @Override public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO) { public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO){ Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO); return R.ok(doPager); @@ -63,52 +75,53 @@ /** * 用户发布邻里圈审核 * * @param addNeighborCircleAppDTO 邻里圈请求参数 * @return 发布结果 * @param addNeighborCircleAppDTO 邻里圈请求参数 * @return 发布结果 */ @Override public R addNeighborByApp(AddComActNeighborCircleAppDTO addNeighborCircleAppDTO) { public R addNeighborByApp(AddComActNeighborCircleAppDTO addNeighborCircleAppDTO){ //新增邻里圈审核 ComActNeighborCircleDO neighborCircleDO = new ComActNeighborCircleDO(); BeanUtils.copyProperties(addNeighborCircleAppDTO, neighborCircleDO); if (addNeighborCircleAppDTO.getUserId() != null) { BeanUtils.copyProperties(addNeighborCircleAppDTO,neighborCircleDO); if(addNeighborCircleAppDTO.getUserId() != null){ neighborCircleDO.setReleaseId(addNeighborCircleAppDTO.getUserId()); } if (addNeighborCircleAppDTO.getCommunityId() != null) { if(addNeighborCircleAppDTO.getCommunityId() != null){ neighborCircleDO.setCommunityId(addNeighborCircleAppDTO.getCommunityId()); } if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) { if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())){ neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone()); } if (this.baseMapper.insert(neighborCircleDO) > 0) { if(this.baseMapper.insert(neighborCircleDO) > 0){ return R.ok(); } else { }else{ return R.fail("发布失败"); } } /** * 查看邻里圈详情 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈详情 */ @Override public R neighborDetailByApp(ComActNeighborCircleDetailAppDTO neighborCircleAppDTO) { public R neighborDetailByApp(ComActNeighborCircleDetailAppDTO neighborCircleAppDTO){ //添加邻里圈浏览记录 comActNeighborCircleBrowseService.addBrowseRecord(neighborCircleAppDTO.getCircleId(), neighborCircleAppDTO.getUserId()); comActNeighborCircleBrowseService.addBrowseRecord(neighborCircleAppDTO.getCircleId(),neighborCircleAppDTO.getUserId()); //查询邻里圈详情 ComActNeighborCircleDetailAppVO circleDetailAppVO = this.baseMapper.neighborDetailByApp(neighborCircleAppDTO.getCircleId()); //查询邻里圈下评论列表 IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = neighborCircleCommentDAO.pageNeighborCommentByApp( new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()), neighborCircleAppDTO.getCircleId()); if (!circleCommentAppPage.getRecords().isEmpty()) { for (ComActNeighborCircleCommentAppVO circleCommentVo : circleCommentAppPage.getRecords()) { IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = comActNeighborCircleCommentDAO.pageNeighborCommentByApp( new Page(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO); if(!circleCommentAppPage.getRecords().isEmpty()){ for (ComActNeighborCircleCommentAppVO circleCommentVo:circleCommentAppPage.getRecords()) { //查询评论下评论回复 List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = comActNeighborCircleCommentReplyDAO.getCircleCommentReplyList(circleCommentVo.getId()); if(!commentReplyAppVOS.isEmpty()){ circleCommentVo.setCircleCommentReplyAppList(commentReplyAppVOS); } } } return R.ok(circleDetailAppVO); } @@ -157,6 +170,205 @@ return R.ok(); } /** * 用户查询邻里圈列表 * @param neighborCircleAppDTO 请求参数 * @return 邻里圈列表 */ @Override public R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO){ IPage<ComActNeighborCircleAppVO> neighborCircleIPage = this.baseMapper.neighborExamineByApp( new Page<>(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO.getUserId()); return R.ok(neighborCircleIPage); } /** * 邻里圈点赞 * @param fabulousAppDTO 请求参数 * @return 点赞结果 */ @Override @Transactional(rollbackFor = Exception.class) public R neighborFabulousByApp(ComActNeighborFabulousAppDTO fabulousAppDTO){ ComActNeighborCircleFabulousDO circleFabulousDO = new ComActNeighborCircleFabulousDO(); circleFabulousDO.setUserId(fabulousAppDTO.getUserId()); circleFabulousDO.setType(fabulousAppDTO.getType()); circleFabulousDO.setParentId(fabulousAppDTO.getServiceId()); //判断点赞类型 if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.llq)){ //增加邻里圈点赞数量 ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId()); if(neighborCircleDO != null){ neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() + 1); this.baseMapper.updateById(neighborCircleDO); circleFabulousDO.setCircleId(neighborCircleDO.getId()); } //添加邻里圈浏览记录 comActNeighborCircleBrowseService.addBrowseRecord(fabulousAppDTO.getServiceId(),fabulousAppDTO.getUserId()); }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){ //增加邻里圈评论点赞数量 ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId()); if(circleCommentDO != null){ circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1); comActNeighborCircleCommentDAO.updateById(circleCommentDO); circleFabulousDO.setCircleId(circleCommentDO.getCircleId()); } }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){ //增加邻里圈评论回复点赞数量 ComActNeighborCircleCommentReplyDO circleCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId()); if(circleCommentReplyDO != null){ circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() + 1); comActNeighborCircleCommentReplyDAO.updateById(circleCommentReplyDO); circleFabulousDO.setCircleId(circleCommentReplyDO.getCircleId()); } } if(comActNeighborCircleFabulousDAO.insert(circleFabulousDO) > 0){ return R.ok(); }else{ return R.fail("点赞失败"); } } /** * 邻里圈转发 * @param forwardAppDTO 请求参数 * @return 转发结果 */ @Override public R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO){ //添加邻里圈浏览记录 comActNeighborCircleBrowseService.addBrowseRecord(forwardAppDTO.getCircleId(),forwardAppDTO.getUserId()); ComActNeighborCircleDO circleDO = this.baseMapper.selectById(forwardAppDTO.getCircleId()); if(circleDO == null){ return R.fail("没有找到邻里圈"); } circleDO.setForwardNum(circleDO.getForwardNum() + 1); if(this.baseMapper.updateById(circleDO) > 0){ return R.ok(); }else{ return R.fail("转发失败"); } } /** * 邻里圈评论 * @param commentAppDTO 请求参数 * @return 评论结果 */ @Override @Transactional(rollbackFor = Exception.class) public R neighborCommentByApp(ComActNeighborCommentAppDTO commentAppDTO){ ComActNeighborCircleCommentDO circleCommentDO = new ComActNeighborCircleCommentDO(); //查询邻里圈更新邻里圈评论数量 ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(commentAppDTO.getCircleId()); if(neighborCircleDO == null){ return R.fail("没有找到邻里圈"); } neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); neighborCircleDO.setReplyAt(new Date()); this.baseMapper.updateById(neighborCircleDO); circleCommentDO.setCircleId(commentAppDTO.getCircleId()); circleCommentDO.setUserId(commentAppDTO.getUserId()); circleCommentDO.setUserPhone(commentAppDTO.getPhone()); circleCommentDO.setContent(commentAppDTO.getContent()); if(neighborCircleDO.getReleaseId().equals(commentAppDTO.getUserId())){ circleCommentDO.setIsRelease(ComActNeighborCircleCommentDO.isRelease.yes); } if(comActNeighborCircleCommentDAO.insert(circleCommentDO) > 0){ return R.ok(); }else{ return R.fail("评论失败"); } } /** * 邻里圈回复 * @param replyAppDTO 请求参数 * @return 回复结果 */ @Override public R neighborReplyByApp(ComActNeighborReplyAppDTO replyAppDTO){ ComActNeighborCircleCommentReplyDO circleCommentReplyDO = new ComActNeighborCircleCommentReplyDO(); //查询邻里圈更新邻里圈评论数量 ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(replyAppDTO.getCircleId()); if(neighborCircleDO == null){ return R.fail("没有找到邻里圈"); } neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1); neighborCircleDO.setReplyAt(new Date()); this.baseMapper.updateById(neighborCircleDO); circleCommentReplyDO.setCircleId(replyAppDTO.getCircleId()); circleCommentReplyDO.setUserId(replyAppDTO.getUserId()); circleCommentReplyDO.setReplyContent(replyAppDTO.getContent()); if(neighborCircleDO.getReleaseId().equals(replyAppDTO.getUserId())){ circleCommentReplyDO.setIsRelease(1); } //判断回复类型 if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.pl)){ //查询评论信息 ComActNeighborCircleCommentDO circleCommentDO = comActNeighborCircleCommentDAO.selectById(replyAppDTO.getServiceId()); if(circleCommentDO != null){ circleCommentReplyDO.setCommentId(replyAppDTO.getServiceId()); circleCommentReplyDO.setParentId(0L); circleCommentReplyDO.setParentUserId(circleCommentDO.getUserId()); } }else if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.hf)){ //查询上级回复信息 ComActNeighborCircleCommentReplyDO parentCommentReplyDO = comActNeighborCircleCommentReplyDAO.selectById(replyAppDTO.getServiceId()); if(parentCommentReplyDO != null){ circleCommentReplyDO.setCommentId(parentCommentReplyDO.getCommentId()); circleCommentReplyDO.setParentId(parentCommentReplyDO.getId()); circleCommentReplyDO.setParentUserId(parentCommentReplyDO.getUserId()); } } if(comActNeighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){ return R.ok(); }else{ return R.fail("回复失败"); } } @Override public R timeTaskCircleFlow(){ Date oldDate = DateUtils.addDay(new Date(),-3); //查询所有状态正常的邻里圈 List<ComActNeighborCircleDO> circleDOList = this.baseMapper.selectList( new QueryWrapper<ComActNeighborCircleDO>().lambda().eq(ComActNeighborCircleDO::getStatus,ComActNeighborCircleDO.status.xs)); if(!circleDOList.isEmpty()){ //遍历查询到的邻里圈,更新邻里圈内近3天的评论数,点赞数,浏览量 for (ComActNeighborCircleDO neighborCircleDO:circleDOList) { //查询邻里圈近3天的评论数 int commentCount = comActNeighborCircleCommentDAO.selectCount( new QueryWrapper<ComActNeighborCircleCommentDO>().lambda().eq(ComActNeighborCircleCommentDO::getCircleId,neighborCircleDO.getId())); //查询邻里圈近3天的评论回复数 int commentReplyCount = comActNeighborCircleCommentReplyDAO.selectCount( new QueryWrapper<ComActNeighborCircleCommentReplyDO>().lambda() .eq(ComActNeighborCircleCommentReplyDO::getCircleId,neighborCircleDO.getId())); //查询邻里圈近3天的点赞数 int fabulousCount = comActNeighborCircleFabulousDAO.selectCount(new QueryWrapper<ComActNeighborCircleFabulousDO>() .lambda().eq(ComActNeighborCircleFabulousDO::getCircleId,neighborCircleDO.getId()) .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes)); //查询邻里圈近3天的浏览量 } } return R.ok(); } @Override public R deleteByAdmin(Long id) { ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id); springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/NeighborCircleJobHandler.java
New file @@ -0,0 +1,37 @@ package com.panzhihua.timejob.jobhandler; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.service.community.CommunityService; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * @auther lyq * @create 2021-04-28 09:21:45 * @describe 邻里圈相关 */ @Slf4j @Component public class NeighborCircleJobHandler { @Resource private CommunityService communityService; /** * 定时任务更新邻里圈近3天评论数/点赞数/浏览量 * @return 刷新个数 * @throws Exception 出现的异常 */ @XxlJob("timedtaskpartybuildingstatusJobHandler") public ReturnT<String> timedtaskpartybuildingstatusJobHandler(String param) throws Exception { log.info("定时任务更新邻里圈近3天评论数/点赞数/浏览量"); R r=communityService.timedTaskNeighborCircleRecord(); log.info("执行结果【{}】",r.toString()); return ReturnT.SUCCESS; } } springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -79,8 +79,9 @@ boolean wxPay = requestURI.contains("wxNotify"); boolean wxCgi = requestURI.contains("cgi"); boolean isShop = requestURI.contains("isShop"); boolean listadvertisement = requestURI.contains("listadvertisement"); SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request); if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement||wxPay||wxCgi||isShop) { if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement||wxPay||wxCgi||isShop||listadvertisement) { //什么也不做 } else { // 获取请求头中JWT的Token springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/SercuritFilter.java
@@ -80,7 +80,8 @@ boolean isShop = !requestUrl.contains("isShop"); boolean refreshToken = !requestUrl.contains("refreshToken"); boolean useragreement = !requestUrl.contains("useragreement"); if (contains&&docs&&login&&refreshToken&&useragreement&&wxNotify&&wxCgi&&isShop) { boolean listadvertisement = !requestUrl.contains("listadvertisement"); if (contains&&docs&&login&&refreshToken&&useragreement&&wxNotify&&wxCgi&&isShop&&listadvertisement) { configAttributes.add(new SecurityConfig(SecurityConstants.ROLE_APPLETS)); } return configAttributes;