yanghui
2022-11-28 81869518b49a94ffe8c7973c1c9f9c5829eba5c6
#feat 订单自提点查询
7个文件已修改
52 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerOrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ShopFlowerApi.java
@@ -176,7 +176,15 @@
    @GetMapping("orderDetail")
    @ApiImplicitParam(name = "orderId", value = "订单id", required = true)
    public R orderDetail(@RequestParam("orderId") Long orderId) {
        return communityService.orderDetailFlower(orderId);
        return communityService.orderDetailFlower(orderId,null);
    }
    @ApiOperation(value = "自提点查询订单详情", response = ComShopFlowerOrderPageVO.class)
    @GetMapping("pointOrderDetail")
    @ApiImplicitParam(name = "orderId", value = "订单id", required = true)
    public R pointOrderDetail(@RequestParam("orderId") Long orderId) {
        String phone = this.getLoginUserInfo().getPhone();
        return communityService.orderDetailFlower(orderId,phone);
    }
    @ApiOperation(value = "取消订单")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10803,7 +10803,7 @@
     * @return 订单详情
     */
    @GetMapping("/shopFlower/orderDetail")
    R orderDetailFlower(@RequestParam("orderId") Long orderId);
    R orderDetailFlower(@RequestParam("orderId") Long orderId,@RequestParam("phone") String phone);
    /**
     * 根据订单id取消订单
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ShopFlowerApi.java
@@ -120,7 +120,7 @@
    @ApiOperation(value = "订单_详细", response = ComShopFlowerOrderPageVO.class)
    @GetMapping("/order/detail")
    public R detail(@RequestParam("orderId") Long orderId) {
        return communityService.orderDetailFlower(orderId);
        return communityService.orderDetailFlower(orderId,null);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopFlowerApi.java
@@ -198,8 +198,8 @@
     * @return 订单详情
     */
    @GetMapping("orderDetail")
    public R orderDetailFlower(@RequestParam("orderId") Long orderId) {
        return comShopFlowerOrderService.orderDetail(orderId);
    public R orderDetailFlower(@RequestParam("orderId") Long orderId,@RequestParam("phone") String phone) {
        return comShopFlowerOrderService.orderDetail(orderId,phone);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComShopFlowerOrderService.java
@@ -56,7 +56,7 @@
     *            订单id
     * @return 订单详情
     */
    R orderDetail(Long orderId);
    R orderDetail(Long orderId,String phone);
    /**
     * 根据订单id取消订单
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderServiceImpl.java
@@ -1,6 +1,7 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -31,6 +32,7 @@
import java.util.*;
import java.util.stream.Collectors;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
/**
@@ -384,11 +386,23 @@
     * @return 订单详情
     */
    @Override
    public R orderDetail(Long orderId) {
    public R orderDetail(Long orderId,String phone) {
        ComShopFlowerOrderPageVO orderVO = new ComShopFlowerOrderPageVO();
        // 查询订单信息
        ComShopFlowerOrderDO shopOrderDO = this.baseMapper.selectById(orderId);
        ComShopFlowerOrderDO shopOrderDO = null;
        if (StrUtil.isEmpty(phone)){
            // 查询订单信息
            shopOrderDO = this.baseMapper.selectById(orderId);
        }else {
            //查询自提点信息
            ConvenientElevatingPointDO convenientElevatingPointDO = convenientElevatingPointDAO.selectOne(new LambdaQueryWrapper<ConvenientElevatingPointDO>().eq(ConvenientElevatingPointDO::getWechatAccount, phone));
            if (isNull(convenientElevatingPointDO)){
                return R.fail("自提点不存在");
            }
            Long pointDOId = convenientElevatingPointDO.getId();
            shopOrderDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopFlowerOrderDO>().eq(ComShopFlowerOrderDO::getId, orderId).eq(ComShopFlowerOrderDO::getPointId, pointDOId));
        }
        if (shopOrderDO == null) {
            return R.fail("未查询到订单");
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java
@@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
@@ -67,6 +68,10 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R addPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO) {
        ConvenientElevatingPointDO convenientElevatingPointDODB = this.baseMapper.selectOne(new LambdaQueryWrapper<ConvenientElevatingPointDO>().eq(ConvenientElevatingPointDO::getWechatAccount, convenientElevatingPointDTO.getWechatAccount()));
        if (!Objects.isNull(convenientElevatingPointDODB)){
            return  R.fail("该微信手机号已使用,请更换");
        }
        ConvenientElevatingPointDO convenientElevatingPointDO = new ConvenientElevatingPointDO();
        BeanUtils.copyProperties(convenientElevatingPointDTO, convenientElevatingPointDO);
        String communityId = convenientElevatingPointDTO.getCommunityId();
@@ -89,11 +94,16 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R putPoint(ConvenientElevatingPointDTO convenientElevatingPointDTO) {
        ConvenientElevatingPointDO convenientElevatingPointDODB = this.baseMapper.selectOne(new LambdaQueryWrapper<ConvenientElevatingPointDO>().eq(ConvenientElevatingPointDO::getWechatAccount, convenientElevatingPointDTO.getWechatAccount()));
        Long id = convenientElevatingPointDTO.getId();
        ConvenientElevatingPointDO convenientElevatingPointDO = this.baseMapper.selectById(id);
        if (isNull(convenientElevatingPointDO)) {
            return R.fail("自提点不存在");
        }
        if (nonNull(convenientElevatingPointDODB) && !convenientElevatingPointDODB.getId().equals(convenientElevatingPointDO.getId())) {
            R.fail("该微信手机号:" + convenientElevatingPointDTO.getWechatAccount() + "已被使用!请更换");
        }
        String communityId = convenientElevatingPointDTO.getCommunityId();
        if (nonNull(communityId)) {
            ComActDO comActDO = comActDAO.selectById(Long.parseLong(communityId.substring(communityId.lastIndexOf(",") + 1)));