Commit a301bb57 authored by zhengyi's avatar zhengyi

Merge branch 'inquiry-zhengyi'

parents e18e4476 0f61b1e6
......@@ -394,4 +394,10 @@ public interface ErrorCodeConstants {
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_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
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) {
throw exception(ORDER_NO_QUOTE_NOT_CUSTOM_PRICE);
}
......@@ -2694,7 +2703,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
}
if ((type == 6 || type == 10) && isPayAdvanceException) {
if ((type == 6 || type == 10 || (orderDO.getStatus() == 5 && type == 12)) && isPayAdvanceException) {
// TODO 待确定,订单之前处理过预付异常,这时入仓修改产生的新预付异常是否重复生成
List<OrderExceptionDO> orderExceptionDOList =
orderExceptionService.getOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(),
......
......@@ -1005,11 +1005,53 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
if (Objects.isNull(channelPrice.getOrderItemId())) {
throw exception(ORDER_ITEM_NOT_EXISTS);
}
//得到以前的费用
OrderItemDO orderItemDO = orderItemService.getOrderItem(channelPrice.getOrderItemId());
if (Objects.isNull(orderItemDO)) {
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) {
// 运费+清关费,两者都为0则不是自定义价格
if (channelPrice.getFreightFee().compareTo(BigDecimal.ZERO) == 0 && channelPrice.getClearanceFee().compareTo(BigDecimal.ZERO) == 0) {
......@@ -1021,21 +1063,33 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
continue;
}
}
channelPrice.setExceptionId(vo.getOrderExceptionId());
channelPrice.setExceptionResultId(orderExceptionResult.getId());
orderExceptionChannelPriceService.createExceptionChannelPrice(channelPrice);
OrderChangePriceParam priceParam = new OrderChangePriceParam();
BeanUtil.copyProperties(channelPrice, priceParam);
priceParam.setFreightCurrencyId(orderItemDO.getSeaFreightCurrency());
priceParam.setClearanceCurrencyId(orderItemDO.getClearanceFreightCurrency());
inquiryPriceParams.add(priceParam);
if (orderItemDO.getOneSeaFreight().compareTo(BigDecimal.ZERO) == 0) {
ApplyInfoVO applyInfo = new ApplyInfoVO();
applyInfo.setName(orderItemDO.getProdTitleZh() + "计费方式");
applyInfo.setNewValue(channelPrice.getCharging() == 1 ? "全包价" : "运费+清关费");
applyInfoVOList.add(applyInfo);
applyInfo = new ApplyInfoVO();
applyInfo.setName(orderItemDO.getProdTitleZh() + "是否预付");
applyInfo.setNewValue(channelPrice.getIsPayAdvance() ? "是" : "否");
applyInfoVOList.add(applyInfo);
}
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName(orderItemDO.getProdTitleZh() + (channelPrice.getCharging() == 1 ? "全包价" : "运费"));
String freightCurrency = (null == allCurrency.get(orderItemDO.getSeaFreightCurrency()) ? "" : allCurrency.get(orderItemDO.getSeaFreightCurrency()).getFuhao());
String freightUnit = (null == allUnit.get(orderItemDO.getSeaFreightVolume().intValue()) ? "" : allUnit.get(orderItemDO.getSeaFreightVolume().intValue()).getFuhao());
applyInfoVO.setOrgValue(orderItemDO.getOneSeaFreight() + freightCurrency + "/" + freightUnit);
if (orderItemDO.getOneSeaFreight().compareTo(BigDecimal.ZERO) > 0) {
applyInfoVO.setOrgValue(orderItemDO.getOneSeaFreight() + freightCurrency + "/" + freightUnit);
}
applyInfoVO.setNewValue(channelPrice.getFreightFee() + freightCurrency + "/" + freightUnit);
applyInfoVOList.add(applyInfoVO);
......@@ -1044,7 +1098,9 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
applyInfoVO.setName(orderItemDO.getProdTitleZh() + "清关费");
String clearanceCurrency = (null == allCurrency.get(orderItemDO.getClearanceFreightCurrency()) ? "" : allCurrency.get(orderItemDO.getClearanceFreightCurrency()).getFuhao());
String clearanceUnit = (null == allUnit.get(orderItemDO.getClearanceFreightVolume().intValue()) ? "" : allUnit.get(orderItemDO.getClearanceFreightVolume().intValue()).getFuhao());
applyInfoVO.setOrgValue(orderItemDO.getOneClearanceFreight() + clearanceCurrency + "/" + clearanceUnit);
if (orderItemDO.getOneClearanceFreight().compareTo(BigDecimal.ZERO) > 0) {
applyInfoVO.setOrgValue(orderItemDO.getOneClearanceFreight() + clearanceCurrency + "/" + clearanceUnit);
}
applyInfoVO.setNewValue((null == channelPrice.getClearanceFee() ? "" : channelPrice.getClearanceFee()) + clearanceCurrency + "/" + clearanceUnit);
applyInfoVOList.add(applyInfoVO);
}
......
......@@ -262,3 +262,9 @@ order.already.in.merge.pkg=
customer.is.new.or.old.no.change=
order.is.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
order.is.pre.installed=Order pre installed
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.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
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.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