From 435c322d26ffd9d459cb597cfcc68ebc27f1590d Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期五, 05 八月 2022 16:45:17 +0800 Subject: [PATCH] bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java | 38 ++++++++++++++------------------------ 1 files changed, 14 insertions(+), 24 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 22e4363..902e421 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 @@ -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); }); @@ -399,13 +400,11 @@ List<ComActActRegistDO> collect = regList.stream().sorted(Comparator.comparing(ComActActRegistDO::getId).reversed()).collect(Collectors.toList()); comActActivityVO.setTimes(collect.get(0).getTimes()); ComActActRegistDO comActActRegistDO=collect.get(0); - if(comActActRegistDO.getType()==3||comActActRegistDO.getType()==5){ - if(comActActRegistDO.getEndTime()==null){ - comActActivityVO.setSignType(2); - } - else { - comActActivityVO.setSignType(1); - } + if(comActActRegistDO.getEndTime()==null){ + comActActivityVO.setSignType(2); + } + else { + comActActivityVO.setSignType(1); } } else { @@ -1040,6 +1039,7 @@ rewardIntegral = comActActivityDO.getPbRewardIntegral(); integralType = 5; remark = "社区活动-党员身份成功参与"; + break; case 3: rewardWay = comActActivityDO.getVolunteerRewardWay(); rewardIntegral = comActActivityDO.getVolunteerRewardIntegral(); @@ -1065,23 +1065,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(); } @@ -1108,22 +1109,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