From fae06da02f16a57b7f194c172b1b24e01df432c9 Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期一, 31 十月 2022 15:13:50 +0800
Subject: [PATCH] Merge branch 'local_20221024' into huacheng_test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java | 213 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 174 insertions(+), 39 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 68a6cb0..59c943d 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,22 +1,10 @@
package com.panzhihua.service_community.service.impl;
-import java.util.*;
-
-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 org.apache.commons.lang3.ObjectUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -24,18 +12,27 @@
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.vos.PageVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.neighbor.*;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
-import com.panzhihua.common.utlis.DateUtils;
-import com.panzhihua.common.utlis.StringUtils;
+import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.common.utlis.*;
import com.panzhihua.service_community.dao.*;
+import com.panzhihua.service_community.entity.ComPbCheckUnit;
+import com.panzhihua.service_community.entity.SysUser;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComActNeighborCircleBrowseService;
import com.panzhihua.service_community.service.ComActNeighborCircleService;
-
+import com.panzhihua.service_community.service.ComActNeighborCircleTopicService;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.util.CollectionUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
/**
* @auther lyq
@@ -81,6 +78,8 @@
private ComActActivityDAO comActActivityDAO;
@Resource
private ComPbCheckUnitDao comPbCheckUnitDao;
+ @Resource
+ private SysUserDao sysUserDao;
/**
* 分页查询邻里圈列表
*
@@ -102,6 +101,15 @@
// }
// }
// }
+ Long communityId = neighborCircleAppDTO.getCommunityId();
+ if(null != communityId){
+ List<Long> communityIds = comActDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ neighborCircleAppDTO.setCommunityIds(communityIds);
+ }
Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize());
IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO);
if (!doPager.getRecords().isEmpty()) {
@@ -192,6 +200,7 @@
if (StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())) {
neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone());
}
+
//判断当前邻里圈是否需要审核
if(addNeighborCircleAppDTO.getIsExamine().equals(AddComActNeighborCircleAppDTO.isExamine.no)){
//当邻里圈不需要审核才进入自动审核
@@ -242,7 +251,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 +276,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(
@@ -330,6 +344,15 @@
@Override
public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) {
+ Long communityId = neighborCircleAdminDTO.getCommunityId();
+ if(null != communityId){
+ List<Long> communityIds = comActDAO.selectIds(communityId);
+ if (CollUtil.isEmpty(communityIds)) {
+ communityIds = new ArrayList<>();
+ communityIds.add(communityId);
+ }
+ neighborCircleAdminDTO.setCommunityIds(communityIds);
+ }
Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize());
IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO);
doPager.getRecords().forEach(data -> {
@@ -478,6 +501,7 @@
ComActNeighborCircleCommentDO circleCommentDO =
comActNeighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId());
if (circleCommentDO != null) {
+
circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1);
comActNeighborCircleCommentDAO.updateById(circleCommentDO);
//计算需要增加的热度值
@@ -582,6 +606,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("评论失败");
@@ -724,8 +762,10 @@
AdministratorsUserVO user = this.baseMapper.selectUserByUserId(comActNeighborCircleDO.getReleaseId());
DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO();
BeanUtils.copyProperties(comActNeighborCircleDO, vo);
- vo.setReleaseName(user.getName());
- vo.setImageUrl(user.getImageUrl());
+ if(user!=null){
+ vo.setReleaseName(user.getName());
+ vo.setImageUrl(user.getImageUrl());
+ }
if(comActNeighborCircleDO.getOrderType()!=null){
if(comActNeighborCircleDO.getOrderType()==2){
AdministratorsUserVO user1 = this.baseMapper.selectUserByUserId(comActNeighborCircleDO.getSolveId());
@@ -1012,27 +1052,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);
}
@@ -1187,6 +1280,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