Commit b525c1de authored by lanbaoming's avatar lanbaoming

2024-06-18提交

parent e4bbddcc
...@@ -1275,10 +1275,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1275,10 +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 if((customerDO.getIsInOpenSea() && Objects.nonNull(customerDO.getEnterOpenSeaTime())) || !customerDO.getIsCustomerServiceConfirmed()) { //客户还在公海上,和待接收的,不做业绩归属分配,归公司 } else if ((customerDO.getIsInOpenSea() && Objects.nonNull(customerDO.getEnterOpenSeaTime())) || !customerDO.getIsCustomerServiceConfirmed()) { //客户还在公海上,和待接收的,不做业绩归属分配,归公司
order.setSalesmanId(0L); order.setSalesmanId(0L);
order.setCustomerId(0L); order.setCustomerId(0L);
}else { } else {
addOrderSalesmanCustomerService(createReqVO, order); addOrderSalesmanCustomerService(createReqVO, order);
} }
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId()); AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId());
...@@ -2112,7 +2112,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2112,7 +2112,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(orderApprovalDO) && orderApprovalDO.getStatus() == 1) { if (Objects.nonNull(orderApprovalDO) && orderApprovalDO.getStatus() == 1) {
throw exception(YOUR_APPLY_PENDING); throw exception(YOUR_APPLY_PENDING);
} }
if (Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.ORDER_PLACED.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.WAREHOUSING.getValue())) { if (Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())
|| Objects.equals(vo.getStatus(), OrderStatusEnum.ORDER_PLACED.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.WAREHOUSING.getValue())) {
// 是草稿、已下单、入仓中状态 直接修改 // 是草稿、已下单、入仓中状态 直接修改
this.updateOrder(updateReqVO, memberUserDO); this.updateOrder(updateReqVO, memberUserDO);
...@@ -2220,8 +2221,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2220,8 +2221,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(consigneeContactsDO)) { if (Objects.nonNull(consigneeContactsDO)) {
this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO); this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO);
} }
if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() || orderConsigneeBackVO.getIsCharge()) { if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() ||
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,是根据收发货人的变动来实时调整业绩归属 orderConsigneeBackVO.getIsCharge()) {
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,
// 是根据收发货人的变动来实时调整业绩归属
// 获取最早入仓时间,当入仓时间大于三天,则不允许再修改当前客户归属 // 获取最早入仓时间,当入仓时间大于三天,则不允许再修改当前客户归属
OrderWarehouseInDO warehouseInDO = orderWarehouseInMapper.selectOne(new LambdaQueryWrapper<OrderWarehouseInDO>() OrderWarehouseInDO warehouseInDO = orderWarehouseInMapper.selectOne(new LambdaQueryWrapper<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, vo.getOrderId()) .eq(OrderWarehouseInDO::getOrderId, vo.getOrderId())
...@@ -2852,8 +2855,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2852,8 +2855,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
private void comparePerformanceAttribution(OrderBackVO private void comparePerformanceAttribution(OrderBackVO vo,
vo, List<ApplyInfoVO> applyInfoList, OrderConsignorBackVO orderConsignorBackVO, List<ApplyInfoVO> applyInfoList,
OrderConsignorBackVO orderConsignorBackVO,
OrderConsigneeBackVO orderConsigneeBackVO) { OrderConsigneeBackVO orderConsigneeBackVO) {
// TODO 客户归属变动时记录日志 // TODO 客户归属变动时记录日志
if (!Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())) { if (!Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
...@@ -2873,16 +2877,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2873,16 +2877,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} }
} else { } else {
if (vo.getIsCargoControl()) { if (vo.getIsCargoControl()) {
if (!Objects.equals(vo.getCustomerId(), orderConsignorBackVO.getCustomerId())) { if (!Objects.equals(vo.getCustomerId(),
orderConsignorBackVO.getCustomerId())) {
// 控货订单归属发货人 // 控货订单归属发货人
customerType = 1; customerType = 1;
CustomerDO orgCustomerDO = customerService.getCustomer(vo.getCustomerId()); CustomerDO orgCustomerDO = customerService.getCustomer(vo.getCustomerId());
CustomerDO newCustomerDO = customerService.getCustomer(orderConsignorBackVO.getCustomerId()); CustomerDO newCustomerDO = customerService.getCustomer(orderConsignorBackVO.getCustomerId());
infoVO = new ApplyInfoVO(); infoVO = new ApplyInfoVO();
infoVO.setName("订单客户归属变动/Change in customer ownership for orders"); infoVO.setName("新规则,控货订单客户归属不变动/Change in customer ownership for orders");
infoVO.setOrgValue(Objects.nonNull(orgCustomerDO) ? ((StringUtils.isNotBlank(orgCustomerDO.getName()) ? orgCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(orgCustomerDO.getNameEn()) ? orgCustomerDO.getNameEn() : "empty")) : "无/not have"); //lanbm 2024-06-18 出掉控货改变业绩归属的逻辑点
infoVO.setNewValue(Objects.nonNull(newCustomerDO) ? ((StringUtils.isNotBlank(newCustomerDO.getName()) ? newCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(newCustomerDO.getNameEn()) ? newCustomerDO.getNameEn() : "empty")) : "无/not have"); //infoVO.setOrgValue(Objects.nonNull(orgCustomerDO) ? ((StringUtils.isNotBlank(orgCustomerDO.getName()) ? orgCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(orgCustomerDO.getNameEn()) ? orgCustomerDO.getNameEn() : "empty")) : "无/not have");
vo.setCustomerId(orderConsignorBackVO.getCustomerId()); //infoVO.setNewValue(Objects.nonNull(newCustomerDO) ? ((StringUtils.isNotBlank(newCustomerDO.getName()) ? newCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(newCustomerDO.getNameEn()) ? newCustomerDO.getNameEn() : "empty")) : "无/not have");
//vo.setCustomerId(orderConsignorBackVO.getCustomerId());
return;
} }
} else { } else {
// 非控货订单 + 付款人为发货人 归属发货人, 其他归属收货人 // 非控货订单 + 付款人为发货人 归属发货人, 其他归属收货人
...@@ -3465,7 +3472,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -3465,7 +3472,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// //
// } // }
// 更新所属客户经理(业务员) // 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus()) && Objects.nonNull(updateObj.getCustomerId()) && updateObj.getCustomerId() > 0) { if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus())
&& Objects.nonNull(updateObj.getCustomerId()) &&
updateObj.getCustomerId() > 0) {
addOrderCustomerService(updateObj, customerType); addOrderCustomerService(updateObj, customerType);
} }
} }
......
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