同城打票机打印实体类,确认收货通知记录数据

This commit is contained in:
Jack 2025-12-03 17:50:55 +08:00
parent b1f401ff81
commit 28e5b83f6c
10 changed files with 71 additions and 22 deletions

View File

@ -15,9 +15,8 @@ public class StateCode {
public static final int DELIVERY_TYPE_AIR_FREIGHT = 4; //货运空运水运铁路运输公路运输 public static final int DELIVERY_TYPE_AIR_FREIGHT = 4; //货运空运水运铁路运输公路运输
public static final int DELIVERY_TYPE_SELF_PICK_UP = 5; // 自提运费 0 public static final int DELIVERY_TYPE_SELF_PICK_UP = 5; // 自提运费 0
public static final int DELIVERY_TYPE_EXP = 10; // 普通快递 public static final int DELIVERY_TYPE_EXP = 10; // 普通快递
public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送 public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送运费 0
public static final int DELIVERY_TYPE_SAME_CITY = 16;//顺丰同城配送 public static final int DELIVERY_TYPE_SAME_CITY = 16;//同城配送
public static final int DELIVERY_TYPE_STORE_BY_SELF = 17; // 商家线下自己配送
public static final Map<Integer, String> DELIVERY_TYPE_MAP = new HashMap() { public static final Map<Integer, String> DELIVERY_TYPE_MAP = new HashMap() {
{ {
@ -28,7 +27,7 @@ public class StateCode {
put(DELIVERY_TYPE_SELF_PICK_UP, "到店自提"); put(DELIVERY_TYPE_SELF_PICK_UP, "到店自提");
put(DELIVERY_TYPE_EXP, "普通快递"); put(DELIVERY_TYPE_EXP, "普通快递");
put(DELIVERY_TYPE_IN_STORE_SERVICE, "店铺配送"); put(DELIVERY_TYPE_IN_STORE_SERVICE, "店铺配送");
put(DELIVERY_TYPE_SAME_CITY, "顺丰同城"); put(DELIVERY_TYPE_SAME_CITY, "顺丰同城配送");
} }
}; };

View File

@ -65,9 +65,13 @@ public class OrderPrintVO implements Serializable {
@Builder.Default @Builder.Default
private String payment_type_name = "微信支付"; private String payment_type_name = "微信支付";
@ApiModelProperty(value = "配送渠道") @ApiModelProperty(value = "配送方式ID")
@Builder.Default @Builder.Default
private String deliver_type_name = "顺丰同城"; private Integer delivery_type_id = 16;
@ApiModelProperty(value = "配送方式")
@Builder.Default
private String delivery_type_name = "顺丰同城";
@ApiModelProperty(value = "打包费") @ApiModelProperty(value = "打包费")
private BigDecimal packing_fee; private BigDecimal packing_fee;

View File

@ -68,7 +68,7 @@ public class ShopStoreOrderPrintVO implements Serializable {
@ApiModelProperty(value = "支付方式") @ApiModelProperty(value = "支付方式")
private String pay_type; private String pay_type;
@ApiModelProperty(value = "配送来源") @ApiModelProperty(value = "配送方式")
private String shipper_type; private String shipper_type;
@ApiModelProperty(value = "下单时间") @ApiModelProperty(value = "下单时间")
@ -105,7 +105,6 @@ public class ShopStoreOrderPrintVO implements Serializable {
@ApiModelProperty(value = "实际应付款") @ApiModelProperty(value = "实际应付款")
private Long order_payment_amount; private Long order_payment_amount;
// 订单商品详情信息
@ApiModelProperty(value = "订单商品详情信息") @ApiModelProperty(value = "订单商品详情信息")
private OrderItemPrintVO order_items; private OrderItemPrintVO order_items;

View File

@ -17,6 +17,7 @@ import com.suisung.mall.common.constant.CommonConstant;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@Slf4j @Slf4j
@ -76,10 +77,37 @@ public class CommonService {
return false; return false;
} }
// 普通配送是指除了同城配送自提和到店服务之外的配送方式 // 普通配送是指除了同城配送自提和到店服务之外的配送方式没有物流轨迹的
return !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_SAME_CITY) return !Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_SAME_CITY)
&& !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_SELF_PICK_UP) && !Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_SELF_PICK_UP)
&& !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_IN_STORE_SERVICE); && !Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_IN_STORE_SERVICE);
}
/**
* 获取配送方式名称
*
* @param deliveryTypeId 配送方式ID
* @return 配送方式名称
*/
public static String getDeliveryExpressName(Integer deliveryTypeId) {
if (deliveryTypeId == null) return "其他配送";
String name = StateCode.DELIVERY_TYPE_MAP.get(deliveryTypeId);
return name != null ? name : "其他配送";
}
/**
* 判断配送方式是否为同城配送
*
* @param deliveryTypeId 配送方式ID
* @return 是否为普通配送
*/
public static boolean isSameCityExpress(Integer deliveryTypeId) {
// 当配送方式ID为空时返回false
if (deliveryTypeId == null) {
return false;
}
return Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_SAME_CITY);
} }

View File

@ -119,7 +119,7 @@ public class LakalaController extends BaseControllerImpl {
return lakalaPayService.getBankCardBin(paramsJSON.getStr("bankCardNo")); return lakalaPayService.getBankCardBin(paramsJSON.getStr("bankCardNo"));
} }
@ApiOperation(value = "发货类交易确认收货通知", notes = "发货类交易确认收货通知 https://o.lakala.com/#/home/document/detail?id=1003") @ApiOperation(value = "接收拉卡拉发货类交易确认收货通知", notes = "接收拉卡拉发货类交易确认收货通知 https://o.lakala.com/#/home/document/detail?id=1003")
@RequestMapping(value = "/trans/receive/completeNotify", method = RequestMethod.POST) @RequestMapping(value = "/trans/receive/completeNotify", method = RequestMethod.POST)
public ResponseEntity<JSONObject> receiveCompleteNotify(HttpServletRequest request) { public ResponseEntity<JSONObject> receiveCompleteNotify(HttpServletRequest request) {
// 完整地址 https://mall.gpxscs.cn/api/mobile/shop/lakala/trans/receive/completeNotify // 完整地址 https://mall.gpxscs.cn/api/mobile/shop/lakala/trans/receive/completeNotify

View File

@ -823,6 +823,14 @@ public class LakalaApiServiceImpl implements LakalaApiService {
Pair<Boolean, String> checkResult = LakalaUtil.chkLklApiNotifySign(request, lklNotifyCerPath, false); Pair<Boolean, String> checkResult = LakalaUtil.chkLklApiNotifySign(request, lklNotifyCerPath, false);
if (!checkResult.getFirst()) { if (!checkResult.getFirst()) {
log.warn("[确认收货通知] 验签失败: {}", checkResult.getSecond()); log.warn("[确认收货通知] 验签失败: {}", checkResult.getSecond());
try {
// 不管成功与否写入确认收货通知日志后续补偿遗漏分账的材料
lklReceiveNotifyLogService.addOrUpdate(LakalaUtil.getBody(request));
} catch (Exception e) {
log.error("[确认收货通知] 写入确认收货通知日志失败", e);
}
return JSONUtil.createObj().set("code", "FAIL").set("message", checkResult.getSecond()); return JSONUtil.createObj().set("code", "FAIL").set("message", checkResult.getSecond());
} }

View File

@ -268,7 +268,9 @@ public class ShopOrderLogisticsServiceImpl extends BaseServiceImpl<ShopOrderLogi
logisticsType = 3; logisticsType = 3;
} }
if (deliveryType != null && deliveryType.equals(StateCode.DELIVERY_TYPE_SELF_PICK_UP)) { // 门店自提商家送货上门
if (deliveryType != null &&
(deliveryType.equals(StateCode.DELIVERY_TYPE_SELF_PICK_UP) || deliveryType.equals(StateCode.DELIVERY_TYPE_IN_STORE_SERVICE))) {
logisticsType = 4; logisticsType = 4;
} }

View File

@ -37,6 +37,7 @@ import com.suisung.mall.common.modules.store.ShopStoreBase;
import com.suisung.mall.common.modules.store.ShopStoreShippingAddress; import com.suisung.mall.common.modules.store.ShopStoreShippingAddress;
import com.suisung.mall.common.pojo.vo.OrderPrintVO; import com.suisung.mall.common.pojo.vo.OrderPrintVO;
import com.suisung.mall.common.service.MessageService; import com.suisung.mall.common.service.MessageService;
import com.suisung.mall.common.service.impl.CommonService;
import com.suisung.mall.common.utils.*; import com.suisung.mall.common.utils.*;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl; import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
import com.suisung.mall.shop.base.service.ShopBaseProductUnitService; import com.suisung.mall.shop.base.service.ShopBaseProductUnitService;
@ -56,7 +57,6 @@ import com.suisung.mall.shop.product.service.ShopProductBaseService;
import com.suisung.mall.shop.product.service.ShopProductIndexService; import com.suisung.mall.shop.product.service.ShopProductIndexService;
import com.suisung.mall.shop.product.service.ShopProductInfoService; import com.suisung.mall.shop.product.service.ShopProductInfoService;
import com.suisung.mall.shop.product.service.ShopProductItemService; import com.suisung.mall.shop.product.service.ShopProductItemService;
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
import com.suisung.mall.shop.store.service.ShopStoreBaseService; import com.suisung.mall.shop.store.service.ShopStoreBaseService;
import com.suisung.mall.shop.store.service.ShopStoreConfigService; import com.suisung.mall.shop.store.service.ShopStoreConfigService;
import com.suisung.mall.shop.store.service.ShopStorePrinterService; import com.suisung.mall.shop.store.service.ShopStorePrinterService;
@ -207,7 +207,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
@Lazy @Lazy
@Autowired @Autowired
private SFExpressApiService sfExpressApiService; private CommonService commonService;
@Autowired @Autowired
private MessageService messageService; private MessageService messageService;
@ -3036,8 +3036,16 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
} }
try { try {
// 调用Mapper方法获取退货订单打印信息 // 调用Mapper方法获取退货订单打印信息 ShopStoreOrderPrintVO
return shopOrderReturnMapper.fetchReturnOrderPrintInfo(orderId, returnId); OrderPrintVO shopOrderPrintVO = shopOrderReturnMapper.fetchReturnOrderPrintInfo(orderId, returnId);
if (shopOrderPrintVO == null) {
return null;
}
// 设置配送方式名称
shopOrderPrintVO.setDelivery_type_name(CommonService.getDeliveryExpressName(shopOrderPrintVO.getDelivery_type_id()));
return shopOrderPrintVO;
} catch (Exception e) { } catch (Exception e) {
logger.error("获取退货订单打印信息失败, orderId: {}, returnId: {}", orderId, returnId, e); logger.error("获取退货订单打印信息失败, orderId: {}, returnId: {}", orderId, returnId, e);
return null; return null;

View File

@ -1027,9 +1027,9 @@
</choose> </choose>
</if> </if>
<!-- 2-物流配送订单 --> <!-- 2-非同城配送 物流配送订单 -->
<if test="delivery != null and delivery == 2"> <if test="delivery != null and delivery == 2">
AND oi.delivery_type_id IN (1,2,3,4,10) AND oi.delivery_type_id IN (1,2,3,4,5,10,15)
<!-- 订单状态筛选 --> <!-- 订单状态筛选 -->
<choose> <choose>

View File

@ -104,7 +104,8 @@
<result property="order_shipping_fee" column="order_shipping_fee"/> <result property="order_shipping_fee" column="order_shipping_fee"/>
<result property="order_channel_name" column="order_channel_name"/> <result property="order_channel_name" column="order_channel_name"/>
<result property="payment_type_name" column="payment_type_name"/> <result property="payment_type_name" column="payment_type_name"/>
<result property="deliver_type_name" column="deliver_type_name"/> <result property="delivery_type_id" column="delivery_type_id"/>
<result property="delivery_type_name" column="delivery_type_name"/>
<result property="packing_fee" column="packing_fee"/> <result property="packing_fee" column="packing_fee"/>
<result property="basic_rights" column="basic_rights"/> <result property="basic_rights" column="basic_rights"/>
<result property="order_payment_amount" column="order_payment_amount"/> <result property="order_payment_amount" column="order_payment_amount"/>
@ -143,7 +144,7 @@
soi.order_title, soi.delivery_type_id, soi.payment_type_id, soi.payment_time, soi.order_title, soi.delivery_type_id, soi.payment_type_id, soi.payment_time,
LPAD(soi.order_pickup_num, 7, '0') as order_pickup_num_str, LPAD(soi.order_pickup_num, 7, '0') as order_pickup_num_str,
CASE WHEN soi.booking_state = 2 THEN 2 ELSE 1 END AS booking_state, soi.booking_begin_time, CASE WHEN soi.booking_state = 2 THEN 2 ELSE 1 END AS booking_state, soi.booking_begin_time,
sod.order_message, sod.order_shipping_fee, sod.order_shipping_fee_amount, sod.delivery_time, sod.order_message, sod.order_shipping_fee, sod.order_shipping_fee_amount, sod.delivery_time, sod.delivery_type_id,
(sod.order_discount_amount + sod.voucher_price + sod.order_points_fee + sod.order_adjust_fee) as total_discount_amount, (sod.order_discount_amount + sod.voucher_price + sod.order_points_fee + sod.order_adjust_fee) as total_discount_amount,
sod.packing_fee, sod.packing_fee,
ssi.store_tel, ssi.store_tel,