| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.panzhihua.common.constants.HttpStatus; |
| | | import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; |
| | | import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; |
| | |
| | | import com.panzhihua.service_community.entity.ComActActivityInvite; |
| | | import com.panzhihua.service_community.model.dos.ComActNeighborCircleTopicWestDO; |
| | | import com.panzhihua.service_community.service.ComActActivityInviteService; |
| | | import com.panzhihua.service_community.util.WxMaConfiguration; |
| | | import org.apache.commons.lang3.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | |
| | | private ComActActivityInviteService comActActivityInviteService; |
| | | @Resource |
| | | private ComActNeighborCircleDAO comActNeighborCircleDAO; |
| | | @Resource |
| | | private WxMaConfiguration wxMaConfiguration; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | List<ActivitySignVO> activitySignVOS = comActActSignDAO.listActivitySigns(activitySignVO); |
| | | if (!activitySignVOS.isEmpty()) { |
| | | try { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | String accessToken = util.getAccessToken(); |
| | | WxMaService maService = wxMaConfiguration.getMaService("wx118de8a734d269f0"); |
| | | String accessToken = maService.getAccessToken(); |
| | | ComActDO comActDO=comActDAO.selectById(comActActivityDO.getCommunityId()); |
| | | R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),1); |
| | | activitySignVOS.forEach(activitySignVO1 -> { |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | Long communityId = comActActivityVO.getCommunityId(); |
| | | if (null != communityId){ |
| | | List<Long> communityIds = comActDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | comActActivityVO.setCommunityIds(communityIds); |
| | | } |
| | | Integer type = comActActivityVO.getType(); |
| | | IPage<ComActActivityVO> iPage = null; |
| | | if (nonNull(type) && type.equals(4)) { |
| | | if (nonNull(comActActivityVO.getCommunityId())) { |
| | | ComActDO comActDO = comActDAO.selectById(comActActivityVO.getCommunityId()); |
| | | if (nonNull(comActDO)) { |
| | | comActActivityVO.setStreetId(comActDO.getStreetId()); |
| | | } |
| | | ComActDO comActDO = comActDAO.selectById(comActActivityVO.getCommunityId()); |
| | | if (nonNull(comActDO)) { |
| | | comActActivityVO.setStreetId(comActDO.getStreetId()); |
| | | } |
| | | } |
| | | iPage = comActActivityDAO.pageProjectActivity(page, comActActivityVO); |
| | | } else { |
| | |
| | | comActActSignDO.setSignIdentity(signIdentity); |
| | | comActActSignDO.setTimes(comActActSignDO.getTimes()+1); |
| | | comActActSignDO.setIsInvite(isInvite); |
| | | comActActSignDO.setCheckUnitId(signactivityVO.getCheckUnitId()); |
| | | num = comActActSignDAO.updateById(comActActSignDO); |
| | | } else { |
| | | comActActSignDO = new ComActActSignDO(); |
| | |
| | | comActActSignDO.setSignIdentity(signIdentity); |
| | | comActActSignDO.setTimes(1); |
| | | comActActSignDO.setIsInvite(isInvite); |
| | | comActActSignDO.setCheckUnitId(signactivityVO.getCheckUnitId()); |
| | | num = comActActSignDAO.insert(comActActSignDO); |
| | | } |
| | | } else { |
| | |
| | | // 修改报名状态 变为报名中 |
| | | // int num1 = comActActivityDAO.updateStatusToBeginSign(); |
| | | // log.info("定时任务--修改社区活动报名状态活动数量【{}】", num1); |
| | | // 查询已经结束的活动,需要计算积分 |
| | | List<Long> activityEndIds = comActActivityDAO.selectBeginIds(); |
| | | WxMaService maService = wxMaConfiguration.getMaService("wx118de8a734d269f0"); |
| | | if(!CollectionUtils.isEmpty(activityEndIds)){ |
| | | activityEndIds.forEach(activityId->{ |
| | | List<String> openIds=comActActivityDAO.selectOpenIdByActivityId(activityId); |
| | | if(!CollectionUtils.isEmpty(openIds)){ |
| | | openIds.forEach(op->{ |
| | | WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendLongTimeTemplate(op,maService.getAccessToken(),"活动开始提醒","您参加的活动已开始","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+activityId); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | int num3 = comActActivityDAO.updateStatusToBeginAfterSingEnd(); |
| | | log.info("定时任务--报名结束修改社区活动进行状态活动数量【{}】", num3); |
| | | // 查询已经结束的活动,需要计算积分 |
| | | List<Long> activityEndIds = comActActivityDAO.getActivityEndIds(); |
| | | // 修改进行状态 变为进行中或者已结束 |
| | | int num2 = comActActivityDAO.updateStatusToBeginActiveOrEnd(); |
| | | log.info("定时任务--修改社区活动进行状态活动数量【{}】", num2); |
| | | List<Long> ids = comActActivityDAO.getActivityEndIds(); |
| | | if(!CollectionUtils.isEmpty(ids)){ |
| | | int num2 = comActActivityDAO.updateStatusToBeginActiveOrEnd(); |
| | | log.info("定时任务--修改社区活动进行状态活动数量【{}】", num2); |
| | | ids.forEach(id ->{ |
| | | List<String> openIds=comActActivityDAO.selectOpenIdByActivityId(id); |
| | | if(!CollectionUtils.isEmpty(openIds)){ |
| | | openIds.forEach(op->{ |
| | | WxXCXTempSend wxXCXTempSend=new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendLongTimeTemplate(op,maService.getAccessToken(),"活动结束提醒","您参加的活动已结束","packageC/pages/activity/communityActivityDetails/communityActivityDetails?id="+id); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | return R.ok(activityEndIds); |
| | | } |
| | | |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | Long communityId = comActActivityVO.getCommunityId(); |
| | | if (null != communityId){ |
| | | List<Long> communityIds = comActDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)) { |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | comActActivityVO.setCommunityIds(communityIds); |
| | | } |
| | | IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivityCommunityBack(page, comActActivityVO); |
| | | iPage.getRecords().forEach(vo ->{ |
| | | List<ComActActEvaluateDO> comActActEvaluateDOList = comActActEvaluateDAO |
| | |
| | | .lambda().le(ComActActivityDO::getBeginAt, DateUtils.addDays(new Date(), 1)) |
| | | .ge(ComActActivityDO::getBeginAt, new Date()).notIn(ComActActivityDO::getStatus,5,6)); |
| | | if (!actActivityList.isEmpty()) { |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | WxMaService maService = wxMaConfiguration.getMaService("wx118de8a734d269f0"); |
| | | try { |
| | | String accessToken = util.getAccessToken(); |
| | | String accessToken = maService.getAccessToken(); |
| | | actActivityList.forEach(actActivity -> { |
| | | ComActDO comActDO=comActDAO.selectById(actActivity.getCommunityId()); |
| | | R<SysTemplateConfigVO> r=userService.selectTemplate(comActDO.getAreaCode(),9); |
| | |
| | | comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); |
| | | comActActRegistDO.setAward(0); |
| | | comActActRegistDO.setPosition(comActActRegistVO.getPosition()); |
| | | comActActRegistDO.setCheckUnitId(comActActSignDO.getCheckUnitId()); |
| | | comActActRegistDO.setTimes(signAllCount + 1); |
| | | int result = comActActRegistDAO.insert(comActActRegistDO); |
| | | if (result > 0) { |
| | |
| | | |
| | | @Override |
| | | public R partyMemberCount(Long communityId, String year) { |
| | | PartyActivityStatics partyActivityStatics=this.comActActivityDAO.selectActivityStatics(communityId); |
| | | List<PartyActivityTypeChart> partyActivityTypeChart=this.comActActivityDAO.selectActivityChart(communityId); |
| | | |
| | | List<Long> communityIds = comActDAO.selectIds(communityId); |
| | | if (CollUtil.isEmpty(communityIds)){ |
| | | communityIds = new ArrayList<>(); |
| | | communityIds.add(communityId); |
| | | } |
| | | PartyActivityStatics partyActivityStatics=this.comActActivityDAO.selectActivityStatics(communityIds); |
| | | List<PartyActivityTypeChart> partyActivityTypeChart=this.comActActivityDAO.selectActivityChart(communityIds); |
| | | if(partyActivityStatics.getActivityCount()!=null&&partyActivityStatics.getActivityCount()>0){ |
| | | if(!CollectionUtils.isEmpty(partyActivityTypeChart)){ |
| | | partyActivityTypeChart.forEach(partyActivityTypeChart1 -> { |
| | |
| | | } |
| | | } |
| | | partyActivityStatics.setPartyActivityTypeChartList(partyActivityTypeChart); |
| | | partyActivityStatics.setPartyActivityLines(getPoints(communityId,year)); |
| | | partyActivityStatics.setPartyActivityLines(getPoints(communityIds,year)); |
| | | return R.ok(partyActivityStatics); |
| | | } |
| | | |
| | |
| | | return R.ok(comActActivityDAO.exportPartyMemberDetail(commonPage)); |
| | | } |
| | | |
| | | public List<PartyActivityLine> getPoints(Long communityId,String year){ |
| | | public List<PartyActivityLine> getPoints(List<Long> communityIds,String year){ |
| | | List<PartyActivityLine> partyActivityLines=new ArrayList<>(); |
| | | for(int i=1;i<=12;i++){ |
| | | String x=""; |
| | |
| | | } |
| | | PartyActivityLine partyActivityLine=new PartyActivityLine(); |
| | | partyActivityLine.setX(i+"月"); |
| | | Integer y=this.comActActivityDAO.selectActivityLine(communityId,year,x); |
| | | Integer y=this.comActActivityDAO.selectActivityLine(communityIds,year,x); |
| | | partyActivityLine.setY(y); |
| | | partyActivityLines.add(partyActivityLine); |
| | | } |