Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
4d740683
Commit
4d740683
authored
Aug 02, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手动重置订单业绩归属的业务完善
parent
140dacde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
13 deletions
+60
-13
OrderAssociationOfferInfoEvent.java
...ork/apollo/core/event/OrderAssociationOfferInfoEvent.java
+28
-0
OrderBusinessServiceImpl.java
...le/order/service/order/impl/OrderBusinessServiceImpl.java
+16
-13
OrderAssociationOfferListener.java
...o/module/sale/listener/OrderAssociationOfferListener.java
+16
-0
No files found.
yudao-framework/yudao-spring-boot-starter-config/src/main/java/cn/iocoder/yudao/framework/apollo/core/event/OrderAssociationOfferInfoEvent.java
0 → 100644
View file @
4d740683
package
cn
.
iocoder
.
yudao
.
framework
.
apollo
.
core
.
event
;
import
cn.iocoder.yudao.framework.common.validation.Marks
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@Data
@AllArgsConstructor
public
class
OrderAssociationOfferInfoEvent
{
/**
* 订单ID
*/
private
Long
orderId
;
@ApiModelProperty
(
value
=
"主键ID"
,
required
=
true
)
private
Long
offerId
;
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
View file @
4d740683
...
...
@@ -2012,7 +2012,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
checkOrderSalesman
(
orderDO
,
null
,
consignorDO
,
consigneeDO
,
orderConsignorDO
,
orderConsigneeDO
);
OrderAssociationOfferInfoEvent
event
=
new
OrderAssociationOfferInfoEvent
(
orderDO
.
getOrderId
(),
null
);
applicationContext
.
publishEvent
(
event
);
checkOrderSalesman
(
orderDO
,
event
.
getOfferId
(),
consignorDO
,
consigneeDO
,
orderConsignorDO
,
orderConsigneeDO
);
// if (!Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
// if (StringUtils.isNotBlank(orderDO.getType()) && orderDO.getType().contains("2")) {
...
...
@@ -2120,6 +2122,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
orderMapper
.
updateById
(
orderDO
);
}
public
int
checkOrderSalesman
(
OrderDO
order
,
Long
offerId
,
CustomerDO
consignorDO
,
CustomerDO
consigneeDO
,
OrderConsignorDO
orderConsignorDO
,
OrderConsigneeDO
orderConsigneeDO
)
{
int
customerType
=
1
;
//1-业绩归属发货人,2-业绩归属收货人
if
(
Objects
.
isNull
(
orderConsigneeDO
))
{
//订单收货人
...
...
@@ -2144,30 +2147,30 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
if
(
consignorDO
!=
null
&&
!
consignorDO
.
getNoConsignee
()
&&
!
order
.
getHasConsignee
())
{
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
if
(
order
.
getDrawee
()
==
1
)
{
//发货人付款
if
(
order
.
getDrawee
()
==
1
&&
offerId
!=
null
)
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
order
.
getDrawee
()
==
1
&&
consignorDO
.
getDefaultPay
())
{
// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
}
}
else
if
(
order
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
...
...
@@ -2175,7 +2178,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
}
else
{
//没有收货人
order
.
setCustomerId
(
0L
);
...
...
@@ -2194,29 +2197,29 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
offerId
!=
null
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
order
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order
.
setCustomerId
(
orderConsignorDO
.
getCustomerId
());
order
.
setIsInOpenSea
(
consignorDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consignorDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
consignorDO
.
getIsInOpenSea
()
?
0L
:
(
consignorDO
.
getCustomerService
()
!=
null
&&
consignorDO
.
getIsCustomerServiceConfirmed
()
?
consignorDO
.
getCustomerService
()
:
0
));
}
else
{
//去掉层级5、6 ,以上不符合的都归收货人
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
}
}
...
...
@@ -2225,7 +2228,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
order
.
setCustomerId
(
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
);
order
.
setIsInOpenSea
(
consigneeDO
.
getIsInOpenSea
());
order
.
setYejiType
(
consigneeDO
.
getIsNew
()
?
1
:
0
);
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
order
.
setSalesmanId
(
Objects
.
nonNull
(
consigneeDO
.
getIsInOpenSea
())
&&
consigneeDO
.
getIsInOpenSea
()
?
0L
:
(
consigneeDO
.
getCustomerService
()
!=
null
&&
consigneeDO
.
getIsCustomerServiceConfirmed
()
?
consigneeDO
.
getCustomerService
()
:
0
));
customerType
=
2
;
}
}
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/listener/OrderAssociationOfferListener.java
View file @
4d740683
...
...
@@ -3,11 +3,14 @@ package cn.iocoder.yudao.module.sale.listener;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.OrderAssociationOfferCostEvent
;
import
cn.iocoder.yudao.framework.apollo.core.event.OrderAssociationOfferInfoEvent
;
import
cn.iocoder.yudao.module.product.dto.FeeDto
;
import
cn.iocoder.yudao.module.product.enums.FeeTypeEnum
;
import
cn.iocoder.yudao.module.sale.service.offer.OfferService
;
import
cn.iocoder.yudao.module.sale.vo.offer.EstCostVO
;
import
cn.iocoder.yudao.module.sale.vo.offer.OfferRespVO
;
import
lombok.AllArgsConstructor
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.context.event.EventListener
;
import
org.springframework.stereotype.Component
;
...
...
@@ -53,4 +56,17 @@ public class OrderAssociationOfferListener {
}
}
}
/**
* 根据订单id查询关联报价单信息
*
* @param event 参数与返回值
*/
@EventListener
(
OrderAssociationOfferInfoEvent
.
class
)
public
void
selectOfferInfoByOrderId
(
OrderAssociationOfferInfoEvent
event
)
{
OfferRespVO
offerRespVO
=
offerService
.
getOfferByOrderId
(
event
.
getOrderId
());
if
(
Objects
.
nonNull
(
offerRespVO
))
{
event
.
setOfferId
(
offerRespVO
.
getOfferId
());
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment