Jelajahi Sumber

Merge remote-tracking branch 'origin/point_dev' into point_dev

jinshihui 4 hari lalu
induk
melakukan
524920a565
21 mengubah file dengan 119 tambahan dan 600 penghapusan
  1. 10 4
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/AfterSaleOrderController.java
  2. 8 0
      nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/ProductOrderController.java
  3. 0 80
      nightFragrance-admin/src/main/java/com/ylx/web/controller/product/ProductOrderAddressController.java
  4. 20 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/AfterSaleOrderUpdateDTO.java
  5. 22 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/ProductOrderEditLogisticsNo.java
  6. 3 0
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/OrderItemVo.java
  7. 4 1
      nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/ProductOrderPageItemVo.java
  8. 2 0
      nightFragrance-massage/src/main/java/com/ylx/massage/service/IAfterSaleOrderService.java
  9. 2 0
      nightFragrance-massage/src/main/java/com/ylx/massage/service/IProductOrderInfoService.java
  10. 14 0
      nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/AfterSaleOrderServiceImpl.java
  11. 26 14
      nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/ProductOrderInfoServiceImpl.java
  12. 0 101
      nightFragrance-massage/src/main/java/com/ylx/product/domain/ProductOrderAddress.java
  13. 0 58
      nightFragrance-massage/src/main/java/com/ylx/product/domain/dto/ProductOrderAddressDTO.java
  14. 0 14
      nightFragrance-massage/src/main/java/com/ylx/product/domain/dto/ProductOrderAddressPageDTO.java
  15. 0 47
      nightFragrance-massage/src/main/java/com/ylx/product/domain/vo/ProductOrderAddressVo.java
  16. 0 19
      nightFragrance-massage/src/main/java/com/ylx/product/mapper/ProductOrderAddressMapper.java
  17. 0 30
      nightFragrance-massage/src/main/java/com/ylx/product/service/IProductOrderAddressService.java
  18. 0 189
      nightFragrance-massage/src/main/java/com/ylx/product/service/impl/ProductOrderAddressServiceImpl.java
  19. 5 3
      nightFragrance-massage/src/main/resources/mapper/massage/ProductOrderInfoMapper.xml
  20. 3 2
      nightFragrance-massage/src/main/resources/mapper/massage/ProductOrderItemMapper.xml
  21. 0 38
      nightFragrance-massage/src/main/resources/mapper/product/ProductOrderAddressMapper.xml

+ 10 - 4
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/AfterSaleOrderController.java

@@ -5,15 +5,13 @@ import com.ylx.common.core.domain.R;
 import com.ylx.common.enums.BusinessType;
 import com.ylx.massage.domain.dto.AfterSaleOrderDTO;
 import com.ylx.massage.domain.dto.AfterSaleOrderFeeBatchDTO;
+import com.ylx.massage.domain.dto.AfterSaleOrderUpdateDTO;
 import com.ylx.massage.service.IAfterSaleOrderFeeService;
 import com.ylx.massage.service.IAfterSaleOrderService;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 
@@ -45,4 +43,12 @@ public class AfterSaleOrderController {
         return R.ok();
     }
 
+    @ApiOperation("售后信息修改物流单号")
+    @Log(title = "售后信息修改物流单号", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public R updateLogisticsNo(@Validated @RequestBody AfterSaleOrderUpdateDTO dto) {
+        this.afterSaleOrderService.edit(dto);
+        return R.ok();
+    }
+
 }

+ 8 - 0
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/ProductOrderController.java

@@ -161,4 +161,12 @@ public class ProductOrderController extends BaseController {
         return R.ok(detailVO);
     }
 
+    @PreAuthorize("@ss.hasPermi('product:order:edit')")
+    @PutMapping("/admin/edit/logisticsNo")
+    @ApiOperation("积分订单管理详情修改物流单号接口")
+    public R editLogisticsNo(@Validated @RequestBody ProductOrderEditLogisticsNo dto) {
+        this.productOrderInfoService.editLogisticsNo(dto);
+        return R.ok();
+    }
+
 }

+ 0 - 80
nightFragrance-admin/src/main/java/com/ylx/web/controller/product/ProductOrderAddressController.java

@@ -1,80 +0,0 @@
-package com.ylx.web.controller.product;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ylx.common.annotation.Log;
-import com.ylx.common.core.controller.BaseController;
-import com.ylx.common.core.domain.R;
-import com.ylx.common.enums.BusinessType;
-import com.ylx.product.domain.ProductOrderAddress;
-import com.ylx.product.domain.dto.ProductOrderAddressDTO;
-import com.ylx.product.domain.dto.ProductOrderAddressPageDTO;
-import com.ylx.product.domain.vo.ProductOrderAddressVo;
-import com.ylx.product.service.IProductOrderAddressService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-
-@RestController
-@RequestMapping("/product/order/address")
-@Api(tags = {"订单收货地址"})
-public class ProductOrderAddressController extends BaseController {
-
-    @Resource
-    private IProductOrderAddressService productOrderAddressService;
-
-
-    @ApiOperation("新增地址接口")
-    @Log(title = "新增地址接口", businessType = BusinessType.INSERT)
-    @PostMapping("/add")
-    public R add(@Validated @RequestBody ProductOrderAddressDTO dto) {
-        this.productOrderAddressService.add(dto);
-        return R.ok();
-    }
-
-    @ApiOperation("编辑地址接口")
-    @Log(title = "编辑地址接口", businessType = BusinessType.UPDATE)
-    @PutMapping("/edit")
-    public R edit(@Validated @RequestBody ProductOrderAddressDTO dto) {
-        this.productOrderAddressService.edit(dto);
-        return R.ok();
-    }
-
-    @ApiOperation("地址详情接口")
-    @GetMapping("/{id}")
-    public R<ProductOrderAddressVo> getById(@PathVariable("id") Long id) {
-        ProductOrderAddressVo vo = this.productOrderAddressService.findById(id);
-        return R.ok(vo);
-    }
-
-    @ApiOperation("删除地址接口")
-    @Log(title = "删除地址接口", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{id}")
-    public R delete(@PathVariable("id") Long id) {
-        int i = this.productOrderAddressService.deleteById(id);
-        if (i > 0) {
-            return R.ok();
-        }
-        return R.fail();
-    }
-
-    @ApiOperation("设置默认地址接口")
-    @Log(title = "设置默认地址接口", businessType = BusinessType.UPDATE)
-    @PutMapping("/default/{id}")
-    public R defaultAddress(@PathVariable("id") Long id) {
-        int i = this.productOrderAddressService.defaultAddress(id);
-        if (i > 0) {
-            return R.ok();
-        }
-        return R.fail();
-    }
-
-    @ApiOperation("地址分页接口")
-    @PostMapping("/page")
-    public R<Page<ProductOrderAddressVo>> page(Page<ProductOrderAddress> page, @RequestBody ProductOrderAddressPageDTO dto) {
-        Page<ProductOrderAddressVo> pageData = this.productOrderAddressService.list(page, dto);
-        return R.ok(pageData);
-    }
-}

+ 20 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/AfterSaleOrderUpdateDTO.java

@@ -0,0 +1,20 @@
+package com.ylx.massage.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel(description = "售后修改dto")
+public class AfterSaleOrderUpdateDTO {
+
+    @NotNull(message = "售后单ID不能为空")
+    @ApiModelProperty(value = "售后单ID", required = true)
+    private Long afterSaleOrderId;
+
+    @ApiModelProperty(value = "物流单号")
+    private String logisticsNo;
+
+}

+ 22 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/dto/ProductOrderEditLogisticsNo.java

@@ -0,0 +1,22 @@
+package com.ylx.massage.domain.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+@Data
+@ApiModel("积分订单修改物流单号dto")
+public class ProductOrderEditLogisticsNo {
+
+    @NotNull(message = "订单ID不能为空")
+    @ApiModelProperty(value = "订单ID", required = true)
+    private Long orderId;
+
+    @NotBlank(message = "物流单号不能为空")
+    @ApiModelProperty(value = "物流单号", required = true)
+    private String logisticsNo;
+
+}

+ 3 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/OrderItemVo.java

@@ -31,4 +31,7 @@ public class OrderItemVo {
     @ApiModelProperty("付款类型(1:积分 2:金额 3:积分+金额)")
     private Integer paymentType;
 
+    @ApiModelProperty("原价")
+    private BigDecimal originPrice;
+
 }

+ 4 - 1
nightFragrance-massage/src/main/java/com/ylx/massage/domain/vo/ProductOrderPageItemVo.java

@@ -13,7 +13,7 @@ import java.time.LocalDateTime;
 public class ProductOrderPageItemVo {
 
     @ApiModelProperty("订单ID")
-    private Long id;
+    private String id;
 
     @ApiModelProperty("订单号")
     private String orderNo;
@@ -39,6 +39,9 @@ public class ProductOrderPageItemVo {
     @ApiModelProperty("使用积分数量")
     private Integer pointsUsed;
 
+    @ApiModelProperty("付款类型(1:积分 2:金额 3:积分+金额)")
+    private Integer paymentType;
+
     @ApiModelProperty("快递单号")
     private String logisticsNo;
 

+ 2 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/IAfterSaleOrderService.java

@@ -3,6 +3,7 @@ package com.ylx.massage.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ylx.massage.domain.AfterSaleOrder;
 import com.ylx.massage.domain.dto.AfterSaleOrderDTO;
+import com.ylx.massage.domain.dto.AfterSaleOrderUpdateDTO;
 import com.ylx.massage.domain.vo.OrderAfterSaleVo;
 
 public interface IAfterSaleOrderService extends IService<AfterSaleOrder> {
@@ -11,4 +12,5 @@ public interface IAfterSaleOrderService extends IService<AfterSaleOrder> {
 
     OrderAfterSaleVo getOrderAfterSaleVo(Long orderId);
 
+    void edit(AfterSaleOrderUpdateDTO dto);
 }

+ 2 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/IProductOrderInfoService.java

@@ -64,4 +64,6 @@ public interface IProductOrderInfoService extends IService<ProductOrderInfo> {
     ProductOrderDetailAdminVo getOrderDetailForAdmin(Long orderId);
 
     ProductOrderCountVo adminPageStats();
+
+    void editLogisticsNo(ProductOrderEditLogisticsNo dto);
 }

+ 14 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/AfterSaleOrderServiceImpl.java

@@ -8,6 +8,7 @@ import com.ylx.common.exception.ServiceException;
 import com.ylx.common.utils.SecurityUtils;
 import com.ylx.massage.domain.AfterSaleOrder;
 import com.ylx.massage.domain.dto.AfterSaleOrderDTO;
+import com.ylx.massage.domain.dto.AfterSaleOrderUpdateDTO;
 import com.ylx.massage.domain.vo.OrderAfterSaleVo;
 import com.ylx.massage.enums.AfterSaleStatusEnum;
 import com.ylx.massage.mapper.AfterSaleOrderMapper;
@@ -47,6 +48,19 @@ public class AfterSaleOrderServiceImpl extends ServiceImpl<AfterSaleOrderMapper,
         return this.afterSaleOrderMapper.selectAfterSaleVoByOrderId(orderId);
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void edit(AfterSaleOrderUpdateDTO dto) {
+        AfterSaleOrder afterSaleOrder = this.afterSaleOrderMapper.selectById(dto.getAfterSaleOrderId());
+        if (ObjectUtil.isNull(afterSaleOrder)) {
+            throw new ServiceException("售后订单不存在");
+        }
+
+        afterSaleOrder.setLogisticsNo(dto.getLogisticsNo());
+        afterSaleOrder.setUpdateTime(LocalDateTime.now());
+        this.afterSaleOrderMapper.updateById(afterSaleOrder);
+    }
+
     private WxLoginUser getCurrentWxLoginUser() {
         WxLoginUser loginUser = SecurityUtils.getWxLoginUser();
         if (ObjectUtil.isNull(loginUser)) {

+ 26 - 14
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/ProductOrderInfoServiceImpl.java

@@ -1,6 +1,5 @@
 package com.ylx.massage.service.impl;
 
-import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -23,8 +22,6 @@ import com.ylx.massage.mapper.ProductOrderItemMapper;
 import com.ylx.massage.mapper.ProductSkuMapper;
 import com.ylx.massage.service.*;
 import com.ylx.massage.utils.OrderNumberGenerator;
-import com.ylx.product.domain.ProductOrderAddress;
-import com.ylx.product.service.IProductOrderAddressService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -34,8 +31,6 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
 
 /**
  * 商品订单信息Service实现类
@@ -65,13 +60,12 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
     @Resource
     private TConsumptionLogService consumptionLogService;
 
-    @Autowired
-    private IProductOrderAddressService productOrderAddressService;
-
     @Autowired
     private ProductSkuMapper productSkuMapper;
     @Resource
     private IAfterSaleOrderService afterSaleOrderService;
+    @Resource
+    private TAddressService addressService;
 
 
     /**
@@ -344,14 +338,14 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
             throw new ServiceException("订单不存在");
         }
         //根据地址ID查询地址信息
-        ProductOrderAddress address = productOrderAddressService.getById(detail.getAddressId());
+        TAddress address = this.addressService.getById(detail.getAddressId());
         if (address == null) {
             throw new ServiceException("地址不存在");
         }
         //设置收货人姓名和手机号
-        detail.setReceiverName(address.getReceiverName());
-        detail.setReceiverPhone(address.getReceiverPhone());
-        detail.setAddressName(address.getFullAddress());
+        detail.setReceiverName(address.getUserName());
+        detail.setReceiverPhone(address.getPhone());
+        detail.setAddressName(address.getAddress());
         detail.setOrderStatusName(ProductOrderStatusEnum.getDescByCode(detail.getOrderStatus()));
         return detail;
     }
@@ -522,6 +516,22 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
         return this.productOrderInfoMapper.getOrderTotalCount();
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void editLogisticsNo(ProductOrderEditLogisticsNo dto) {
+
+        ProductOrderInfo productOrderInfo = this.productOrderInfoMapper.selectById(dto.getOrderId());
+        if(ObjectUtil.isNull(productOrderInfo)){
+            throw new ServiceException("订单不存在");
+        }
+
+        productOrderInfo.setLogisticsNo(dto.getLogisticsNo());
+        productOrderInfo.setUpdateTime(LocalDateTime.now());
+        productOrderInfo.setOrderStatus(ProductOrderStatusEnum.WAIT_RECEIVE.getCode());
+
+        this.productOrderInfoMapper.updateById(productOrderInfo);
+    }
+
     private WxLoginUser getCurrentWxLoginUser() {
         WxLoginUser loginUser = SecurityUtils.getWxLoginUser();
         if (ObjectUtil.isNull(loginUser)) {
@@ -546,9 +556,11 @@ public class ProductOrderInfoServiceImpl extends ServiceImpl<ProductOrderInfoMap
     private ReceiverInfoVo getReceiverInfo(Long addressId) {
         ReceiverInfoVo receiverInfo = new ReceiverInfoVo();
         if (ObjectUtil.isNotNull(addressId)) {
-            ProductOrderAddress address = productOrderAddressService.getById(addressId);
+            TAddress address = this.addressService.getById(addressId);
             if (ObjectUtil.isNotNull(address)) {
-                BeanUtil.copyProperties(address, receiverInfo);
+                receiverInfo.setReceiverName(address.getUserName());
+                receiverInfo.setReceiverPhone(address.getPhone());
+                receiverInfo.setFullAddress(address.getAddress());
             }
         }
         return receiverInfo;

+ 0 - 101
nightFragrance-massage/src/main/java/com/ylx/product/domain/ProductOrderAddress.java

@@ -1,101 +0,0 @@
-package com.ylx.product.domain;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.ylx.common.core.domain.BaseEntity;
-import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.ylx.common.annotation.Excel;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * 订单收货地址对象 product_order_address
- *
- * @author wzj
- * @date 2026-04-03
- */
-@Data
-@TableName("product_order_address")
-public class ProductOrderAddress implements Serializable {
-    private static final long serialVersionUID = -5923046914051480272L;
-
-    /**
-     * 主键ID
-     */
-    private String id;
-
-    /**
-     * 用户的openID
-     */
-    @Excel(name = "用户的openID")
-    private String openId;
-
-    /**
-     * 收货人姓名
-     */
-    @Excel(name = "收货人姓名")
-    private String receiverName;
-
-    /**
-     * 收货人手机号
-     */
-    @Excel(name = "收货人手机号")
-    private String receiverPhone;
-
-    /**
-     * 省份名称
-     */
-    @Excel(name = "省份名称")
-    private String provinceName;
-
-    /**
-     * 城市名称
-     */
-    @Excel(name = "城市名称")
-    private String cityName;
-
-    /**
-     * 区县名称
-     */
-    @Excel(name = "区县名称")
-    private String districtName;
-
-    /**
-     * 详细地址
-     */
-    @Excel(name = "详细地址")
-    private String detailAddress;
-
-    /**
-     * 完整地址(省+市+区+详细)
-     */
-    @Excel(name = "完整地址", readConverterExp = "省=+市+区+详细")
-    private String fullAddress;
-
-    /**
-     * 是否默认地址 0否1是
-     */
-    @Excel(name = "是否默认地址 0否1是")
-    private Integer isDefault;
-
-    /**
-     * 是否删除 0否1是
-     */
-    @Excel(name = "是否删除 0否1是")
-    private Integer isDelete;
-
-    /**
-     * 创建时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime updateTime;
-}

+ 0 - 58
nightFragrance-massage/src/main/java/com/ylx/product/domain/dto/ProductOrderAddressDTO.java

@@ -1,58 +0,0 @@
-package com.ylx.product.domain.dto;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-
-@Data
-@ApiModel("订单收货地址新增/修改DTO")
-public class ProductOrderAddressDTO {
-
-    @ApiModelProperty("主键id")
-    private Long id;
-
-    @NotBlank(message = "收货人姓名不能为空")
-    @ApiModelProperty(value = "收货人姓名", required = true)
-    private String receiverName;
-
-    @NotBlank(message = "收货人手机号不能为空")
-    @ApiModelProperty(value = "收货人手机号", required = true)
-    private String receiverPhone;
-
-    @NotBlank(message = "省份编码不能为空")
-    @ApiModelProperty(value = "省份编码", required = true)
-    private String provinceCode;
-
-    @NotBlank(message = "省份名称不能为空")
-    @ApiModelProperty(value = "省份名称", required = true)
-    private String provinceName;
-
-    @NotBlank(message = "城市编码不能为空")
-    @ApiModelProperty(value = "城市编码", required = true)
-    private String cityCode;
-
-    @NotBlank(message = "城市名称不能为空")
-    @ApiModelProperty(value = "城市名称", required = true)
-    private String cityName;
-
-    @NotBlank(message = "区县编码不能为空")
-    @ApiModelProperty(value = "区县编码", required = true)
-    private String districtCode;
-
-    @NotBlank(message = "区县名称不能为空")
-    @ApiModelProperty(value = "区县名称", required = true)
-    private String districtName;
-
-    @NotBlank(message = "详细地址不能为空")
-    @ApiModelProperty(value = "详细地址", required = true)
-    private String detailAddress;
-
-    @ApiModelProperty(value = "邮政编码")
-    private String zipCode;
-
-    @ApiModelProperty(value = "是否默认地址 0-否 1-是")
-    private Integer isDefault;
-
-}

+ 0 - 14
nightFragrance-massage/src/main/java/com/ylx/product/domain/dto/ProductOrderAddressPageDTO.java

@@ -1,14 +0,0 @@
-package com.ylx.product.domain.dto;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-@Data
-@ApiModel("订单收货地址分页查询请求DTO")
-public class ProductOrderAddressPageDTO {
-
-    @ApiModelProperty(name = "用户openId", hidden = true)
-    private String openId;
-
-}

+ 0 - 47
nightFragrance-massage/src/main/java/com/ylx/product/domain/vo/ProductOrderAddressVo.java

@@ -1,47 +0,0 @@
-package com.ylx.product.domain.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-@Data
-@ApiModel("订单收货地址vo")
-public class ProductOrderAddressVo {
-
-    @ApiModelProperty("地址ID")
-    private Long id;
-
-    @ApiModelProperty("收货人姓名")
-    private String receiverName;
-
-    @ApiModelProperty("收货人手机号")
-    private String receiverPhone;
-
-    @ApiModelProperty("省份编码")
-    private String provinceCode;
-
-    @ApiModelProperty("省份名称")
-    private String provinceName;
-
-    @ApiModelProperty("城市编码")
-    private String cityCode;
-
-    @ApiModelProperty("城市名称")
-    private String cityName;
-
-    @ApiModelProperty("区县编码")
-    private String districtCode;
-
-    @ApiModelProperty("区县名称")
-    private String districtName;
-
-    @ApiModelProperty("详细地址")
-    private String detailAddress;
-
-    @ApiModelProperty("邮政编码")
-    private String zipCode;
-
-    @ApiModelProperty("是否默认地址 0-否 1-是")
-    private Integer isDefault;
-
-}

+ 0 - 19
nightFragrance-massage/src/main/java/com/ylx/product/mapper/ProductOrderAddressMapper.java

@@ -1,19 +0,0 @@
-package com.ylx.product.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ylx.product.domain.ProductOrderAddress;
-import com.ylx.product.domain.dto.ProductOrderAddressPageDTO;
-import com.ylx.product.domain.vo.ProductOrderAddressVo;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * 订单收货地址Mapper接口
- *
- * @author wzj
- * @date 2026-04-03
- */
-public interface ProductOrderAddressMapper extends BaseMapper<ProductOrderAddress> {
-
-    Page<ProductOrderAddressVo> list(Page<ProductOrderAddress> page, @Param("dto") ProductOrderAddressPageDTO dto);
-}

+ 0 - 30
nightFragrance-massage/src/main/java/com/ylx/product/service/IProductOrderAddressService.java

@@ -1,30 +0,0 @@
-package com.ylx.product.service;
-
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.ylx.product.domain.ProductOrderAddress;
-import com.ylx.product.domain.dto.ProductOrderAddressDTO;
-import com.ylx.product.domain.dto.ProductOrderAddressPageDTO;
-import com.ylx.product.domain.vo.ProductOrderAddressVo;
-
-/**
- * 订单收货地址Service接口
- *
- * @author wzj
- * @date 2026-04-03
- */
-public interface IProductOrderAddressService extends IService<ProductOrderAddress> {
-
-    void add(ProductOrderAddressDTO dto);
-
-    void edit(ProductOrderAddressDTO dto);
-
-    ProductOrderAddressVo findById(Long id);
-
-    int deleteById(Long id);
-
-    int defaultAddress(Long id);
-
-    Page<ProductOrderAddressVo> list(Page<ProductOrderAddress> page, ProductOrderAddressPageDTO dto);
-}

+ 0 - 189
nightFragrance-massage/src/main/java/com/ylx/product/service/impl/ProductOrderAddressServiceImpl.java

@@ -1,189 +0,0 @@
-package com.ylx.product.service.impl;
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ylx.common.core.domain.model.WxLoginUser;
-import com.ylx.common.utils.SecurityUtils;
-import com.ylx.product.domain.ProductOrderAddress;
-import com.ylx.product.domain.dto.ProductOrderAddressDTO;
-import com.ylx.product.domain.dto.ProductOrderAddressPageDTO;
-import com.ylx.product.domain.vo.ProductOrderAddressVo;
-import com.ylx.product.mapper.ProductOrderAddressMapper;
-import com.ylx.product.service.IProductOrderAddressService;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.time.LocalDateTime;
-
-/**
- * 订单收货地址Service业务层处理
- *
- * @author wzj
- * @date 2026-04-03
- */
-@Service
-public class ProductOrderAddressServiceImpl extends ServiceImpl<ProductOrderAddressMapper, ProductOrderAddress> implements IProductOrderAddressService {
-    @Resource
-    private ProductOrderAddressMapper productOrderAddressMapper;
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void add(ProductOrderAddressDTO dto) {
-
-        WxLoginUser wxLoginUser = SecurityUtils.getWxLoginUser();
-        if (ObjectUtil.isNull(wxLoginUser)) {
-            throw new RuntimeException("用户不存在");
-        }
-        String openId = wxLoginUser.getCOpenid();
-
-        ProductOrderAddress entity = new ProductOrderAddress();
-        BeanUtil.copyProperties(dto, entity);
-        entity.setOpenId(openId);
-        entity.setIsDelete(0);
-        // 拼接完整地址
-        String fullAddress = entity.getProvinceName()
-                + entity.getCityName()
-                + entity.getDistrictName()
-                + entity.getDetailAddress();
-        entity.setFullAddress(fullAddress);
-        entity.setCreateTime(LocalDateTime.now());
-        productOrderAddressMapper.insert(entity);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void edit(ProductOrderAddressDTO dto) {
-
-        if (ObjectUtil.isNull(dto.getId())) {
-            throw new RuntimeException("id不能为空");
-        }
-
-        ProductOrderAddress entity = this.productOrderAddressMapper.selectById(dto.getId());
-
-        if (ObjectUtil.isNull(entity)) {
-            throw new RuntimeException("参数有误,查询数据不存在");
-        }
-
-        WxLoginUser wxLoginUser = SecurityUtils.getWxLoginUser();
-        if (ObjectUtil.isNull(wxLoginUser)) {
-            throw new RuntimeException("用户不存在");
-        }
-        String openId = wxLoginUser.getCOpenid();
-
-        BeanUtil.copyProperties(dto, entity);
-        entity.setOpenId(openId);
-        entity.setUpdateTime(LocalDateTime.now());
-        // 拼接完整地址
-        String fullAddress = entity.getProvinceName()
-                + entity.getCityName()
-                + entity.getDistrictName()
-                + entity.getDetailAddress();
-        entity.setFullAddress(fullAddress);
-        productOrderAddressMapper.updateById(entity);
-
-    }
-
-    @Override
-    public ProductOrderAddressVo findById(Long id) {
-
-        ProductOrderAddress entity = this.productOrderAddressMapper.selectById(id);
-
-        if (ObjectUtil.isNull(entity)) {
-            throw new RuntimeException("参数有误,查询数据不存在");
-        }
-
-        ProductOrderAddressVo vo = new ProductOrderAddressVo();
-        BeanUtil.copyProperties(entity, vo);
-        return vo;
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public int deleteById(Long id) {
-
-        ProductOrderAddress entity = this.productOrderAddressMapper.selectById(id);
-
-        if (ObjectUtil.isNull(entity)) {
-            throw new RuntimeException("参数有误,查询数据不存在");
-        }
-
-        WxLoginUser wxLoginUser = SecurityUtils.getWxLoginUser();
-        if (ObjectUtil.isNull(wxLoginUser)) {
-            throw new RuntimeException("用户不存在");
-        }
-        String openId = wxLoginUser.getCOpenid();
-        entity.setOpenId(openId);
-        entity.setIsDelete(1);
-        entity.setUpdateTime(LocalDateTime.now());
-
-        return this.productOrderAddressMapper.updateById(entity);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public int defaultAddress(Long id) {
-        ProductOrderAddress entity = this.productOrderAddressMapper.selectById(id);
-
-        if (ObjectUtil.isNull(entity)) {
-            throw new RuntimeException("参数有误,查询数据不存在");
-        }
-
-        WxLoginUser wxLoginUser = SecurityUtils.getWxLoginUser();
-        if (ObjectUtil.isNull(wxLoginUser)) {
-            throw new RuntimeException("用户不存在");
-        }
-        String openId = wxLoginUser.getCOpenid();
-
-        Integer currentIsDefault = entity.getIsDefault();
-
-        // ==============================================
-        // 核心逻辑:切换默认状态
-        // ==============================================
-        if (currentIsDefault == 1) {
-            // --------------------------
-            // 当前是默认 → 改为 非默认
-            // --------------------------
-            LambdaUpdateWrapper<ProductOrderAddress> wrapper = new LambdaUpdateWrapper<>();
-            wrapper.eq(ProductOrderAddress::getId, id);
-            wrapper.set(ProductOrderAddress::getIsDefault, 0);
-            wrapper.set(ProductOrderAddress::getOpenId, openId);
-            return productOrderAddressMapper.update(null, wrapper);
-
-        } else {
-            // --------------------------
-            // 当前非默认 → 设为默认
-            // 同时把该用户其他所有地址 → 非默认
-            // --------------------------
-            // 第一步:把该用户所有地址设为非默认
-            LambdaUpdateWrapper<ProductOrderAddress> updateAll = new LambdaUpdateWrapper<>();
-            updateAll.eq(ProductOrderAddress::getOpenId, openId);
-            updateAll.set(ProductOrderAddress::getIsDefault, 0);
-            updateAll.set(ProductOrderAddress::getOpenId, openId);
-            productOrderAddressMapper.update(null, updateAll);
-
-            // 第二步:把当前设为默认
-            LambdaUpdateWrapper<ProductOrderAddress> updateOne = new LambdaUpdateWrapper<>();
-            updateOne.eq(ProductOrderAddress::getId, id);
-            updateOne.set(ProductOrderAddress::getIsDefault, 1);
-            updateOne.set(ProductOrderAddress::getOpenId, openId);
-            return productOrderAddressMapper.update(null, updateOne);
-        }
-    }
-
-    @Override
-    public Page<ProductOrderAddressVo> list(Page<ProductOrderAddress> page, ProductOrderAddressPageDTO dto) {
-
-        WxLoginUser wxLoginUser = SecurityUtils.getWxLoginUser();
-        if (ObjectUtil.isNull(wxLoginUser)) {
-            throw new RuntimeException("用户不存在");
-        }
-        String openId = wxLoginUser.getCOpenid();
-        dto.setOpenId(openId);
-        return productOrderAddressMapper.list(page, dto);
-    }
-
-}

+ 5 - 3
nightFragrance-massage/src/main/resources/mapper/massage/ProductOrderInfoMapper.xml

@@ -109,13 +109,15 @@
             ROUND( item.price / 100, 2 ) AS payAmount,
             oi.open_id,
             u.c_nick_name AS nickName,
-            u.c_phone AS phone
+            u.c_phone AS phone,
+            p.payment_type AS paymentType
         FROM
             product_order_info oi
         LEFT JOIN product_order_item item ON oi.id = item.order_id
         LEFT JOIN t_wx_user u ON oi.open_id = u.c_openid
-        WHERE oi.is_deleted = 0
-
+        LEFT JOIN product p ON p.id = item.product_id
+        WHERE
+            oi.is_deleted = 0
         <!-- 查询条件 -->
         <if test="dto.orderNo != null and dto.orderNo != ''">
             AND oi.order_no LIKE CONCAT('%', #{dto.orderNo}, '%')

+ 3 - 2
nightFragrance-massage/src/main/resources/mapper/massage/ProductOrderItemMapper.xml

@@ -10,11 +10,12 @@
             poi.product_name,
             ps.price_money AS payAmount,
             ps.price_point AS pointsUsed,
+            ps.origin_price,
             p.payment_type AS paymentType
         FROM
             product_order_item poi
-                LEFT JOIN product p ON poi.product_id = p.id
-                LEFT JOIN product_sku ps ON poi.sku_id = ps.id
+        LEFT JOIN product p ON poi.product_id = p.id
+        LEFT JOIN product_sku ps ON poi.sku_id = ps.id
         WHERE
             poi.order_id = #{orderId}
     </select>

+ 0 - 38
nightFragrance-massage/src/main/resources/mapper/product/ProductOrderAddressMapper.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ylx.product.mapper.ProductOrderAddressMapper">
-    
-    <resultMap type="ProductOrderAddress" id="ProductOrderAddressResult">
-        <result property="id"    column="id"    />
-        <result property="openId"    column="open_id"    />
-        <result property="receiverName"    column="receiver_name"    />
-        <result property="receiverPhone"    column="receiver_phone"    />
-        <result property="provinceName"    column="province_name"    />
-        <result property="cityName"    column="city_name"    />
-        <result property="districtName"    column="district_name"    />
-        <result property="detailAddress"    column="detail_address"    />
-        <result property="fullAddress"    column="full_address"    />
-        <result property="isDefault"    column="is_default"    />
-        <result property="isDelete"    column="is_delete"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
-
-    <sql id="selectProductOrderAddressVo">
-        select id, open_id, receiver_name, receiver_phone, province_name, city_name, district_name, detail_address, full_address, is_delete, is_default, create_time, update_time from product_order_address
-    </sql>
-
-    <select id="list" resultType="com.ylx.product.domain.vo.ProductOrderAddressVo">
-        <include refid="selectProductOrderAddressVo"/>
-        <where>
-            <if test="dto.openId != null">
-                AND open_id = #{dto.openId}
-            </if>
-            AND is_delete = 0
-        </where>
-        order by update_time desc ,create_time desc
-    </select>
-
-</mapper>