From 4c80d2017a3b88b9ad55f28c3b87fd96eb67bcb2 Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期四, 29 九月 2022 09:40:51 +0800 Subject: [PATCH] Merge branch 'sanshuohuitang_dev' into huacheng_test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 243 ++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 212 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 0277595..a8752c1 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,16 @@ 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.service_community.entity.ComPbCheckUnit; -import com.panzhihua.service_community.service.ComActNeighborCircleTopicService; +import com.panzhihua.common.utlis.*; +import com.panzhihua.service_community.dao.*; +import com.panzhihua.service_community.entity.SysUser; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -23,19 +22,85 @@ 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.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.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 @@ -81,6 +146,8 @@ private ComActActivityDAO comActActivityDAO; @Resource private ComPbCheckUnitDao comPbCheckUnitDao; + @Resource + private SysUserDao sysUserDao; /** * 分页查询邻里圈列表 * @@ -242,7 +309,7 @@ if(circleDetailAppVO.getOrderType()!=null){ if(circleDetailAppVO.getOrderType()==2){ AdministratorsUserVO user1 = this.baseMapper.selectUserByUserId(circleDetailAppVO.getSolveId()); - circleDetailAppVO.setSolveName(user1.getName()); + circleDetailAppVO.setSolveName(SensitiveUtil.replaceName(user1.getName())); } if(circleDetailAppVO.getOrderType()==1){ ComPbCheckUnit comPbCheckUnit=comPbCheckUnitDao.selectById(circleDetailAppVO.getSolveUnitId()); @@ -267,7 +334,12 @@ circleDetailAppVO.setHaveSign(2); } } - + ComActActivityDO comActActivityDO=comActActivityDAO.selectOne(new QueryWrapper<ComActActivityDO>().lambda().eq(ComActActivityDO::getRelationId,neighborCircleAppDTO.getCircleId())); + if(comActActivityDO!=null){ + circleDetailAppVO.setActivityDate(comActActivityDO.getCreateAt()); + circleDetailAppVO.setActivityId(comActActivityDO.getId()); + circleDetailAppVO.setActivityName(comActActivityDO.getActivityName()); + } // 查询邻里圈下评论列表 IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = comActNeighborCircleCommentDAO.pageNeighborCommentByApp( @@ -583,6 +655,20 @@ } if (comActNeighborCircleCommentDAO.insert(circleCommentDO) > 0) { + SysUser sysUser=sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,neighborCircleDO.getSolveId())); + if(sysUser!=null) { + try { + WxXCXTempSend util = new WxXCXTempSend(); + if (neighborCircleDO.getBelongType()==2){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你有一条新的评价信息",neighborCircleDO.getReleaseContent().length()>10?neighborCircleDO.getReleaseContent().substring(0,10)+"..":neighborCircleDO.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+neighborCircleDO.getId()+"&type=888"); + } + if (neighborCircleDO.getBelongType()==3){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你有一条新的评价信息",neighborCircleDO.getReleaseContent().length()>10?neighborCircleDO.getReleaseContent().substring(0,10)+"..":neighborCircleDO.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+neighborCircleDO.getId()+"&type=777"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } return R.ok(); } else { return R.fail("评论失败"); @@ -1015,27 +1101,80 @@ if(StringUtils.isNotEmpty(comActNeighborCircleDO.getComment())){ comActNeighborCircleDO.setCommentTime(new Date()); } - return R.ok(this.baseMapper.updateById(comActNeighborCircleDO)); + int result=this.baseMapper.updateById(comActNeighborCircleDO); + if(result>0){ + ComActNeighborCircleDO comActNeighborCircleDO1=this.baseMapper.selectById(comActNeighborCircleDO.getId()); + if(comActNeighborCircleDO.getOrderStatus()!=null){ + SysUser sysUser=sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,comActNeighborCircleDO1.getReleaseId())); + if(sysUser!=null) { + try { + WxXCXTempSend util = new WxXCXTempSend(); + if (comActNeighborCircleDO1.getBelongType()==2){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你反馈的问题已被人认领",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=888"); + } + if (comActNeighborCircleDO1.getBelongType()==3){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你反馈的需求已被人认领",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=777"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + if(comActNeighborCircleDO.getSolveStatus()==3){ + SysUser sysUser=sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,comActNeighborCircleDO1.getReleaseId())); + if(sysUser!=null) { + try { + WxXCXTempSend util = new WxXCXTempSend(); + if (comActNeighborCircleDO1.getBelongType()==2){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你反馈的问题已被人处理",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=888"); + } + if (comActNeighborCircleDO1.getBelongType()==3){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你反馈的需求已被人处理",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=777"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + if(comActNeighborCircleDO.getSolveStatus()==4){ + SysUser sysUser=sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getUserId,comActNeighborCircleDO1.getSolveId())); + if(sysUser!=null) { + try { + WxXCXTempSend util = new WxXCXTempSend(); + if (comActNeighborCircleDO1.getBelongType()==2){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你有一条新的评价信息",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=888"); + } + if (comActNeighborCircleDO1.getBelongType()==3){ + WxUtil.sendLongTimeTemplate(sysUser.getOpenid(),util.getAccessToken(),"你有一条新的评价信息",comActNeighborCircleDO1.getReleaseContent().length()>10?comActNeighborCircleDO1.getReleaseContent().substring(0,10)+"..":comActNeighborCircleDO1.getReleaseContent(),"packageB/pages/partySecond/problemDetails/index?id="+comActNeighborCircleDO.getId()+"&type=777"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return R.ok(result); + } + return R.fail(); } @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); } @@ -1190,6 +1329,48 @@ return null; } + @Override + public R selectCount(Integer type, String phone,Long communityId) { + return R.ok(this.baseMapper.selectCount(type,phone,communityId)); + } + + /** + * 分页查询可关联清单列表 + * @param neighborCircleAppDTO + * @return + */ + @Override + public R pageRelationList(ComActNeighborCircleAppDTO neighborCircleAppDTO) { + Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize()); + IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageRelationList(userPage, neighborCircleAppDTO); + if (!doPager.getRecords().isEmpty()) { + for (ComActNeighborCircleAppVO circleAppVO : doPager.getRecords()) { + if (neighborCircleAppDTO.getUserId() != null) { + // 查询点赞信息 + ComActNeighborCircleFabulousDO circleFabulousDO = + comActNeighborCircleFabulousDAO.selectOne(new QueryWrapper<ComActNeighborCircleFabulousDO>() + .lambda().eq(ComActNeighborCircleFabulousDO::getParentId, circleAppVO.getId()) + .eq(ComActNeighborCircleFabulousDO::getUserId, neighborCircleAppDTO.getUserId()) + .eq(ComActNeighborCircleFabulousDO::getType, ComActNeighborCircleFabulousDO.type.llq) + .eq(ComActNeighborCircleFabulousDO::getIsEffective, + ComActNeighborCircleFabulousDO.isEffective.yes)); + if (circleFabulousDO != null) { + circleAppVO.setHaveSign(1); + } else { + circleAppVO.setHaveSign(2); + } + } + if (circleAppVO.getType() != null && circleAppVO.getType().equals(ComActNeighborCircleDO.type.admin)) { + ComActDO actDO = comActDAO.selectById(circleAppVO.getCommunityId()); + if (actDO != null) { + circleAppVO.setName(actDO.getName()); + } + } + } + } + return R.ok(doPager); + } + /** * 判断活动统计列表中是否已有该单位的数据 * */ -- Gitblit v1.7.1