From 587ecd99463a4998512a75ae9fc5f349d3049e7e Mon Sep 17 00:00:00 2001 From: LuoTong <2232327099qq.com> Date: 星期一, 29 七月 2024 18:02:57 +0800 Subject: [PATCH] 社区id 提交 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java | 94 +++++++++++++++++++++++++++++++++------------- 1 files changed, 67 insertions(+), 27 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java index a26b627..f10c7d2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java @@ -183,7 +183,9 @@ comActActivityDO.setIsProject(1); } if(comActActivityVO.getType()==5){ - comPbCheckUnitDao.selectOne(new QueryWrapper<ComPbCheckUnit>().lambda().eq(ComPbCheckUnit::getAdminPhone,comActActivityVO.getPhone()).last("limit 1")); + //TODO 查询然后呢? 值都没给... + comPbCheckUnitDao.selectOne(new QueryWrapper<ComPbCheckUnit>().lambda() + .eq(ComPbCheckUnit::getAdminPhone,comActActivityVO.getPhone()).last("limit 1")); } boolean save = this.save(comActActivityDO); @@ -747,7 +749,7 @@ if(!isNull(type)){ comActActivityDOS=comActActivityDOS.stream().filter(comActActivityDO -> comActActivityDO.getType().equals(type)).collect(Collectors.toList()); } - if (!comActActivityDOS.isEmpty()) { + if (comActActivityDOS != null ) { comActActivityDOS.forEach(comActActivityDO -> { ComActActivityVO comActActivityVO = new ComActActivityVO(); BeanUtils.copyProperties(comActActivityDO, comActActivityVO); @@ -908,12 +910,12 @@ 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); +// List<Long> communityIds = comActDAO.selectIds(communityId); +// if (CollUtil.isEmpty(communityIds)) { +// communityIds = new ArrayList<>(); +// communityIds.add(communityId); +// } + comActActivityVO.setCommunityIds(Arrays.asList( comActActivityVO.getCommunityId() )); } IPage<ComActActivityVO> iPage = comActActivityDAO.pageActivityCommunityBack(page, comActActivityVO); iPage.getRecords().forEach(vo ->{ @@ -1364,10 +1366,10 @@ ComActActivityInvite activityInvite = comActActivityInviteService.getBaseMapper().selectOne(new LambdaQueryWrapper<ComActActivityInvite>() .eq(ComActActivityInvite::getActivityId, activityId).eq(ComActActivityInvite::getUserId, userId)); if (isNull(activityInvite)) { - int count = pbMemberDAO.checkIsPbMember(userId); - if (count < 1) { - return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是党员"); - } +// int count = pbMemberDAO.checkIsPbMember(userId); +// if (count < 1) { +// return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是党员"); +// } // 查询当前活动下参与志愿者 Integer partyMemberCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getSignIdentity, 2) @@ -1384,10 +1386,10 @@ if (volunteerMax == null) { return R.fail("活动暂未对志愿者开放"); } - int count = pbMemberDAO.checkIsVolunteer(userId); - if (count < 1) { - return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是志愿者"); - } +// int count = pbMemberDAO.checkIsVolunteer(userId); +// if (count < 1) { +// return R.fail(HttpStatus.NOT_ACCEPTABLE, "您还不是志愿者"); +// } // 查询当前活动下参与志愿者 Integer volunteerCount = comActActSignDAO.selectCount(new QueryWrapper<ComActActSignDO>().lambda() .eq(ComActActSignDO::getActivityId, activityId).eq(ComActActSignDO::getSignIdentity, 3).eq(ComActActSignDO::getStatus, 1)); @@ -1440,16 +1442,16 @@ if(!StringUtils.isEmpty(actActivityDO.getJinhuiCoinPunishment()) && !StringUtils.equals(actActivityDO.getJinhuiCoinPunishment(),"0")) { //查询个人金汇币总额 - R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); + JinhuiCoinGeneralTable jinhuiCoinGeneralTable=comActActRegistDAO.getDetails(userId+""); if(jinhuiCoinGeneralTable!=null) { - if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getData().getGoldCoin())) + if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getGoldCoin())) { JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); - jinhuiVO.setId(jinhuiCoinGeneralTable.getData().getId()); + jinhuiVO.setId(jinhuiCoinGeneralTable.getId()); int punishmentGold=Integer.valueOf(actActivityDO.getJinhuiCoinPunishment()); - int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getData().getGoldCoin()); + int allGold=Integer.valueOf(jinhuiCoinGeneralTable.getGoldCoin()); if(punishmentGold>=allGold) { jinhuiVO.setGoldCoin("0"); @@ -1521,9 +1523,48 @@ if (comActActActRegistDO.getEndTime() != null) { return R.fail("无法重复签退"); } + + //1.居民 2.党员 3.志愿者 + switch (comActActActRegistDO.getSignIdentity()) + { + case 1: + if(comActActivityDO.getParticipantRewardWay()==2) + { + int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActActRegistDO.getStartTime(), comActActActRegistDO.getEndTime()); + if(hours>1) + { + rewardIntegral=rewardIntegral * hours; + } + } + break; + + case 2: + if(comActActivityDO.getPbRewardWay()==2) + { + int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActActRegistDO.getStartTime(), comActActActRegistDO.getEndTime()); + if(hours>1) + { + rewardIntegral=rewardIntegral * hours; + } + } + break; + + case 3: + if(comActActivityDO.getVolunteerRewardWay()==2) + { + int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActActRegistDO.getStartTime(), comActActActRegistDO.getEndTime()); + if(hours>1) + { + rewardIntegral=rewardIntegral * hours; + } + } + break; + } + comActActRegistDO.setId(comActActActRegistDO.getId()); comActActRegistDO.setEndTime(nowDate); - comActActRegistDO.setAward(0); + comActActRegistDO.setAward(rewardIntegral); + int result = comActActRegistDAO.updateById(comActActRegistDO); if (result > 0) { if (isHave) { @@ -1538,16 +1579,15 @@ // comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); //查询个人金汇币总额 - R<JinhuiCoinGeneralTable> jinhuiCoinGeneralTable=jinhuiCommunityService.coinTableGetDetails(userId+""); - JinhuiCoinGeneralTable table=jinhuiCoinGeneralTable.getData(); - if(table!=null) + JinhuiCoinGeneralTable jinhuiCoinGeneralTable=comActActRegistDAO.getDetails(userId+""); + if(jinhuiCoinGeneralTable!=null) { JinhuiCoinGeneralTableVO jinhuiVO=new JinhuiCoinGeneralTableVO(); - jinhuiVO.setId(table.getId()); + jinhuiVO.setId(jinhuiCoinGeneralTable.getId()); int allGold=0; - if (!StringUtils.isEmpty(table.getGoldCoin())) + if (!StringUtils.isEmpty(jinhuiCoinGeneralTable.getGoldCoin())) { - allGold=Integer.valueOf(table.getGoldCoin()); + allGold=Integer.valueOf(jinhuiCoinGeneralTable.getGoldCoin()); } allGold=allGold+rewardIntegral; jinhuiVO.setGoldCoin(allGold+""); -- Gitblit v1.7.1