puhanshu
2022-08-05 435c322d26ffd9d459cb597cfcc68ebc27f1590d
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -400,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 {
@@ -1041,6 +1039,7 @@
                rewardIntegral = comActActivityDO.getPbRewardIntegral();
                integralType = 5;
                remark = "社区活动-党员身份成功参与";
                break;
            case 3:
                rewardWay = comActActivityDO.getVolunteerRewardWay();
                rewardIntegral = comActActivityDO.getVolunteerRewardIntegral();
@@ -1066,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();
                }