Commit 3e7053ff authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'master-fix' into dev

parents 47145330 66cef53e
...@@ -796,7 +796,11 @@ ...@@ -796,7 +796,11 @@
-- 捞取时间置为空 -- 捞取时间置为空
a.catch_time = null, a.catch_time = null,
-- 移交客户重置报价延期次数为0 -- 移交客户重置报价延期次数为0
a.create_offer_postpone_num = 0 a.create_offer_postpone_num = 0,
-- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
-- 新客户置为1
a.is_new = (case when a.status = 3 then 0 else 1 end)
WHERE id in WHERE id in
<foreach item='customer' index='index' collection='customerList' open='(' separator=',' close=')'> <foreach item='customer' index='index' collection='customerList' open='(' separator=',' close=')'>
#{customer.id} #{customer.id}
...@@ -859,8 +863,6 @@ ...@@ -859,8 +863,6 @@
a.is_in_open_sea = 0, a.is_in_open_sea = 0,
a.enter_open_sea_time = null, a.enter_open_sea_time = null,
-- 客户经理
a.customer_service = #{loginUserId},
-- 确认接收置为true #2201 公海池捞取客户后,捞取客户直接进入我的客户 -- 确认接收置为true #2201 公海池捞取客户后,捞取客户直接进入我的客户
a.is_customer_service_confirmed = 1, a.is_customer_service_confirmed = 1,
-- 分配时间 -- 分配时间
...@@ -874,7 +876,14 @@ ...@@ -874,7 +876,14 @@
a.status = if(a.status = 2, 1, a.status), a.status = if(a.status = 2, 1, a.status),
-- 预计进入公海池时间 -- 预计进入公海池时间
a.estimate_enter_open_sea_time = #{estimateEnterOpenSeaTime} a.estimate_enter_open_sea_time = #{estimateEnterOpenSeaTime},
-- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
-- 不同客户经理更新为新客户; 同一客户经理,成交为老客户,非已成交状态为新客户
a.is_new = (case when a.customer_service != #{loginUserId} then 1 else (if(a.status = 3, 0, 1)) end),
-- 客户经理 (这个要放到后面,因为前面有用到这条件)
a.customer_service = #{loginUserId}
WHERE id = #{customerId} WHERE id = #{customerId}
</update> </update>
...@@ -884,9 +893,9 @@ ...@@ -884,9 +893,9 @@
update ecw_customer a update ecw_customer a
set a.is_new = 0 set a.is_new = 0
where a.deleted = 0 and a.is_new = 1 and a.id = #{customerId} where a.deleted = 0 and a.is_new = 1 and a.id = #{customerId}
and exists( -- 20240809修改 zendao #195 客户业绩类型字段,判断条件变更
select 1 from ecw_target_log where deleted = 0 and customer_id = a.id and a.status = 3
) -- and exists(select 1 from ecw_target_log where deleted = 0 and customer_id = a.id)
</update> </update>
<sql id="orderQuery"> <sql id="orderQuery">
......
...@@ -1416,41 +1416,43 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI ...@@ -1416,41 +1416,43 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()) orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1")); .orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsignorDO2 != null && // if (orderConsignorDO2 != null &&
orderConsignorDO2.getCustomerId() != null && // orderConsignorDO2.getCustomerId() != null &&
orderConsigneeDO2 != null && // orderConsigneeDO2 != null &&
orderConsigneeDO2.getCustomerId() != null) { // orderConsigneeDO2.getCustomerId() != null) {
//获取发货人客户经理 // //获取发货人客户经理
CustomerDO consignorCustomer = // CustomerDO consignorCustomer =
customerService.getById(orderConsignorDO2.getCustomerId()); // customerService.getById(orderConsignorDO2.getCustomerId());
//获取收货人客户经理 // //获取收货人客户经理
CustomerDO consigneeCustomer = // CustomerDO consigneeCustomer =
customerService.getById(orderConsigneeDO2.getCustomerId()); // customerService.getById(orderConsigneeDO2.getCustomerId());
//订单的发货人、收货人同属一个客户经理,则两个客户经理都延期, // //订单的发货人、收货人同属一个客户经理,则两个客户经理都延期,
// 否则只延期订单中业绩归属方客户 // // 否则只延期订单中业绩归属方客户
if (consignorCustomer != null && consigneeCustomer != null && // if (consignorCustomer != null && consigneeCustomer != null &&
Objects.nonNull(consignorCustomer.getCustomerService()) && // Objects.nonNull(consignorCustomer.getCustomerService()) &&
Objects.nonNull(consigneeCustomer.getCustomerService()) && // Objects.nonNull(consigneeCustomer.getCustomerService()) &&
(consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) { // (consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) {
//
if (orderConsignorDO2 != null && // if (orderConsignorDO2 != null &&
orderConsignorDO2.getCustomerId() != 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()); idSet.add(orderConsignorDO2.getCustomerId());
} }
if (orderConsigneeDO2 != null &&
orderConsigneeDO2.getCustomerId() != null) { if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId()); 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) { for (Long id : idSet) {
customerService.updateCustomerByFinishWarehouseIn(id, customerService.updateCustomerByFinishWarehouseIn(id,
orderId, orderDO != null ? orderDO.getOrderNo() : "", 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