|
|
@@ -399,7 +399,8 @@ public class OrderInvoiceService {
|
|
|
throw new ServiceException("仅失败或作废的发票可重新开票");
|
|
|
}
|
|
|
// 重置为未开,复用客户开票参数重开(运营身份 currentUserId 传 null 跳过归属校验)
|
|
|
- PosOrder order = posOrderMapper.selectOne(new LambdaQueryWrapper<PosOrder>().eq(PosOrder::getDdId,row.getOrderNo()));
|
|
|
+ // orderId 实为 pos_order.id(主键,发票行 order_id 已证实),按主键查最稳,不依赖 order_no 是否回填
|
|
|
+ PosOrder order = posOrderMapper.selectPosOrderById(orderId);
|
|
|
if (order == null) {
|
|
|
throw new ServiceException("订单不存在");
|
|
|
}
|
|
|
@@ -735,15 +736,12 @@ public class OrderInvoiceService {
|
|
|
} else {
|
|
|
// B2C:有载具 → PrintFlag=N 存载具;无载具 → PrintFlag=Y 个人纸本(零信息兜底,010 Phase 11)
|
|
|
if (StrUtil.isNotBlank(dto.getCarrierType())) {
|
|
|
- if ("2".equals(dto.getCarrierType())) {
|
|
|
- // 【临时测试】无载具云端发票:PrintFlag=N 但不传 CarrierType/CarrierNum/邮箱
|
|
|
- // 验证 ezPay 是否接受 B2C 无载具+PrintFlag=N(成功→会员载具改走此路;失败→回落纸本)
|
|
|
- inv.put("PrintFlag", "N");
|
|
|
- } else {
|
|
|
- inv.put("CarrierType", dto.getCarrierType());
|
|
|
- inv.put("CarrierNum", dto.getCarrierNum());
|
|
|
- inv.put("PrintFlag", "N");
|
|
|
- // 手机条码(0)/自然人凭证(1)票进载具,邮箱留空
|
|
|
+ inv.put("CarrierType", dto.getCarrierType());
|
|
|
+ inv.put("CarrierNum", dto.getCarrierNum());
|
|
|
+ inv.put("PrintFlag", "N");
|
|
|
+ // ezPay 手册:CarrierType=2(ezPay会员载具)时 BuyerEmail 必填(INV10013);CarrierNum=卖方自订代号(手机/邮箱/会员编号)
|
|
|
+ if ("2".equals(dto.getCarrierType()) && StrUtil.isNotBlank(dto.getBuyerEmail())) {
|
|
|
+ inv.put("BuyerEmail", dto.getBuyerEmail());
|
|
|
}
|
|
|
} else {
|
|
|
// 个人纸本:无载具无捐赠,法定 PrintFlag=Y;不传载具/邮箱
|