Commit 330289b6 authored by liuzeheng's avatar liuzeheng

Merge branch 'master' into dev

# Conflicts:
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
parents 3b597a91 190d30c9
...@@ -53,6 +53,14 @@ public interface OrderMutualMapper extends AbstractMapper<OrderMutualDO> { ...@@ -53,6 +53,14 @@ public interface OrderMutualMapper extends AbstractMapper<OrderMutualDO> {
@Select("update ecw_order_mutual set deleted=0 where creator=#{query.creator} and create_time=#{query.createTime} " + @Select("update ecw_order_mutual set deleted=0 where creator=#{query.creator} and create_time=#{query.createTime} " +
"and updater=#{query.updater} and update_time=#{query.updateTime} and order_id=#{query.orderId}") "and updater=#{query.updater} and update_time=#{query.updateTime} and order_id=#{query.orderId}")
void updateMutualBackByOrderId(OrderMutualDO item);*/
@Select("update ecw_order_mutual set deleted=0 where creator=#{creator} and create_time=#{createTime} " +
"and updater=#{updater} and update_time=#{updateTime} and mutual_order_id=#{mutualOrderId}")
void updateMutualBackByRelatId(OrderMutualDO item);
@Select("update ecw_order_mutual set deleted=0 where creator=#{creator} and create_time=#{createTime} " +
"and updater=#{updater} and update_time=#{updateTime} and order_id=#{orderId}")
void updateMutualBackByOrderId(OrderMutualDO item); void updateMutualBackByOrderId(OrderMutualDO item);
*/ */
......
...@@ -717,9 +717,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -717,9 +717,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// }//end // }//end
// 更新所属客户经理(业务员) // 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(order.getStatus()) if (!OrderStatusEnum.DRAFT.getValue().equals(order.getStatus()) && Objects.nonNull(order.getCustomerId()) && order.getCustomerId() > 0) {
&& Objects.nonNull(order.getCustomerId()) &&
order.getCustomerId() > 0) {
//addOrderCustomerService(order, customerType); //addOrderCustomerService(order, customerType);
addOrderCustomerServiceAndCustomer(createReqVO, order, customerType); addOrderCustomerServiceAndCustomer(createReqVO, order, customerType);
} }
...@@ -1246,11 +1244,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1246,11 +1244,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
return customerType; return customerType;
} }
private void addOrderCustomerServiceAndCustomer( private void addOrderCustomerServiceAndCustomer(OrderCreateReqVO createReqVO, OrderDO order, int customerType) {
OrderCreateReqVO createReqVO, OrderDO order, int customerType) { if (Objects.nonNull(order.getParentOrderId()) && order.getParentOrderId() > 0 && !order.getSplitSeparateOrder()) {
if (Objects.nonNull(order.getParentOrderId())
&& order.getParentOrderId() > 0 && !order.getSplitSeparateOrder()) {
// 拆单子订单,并且未标记为独立订单,则不执行客户经理分配规则,以原单为主 // 拆单子订单,并且未标记为独立订单,则不执行客户经理分配规则,以原单为主
return; return;
} }
...@@ -1280,8 +1275,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1280,8 +1275,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(oldCustomerService)) { if (Objects.nonNull(oldCustomerService)) {
// 如果这里的旧客户经理id不为null,说明此客户属于移交新客户经理,但是新客户经理还未接收,业绩算老客户经理的 // 如果这里的旧客户经理id不为null,说明此客户属于移交新客户经理,但是新客户经理还未接收,业绩算老客户经理的
order.setSalesmanId(oldCustomerService); order.setSalesmanId(oldCustomerService);
} else { } else if((customerDO.getIsInOpenSea() && Objects.nonNull(customerDO.getEnterOpenSeaTime())) || !customerDO.getIsCustomerServiceConfirmed()) { //客户还在公海上,和待接收的,不做业绩归属分配,归公司
//order.setSalesmanId(customerDO.getCustomerService()); order.setSalesmanId(0L);
order.setCustomerId(0L);
}else {
addOrderSalesmanCustomerService(createReqVO, order); addOrderSalesmanCustomerService(createReqVO, order);
} }
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId()); AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId());
...@@ -1368,7 +1365,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1368,7 +1365,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
&& (Objects.isNull(customerDO.getCustomerService()) || (!customerDO.getIsCustomerServiceConfirmed() && Objects.isNull(oldCustomerService)))) { && (Objects.isNull(customerDO.getCustomerService()) || (!customerDO.getIsCustomerServiceConfirmed() && Objects.isNull(oldCustomerService)))) {
// 如果客户正在移交新客户经理,但是未接收,并且老客户经理不为null,则不创建客户经理未分配异常 // 如果客户正在移交新客户经理,但是未接收,并且老客户经理不为null,则不创建客户经理未分配异常
//web下单,业绩为收货人,不产生未分配客户经理异常 //web下单,业绩为收货人,不产生未分配客户经理异常
if (order.getUserId() != null && order.getUserId() > 0 && customerType == 2) { if (order.getUserId() != null && order.getUserId() > 0 &&
customerType == 2) {
//order.setSalesmanId(0L); //order.setSalesmanId(0L);
addOrderSalesmanCustomerService(order); addOrderSalesmanCustomerService(order);
order.setDeptId(0L); order.setDeptId(0L);
......
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