| | |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.mall.dto.ApiOperateDoDto; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiActivityOrderInfoVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiActivityOrderListVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiCheckOrderVo; |
| | | import cc.mrbird.febs.mall.vo.activity.ApiVoteActivityHotVo; |
| | | import cc.mrbird.febs.mall.vo.activity.*; |
| | | import cc.mrbird.febs.pay.model.BrandWCPayRequestData; |
| | | import cc.mrbird.febs.pay.service.IXcxPayService; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse expireOrder(ApiExpireOrderDto dto) { |
| | | if(CollUtil.isEmpty(dto.getIds())){ |
| | | throw new FebsException("请选择订单"); |
| | | } |
| | | |
| | | dto.getIds().forEach(id -> { |
| | | HappyActivityOrder happyActivityOrder = happyActivityOrderMapper.selectById(id); |
| | | if(ObjectUtil.isNotEmpty(happyActivityOrder)){ |
| | | Long activityId = happyActivityOrder.getActivityId(); |
| | | Integer numCnt = happyActivityOrder.getNumCnt(); |
| | | this.baseMapper.updateHappyActivitySurplusCnt(activityId,numCnt); |
| | | |
| | | happyActivityOrder.setState(StateUpDownEnum.ORDER_STATE_OVERTIME.getCode()); |
| | | happyActivityOrderMapper.updateById(happyActivityOrder); |
| | | } |
| | | }); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse createOrder(ApiCreateOrderDto dto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | if(CollUtil.isEmpty(dto.getConnectIds())){ |
| | |
| | | if(amount.compareTo(BigDecimal.ZERO) < 0){ |
| | | throw new FebsException("支付金额错误"); |
| | | } |
| | | DateTime failTime = DateUtil.offsetMinute(new Date(), StateUpDownEnum.ORDER_OVERTIME.getCode()); |
| | | HappyActivityOrder happyActivityOrder = new HappyActivityOrder(); |
| | | happyActivityOrder.setOrderNo(MallUtils.getOrderNum()); |
| | | happyActivityOrder.setMemberId(memberId); |
| | |
| | | happyActivityOrder.setNumCnt(dto.getNumCnt()); |
| | | happyActivityOrder.setAmount(amount); |
| | | happyActivityOrder.setPayState(StateUpDownEnum.PAY_STATE_NOT_PAY.getCode()); |
| | | happyActivityOrder.setPayType(StateUpDownEnum.PAY_METHOD_WECHAT.getCode()); |
| | | happyActivityOrder.setFailTime(failTime); |
| | | log.info("创建订单,订单号="+JSONUtil.parse(happyActivityOrder)); |
| | | happyActivityOrderMapper.insert(happyActivityOrder); |
| | | |
| | | for(Long connectId : connectIds){ |
| | |
| | | HashMap<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | stringObjectHashMap.put("orderId",happyActivityOrder.getId()); |
| | | stringObjectHashMap.put("amount",amount); |
| | | stringObjectHashMap.put("failTime",failTime); |
| | | |
| | | return new FebsResponse().success().data(stringObjectHashMap); |
| | | } |
| | |
| | | log.error("支付失败,订单ID:{},支付类型:{}", orderId, payType, e); |
| | | throw new FebsException("支付失败:" + e.getMessage()); |
| | | } |
| | | |
| | | // todo 支付失败要把对应的人数加回来 |
| | | |
| | | // 构造返回结果,包含支付相关信息 |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | LambdaQueryWrapper<HappyActivityOrder> happyActivityOrderLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | happyActivityOrderLambdaQueryWrapper.eq(HappyActivityOrder::getMemberId, memberId); |
| | | if(ObjectUtil.isNotEmpty(dto.getState())){ |
| | | if(ObjectUtil.isNotEmpty(dto.getState()) && dto.getState() != 0){ |
| | | happyActivityOrderLambdaQueryWrapper.eq(HappyActivityOrder::getState, dto.getState()); |
| | | } |
| | | happyActivityOrderLambdaQueryWrapper.eq(HappyActivityOrder::getDeleteFlag, StateUpDownEnum.DOWN.getCode()); |
| | |
| | | List<HappyActivity> happyActivities = this.baseMapper.selectList( |
| | | new LambdaQueryWrapper<HappyActivity>() |
| | | .select( |
| | | HappyActivity::getId, |
| | | HappyActivity::getCategoryId, |
| | | HappyActivity::getName, |
| | | HappyActivity::getStartTime, |
| | |
| | | List<HappyActivityOrder> happyActivityOrders = happyActivityOrderMapper.selectList( |
| | | new LambdaQueryWrapper<HappyActivityOrder>() |
| | | .eq(HappyActivityOrder::getState, StateUpDownEnum.ORDER_STATE_WAIT_PAY.getCode()) |
| | | .lt(HappyActivityOrder::getCreatedTime, DateUtil.offsetMinute(new Date(), -10)) |
| | | .lt(HappyActivityOrder::getFailTime, new Date()) |
| | | ); |
| | | if(CollUtil.isNotEmpty(happyActivityOrders)){ |
| | | happyActivityOrders.forEach(happyActivityOrder -> { |
| | |
| | | Integer numCnt = happyActivityOrder.getNumCnt(); |
| | | this.baseMapper.updateHappyActivitySurplusCnt(activityId,numCnt); |
| | | |
| | | happyActivityOrder.setDeleteFlag(StateUpDownEnum.UP.getCode()); |
| | | happyActivityOrder.setState(StateUpDownEnum.ORDER_STATE_OVERTIME.getCode()); |
| | | happyActivityOrderMapper.updateById(happyActivityOrder); |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ApiActivityCommentVo> commentByActivityId(ApiActivityCommentDto dto) { |
| | | Page<ApiActivityCommentVo> page = new Page<>(dto.getPageNow(), dto.getPageSize()); |
| | | return this.baseMapper.selectActivityCommentPage(page,dto); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse voteActivityHot(Long id) { |
| | | |
| | | ApiVoteActivityHotVo apiVoteActivityHotVo = new ApiVoteActivityHotVo(); |