| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | |
| | | BigDecimal activityPrice = mgtActivityGoodsEditDto.getActivityPrice(); |
| | | BigDecimal activitySubscription = mgtActivityGoodsEditDto.getActivitySubscription(); |
| | | Integer activityNumber = mgtActivityGoodsEditDto.getActivityNumber(); |
| | | if(goodsId.equals(goodsId1) && activitySubscription1.compareTo(activitySubscription) != 0){ |
| | | if(null != activitySubscription && null != activitySubscription1 && |
| | | goodsId.equals(goodsId1) && activitySubscription1.compareTo(activitySubscription) != 0){ |
| | | throw new ServiceException("不能修改定金"); |
| | | } |
| | | if(goodsId.equals(goodsId1) && activityPrice1.compareTo(activityPrice) != 0){ |
| | |
| | | MgtBaseBathDto mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto = new MgtBaseBathDto(); |
| | | mgtBaseBathDto.setIds(userJoinedString); |
| | | List<MgtSimpleMemberVo> simpleMemberVoList = remoteMemberService.listSimpleVoByIds(mgtBaseBathDto).getData(); |
| | | List<MgtSimpleMemberVo> simpleMemberVoList = remoteMemberService.listSimpleVoByIds(userJoinedString).getData(); |
| | | Map<Long, MgtSimpleMemberVo> userMap = simpleMemberVoList.stream() |
| | | .collect(Collectors.toMap(MgtSimpleMemberVo::getUserId, Function.identity())); |
| | | for (MgtActivityRecordPageVo mgtActivityRecordPageVo : activityRecordPageVoList) { |
| | |
| | | } |
| | | return judge; |
| | | } |
| | | |
| | | /** |
| | | * 立即结束活动 |
| | | * @param mgtBaseGetDto |
| | | */ |
| | | @Override |
| | | public R endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | Activity activity = this.getById(mgtBaseGetDto.getId()); |
| | | if(null == activity){ |
| | | return R.fail("活动不存在"); |
| | | } |
| | | //判断是否在活动中 |
| | | Date now = new Date(); |
| | | if (now.before(activity.getActivityStartTime())||now.after(activity.getActivityEndTime())){ |
| | | return R.fail("未在活动时间范围内,不能执行立即结束操作"); |
| | | } |
| | | activity.setActivityEndTime(now); |
| | | activity.setUpdateTime(now); |
| | | activity.setUpdateUserId(mgtBaseGetDto.getUserId()); |
| | | this.updateById(activity); |
| | | return R.ok(); |
| | | } |
| | | } |