Commit 684db67a authored by 332784038@qq.com's avatar 332784038@qq.com

订单单询异常处理业务暂定

parent bc49f8b0
...@@ -394,4 +394,10 @@ public interface ErrorCodeConstants { ...@@ -394,4 +394,10 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_IS_PRE_INSTALLED = new ErrorCode(1004001153, "order.is.pre.installed"); ErrorCode ORDER_IS_PRE_INSTALLED = new ErrorCode(1004001153, "order.is.pre.installed");
ErrorCode ORDER_IS_NOT_PRE_INSTALLED = new ErrorCode(1004001154, "order.is.not.pre.installed"); ErrorCode ORDER_IS_NOT_PRE_INSTALLED = new ErrorCode(1004001154, "order.is.not.pre.installed");
ErrorCode ORDER_ITEM_CHARGING_NOT_NULL = new ErrorCode(1004001155, "order.item.charging.not.null");
ErrorCode ORDER_ITEM_IS_PAY_ADVANCE_NOT_NULL = new ErrorCode(1004001156, "order.item.is.pay.advance.not.null");
ErrorCode FREIGHT_CURRENCY_NOT_NULL = new ErrorCode(1004001157, "order.item.freight.currency.not.null");
ErrorCode FREIGHT_UNIT_NOT_NULL = new ErrorCode(1004001158, "order.item.freight.unit.not.null");
ErrorCode CLEARANCE_CURRENCY_NOT_NULL = new ErrorCode(1004001159, "order.item.clearance.currency.not.null");
ErrorCode CLEARANCE_UNIT_NOT_NULL = new ErrorCode(1004001160, "order.item.clearance.unit.not.null");
} }
...@@ -542,6 +542,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -542,6 +542,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
continue; continue;
} }
} }
if (type == 12) {
// 单询异常的参数单独处理, 以传参为准
it.setCharging(channelPriceParam.getCharging());
it.setIsPayAdvance(channelPriceParam.getIsPayAdvance());
it.setSeaFreightCurrency(channelPriceParam.getFreightCurrencyId());
it.setSeaFreightVolume(channelPriceParam.getFreightUnitId());
it.setClearanceFreightCurrency(channelPriceParam.getClearanceCurrencyId());
it.setClearanceFreightVolume(channelPriceParam.getClearanceUnitId());
}
if (it.getSeaFreightCurrency() == 0 || it.getSeaFreightVolume() == 0L) { if (it.getSeaFreightCurrency() == 0 || it.getSeaFreightVolume() == 0L) {
throw exception(ORDER_NO_QUOTE_NOT_CUSTOM_PRICE); throw exception(ORDER_NO_QUOTE_NOT_CUSTOM_PRICE);
} }
......
...@@ -1005,11 +1005,53 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -1005,11 +1005,53 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
if (Objects.isNull(channelPrice.getOrderItemId())) { if (Objects.isNull(channelPrice.getOrderItemId())) {
throw exception(ORDER_ITEM_NOT_EXISTS); throw exception(ORDER_ITEM_NOT_EXISTS);
} }
//得到以前的费用 //得到以前的费用
OrderItemDO orderItemDO = orderItemService.getOrderItem(channelPrice.getOrderItemId()); OrderItemDO orderItemDO = orderItemService.getOrderItem(channelPrice.getOrderItemId());
if (Objects.isNull(orderItemDO)) { if (Objects.isNull(orderItemDO)) {
throw exception(ORDER_ITEM_NOT_EXISTS); throw exception(ORDER_ITEM_NOT_EXISTS);
} }
if (Objects.isNull(orderItemDO.getOneSeaFreight()) || orderItemDO.getOneSeaFreight().compareTo(BigDecimal.ZERO) == 0) {
// TODO 当原商品未报价(运费值为0时)即可以自定义收费模式、货币单位、计量单位
if (Objects.isNull(channelPrice.getCharging())) {
throw exception(ORDER_ITEM_CHARGING_NOT_NULL);
}
orderItemDO.setCharging(channelPrice.getCharging());
if (Objects.isNull(channelPrice.getIsPayAdvance())) {
throw exception(ORDER_ITEM_IS_PAY_ADVANCE_NOT_NULL);
}
orderItemDO.setIsPayAdvance(channelPrice.getIsPayAdvance() ? 1 : 0);
if (Objects.isNull(channelPrice.getIsPayAdvance())) {
throw exception(ORDER_ITEM_IS_PAY_ADVANCE_NOT_NULL);
}
if (Objects.isNull(channelPrice.getFreightCurrencyId())) {
throw exception(FREIGHT_CURRENCY_NOT_NULL);
}
orderItemDO.setSeaFreightCurrency(Math.toIntExact(channelPrice.getFreightCurrencyId()));
if (Objects.isNull(channelPrice.getFreightUnitId())) {
throw exception(FREIGHT_UNIT_NOT_NULL);
}
orderItemDO.setSeaFreightVolume(channelPrice.getFreightUnitId());
if (channelPrice.getCharging() == 0){
if (Objects.isNull(channelPrice.getClearanceCurrencyId())) {
throw exception(CLEARANCE_CURRENCY_NOT_NULL);
}
orderItemDO.setClearanceFreightCurrency(Math.toIntExact(channelPrice.getClearanceCurrencyId()));
if (Objects.isNull(channelPrice.getClearanceUnitId())) {
throw exception(CLEARANCE_UNIT_NOT_NULL);
}
orderItemDO.setClearanceFreightVolume(channelPrice.getClearanceUnitId());
}
}else {
// TODO 如果原订单商品价格非未报价,则不采用前端传值的货币单位、计量单位、收费方式、是否预付等参数,以原有参数为准
channelPrice.setCharging(orderItemDO.getCharging());
channelPrice.setIsPayAdvance(Objects.nonNull(orderItemDO.getIsPayAdvance()) && orderItemDO.getIsPayAdvance() == 1);
channelPrice.setFreightCurrencyId(Long.valueOf(orderItemDO.getSeaFreightCurrency()));
channelPrice.setFreightUnitId(orderItemDO.getSeaFreightVolume());
channelPrice.setClearanceCurrencyId(Long.valueOf(orderItemDO.getClearanceFreightCurrency()));
channelPrice.setClearanceUnitId(orderItemDO.getClearanceFreightVolume());
}
if (orderItemDO.getCharging() == 0) { if (orderItemDO.getCharging() == 0) {
// 运费+清关费,两者都为0则不是自定义价格 // 运费+清关费,两者都为0则不是自定义价格
if (channelPrice.getFreightFee().compareTo(BigDecimal.ZERO) == 0 && channelPrice.getClearanceFee().compareTo(BigDecimal.ZERO) == 0) { if (channelPrice.getFreightFee().compareTo(BigDecimal.ZERO) == 0 && channelPrice.getClearanceFee().compareTo(BigDecimal.ZERO) == 0) {
...@@ -1021,12 +1063,15 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap ...@@ -1021,12 +1063,15 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
continue; continue;
} }
} }
channelPrice.setExceptionId(vo.getOrderExceptionId()); channelPrice.setExceptionId(vo.getOrderExceptionId());
channelPrice.setExceptionResultId(orderExceptionResult.getId()); channelPrice.setExceptionResultId(orderExceptionResult.getId());
orderExceptionChannelPriceService.createExceptionChannelPrice(channelPrice); orderExceptionChannelPriceService.createExceptionChannelPrice(channelPrice);
OrderChangePriceParam priceParam = new OrderChangePriceParam(); OrderChangePriceParam priceParam = new OrderChangePriceParam();
BeanUtil.copyProperties(channelPrice, priceParam); BeanUtil.copyProperties(channelPrice, priceParam);
priceParam.setFreightCurrencyId(orderItemDO.getSeaFreightCurrency());
priceParam.setClearanceCurrencyId(orderItemDO.getClearanceFreightCurrency());
inquiryPriceParams.add(priceParam); inquiryPriceParams.add(priceParam);
......
...@@ -262,3 +262,9 @@ order.already.in.merge.pkg= ...@@ -262,3 +262,9 @@ order.already.in.merge.pkg=
customer.is.new.or.old.no.change= customer.is.new.or.old.no.change=
order.is.pre.installed= order.is.pre.installed=
order.is.not.pre.installed= order.is.not.pre.installed=
order.item.charging.not.null=
order.item.is.pay.advance.not.null=
order.item.freight.currency.not.null=
order.item.freight.unit.not.null=
order.item.clearance.currency.not.null=
order.item.clearance.unit.not.null=
\ No newline at end of file
...@@ -999,3 +999,10 @@ customer.is.new.or.old.no.change=customer current business type is {}, it's no c ...@@ -999,3 +999,10 @@ customer.is.new.or.old.no.change=customer current business type is {}, it's no c
order.is.pre.installed=Order pre installed order.is.pre.installed=Order pre installed
customer.delay.approval.times.more.then.one=delay approval times more then one customer.delay.approval.times.more.then.one=delay approval times more then one
order.is.not.pre.installed =Order not pre installed, unable to package together order.is.not.pre.installed =Order not pre installed, unable to package together
order.item.charging.not.null=The billing method for order products cannot be empty
order.item.is.pay.advance.not.null=Whether the ordered goods have been prepaid cannot be left blank
order.item.freight.currency.not.null=The currency unit for the shipping cost of the order item cannot be empty
order.item.freight.unit.not.null=The unit of measurement for shipping fees for order items cannot be empty
order.item.clearance.currency.not.null=Customs clearance fee for order goods, currency unit cannot be empty
order.item.clearance.unit.not.null=The unit of measurement for customs clearance fees for order goods cannot be empty
...@@ -1002,3 +1002,9 @@ order.already.in.merge.pkg=\u8BA2\u5355\u5DF2\u5728\u5408\u5305\u7BB1\u4E0B ...@@ -1002,3 +1002,9 @@ order.already.in.merge.pkg=\u8BA2\u5355\u5DF2\u5728\u5408\u5305\u7BB1\u4E0B
customer.is.new.or.old.no.change=\u5BA2\u6237\u5F53\u524D\u4E1A\u7EE9\u7C7B\u578B\u662F{}\u5BA2\u6237\uFF0C\u4E0D\u9700\u8981\u66F4\u65B0 customer.is.new.or.old.no.change=\u5BA2\u6237\u5F53\u524D\u4E1A\u7EE9\u7C7B\u578B\u662F{}\u5BA2\u6237\uFF0C\u4E0D\u9700\u8981\u66F4\u65B0
order.is.pre.installed=\u8BA2\u5355\u5DF2\u9884\u88C5 order.is.pre.installed=\u8BA2\u5355\u5DF2\u9884\u88C5
order.is.not.pre.installed =\u8ba2\u5355\u672a\u9884\u88c5\uff0c\u4e0d\u80fd\u5408\u5305 order.is.not.pre.installed =\u8ba2\u5355\u672a\u9884\u88c5\uff0c\u4e0d\u80fd\u5408\u5305
order.item.charging.not.null=\u8ba2\u5355\u5546\u54c1\u8ba1\u8d39\u65b9\u5f0f\u4e0d\u80fd\u4e3a\u7a7a
order.item.is.pay.advance.not.null=\u8ba2\u5355\u5546\u54c1\u662f\u5426\u9884\u4ed8\u4e0d\u80fd\u4e3a\u7a7a
order.item.freight.currency.not.null=\u8ba2\u5355\u5546\u54c1\u8fd0\u8d39\u8d27\u5e01\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.freight.unit.not.null=\u8ba2\u5355\u5546\u54c1\u8fd0\u8d39\u8ba1\u91cf\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.clearance.currency.not.null=\u8ba2\u5355\u5546\u54c1\u6e05\u5173\u8d39\u8d27\u5e01\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
order.item.clearance.unit.not.null=\u8ba2\u5355\u5546\u54c1\u6e05\u5173\u8d39\u8ba1\u91cf\u5355\u4f4d\u4e0d\u80fd\u4e3a\u7a7a
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment