Commit 33f4286a authored by yanghao's avatar yanghao

fix: #196 当订单入仓完成,订单收发方客户的客户状态均修改为成交

parent bc49f8b0
......@@ -1416,41 +1416,43 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsignorDO2 != null &&
orderConsignorDO2.getCustomerId() != null &&
orderConsigneeDO2 != null &&
orderConsigneeDO2.getCustomerId() != null) {
//获取发货人客户经理
CustomerDO consignorCustomer =
customerService.getById(orderConsignorDO2.getCustomerId());
//获取收货人客户经理
CustomerDO consigneeCustomer =
customerService.getById(orderConsigneeDO2.getCustomerId());
//订单的发货人、收货人同属一个客户经理,则两个客户经理都延期,
// 否则只延期订单中业绩归属方客户
if (consignorCustomer != null && consigneeCustomer != null &&
Objects.nonNull(consignorCustomer.getCustomerService()) &&
Objects.nonNull(consigneeCustomer.getCustomerService()) &&
(consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) {
if (orderConsignorDO2 != null &&
orderConsignorDO2.getCustomerId() != null) {
idSet.add(orderConsignorDO2.getCustomerId());
}
if (orderConsigneeDO2 != null &&
orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId());
}
}
// if (orderConsignorDO2 != null &&
// orderConsignorDO2.getCustomerId() != null &&
// orderConsigneeDO2 != null &&
// orderConsigneeDO2.getCustomerId() != null) {
// //获取发货人客户经理
// CustomerDO consignorCustomer =
// customerService.getById(orderConsignorDO2.getCustomerId());
// //获取收货人客户经理
// CustomerDO consigneeCustomer =
// customerService.getById(orderConsigneeDO2.getCustomerId());
// //订单的发货人、收货人同属一个客户经理,则两个客户经理都延期,
// // 否则只延期订单中业绩归属方客户
// if (consignorCustomer != null && consigneeCustomer != null &&
// Objects.nonNull(consignorCustomer.getCustomerService()) &&
// Objects.nonNull(consigneeCustomer.getCustomerService()) &&
// (consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) {
//
// if (orderConsignorDO2 != null &&
// orderConsignorDO2.getCustomerId() != null) {
// idSet.add(orderConsignorDO2.getCustomerId());
// }
// if (orderConsigneeDO2 != null &&
// orderConsigneeDO2.getCustomerId() != null) {
// idSet.add(orderConsigneeDO2.getCustomerId());
// }
// }
// }
// 上面逻辑是2024-05-21修改的, 下面在2024-08-08又恢复成之前的这种业务。
// zendao #196 当订单入仓完成,订单收发方客户的客户状态均修改为成交
if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
idSet.add(orderConsignorDO2.getCustomerId());
}
if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId());
}
// //旧逻辑 2024-05-21
// if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
// idSet.add(orderConsignorDO2.getCustomerId());
// }
//
// if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
// idSet.add(orderConsigneeDO2.getCustomerId());
// }
for (Long id : idSet) {
customerService.updateCustomerByFinishWarehouseIn(id,
orderId, orderDO != null ? orderDO.getOrderNo() : "",
......
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