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
234b45b7
Commit
234b45b7
authored
Dec 17, 2024
by
Smile
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建订单,订单的发货人或收货人,无归属客户经理/无在途的待接收流程(包括分配、移交),客户自动迁移到待分配客户列表
parent
4b3fe376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
6 deletions
+37
-6
OrderServiceImpl.java
...dao/module/order/service/order/impl/OrderServiceImpl.java
+37
-6
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderServiceImpl.java
View file @
234b45b7
...
...
@@ -27,6 +27,7 @@ import cn.iocoder.yudao.module.bpm.resp.TaskResp;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerOperateLog.CustomerOperateLogDO
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper
;
import
cn.iocoder.yudao.module.customer.service.customer.CustomerService
;
import
cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService
;
import
cn.iocoder.yudao.module.customer.service.customerCreditLog.CustomerCreditLogService
;
...
...
@@ -197,7 +198,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
private
final
UnitApi
unitApi
;
private
final
OrderOperateLogService
orderOperateLogService
;
private
TargetLogMapper
targetLogMapper
;
private
final
CustomerMapper
customerMapper
;
/*
后台创建订单 memberUserDO 信息为空
...
...
@@ -721,7 +722,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
int
customerType
=
this
.
checkOrderSalesman
(
order
,
createReqVO
.
getOfferId
(),
null
,
null
,
orderConsignorDO
,
orderConsigneeDO
);
// 更新所属客户经理(业务员)
if
(!
DRAFT
.
getValue
().
equals
(
order
.
getStatus
())
&&
Objects
.
nonNull
(
order
.
getIsChargeCustomer
())
&&
order
.
getIsChargeCustomer
())
{
addOrderCustomerService
(
order
,
customerType
);
addOrderCustomerService
(
order
,
orderConsignorDO
,
customerType
);
}
}
...
...
@@ -982,7 +983,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO
);
// 更新所属客户经理(业务员)
if
(!
DRAFT
.
getValue
().
equals
(
order
.
getStatus
())
&&
Objects
.
nonNull
(
order
.
getIsChargeCustomer
())
&&
order
.
getIsChargeCustomer
())
{
addOrderCustomerService
(
order
,
customerType
);
addOrderCustomerService
(
order
,
orderConsignorDO
,
customerType
);
}
}
}
...
...
@@ -1092,7 +1093,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
return
customerType
;
}
private
void
addOrderCustomerService
(
OrderDO
order
,
private
void
addOrderCustomerService
(
OrderDO
order
,
OrderConsignorDO
orderConsignorDO
,
int
customerType
)
{
if
(
Objects
.
nonNull
(
order
.
getParentOrderId
())
&&
...
...
@@ -1174,6 +1175,36 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order
.
setSalesmanId
(
0L
);
order
.
setDeptId
(
0L
);
log
.
info
(
"订单下单,业绩为收货人,不产生未分配客户经理异常 orderNo={}"
,
order
.
getOrderNo
());
// 当后台创建订单,订单的发货人或收货人,无归属客户经理/无在途的待接收流程(包括分配、移交),客户自动迁移到待分配客户列表
if
(
order
.
getUserId
()!=
null
){
if
(
customerDO
.
getIsInOpenSea
()){
customerDO
.
setIsInOpenSea
(
false
);
customerDO
.
setCustomerService
(
null
);
customerDO
.
setIsCustomerServiceConfirmed
(
false
);
customerMapper
.
updateById
(
customerDO
);
}
Long
customerId
=
orderConsignorDO
.
getCustomerId
();
if
(
customerId
!=
null
){
CustomerDO
orderConsignorCustomerDO
=
customerMapper
.
selectById
(
customerId
);
if
(
orderConsignorCustomerDO
.
getIsInOpenSea
()){
orderConsignorCustomerDO
.
setIsInOpenSea
(
false
);
orderConsignorCustomerDO
.
setCustomerService
(
null
);
orderConsignorCustomerDO
.
setIsCustomerServiceConfirmed
(
false
);
customerMapper
.
updateById
(
orderConsignorCustomerDO
);
}
}
}
else
{
Long
customerId
=
orderConsignorDO
.
getCustomerId
();
if
(
customerId
!=
null
)
{
CustomerDO
orderConsignorCustomerDO
=
customerMapper
.
selectById
(
customerId
);
if
(
orderConsignorCustomerDO
.
getIsInOpenSea
())
{
orderConsignorCustomerDO
.
setIsInOpenSea
(
false
);
orderConsignorCustomerDO
.
setCustomerService
(
null
);
orderConsignorCustomerDO
.
setIsCustomerServiceConfirmed
(
false
);
customerMapper
.
updateById
(
orderConsignorCustomerDO
);
}
}
}
}
else
{
// 该订单存在该客户未分配客户经理异常,或者该客户的客户经理待接收,
// 则不再生成未分配客户经理异常,且该订单不产生业绩归属
...
...
@@ -3343,7 +3374,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if
(!
DRAFT
.
getValue
().
equals
(
updateObj
.
getStatus
())
&&
((
Objects
.
nonNull
(
updateObj
.
getIsChargeCustomer
())
&&
updateObj
.
getIsChargeCustomer
())
||
(
Objects
.
nonNull
(
updateObj
.
getIsChargeDraft
())
&&
updateObj
.
getIsChargeDraft
())))
{
addOrderCustomerService
(
updateObj
,
customerType
);
addOrderCustomerService
(
updateObj
,
orderConsignorDO
,
customerType
);
}
}
}
...
...
@@ -3611,7 +3642,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if
(!
DRAFT
.
getValue
().
equals
(
updateObj
.
getStatus
())
&&
((
Objects
.
nonNull
(
updateObj
.
getIsChargeCustomer
())
&&
updateObj
.
getIsChargeCustomer
())
||
(
Objects
.
nonNull
(
updateObj
.
getIsChargeDraft
())
&&
updateObj
.
getIsChargeDraft
())))
{
addOrderCustomerService
(
updateObj
,
customerType
);
addOrderCustomerService
(
updateObj
,
orderConsignorDO
,
customerType
);
}
}
}
...
...
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