Commit 022aee9b authored by 332784038@qq.com's avatar 332784038@qq.com

订单创建与编辑时的业绩计算逻辑bug修复

parent c6977c3d
......@@ -2511,8 +2511,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (!Objects.equals(vo.getCustomerId(), orderConsignorBackVO.getCustomerId())) {
// 海外仓归属发货人
customerType = 1;
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
}
} else {
......@@ -2520,7 +2518,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(vo.getOrderId(), null);
applicationContext.publishEvent(event);
......@@ -2529,17 +2526,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (vo.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsNew()) ? 1 : (consigneeDO.getIsNew() ? 1 : 0));
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
}
} else if (vo.getDrawee() == 2) {//收货人付款 层级5 第一个
......@@ -2547,7 +2541,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
} else {
//没有收货人
vo.setCustomerId(0L);
......@@ -2566,28 +2559,23 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (event.getOfferId() != null && (vo.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (consignorDO.getDefaultPay() && (vo.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (consignorDO.getDefaultPay() && (vo.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
//去掉层级5、6 ,以上不符合的都归收货人
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
}
}
......@@ -2596,7 +2584,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
}
}
......
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