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
if (Objects.nonNull(oldCustomerService)) {
// 如果这里的旧客户经理id不为null,说明此客户属于移交新客户经理,但是新客户经理还未接收,业绩算老客户经理的
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.setCustomerId(0L);
}else {
} else {
addOrderSalesmanCustomerService(createReqVO, order);
}
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId());
......@@ -2112,7 +2112,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(orderApprovalDO) && orderApprovalDO.getStatus() == 1) {
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);
......@@ -2220,8 +2221,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(consigneeContactsDO)) {
this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO);
}
if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() || orderConsigneeBackVO.getIsCharge()) {
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,是根据收发货人的变动来实时调整业绩归属
if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() ||
orderConsigneeBackVO.getIsCharge()) {
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,
// 是根据收发货人的变动来实时调整业绩归属
// 获取最早入仓时间,当入仓时间大于三天,则不允许再修改当前客户归属
OrderWarehouseInDO warehouseInDO = orderWarehouseInMapper.selectOne(new LambdaQueryWrapper<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, vo.getOrderId())
......@@ -2852,8 +2855,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
private void comparePerformanceAttribution(OrderBackVO
vo, List<ApplyInfoVO> applyInfoList, OrderConsignorBackVO orderConsignorBackVO,
private void comparePerformanceAttribution(OrderBackVO vo,
List<ApplyInfoVO> applyInfoList,
OrderConsignorBackVO orderConsignorBackVO,
OrderConsigneeBackVO orderConsigneeBackVO) {
// TODO 客户归属变动时记录日志
if (!Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
......@@ -2873,16 +2877,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
} else {
if (vo.getIsCargoControl()) {
if (!Objects.equals(vo.getCustomerId(), orderConsignorBackVO.getCustomerId())) {
if (!Objects.equals(vo.getCustomerId(),
orderConsignorBackVO.getCustomerId())) {
// 控货订单归属发货人
customerType = 1;
CustomerDO orgCustomerDO = customerService.getCustomer(vo.getCustomerId());
CustomerDO newCustomerDO = customerService.getCustomer(orderConsignorBackVO.getCustomerId());
infoVO = new ApplyInfoVO();
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");
infoVO.setNewValue(Objects.nonNull(newCustomerDO) ? ((StringUtils.isNotBlank(newCustomerDO.getName()) ? newCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(newCustomerDO.getNameEn()) ? newCustomerDO.getNameEn() : "empty")) : "无/not have");
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
infoVO.setName("新规则,控货订单客户归属不变动/Change in customer ownership for orders");
//lanbm 2024-06-18 出掉控货改变业绩归属的逻辑点
//infoVO.setOrgValue(Objects.nonNull(orgCustomerDO) ? ((StringUtils.isNotBlank(orgCustomerDO.getName()) ? orgCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(orgCustomerDO.getNameEn()) ? orgCustomerDO.getNameEn() : "empty")) : "无/not have");
//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 {
// 非控货订单 + 付款人为发货人 归属发货人, 其他归属收货人
......@@ -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);
}
}
......
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