| | |
| | | import cn.hutool.core.map.MapUtil; |
| | | import cn.hutool.core.text.StrBuilder; |
| | | import cn.hutool.core.util.NumberUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | import com.xzx.gc.model.user.*; |
| | | import com.xzx.gc.order.dto.*; |
| | | import com.xzx.gc.order.mapper.*; |
| | | import com.xzx.gc.order.vo.InviteUserOrderVo; |
| | | import com.xzx.gc.service.AccountContext; |
| | | import com.xzx.gc.util.DoubleUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Autowired |
| | | private DistribService distribService; |
| | | |
| | | @Autowired |
| | | private JhyOrderMapper jhyOrderMapper; |
| | | |
| | | |
| | | public OrderReserveResDto getReserveTimeNew(OrderReserveResDto orderReserveResDto, String partnerId) { |
| | |
| | | throw new RestException(-3, "所选位置暂未开通服务"); |
| | | } |
| | | orderInfoReq.setTownId(townId); |
| | | } |
| | | |
| | | List<OrderInfo> orderInfos = orderMapper.selectOrderWithWaitAndIng(orderInfoReq.getCreateUserId()); |
| | | if (CollUtil.isNotEmpty(orderInfos)) { |
| | | String address = addressInfo.getAddressArea() + addressInfo.getDetailAddress() + addressInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber(); |
| | | for (OrderInfo orderInfo : orderInfos) { |
| | | orderInfoReq.setAddress(addressInfo.getDetailAddress()); |
| | | orderInfoReq.setAddressArea(addressInfo.getAddressArea()); |
| | | orderInfoReq.setUnitName(addressInfo.getUnitName()); |
| | | orderInfoReq.setHouseNumber(addressInfo.getHouseNumber()); |
| | | orderInfoReq.setHouseName(addressInfo.getHouseName()); |
| | | |
| | | String hasAddress = orderInfo.getAddressArea() + orderInfo.getAddress() + orderInfo.getHouseName() + addressInfo.getUnitName() + addressInfo.getHouseNumber(); |
| | | if (ObjectUtil.equal(address, hasAddress)) { |
| | | throw new RestException("该地址已经存在正在进行的订单"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | traceIds = getTrace(orderInfoReq); |
| | | } |
| | | |
| | | distribService.inviteAddOrderScore(orderInfoReq.getCreateUserId(), orderId); |
| | | } |
| | | } |
| | | } catch (RestException e) { |
| | |
| | | } |
| | | orderDetailService.updateAllById(orderDetailInfo); |
| | | } |
| | | |
| | | public PageInfo<InviteUserOrderVo> inviteUserOrderDetail(InviteUserOrderDetailsDto detailsDto) { |
| | | UserInfo userInfo = userMapper.selectByPrimaryKey(detailsDto.getUserId()); |
| | | if (userInfo == null) { |
| | | throw new RestException("用户不存在"); |
| | | } |
| | | |
| | | detailsDto.setPhone(userInfo.getMobilePhone()); |
| | | List<InviteUserOrderVo> orderVos = new ArrayList<>(); |
| | | PageHelper.startPage(detailsDto.getPage(), detailsDto.getLimit()); |
| | | if (detailsDto.getType() == 1) { |
| | | orderVos = orderMapper.selectInviteUserOrderList(detailsDto); |
| | | } else { |
| | | orderVos = jhyOrderMapper.selectInviteUserOrderList(detailsDto); |
| | | } |
| | | return new PageInfo<>(orderVos); |
| | | } |
| | | } |