Commit 7fd900e8 authored by 332784038@qq.com's avatar 332784038@qq.com

订单修改审批业务bug修复

parent f396bcde
......@@ -112,6 +112,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
......@@ -2177,10 +2178,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 比较收货人信息
CustomerContactsDO consigneeContactsDO = customerContactsService.getCustomerContacts(updateReqVO.getConsigneeContactsId());
OrderConsigneeBackVO orderConsigneeBackVO = vo.getConsigneeVO();
CustomerDO consigneeDO = null;
CustomerDO consigneeDO = customerService.getById(updateReqVO.getConsignorId());
if (Objects.isNull(consigneeContactsDO)) {
//todo 需要判断手机号唯一性,判断规则:1.区号相同,2.先判断手机号码是否存在,然后再判断:a.如果是0开头,判断是否存在非0开头号码;b.如果非0开头,判断是否存在0开头号码
consigneeDO = customerService.getById(updateReqVO.getConsignorId());
// consigneeDO = customerService.getById(updateReqVO.getConsignorId());
// 客户不存在,新增客户联系人信息 orderConsigneeDO中有值
// 20230511 收货人无客户档案时 判断发货人有无客户经理,没有 生成客户档案,进入待分配。
// 有客户经理,则暂时不生成客户档案。(放在入仓时处理)
......@@ -2836,7 +2837,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
private void comparePerformanceAttribution(OrderBackVO vo,
private void comparePerformanceAttribution(@NotNull OrderBackVO vo,
List<ApplyInfoVO> applyInfoList,
OrderConsignorBackVO orderConsignorBackVO,
OrderConsigneeBackVO orderConsigneeBackVO,
......@@ -2862,7 +2863,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !vo.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
......@@ -2871,25 +2872,25 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (vo.getDrawee() == 1) {//发货人付款
if (vo.getDrawee() == 1 && event.getOfferId() != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (vo.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsNew()) ? 1 : (consigneeDO.getIsNew() ? 1 : 0));
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
}
} else if (vo.getDrawee() == 2) {//收货人付款 层级5 第一个
if (consigneeDO != null) {
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consigneeDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
} else {
......@@ -2908,28 +2909,28 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
int clearanceFee = clearanceFeeList.get(0).getValue();//清关费
if (event.getOfferId() != null && (vo.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (event.getOfferId() != null && (vo.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (consignorDO.getDefaultPay() && (vo.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else if (consignorDO.getDefaultPay() && (vo.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
vo.setIsInOpenSea(consignorDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consignorDO) || Objects.isNull(consignorDO.getIsInOpenSea()) ? false : consignorDO.getIsInOpenSea());
vo.setYejiType(consignorDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(consignorDO.getIsInOpenSea() ? 0L : (consignorDO.getCustomerService() != null && consignorDO.getIsCustomerServiceConfirmed() ? consignorDO.getCustomerService() : 0));
} else {
//去掉层级5、6 ,以上不符合的都归收货人
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(consigneeDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
......@@ -2938,7 +2939,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else {
//业绩归收货人
vo.setCustomerId(orderConsigneeBackVO.getCustomerId() != null ? orderConsigneeBackVO.getCustomerId() : 0);
vo.setIsInOpenSea(consigneeDO.getIsInOpenSea());
vo.setIsInOpenSea(Objects.isNull(consigneeDO) || Objects.isNull(consigneeDO.getIsInOpenSea()) ? false : consigneeDO.getIsInOpenSea());
vo.setYejiType(consigneeDO.getIsNew() ? 1 : 0);
vo.setSalesmanId(Objects.nonNull(consigneeDO.getIsInOpenSea()) && consigneeDO.getIsInOpenSea() ? 0L : (consigneeDO.getCustomerService() != null && consigneeDO.getIsCustomerServiceConfirmed() ? consigneeDO.getCustomerService() : 0));
customerType = 2;
......
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