Commit 675de447 authored by liuzeheng's avatar liuzeheng

Merge branch 'master' into dev

# Conflicts:
#	yudao-module-customer/yudao-module-customer-rest/src/main/java/cn/iocoder/yudao/module/customer/controller/admin/customer/CustomerController.java
#	yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/listener/CalculateOrderVValueListener.java
#	yudao-module-delivery/yudao-module-delivery-rest/src/main/java/cn/iocoder/yudao/module/delivery/listener/CalculateOrderYeJiTypeListener.java
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderWarehouseIn/OrderWarehouseInServiceImpl.java
parents 4529299b 9cbc7658
......@@ -1360,7 +1360,6 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
@Override
public PageResult<CustomerDO> getWaitToConfirmCustomerPage(CustomerPageReqVO pageReqVO) {
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(pageReqVO);
LambdaQueryWrapper<CustomerDO> customerDOLambdaQueryWrapperX = new LambdaQueryWrapperX<CustomerDO>()
......
......@@ -365,10 +365,11 @@ public class CustomerController {
@ApiOperation("获得待接收列表")
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getWaitConfirmList(@Valid CustomerPageReqVO customerPageReqVO) {
//lanbm 2024-05-26 添加注释
customerPageReqVO.setCustomerService(WebFrameworkUtils.getLoginUserId());
PageResult<CustomerDO> pageResult = customerService.getWaitToConfirmCustomerPage(customerPageReqVO);
PageResult<CustomerDO> pageResult =
customerService.getWaitToConfirmCustomerPage(customerPageReqVO);
return success(CustomerConvert.INSTANCE.convertPage(pageResult));
}
......@@ -398,9 +399,10 @@ public class CustomerController {
@GetMapping("/get-wait-for-distribution")
@ApiOperation("获得待分配客户列表")
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getWaitForDistributionList(@Valid CustomerPageReqDTO customerPageReqVO,PageVO page) {
PageResult<CustomerDO> pageResult = customerService.getWaitToAssignedCustomerPageReq(customerPageReqVO,page);
public CommonResult<PageResult<CustomerRespVO>> getWaitForDistributionList(@Valid CustomerPageReqVO customerPageReqVO) {
//lanbm 2024-05-26 添加注释
PageResult<CustomerDO> pageResult =
customerService.getWaitToAssignedCustomerPage(customerPageReqVO);
return success(CustomerConvert.INSTANCE.convertPage(pageResult));
}
......
......@@ -24,7 +24,7 @@ import static cn.iocoder.yudao.module.delivery.enums.ErrorCodeConstants.VCONFIG_
/*
计算订单V值计算 海运已装柜,空运已入仓 计算V值
lanbm 2024-05-13 add
lanbm 2024-05-26 update
*/
@Component("CalculateOrderVValueListener")
@AllArgsConstructor
......@@ -65,7 +65,7 @@ public class CalculateOrderVValueListener {
EcwVz temp = null;
BigDecimal CalVvalue = new BigDecimal(0);
if (orderDO.getTransportId() == 1) {
//海运计算V值
//海运计算V值 修改查询条件
temp = ecwVzService.getOne(new LambdaQueryWrapperX<EcwVz>()
.eqIfPresent(EcwVz::getFuhao, "M3"));
if (temp == null) {
......@@ -78,7 +78,7 @@ public class CalculateOrderVValueListener {
CalVvalue = new BigDecimal(temp.getVz()).divide(orderDO.getSumVolume());
}
} else if (orderDO.getTransportId() == 3) {
//空运计算V值
//空运计算V值,修改查询条件
temp = ecwVzService.getOne(new LambdaQueryWrapperX<EcwVz>()
.eqIfPresent(EcwVz::getFuhao, "KG"));
if (temp == null) {
......
......@@ -44,33 +44,37 @@ public class CalculateOrderYeJiTypeListener {
public void CalculateOrderYeJiTypePushEvent(
CalculateOrderYeJiTypeEvent event) {
zTest m=new zTest();
String sMsg="计算业绩类型"+event.getCustomerId();
zTest m = new zTest();
String sMsg = "计算业绩类型" + event.getCustomerId();
OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) {
throw exception(ORDER_NOT_EXISTS);
}
//获取订单中计算号的业绩归属客户ID
event.setCustomerId(orderDO.getCustomerId());
CustomerDO customerDO = customerService.getById(event.getCustomerId());
if (customerDO == null) {
//throw exception(CUSTOMER_NOT_EXISTS);
sMsg+=",客户不存在先不计算业绩类型";
//lanbm 2024-05-27 添加的逻辑细化
orderService.UpdateOrderYeJiType(event.getOrderId(), 0);
sMsg += ",客户不存,订单业绩属于公司,订单算老业绩";
m.setTestname(sMsg);
m.setCreatedate(new Date());
zTestService.save(m);
return;
}
int isNew = 0;
if (customerDO.getIsNew() == true) {
isNew = 1;//新客户业绩类型
sMsg+=",新业绩";
}
else {
sMsg += ",新业绩";
} else {
isNew = 0;//老客户业绩类型
sMsg+=",老业绩";
sMsg += ",老业绩";
}
orderService.UpdateOrderYeJiType(event.getOrderId(), isNew);
......
......@@ -1358,10 +1358,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
//入仓完成,计算V值 lanbm 2024-05-13 add
CalculateOrderVValueEvent event = new CalculateOrderVValueEvent();
/*27号注释掉
CalculateOrderVValueEvent event=new CalculateOrderVValueEvent();
event.setOrderId(orderId);
applicationContext.publishEvent(event);
//end 入仓完成,计算V值 lanbm 2024-05-13 add
*/
// end 入仓完成,计算V值 lanbm 2024-05-13 add
// 返回是否包含异常
return exceptionNum > 0;
......
......@@ -166,37 +166,44 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
OrderBackInfoDto info = orderQueryService.info(orderId);
if (info != null && info.getSalesmanId()!=null && info.getSalesmanId()>0L) {//客户经理
Long customerId = 0L;
CustomerDO consignorDO = customerService.getCustomer(info.getConsignorVO().getCustomerId());
CustomerDO consigneeDO = customerService.getCustomer(info.getConsigneeVO().getCustomerId());//收货人
if (info.getType().contains("2")) {//海外仓归属发货人
customerId = info.getConsignorVO().getCustomerId();
} else {
if (info.getIsCargoControl()) {//非海外控货归属发货人
customerId = info.getConsignorVO().getCustomerId();
//customerId = info.getConsignorVO().getCustomerId(); //二期需求修改
customerId = consignorDO.getId();
} else {
// if (info.getIsCargoControl()) {//非海外控货归属发货人
// customerId = info.getConsignorVO().getCustomerId();
// } else {
// if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人
// customerId = info.getConsignorVO().getCustomerId();
// } else { //非海外非控货 付款人为其他 归属收货人
// 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"));
OrderConsignorDO orderConsignorDO = orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, info.getOrderId()).orderByDesc(OrderConsignorDO::getId).last("limit 1"));
if(info.getIsCargoControl()){
customerId = info.getConsignorVO().getCustomerId();
}else {
if(consignorDO !=null && ! consignorDO.getNoConsignee() && !info.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if(consignorDO!=null){
customerId = consignorDO.getId();
}
}
}else{
List<TargetOfferBackVO> offerBackVOList =targetLogMapper.getTargetOfferBackByOrerId(orderId) ;
if (info.getDrawee() == 1) {//发货人付款
if (info.getDrawee() == 1 && CollectionUtil.isNotEmpty(offerBackVOList)) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
customerId =orderConsignorDO.getCustomerId();
customerId = consignorDO.getId();
}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 ) {//收货人付款 层级5 第一个
customerId = orderConsigneeDO.getCustomerId()!=null? orderConsigneeDO.getCustomerId():consigneeDO.getId();
} else if (info.getDrawee() == 3) { //自定义付款
......@@ -229,11 +236,16 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
} else {
//业绩归属公司
customerId = info.getConsigneeVO().getCustomerId();
return;
}
}
}
// }
}
TargetLogDO targetLogDO = new TargetLogDO();
targetLogDO.setOrderId(orderId);
targetLogDO.setCustomerId(customerId);
......
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