Commit 00d1abe9 authored by liuzeheng's avatar liuzeheng

判空

parent f0c3f018
...@@ -166,19 +166,21 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -166,19 +166,21 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
OrderBackInfoDto info = orderQueryService.info(orderId); OrderBackInfoDto info = orderQueryService.info(orderId);
if (info != null && info.getSalesmanId()!=null && info.getSalesmanId()>0L) {//客户经理 if (info != null && info.getSalesmanId()!=null && info.getSalesmanId()>0L) {//客户经理
Long customerId = 0L; Long customerId = 0L;
CustomerDO consignorDO = customerService.getCustomer(info.getConsignorVO().getCustomerId());
CustomerDO consigneeDO = customerService.getCustomer(info.getConsigneeVO().getCustomerId());//收货人
if (info.getType().contains("2")) {//海外仓归属发货人 if (info.getType().contains("2")) {//海外仓归属发货人
customerId = info.getConsignorVO().getCustomerId(); //customerId = info.getConsignorVO().getCustomerId(); //二期需求修改
customerId = consignorDO.getId();
} else { } else {
if (info.getIsCargoControl()) {//非海外控货归属发货人 // if (info.getIsCargoControl()) {//非海外控货归属发货人
customerId = info.getConsignorVO().getCustomerId(); // customerId = info.getConsignorVO().getCustomerId();
} else { // } else {
// if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人 // if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人
// customerId = info.getConsignorVO().getCustomerId(); // customerId = info.getConsignorVO().getCustomerId();
// } else { //非海外非控货 付款人为其他 归属收货人 // } else { //非海外非控货 付款人为其他 归属收货人
// customerId = info.getConsigneeVO().getCustomerId(); // customerId = info.getConsigneeVO().getCustomerId();
// } // }
CustomerDO consignorDO = customerService.getCustomer(info.getConsignorVO().getCustomerId());
CustomerDO consigneeDO = customerService.getCustomer(info.getConsigneeVO().getCustomerId());//收货人
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, info.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1")); OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, info.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
OrderConsignorDO orderConsignorDO = orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, info.getOrderId()).orderByDesc(OrderConsignorDO::getId).last("limit 1")); OrderConsignorDO orderConsignorDO = orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, info.getOrderId()).orderByDesc(OrderConsignorDO::getId).last("limit 1"));
if(consignorDO !=null && ! consignorDO.getNoConsignee() && !info.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2 if(consignorDO !=null && ! consignorDO.getNoConsignee() && !info.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
...@@ -191,12 +193,14 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -191,12 +193,14 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
if (info.getDrawee() == 1) {//发货人付款 if (info.getDrawee() == 1) {//发货人付款
if (info.getDrawee() == 1 && CollectionUtil.isNotEmpty(offerBackVOList)) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个 if (info.getDrawee() == 1 && CollectionUtil.isNotEmpty(offerBackVOList)) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
customerId =orderConsignorDO.getCustomerId(); customerId = consignorDO.getId();
}else if(info.getDrawee() == 1 && consignorDO.getDefaultPay() ){// 如果是发货人付款且档案设置默认付运费 --层级4 第一个 }else if(info.getDrawee() == 1 && consignorDO.getDefaultPay() ){// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
customerId =orderConsignorDO.getCustomerId() ; customerId = consignorDO.getId();
}else{
customerId = consignorDO.getId();
} }
} else if (info.getDrawee() == 2) {//收货人付款 层级5 第一个 } else if (info.getDrawee() == 2 && CollectionUtil.isEmpty(offerBackVOList) && !consignorDO.getDefaultPay()) {//收货人付款 层级5 第一个
customerId = orderConsigneeDO.getCustomerId()!=null? orderConsigneeDO.getCustomerId():consigneeDO.getId(); customerId = orderConsigneeDO.getCustomerId()!=null? orderConsigneeDO.getCustomerId():consigneeDO.getId();
} else if (info.getDrawee() == 3) { //自定义付款 } else if (info.getDrawee() == 3) { //自定义付款
...@@ -229,10 +233,10 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -229,10 +233,10 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
} else { } else {
//业绩归属公司 //业绩归属公司
customerId = info.getConsigneeVO().getCustomerId(); return;
} }
} // }
} }
TargetLogDO targetLogDO = new TargetLogDO(); TargetLogDO targetLogDO = new TargetLogDO();
targetLogDO.setOrderId(orderId); targetLogDO.setOrderId(orderId);
......
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