| | |
| | | package cc.mrbird.febs.mall.service.impl; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.OrderDeliveryStateEnum; |
| | | import cc.mrbird.febs.common.enumerates.OrderStatusEnum; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.ShareCodeUtil; |
| | |
| | | if(CollUtil.isNotEmpty(mallTeamLeaders)){ |
| | | return new FebsResponse().fail().message("正在申请中"); |
| | | } |
| | | List<MallTeamLeader> mallTeamLeaderCancel = this.baseMapper.selectListByMemberIdAndState(memberId, MallTeamLeader.STATE_CANCEL); |
| | | if(CollUtil.isNotEmpty(mallTeamLeaderCancel)){ |
| | | return new FebsResponse().fail().message("当前用户无法申请"); |
| | | } |
| | | MallTeamLeader mallTeamLeader = MallTeamLeaderConversion.INSTANCE.dtoToEntity(apiApplayLeaderDto); |
| | | mallTeamLeader.setMemberId(memberId); |
| | | mallTeamLeader.setState(MallTeamLeader.STATE_ING); |
| | |
| | | List<MallTeamLeader> mallTeamLeadersIng = this.baseMapper.selectListByMemberIdAndState(memberId, MallTeamLeader.STATE_ING); |
| | | List<MallTeamLeader> mallTeamLeadersNo = this.baseMapper.selectListByMemberIdAndState(memberId, MallTeamLeader.STATE_NO); |
| | | List<MallTeamLeader> mallTeamLeadersYes = this.baseMapper.selectListByMemberIdAndState(memberId, MallTeamLeader.STATE_YES); |
| | | List<MallTeamLeader> mallTeamLeadersCancel = this.baseMapper.selectListByMemberIdAndState(memberId, MallTeamLeader.STATE_CANCEL); |
| | | if(CollUtil.isNotEmpty(mallTeamLeadersIng) ||CollUtil.isNotEmpty(mallTeamLeadersYes)){ |
| | | apiMallleaderStateVo.setState(2); |
| | | }else if(CollUtil.isNotEmpty(mallTeamLeadersNo)){ |
| | | apiMallleaderStateVo.setState(1); |
| | | }else if(CollUtil.isNotEmpty(mallTeamLeadersCancel)){ |
| | | apiMallleaderStateVo.setState(2); |
| | | }else{ |
| | | apiMallleaderStateVo.setState(1); |
| | | } |
| | |
| | | public FebsResponse getApiLeaderInfoVoById(Long id) { |
| | | MallTeamLeader mallTeamLeader = this.baseMapper.selectById(id); |
| | | ApiLeaderInfoVo apiLeaderInfoVo = new ApiLeaderInfoVo(); |
| | | apiLeaderInfoVo.setId(mallTeamLeader.getId()); |
| | | apiLeaderInfoVo.setName(mallTeamLeader.getName()); |
| | | apiLeaderInfoVo.setPhone(mallTeamLeader.getPhone()); |
| | | apiLeaderInfoVo.setAddressPic(mallTeamLeader.getAddressPic()); |
| | |
| | | return new FebsResponse().fail().message("订单不存在"); |
| | | } |
| | | Integer status = mallOrderInfo.getStatus(); |
| | | if(OrderStatusEnum.WAIT_SHIPPING.getValue() != status){ |
| | | if(OrderStatusEnum.WAIT_FINISH.getValue() != status){ |
| | | return new FebsResponse().fail().message("订单不是待确认到货状态"); |
| | | } |
| | | Integer deliveryType = mallOrderInfo.getDeliveryType(); |
| | | if(1 != deliveryType){ |
| | | return new FebsResponse().fail().message("订单的配送方式不是自提"); |
| | | } |
| | | mallOrderInfo.setStatus(OrderStatusEnum.WAIT_FINISH.getValue()); |
| | | mallOrderInfo.setDeliveryState(OrderDeliveryStateEnum.DELIVERY_FINISH.getValue()); |
| | | mallOrderInfoMapper.updateById(mallOrderInfo); |
| | | return new FebsResponse().success().message("确认成功"); |
| | | } |