From c4d5bef7a85585de8391d26d8f7960790614e876 Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期三, 28 四月 2021 16:53:36 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java index f026ac8..65df6e8 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java @@ -1,17 +1,23 @@ package com.panzhihua.service_community.service.impl; +import java.util.Date; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleDetailAppDTO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleCommentAppVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO; +import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; +import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; import com.panzhihua.service_community.service.ComActNeighborCircleBrowseService; @@ -99,4 +105,48 @@ return R.ok(circleDetailAppVO); } + @Override + public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) { + Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize()); + IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO); + return R.ok(doPager); + } + + @Override + public R addNeighborByAdmin(AddNeighborCircleAdminVO addVO) { + ComActNeighborCircleDO comActNeighborCircleDO = new ComActNeighborCircleDO(); + AdministratorsUserVO adminUser = this.baseMapper.selectUserByUserId(addVO.getUserId()); + if(adminUser==null){ + return R.fail("请登录重试"); + } + comActNeighborCircleDO.setReleaseId(addVO.getUserId()); + comActNeighborCircleDO.setReleasePhone(adminUser.getPhone()); + comActNeighborCircleDO.setCommunityId(adminUser.getCommunityId()); + comActNeighborCircleDO.setReleaseContent(addVO.getReleaseContent()); + comActNeighborCircleDO.setReleaseImages(addVO.getReleaseImages()); + comActNeighborCircleDO.setStatus(1); + comActNeighborCircleDO.setCommentNum(0); + comActNeighborCircleDO.setFabulousNum(0); + comActNeighborCircleDO.setForwardNum(0); + comActNeighborCircleDO.setViewsNum(0); + comActNeighborCircleDO.setIsBoutique(2); + comActNeighborCircleDO.setCreateAt(new Date()); + comActNeighborCircleDO.setLastCommentNum(0); + comActNeighborCircleDO.setLastFabulousNum(0); + comActNeighborCircleDO.setLastViewsNum(0); + this.baseMapper.insert(comActNeighborCircleDO); + return R.ok(); + } + + @Override + public R changeStatusByAdmin(EditNeighborCircleAdminVO editVO) { + ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(editVO.getId()); + if(neighborCircleDO==null){ + return R.fail("id有误!"); + } + neighborCircleDO.setStatus(editVO.getStatus()); + neighborCircleDO.setRefuseReason(editVO.getRefuseReason()); + this.baseMapper.updateById(neighborCircleDO); + return R.ok(); + } } -- Gitblit v1.7.1