feat: 移植商户端订单管理到平台端 & 新增订单打印功能
1. 将商户端订单管理功能完整移植到平台端管理后台,包括: - 商户订单列表、退款单、预约管理(服务看板+工单管理) - 菜单名称加"商户"前缀,区别于平台端原有订单管理 - 不影响平台端原有订单管理功能 2. 新增订单打印功能: - 前端:独立打印页面(无layout),支持浏览器打印 - 后端:新增打印专用API,使用eb_sync_order_detail_staging表的product_name和info字段 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -161,6 +161,13 @@ public class MerchantOrderController {
|
||||
}
|
||||
return CommonResult.failed().setMessage("修改发货单配送信息失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('merchant:order:info')")
|
||||
@ApiOperation(value = "订单打印详情(使用staging表数据)")
|
||||
@RequestMapping(value = "/print/detail/{orderNo}", method = RequestMethod.GET)
|
||||
public CommonResult<OrderPrintDetailResponse> getOrderPrintDetail(@PathVariable(value = "orderNo") String orderNo) {
|
||||
return CommonResult.success(manageOrderService.getOrderPrintDetail(orderNo));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -108,4 +108,11 @@ public interface ManageOrderService {
|
||||
* 修改发货单配送信息
|
||||
*/
|
||||
Boolean updateInvoice(OrderInvoiceUpdateRequest request);
|
||||
|
||||
/**
|
||||
* 获取订单打印详情(使用staging表数据)
|
||||
* @param orderNo 订单号
|
||||
* @return OrderPrintDetailResponse
|
||||
*/
|
||||
OrderPrintDetailResponse getOrderPrintDetail(String orderNo);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,16 @@ import com.zbkj.common.model.admin.SystemAdmin;
|
||||
import com.zbkj.common.model.order.Order;
|
||||
import com.zbkj.common.model.order.OrderDetail;
|
||||
import com.zbkj.common.model.reservation.ReservationWorkOrder;
|
||||
import com.zbkj.common.model.sync.SyncOrderDetailStaging;
|
||||
import com.zbkj.common.request.*;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.result.OrderResultCode;
|
||||
import com.zbkj.common.utils.SecurityUtil;
|
||||
import com.zbkj.common.vo.LogisticsResultVo;
|
||||
import com.zbkj.service.dao.sync.SyncOrderDetailStagingDao;
|
||||
import com.zbkj.service.service.OrderService;
|
||||
import com.zbkj.service.service.ReservationWorkOrderService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -43,6 +46,8 @@ public class ManageOrderServiceImpl implements ManageOrderService {
|
||||
private OrderService orderService;
|
||||
@Autowired
|
||||
private ReservationWorkOrderService reservationWorkOrderService;
|
||||
@Autowired
|
||||
private SyncOrderDetailStagingDao syncOrderDetailStagingDao;
|
||||
|
||||
/**
|
||||
* 商户端后台分页列表
|
||||
@@ -224,6 +229,59 @@ public class ManageOrderServiceImpl implements ManageOrderService {
|
||||
return orderService.updateInvoice(request, systemAdmin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单打印详情(使用staging表数据)
|
||||
* @param orderNo 订单号
|
||||
* @return OrderPrintDetailResponse
|
||||
*/
|
||||
@Override
|
||||
public OrderPrintDetailResponse getOrderPrintDetail(String orderNo) {
|
||||
// 获取订单基本信息
|
||||
OrderAdminDetailResponse orderInfo = adminDetail(orderNo);
|
||||
if (orderInfo == null) {
|
||||
throw new CrmebException("订单不存在");
|
||||
}
|
||||
|
||||
// 从staging表查询商品详情
|
||||
LambdaQueryWrapper<SyncOrderDetailStaging> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SyncOrderDetailStaging::getOrderNo, orderNo);
|
||||
queryWrapper.orderByAsc(SyncOrderDetailStaging::getId);
|
||||
List<SyncOrderDetailStaging> stagingList = syncOrderDetailStagingDao.selectList(queryWrapper);
|
||||
|
||||
List<OrderPrintProductItemResponse> detailList;
|
||||
if (stagingList != null && !stagingList.isEmpty()) {
|
||||
// 使用staging表的数据(包含product_name和info字段)
|
||||
detailList = stagingList.stream().map(staging -> {
|
||||
OrderPrintProductItemResponse item = new OrderPrintProductItemResponse();
|
||||
item.setProductName(staging.getProductName());
|
||||
item.setInfo(staging.getInfo());
|
||||
item.setImage(staging.getImage());
|
||||
item.setSku(staging.getSku());
|
||||
item.setPrice(staging.getPrice());
|
||||
item.setPayNum(staging.getPayNum());
|
||||
item.setProductId(staging.getProductId());
|
||||
item.setProductType(staging.getProductType());
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
// 如果staging表没有数据,降级使用订单详情中的商品信息
|
||||
detailList = orderInfo.getOrderDetailList().stream().map(detail -> {
|
||||
OrderPrintProductItemResponse item = new OrderPrintProductItemResponse();
|
||||
item.setProductName(detail.getProductName());
|
||||
item.setInfo(null);
|
||||
item.setImage(detail.getImage());
|
||||
item.setSku(detail.getSku());
|
||||
item.setPrice(detail.getPrice());
|
||||
item.setPayNum(detail.getPayNum());
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
OrderPrintDetailResponse response = new OrderPrintDetailResponse();
|
||||
response.setOrderInfo(orderInfo);
|
||||
response.setDetailList(detailList);
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.zbkj.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单打印详情响应对象
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "OrderPrintDetailResponse对象", description = "订单打印详情响应对象")
|
||||
public class OrderPrintDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "订单基本信息")
|
||||
private OrderAdminDetailResponse orderInfo;
|
||||
|
||||
@ApiModelProperty(value = "商品详情列表(来自staging表)")
|
||||
private List<OrderPrintProductItemResponse> detailList;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.zbkj.common.response;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单打印商品项响应对象(使用staging表数据)
|
||||
* +----------------------------------------------------------------------
|
||||
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
* +----------------------------------------------------------------------
|
||||
* | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
* +----------------------------------------------------------------------
|
||||
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
* +----------------------------------------------------------------------
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "OrderPrintProductItemResponse对象", description = "订单打印商品项响应对象")
|
||||
public class OrderPrintProductItemResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "商品名称(来自staging表product_name)")
|
||||
private String productName;
|
||||
|
||||
@ApiModelProperty(value = "商品详细信息(来自staging表info字段)")
|
||||
private String info;
|
||||
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String sku;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private Integer payNum;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer productId;
|
||||
|
||||
@ApiModelProperty(value = "商品类型")
|
||||
private Integer productType;
|
||||
}
|
||||
Reference in New Issue
Block a user