diff --git a/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java b/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java index ec853b84..b4613ac9 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java +++ b/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java @@ -15,9 +15,8 @@ public class StateCode { 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_EXP = 10; // 普通快递 - public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送 - public static final int DELIVERY_TYPE_SAME_CITY = 16;//顺丰同城配送 - public static final int DELIVERY_TYPE_STORE_BY_SELF = 17; // 商家(线下)自己配送 + public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送(运费 0 元) + public static final int DELIVERY_TYPE_SAME_CITY = 16;//同城配送 public static final Map DELIVERY_TYPE_MAP = new HashMap() { { @@ -28,7 +27,7 @@ public class StateCode { put(DELIVERY_TYPE_SELF_PICK_UP, "到店自提"); put(DELIVERY_TYPE_EXP, "普通快递"); put(DELIVERY_TYPE_IN_STORE_SERVICE, "店铺配送"); - put(DELIVERY_TYPE_SAME_CITY, "顺丰同城"); + put(DELIVERY_TYPE_SAME_CITY, "顺丰同城配送"); } }; diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/OrderPrintVO.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/OrderPrintVO.java index d1f166ab..391929fa 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/OrderPrintVO.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/OrderPrintVO.java @@ -65,9 +65,13 @@ public class OrderPrintVO implements Serializable { @Builder.Default private String payment_type_name = "微信支付"; - @ApiModelProperty(value = "配送渠道") + @ApiModelProperty(value = "配送方式ID") @Builder.Default - private String deliver_type_name = "顺丰同城"; + private Integer delivery_type_id = 16; + + @ApiModelProperty(value = "配送方式") + @Builder.Default + private String delivery_type_name = "顺丰同城"; @ApiModelProperty(value = "打包费") private BigDecimal packing_fee; diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderPrintVO.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderPrintVO.java index b0b32204..ebe7aa53 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderPrintVO.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderPrintVO.java @@ -68,7 +68,7 @@ public class ShopStoreOrderPrintVO implements Serializable { @ApiModelProperty(value = "支付方式") private String pay_type; - @ApiModelProperty(value = "配送来源") + @ApiModelProperty(value = "配送方式") private String shipper_type; @ApiModelProperty(value = "下单时间") @@ -105,7 +105,6 @@ public class ShopStoreOrderPrintVO implements Serializable { @ApiModelProperty(value = "实际应付款") private Long order_payment_amount; - // 订单商品详情信息 @ApiModelProperty(value = "订单商品详情信息") private OrderItemPrintVO order_items; diff --git a/mall-common/src/main/java/com/suisung/mall/common/service/impl/CommonService.java b/mall-common/src/main/java/com/suisung/mall/common/service/impl/CommonService.java index 2ca316e6..47eeb7f2 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/service/impl/CommonService.java +++ b/mall-common/src/main/java/com/suisung/mall/common/service/impl/CommonService.java @@ -17,6 +17,7 @@ import com.suisung.mall.common.constant.CommonConstant; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.Objects; import java.util.regex.Pattern; @Slf4j @@ -76,10 +77,37 @@ public class CommonService { return false; } - // 普通配送是指除了同城配送、自提和到店服务之外的配送方式 - return !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_SAME_CITY) - && !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_SELF_PICK_UP) - && !deliveryTypeId.equals(StateCode.DELIVERY_TYPE_IN_STORE_SERVICE); + // 普通配送是指除了同城配送、自提和到店服务之外的配送方式(没有物流轨迹的) + return !Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_SAME_CITY) + && !Objects.equals(deliveryTypeId, StateCode.DELIVERY_TYPE_SELF_PICK_UP) + && !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); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java index 547dcf72..ade67100 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java @@ -119,7 +119,7 @@ public class LakalaController extends BaseControllerImpl { 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) public ResponseEntity receiveCompleteNotify(HttpServletRequest request) { // 完整地址: https://mall.gpxscs.cn/api/mobile/shop/lakala/trans/receive/completeNotify diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java index e4c8e546..bafd6aef 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java @@ -823,6 +823,14 @@ public class LakalaApiServiceImpl implements LakalaApiService { Pair checkResult = LakalaUtil.chkLklApiNotifySign(request, lklNotifyCerPath, false); if (!checkResult.getFirst()) { 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()); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java index 927670af..8c85cad9 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java @@ -268,7 +268,9 @@ public class ShopOrderLogisticsServiceImpl extends BaseServiceImpl - + - AND oi.delivery_type_id IN (1,2,3,4,10) + AND oi.delivery_type_id IN (1,2,3,4,5,10,15) diff --git a/mall-shop/src/main/resources/mapper/order/ShopOrderReturnMapper.xml b/mall-shop/src/main/resources/mapper/order/ShopOrderReturnMapper.xml index e296a517..2386122d 100644 --- a/mall-shop/src/main/resources/mapper/order/ShopOrderReturnMapper.xml +++ b/mall-shop/src/main/resources/mapper/order/ShopOrderReturnMapper.xml @@ -104,7 +104,8 @@ - + + @@ -143,7 +144,7 @@ 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, 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.packing_fee, ssi.store_tel,