From bf01de2495d4c8078927d5cde376b4e57496fe80 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期五, 05 八月 2022 14:00:29 +0800 Subject: [PATCH] bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java | 36 +++++++++++++++--------------------- 1 files changed, 15 insertions(+), 21 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 c1be0ea..7af1d14 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 @@ -21,14 +21,12 @@ import com.panzhihua.common.constants.HttpStatus; import com.panzhihua.common.model.dtos.community.ActivityInviteDTO; -import com.panzhihua.common.model.dtos.community.PageActivityInviteDTO; -import com.panzhihua.service_community.dao.ComActActivityInviteDAO; +import com.panzhihua.service_community.dao.ComActNeighborCircleDAO; import com.panzhihua.service_community.dao.ComActNeighborCircleTopicWestMapper; import com.panzhihua.service_community.dao.ComPbMemberDAO; 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.service.ComActNeighborCircleTopicWestService; import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.BeanUtils; import org.springframework.data.redis.core.StringRedisTemplate; @@ -139,6 +137,8 @@ private ComActNeighborCircleTopicWestMapper comActNeighborCircleTopicWestMapper; @Resource private ComActActivityInviteService comActActivityInviteService; + @Resource + private ComActNeighborCircleDAO comActNeighborCircleDAO; /** * 新增社区活动 @@ -188,6 +188,7 @@ inviteList.forEach(e -> { ComActActivityInvite inviteEntity = new ComActActivityInvite(); BeanUtils.copyProperties(e, inviteEntity); + inviteEntity.setActivityId(activityId); inviteEntity.setCreatedBy(comActActivityVO.getUserId()); inviteEntityList.add(inviteEntity); }); @@ -206,7 +207,7 @@ comActNeighborCircleTopicWestMapper.insert(topicWestDO); ComActActivityDO activityUpdate = new ComActActivityDO(); - activityUpdate.setId(activityId); + BeanUtils.copyProperties(comActActivityDO, activityUpdate); activityUpdate.setTopicId(topicWestDO.getId()); this.baseMapper.updateById(activityUpdate); @@ -413,6 +414,9 @@ } } comActActivityVO.setCodeType(1); + if (comActActivityVO.getRelationId() != null) { + comActActivityVO.setListDetail(comActNeighborCircleDAO.neighborDetailByApp(comActActivityVO.getRelationId())); + } } return comActActivityVO; } @@ -1062,23 +1066,24 @@ if (comActActActRegistDO.getEndTime() != null) { return R.fail("无法重复签退"); } - int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActRegistDO.getStartTime(), nowDate); + int hours = com.panzhihua.common.utlis.DateUtils.getHour(comActActActRegistDO.getStartTime(), nowDate); + int retrieveIntegral = rewardWay == 1 ? rewardIntegral : rewardIntegral * hours; comActActRegistDO.setId(comActActActRegistDO.getId()); comActActRegistDO.setEndTime(nowDate); - comActActRegistDO.setAward(rewardIntegral * hours); + comActActRegistDO.setAward(retrieveIntegral); int result = comActActRegistDAO.updateById(comActActRegistDO); if (result > 0) { if (isHave) { AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); addComActIntegralUserDTO.setUserId(userId); addComActIntegralUserDTO.setIntegralType(integralType); - addComActIntegralUserDTO.setIntegral(rewardIntegral * hours); + addComActIntegralUserDTO.setIntegral(retrieveIntegral); addComActIntegralUserDTO.setSignIdentity(comActActSignDO.getSignIdentity()); addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); addComActIntegralUserDTO.setServiceId(activityId); addComActIntegralUserDTO.setRemark(remark); comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); - return R.ok(rewardIntegral * hours); + return R.ok(retrieveIntegral); } else { return R.ok(); } @@ -1105,22 +1110,11 @@ comActActRegistDO.setSignIdentity(comActActSignDO.getSignIdentity()); comActActRegistDO.setCreateAt(nowDate); comActActRegistDO.setCodeId(comActActRegistVO.getCodeId()); - comActActRegistDO.setAward(rewardWay == 1 ? rewardIntegral : 0); + comActActRegistDO.setAward(0); comActActRegistDO.setPosition(comActActRegistVO.getPosition()); comActActRegistDO.setTimes(signAllCount + 1); int result = comActActRegistDAO.insert(comActActRegistDO); - if (result > 0 && isHave && rewardWay == 1) { - AddComActIntegralUserDTO addComActIntegralUserDTO = new AddComActIntegralUserDTO(); - addComActIntegralUserDTO.setUserId(userId); - addComActIntegralUserDTO.setIntegralType(integralType); - addComActIntegralUserDTO.setIntegral(rewardIntegral); - addComActIntegralUserDTO.setSignIdentity(comActActSignDO.getSignIdentity()); - addComActIntegralUserDTO.setCommunityId(comActActivityDO.getCommunityId()); - addComActIntegralUserDTO.setServiceId(activityId); - addComActIntegralUserDTO.setRemark(remark); - comActIntegralUserTradeService.addIntegralTradeAdmin(addComActIntegralUserDTO); - return R.ok(rewardIntegral); - } else { + if (result > 0) { return R.ok(); } } -- Gitblit v1.7.1