From 43f0578e80af82ecae6c61b51bd0539c6b960603 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期二, 16 八月 2022 19:08:32 +0800 Subject: [PATCH] 服务范围优化 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 109 +++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 78 insertions(+), 31 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 06f2c06..d4c8fb8 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,18 +1,13 @@ package com.panzhihua.service_community.service.impl; -import java.util.*; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import javax.annotation.Resource; -import cn.hutool.core.collection.ListUtil; -import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.PageUtil; -import com.panzhihua.common.model.vos.LoginUserInfoVO; -import com.panzhihua.common.model.vos.PageVO; -import com.panzhihua.common.service.user.UserService; -import com.panzhihua.common.utlis.SensitiveUtil; -import com.panzhihua.service_community.entity.ComPbCheckUnit; -import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -24,20 +19,72 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.constants.NeighborCircleConstants; -import com.panzhihua.common.model.dtos.neighbor.*; +import com.panzhihua.common.model.dtos.neighbor.AddComActNeighborCircleAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborAddBrowseAppDTO; +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.dtos.neighbor.ComActNeighborCommentAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCommentReplyAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborFabulousAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborForwardAppDTO; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborReplyAppDTO; +import com.panzhihua.common.model.dtos.neighbor.DeleteNeighborCircleAppDTO; +import com.panzhihua.common.model.dtos.neighbor.DetailNeighborAllCommentByAdminDTO; +import com.panzhihua.common.model.dtos.neighbor.DetailNeighborCommentReplyByAdminDTO; +import com.panzhihua.common.model.dtos.neighbor.ServiceStaticBackstageDTO; +import com.panzhihua.common.model.dtos.neighbor.ServiceStaticDTO; +import com.panzhihua.common.model.vos.PageVO; import com.panzhihua.common.model.vos.R; -import com.panzhihua.common.model.vos.neighbor.*; +import com.panzhihua.common.model.vos.neighbor.ActivityAnalysisVO; +import com.panzhihua.common.model.vos.neighbor.AddNeighborCircleAdminVO; +import com.panzhihua.common.model.vos.neighbor.ChangeCommentReplyStatusByAdminVO; +import com.panzhihua.common.model.vos.neighbor.ChangeCommentStatusByAdminVO; +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.ComActNeighborCircleCommentReplyAppVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentByAdminVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyByAdminVO; +import com.panzhihua.common.model.vos.neighbor.DetailNeighborCircleAdminVO; +import com.panzhihua.common.model.vos.neighbor.EditNeighborCircleAdminVO; +import com.panzhihua.common.model.vos.neighbor.PartyMemberAnalysisVO; +import com.panzhihua.common.model.vos.neighbor.ServiceStaticsVO; +import com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO; import com.panzhihua.common.model.vos.user.AdministratorsUserVO; +import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.DateUtils; +import com.panzhihua.common.utlis.SensitiveUtil; import com.panzhihua.common.utlis.StringUtils; -import com.panzhihua.service_community.dao.*; -import com.panzhihua.service_community.model.dos.*; +import com.panzhihua.service_community.dao.ComActActivityDAO; +import com.panzhihua.service_community.dao.ComActDAO; +import com.panzhihua.service_community.dao.ComActNeighborCircleBrowseDAO; +import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO; +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.dao.ComActNeighborCircleTopicMapper; +import com.panzhihua.service_community.dao.ComPbCheckUnitDao; +import com.panzhihua.service_community.dao.ComPbMemberDAO; +import com.panzhihua.service_community.entity.ComPbCheckUnit; +import com.panzhihua.service_community.model.dos.ComActActivityDO; +import com.panzhihua.service_community.model.dos.ComActDO; +import com.panzhihua.service_community.model.dos.ComActNeighborCircleBrowseDO; +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.model.dos.ComActNeighborCircleTopicDO; +import com.panzhihua.service_community.model.dos.ComPbMemberDO; import com.panzhihua.service_community.service.ComActNeighborCircleBrowseService; import com.panzhihua.service_community.service.ComActNeighborCircleService; +import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.util.PageUtil; import lombok.extern.slf4j.Slf4j; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.RequestParam; /** * @auther lyq @@ -1027,22 +1074,22 @@ @Override public R serviceStatic(ServiceStaticDTO serviceStaticDTO) { - ServiceStaticsVO serviceStaticsVO=new ServiceStaticsVO(); - if(serviceStaticDTO.getCheckUnitId()!=null){ - serviceStaticsVO=this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear()); - serviceStaticsVO=this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear()); - serviceStaticsVO.setServiceProjecList(this.baseMapper.selectListByCheckUnitId(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear())); - serviceStaticsVO.setServiceActivityList(comActActivityDAO.selectListByRelationId(serviceStaticDTO.getCheckUnitId(),serviceStaticDTO.getYear())); - } - else { - serviceStaticsVO=this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(),serviceStaticDTO.getYear()); - serviceStaticsVO.setServiceProjecList(this.baseMapper.selectListByPhone(serviceStaticDTO.getPhone(),serviceStaticDTO.getYear())); - ComPbMemberDO comPbMemberDO=comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getPhone,serviceStaticDTO.getPhone()).last("limit 1")); - if(comPbMemberDO!=null){ - serviceStaticsVO.setWorkActivityList(comActActivityDAO.selectListByRelationId(comPbMemberDO.getCheckUnitId(),serviceStaticDTO.getYear())); - serviceStaticsVO.setServiceActivityList(comActActivityDAO.selectListByCommunityId(comPbMemberDO.getCommunityId(),serviceStaticDTO.getYear(),serviceStaticDTO.getPhone())); + ServiceStaticsVO serviceStaticsVO = new ServiceStaticsVO(); + if (serviceStaticDTO.getCheckUnitId() != null) { + serviceStaticsVO = + this.baseMapper.selectStatsCheckUnit(serviceStaticDTO.getCheckUnitId(), serviceStaticDTO.getYear()); + serviceStaticsVO.setServiceDetailStaticsList(this.baseMapper.selectServiceDetailList(serviceStaticDTO.getCheckUnitId(), + serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType())); + } else { + serviceStaticsVO = this.baseMapper.selectStatsUser(serviceStaticDTO.getPhone(), serviceStaticDTO.getYear()); + ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectOne(new QueryWrapper<ComPbMemberDO>().lambda() + .eq(ComPbMemberDO::getPhone, serviceStaticDTO.getPhone()).last("limit 1")); + Long checkUnitId = null; + if (comPbMemberDO != null) { + checkUnitId = comPbMemberDO.getCheckUnitId(); } - + serviceStaticsVO.setServiceDetailStaticsList(this.baseMapper.selectServiceDetailListForPersonal(checkUnitId, serviceStaticDTO.getPhone(), + serviceStaticDTO.getYear(), serviceStaticDTO.getServiceType())); } return R.ok(serviceStaticsVO); } -- Gitblit v1.7.1