Commit b1816ed2 authored by liuzeheng's avatar liuzeheng

调整

parent 4c59cb25
......@@ -632,38 +632,22 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// customerType = 2;
// order.setCustomerId(orderConsigneeDO.getCustomerId());
// }
if (order.getDrawee() == 1) {//发货人付款
if (order.getDrawee() == 1 && createReqVO.getOfferId()!=null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService()!=null?consignorCustomerDO.getCustomerService():0);
}else if(order.getDrawee() == 1 && consignorCustomerDO.getDefaultPay() ){// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService());
}else{
order.setCustomerId(0L);
order.setSalesmanId(0L);
}
} else if (order.getDrawee() == 2 ) {//收货人付款 层级5 第一个
if(orderConsigneeDO!=null){
order.setCustomerId(orderConsigneeDO.getCustomerId());
// 补充业绩规则判断
if (!consignorCustomerDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
}
if (createReqVO.getOfferId() != null && order.getDrawee() == 1) {
//订单关联报价单 && 发货人付款
order.setCustomerId(orderConsignorDO.getCustomerId());
}
if (createReqVO.getOfferId() != null && order.getDrawee() == 3) {
//订单关联报价单 && 自定义付款
if(!consignorCustomerDO.getNoConsignee() && !order.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else{
if (order.getDrawee() == 1) {//发货人付款
if (order.getDrawee() == 1 && createReqVO.getOfferId() != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else if(order.getDrawee() == 1 && consignorCustomerDO.getDefaultPay() ){// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else{
order.setCustomerId(0L) ;//没有归属人,归公司业绩
order.setSalesmanId(0L);
}
} else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个
order.setCustomerId(orderConsigneeDO.getCustomerId()) ;
} else if (order.getDrawee() == 3) { //自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
......@@ -675,30 +659,15 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
int clearanceFee = clearanceFeeList.get(0).getValue();//清关费
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService());
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService());
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else if(consignorCustomerDO.getDefaultPay() && ( order.getDrawee()==3 && freight==1 )){ //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService());
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else if (consignorCustomerDO.getDefaultPay() && ( order.getDrawee()==3 && clearanceFee==1 )){// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
order.setSalesmanId(consignorCustomerDO.getCustomerService());
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else if(!consignorCustomerDO.getDefaultPay() && (order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
if(orderConsignorDO!=null){
order.setCustomerId(orderConsigneeDO.getCustomerId());
}else{
order.setSalesmanId(0L);
}
}
......@@ -708,13 +677,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else {
//业绩归属公司
order.setSalesmanId(0L);
}
//end
}
}//end
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(order.getStatus()) && Objects.nonNull(order.getCustomerId()) && order.getCustomerId() > 0) {
//addOrderCustomerService(order, customerType);
......@@ -950,7 +915,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}else if(order.getDrawee() == 1 && consignorDO.getDefaultPay() ){// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}else{
order.setCustomerId(0L) ;
order.setCustomerId(0L) ;//没有归属人,归公司业绩
order.setSalesmanId(0L);
}
} else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个
......@@ -985,8 +950,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
//业绩归属公司
order.setSalesmanId(0L);
}
//end
}
}//end
//}
}
......@@ -3400,11 +3365,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus()) && Objects.nonNull(updateObj.getCustomerId()) && updateObj.getCustomerId() > 0) {
......
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