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
ffcf4d52
Commit
ffcf4d52
authored
May 29, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报价结果赢单时,再次判断业绩归属
parent
54164d5c
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
276 additions
and
139 deletions
+276
-139
OrderMapper.java
...coder/yudao/module/order/dal/mysql/order/OrderMapper.java
+8
-0
OrderService.java
...ocoder/yudao/module/order/service/order/OrderService.java
+7
-1
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+235
-122
TargetLogServiceImpl.java
.../module/order/service/targetLog/TargetLogServiceImpl.java
+11
-16
OfferServiceImpl.java
...udao/module/sale/service/offer/impl/OfferServiceImpl.java
+15
-0
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/mysql/order/OrderMapper.java
View file @
ffcf4d52
...
...
@@ -6017,4 +6017,12 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
@Param
(
"calVvalue"
)
BigDecimal
calVvalue
,
@Param
(
"yejiCreateDate"
)
Date
yejiCreateDate
);
/**
* 报价结果赢单时,同步业绩归属
* @param customerId
* @param salesmanId
* @param orderId
*/
@Update
(
"update ecw_order set customer_id=#{customerId},salesman_id=#{salesmanId} where order_id = #{orderId}"
)
void
updateOrderCustomerAndSalesmanId
(
@Param
(
"customerId"
)
Long
customerId
,
@Param
(
"salesmanId"
)
Long
salesmanId
,
@Param
(
"orderId"
)
Long
orderId
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/OrderService.java
View file @
ffcf4d52
...
...
@@ -259,7 +259,12 @@ public interface OrderService extends IService<OrderDO> {
*/
void
addOrderOtherFee
(
Long
orderId
,
List
<
FeeDto
>
feeDtoList
);
/**
*设置订单业绩归属
* @param orderDO
* @param offerId
*/
void
checkOrderSalesman
(
OrderDO
orderDO
,
Long
offerId
)
;
/**
* 更新订单提单号
*
...
...
@@ -370,4 +375,5 @@ public interface OrderService extends IService<OrderDO> {
yejiCreateDate
);
void
updateOrderCustomerAndSalesmanId
(
Long
customerId
,
Long
salesmanId
,
Long
orderId
);
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
ffcf4d52
This diff is collapsed.
Click to expand it.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogServiceImpl.java
View file @
ffcf4d52
...
...
@@ -172,14 +172,6 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
//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();
// }
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"
));
...
...
@@ -201,7 +193,7 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
customerId
=
consignorDO
.
getId
();
}
else
{
customerId
=
consignorDO
.
getId
()
;
customerId
=
orderConsigneeDO
.
getCustomerId
()
;
}
}
else
if
(
info
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
customerId
=
orderConsigneeDO
.
getCustomerId
()!=
null
?
orderConsigneeDO
.
getCustomerId
():
consigneeDO
.
getId
();
...
...
@@ -227,24 +219,27 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()==
3
&&
clearanceFee
==
1
)){
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
customerId
=
orderConsignorDO
.
getCustomerId
()
;
}
else
if
(!
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()==
3
&&
freight
==
2
)
||
(
info
.
getDrawee
()==
3
&&
clearanceFee
==
2
)){
//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
}
else
{
customerId
=
orderConsigneeDO
.
getCustomerId
()
;
}
// if(!consignorDO.getDefaultPay() && (info.getDrawee()==3 && freight==2 ) || (info.getDrawee()==3 && clearanceFee==2)){//层级5 第二、第三点 自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
// customerId = orderConsigneeDO.getCustomerId() ;
//
// }
}
}
else
{
//业绩归属公司
return
;
//业绩归属收货人
if
(
orderConsigneeDO
!=
null
){
customerId
=
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
():
0
;
}
}
}
}
// }
}
TargetLogDO
targetLogDO
=
new
TargetLogDO
();
targetLogDO
.
setOrderId
(
orderId
);
...
...
yudao-module-sale/yudao-module-sale-core/src/main/java/cn/iocoder/yudao/module/sale/service/offer/impl/OfferServiceImpl.java
View file @
ffcf4d52
...
...
@@ -893,6 +893,11 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
if
(
Objects
.
nonNull
(
offer
)){
throw
exception
(
ORDER_BOUND_OFFER
);
}
//如果订单关联上报价单
if
(
orderDO
!=
null
&&
offer
.
getOfferId
()!=
null
){
this
.
checkOrderSalesman
(
orderDO
,
offer
.
getOfferId
())
;
}
}
else
{
orderDO
=
this
.
generateOrder
(
offerDO
,
offerResultVO
);
if
(
Objects
.
isNull
(
orderDO
))
{
...
...
@@ -916,6 +921,16 @@ public class OfferServiceImpl extends AbstractService<OfferMapper, OfferDO> impl
return
offerDO
.
getOrderId
();
}
/**
* 赢单处理报价单时,再次判断业绩归属
* @param orderDO
* @param offerId
*/
private
void
checkOrderSalesman
(
OrderDO
orderDO
,
Long
offerId
)
{
orderService
.
checkOrderSalesman
(
orderDO
,
offerId
);
orderService
.
updateOrderCustomerAndSalesmanId
(
orderDO
.
getCustomerId
()!=
null
?
orderDO
.
getCustomerId
():
0
,
orderDO
.
getSalesmanId
()!=
null
?
orderDO
.
getSalesmanId
():
0
,
orderDO
.
getOrderId
())
;
}
private
OrderDO
generateOrder
(
OfferDO
offerDO
,
OfferResultVO
offerResultVO
)
{
OfferTransportDO
offerTransportDO
=
offerTransportMapper
.
selectOne
(
new
LambdaQueryWrapper
<
OfferTransportDO
>().
eq
(
OfferTransportDO:
:
getOfferId
,
offerDO
.
getOfferId
()).
last
(
"limit 1"
));
List
<
OfferProdDO
>
prodDOList
=
offerProdMapper
.
selectList
(
new
LambdaQueryWrapper
<
OfferProdDO
>().
eq
(
OfferProdDO:
:
getOfferId
,
offerDO
.
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