puhanshu
2022-08-05 dfd80c77abd68b95a8fc1e832d36d6f756083e04
bug修改
2个文件已修改
54 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java
@@ -295,41 +295,9 @@
                        .sorted(Comparator.comparing(ComActActRegistVO::getCreateAt).reversed()).collect(toList());
                collect.forEach(comActActivityVO -> {
                    ArrayList<ComActActRegistVO> currentList = new ArrayList<>();
                    Integer[] rewardWayArr = {0};
                    comActActRegistVOS.forEach(activitySignInVO -> {
                        if (comActActivityVO.getId().equals(activitySignInVO.getActivityId())) {
                            currentList.add(activitySignInVO);
                            Integer signIdentity = activitySignInVO.getSignIdentity();
                            Integer rewardWay = null;
                            Integer rewardIntegral = 0;
                            switch (signIdentity) {
                                case 1:
                                    rewardWay = comActActivityVO.getParticipantRewardWay();
                                    rewardIntegral = comActActivityVO.getParticipantRewardIntegral();
                                    break;
                                case 2:
                                    rewardWay = comActActivityVO.getPbRewardWay();
                                    rewardIntegral = comActActivityVO.getPbRewardIntegral();
                                case 3:
                                    rewardWay = comActActivityVO.getVolunteerRewardWay();
                                    rewardIntegral = comActActivityVO.getVolunteerRewardIntegral();
                                    break;
                                default:
                                    break;
                            }
                            rewardWayArr[0] = rewardWay;
                            if(rewardWay == 1){
                                comActActivityVO.setIsComment(1);
                                if(comActActivityVO.getTimes()==null){
                                    comActActivityVO.setTimes(1);
                                    comActActivityVO.setAward(rewardIntegral);
                                }
                                else {
                                    comActActivityVO.setTimes(comActActivityVO.getTimes()+1);
                                    comActActivityVO.setAward(rewardIntegral*comActActivityVO.getTimes());
                                }
                            } else {
                                if(activitySignInVO.getEndTime()!=null){
                                    comActActivityVO.setIsComment(1);
                                    if(comActActivityVO.getTimes()==null){
@@ -342,7 +310,6 @@
                                    }
                                }
                            }
                        }
                    });
                    if (currentList.size() > 10) {
                        comActActivityVO.setActivitySignInList(currentList.subList(0, 10));
@@ -351,14 +318,8 @@
                    }
                    Integer limit = comActActivityVO.getLimit();
                    if(limit != null && limit>0 &&currentList.size()>0){
                        if(rewardWayArr[0] == 2){
                            if(limit==currentList.size()&&currentList.get(currentList.size()-1).getEndTime()!=null){
                                comActActivityVO.setIsRegist(1);
                            }
                        } else {
                            if(limit==currentList.size()){
                                comActActivityVO.setIsRegist(1);
                            }
                        }
                    }
                });
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -1109,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();
            }
        }