Commit 16545a54 authored by liuzeheng's avatar liuzeheng

补充业绩规则

parent 892a2673
......@@ -612,41 +612,51 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if(createReqVO.getOfferId()!=null && order.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}
if(consignorCustomerDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
if(consignorCustomerDO.getDefaultPay() && (order.getDrawee()==2 || order.getDrawee()==3)){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}
if(order.getDrawee()==2 || order.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(order.getDrawee()==2){//订单收货人付款,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(order.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
......@@ -887,28 +897,34 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if(createReqVO.getOfferId()!=null && order.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}
if(consignorDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
if(consignorDO.getDefaultPay() && (order.getDrawee()==2 || order.getDrawee()==3) ){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}else if(!consignorDO.getDefaultPay() && order.getDrawee()==1 && createReqVO.getOfferId()!=null){//发货人没有设置默认付款且发货人付款且没有关联报价单 -- 层级6
//业绩归属公司
order.setCustomerId(0L) ;
......@@ -919,13 +935,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(order.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
......@@ -3176,41 +3195,50 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if(updateReqVO.getOfferId()!=null && updateObj.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}
if(consignorDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
if(consignorDO.getDefaultPay() && (updateObj.getDrawee()==2 || updateObj.getDrawee()==3)){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateObj.getDrawee()==1 || ( updateObj.getDrawee()==3 && freight==1 ) || ( updateObj.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateObj.getDrawee()==1 || ( updateObj.getDrawee()==3 && freight==1 ) || ( updateObj.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
}
if(updateObj.getDrawee()==2 || updateObj.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(updateObj.getDrawee()==2){//订单收货人付款,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(updateObj.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((updateObj.getDrawee()==3 && freight==2 ) || (updateObj.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
if(CollectionUtil.isNotEmpty(list)){
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((updateObj.getDrawee()==3 && freight==2 ) || (updateObj.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
......
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