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
c4f717ee
Commit
c4f717ee
authored
Jul 04, 2024
by
lanbaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-07-04-5提交
parent
b5acb1a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
488 additions
and
235 deletions
+488
-235
TargetLogDO.java
...ao/module/order/dal/dataobject/targetLog/TargetLogDO.java
+4
-0
TargetLogServiceImpl.java
.../module/order/service/targetLog/TargetLogServiceImpl.java
+484
-234
TargetLogJob.java
...java/cn/iocoder/yudao/module/order/task/TargetLogJob.java
+0
-1
No files found.
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/dal/dataobject/targetLog/TargetLogDO.java
View file @
c4f717ee
...
...
@@ -76,4 +76,8 @@ public class TargetLogDO extends BaseDO {
归属方,发货还是收货方
*/
private
String
gsf
;
/*
归属类型
*/
private
int
gstype
;
}
yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/targetLog/TargetLogServiceImpl.java
View file @
c4f717ee
...
...
@@ -335,30 +335,33 @@ public class TargetLogServiceImpl extends
public
void
dealTargetLogTask
(
Long
orderId
,
Date
achievementTime
,
long
targetId
)
{
try
{
long
selectCount
=
targetLogMapper
.
selectCount
(
TargetLogDO:
:
getOrderId
,
orderId
);
if
(
selectCount
==
0L
)
{
return
;
}
//获取订单信息
OrderBackInfoDto
info
=
orderQueryService
.
info
(
orderId
);
if
(
info
==
null
)
{
return
;
}
if
(
info
.
getSalesmanId
()
==
null
)
{
return
;
}
if
(
info
.
getSalesmanId
()
==
0
l
)
{
return
;
}
long
selectCount
=
targetLogMapper
.
selectCount
(
TargetLogDO:
:
getOrderId
,
orderId
);
if
(
selectCount
==
0L
)
{
return
;
}
//获取订单信息
OrderBackInfoDto
info
=
orderQueryService
.
info
(
orderId
);
if
(
info
==
null
)
{
return
;
}
if
(
info
.
getSalesmanId
()
==
null
)
{
return
;
}
if
(
info
.
getSalesmanId
()
==
0
l
)
{
return
;
}
try
{
//客户经理
Long
customerId
=
0L
;
Long
saleManid
=
info
.
getSalesmanId
();
int
loglev
=
0
;
String
s_gsf
=
"n"
;
int
n_gstype
=
0
;
CustomerDO
consignorDO
=
customerService
.
getCustomer
(
info
.
getConsignorVO
().
getCustomerId
());
...
...
@@ -374,260 +377,507 @@ public class TargetLogServiceImpl extends
//二期需求修改
customerId
=
consignorDO
.
getId
();
loglev
=
1
;
s_gsf
=
"f"
;
s_gsf
=
"归发货客户"
;
n_gstype
=
1
;
//客户的客户经理为空,就把业绩归属设为0
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
consignorDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
11
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
if
(
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
11
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
else
{
OrderConsigneeDO
orderConsigneeDO
=
orderConsigneeService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsigneeDO
>().
eq
(
OrderConsigneeDO:
:
getOrderId
,
info
.
getOrderId
()).
orderByDesc
(
OrderConsigneeDO:
:
getId
).
last
(
"limit 1"
));
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
(
consignorDO
!=
null
&&
!
consignorDO
.
getNoConsignee
()
&&
!
info
.
getHasConsignee
())
{
//getHasConsignee 是否有收货人
//控货无收货人,1-是,0-否
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
customerId
=
consignorDO
.
getId
();
loglev
=
2
;
n_gstype
=
1
;
s_gsf
=
"归发货客户"
;
OrderConsignorDO
orderConsignorDO
=
orderConsignorService
.
getOne
(
new
LambdaQueryWrapper
<
OrderConsignorDO
>().
eq
(
OrderConsignorDO:
:
getOrderId
,
info
.
getOrderId
()).
orderByDesc
(
OrderConsignorDO:
:
getId
).
last
(
"limit 1"
));
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
21
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
if
(
consignorDO
!=
null
&&
!
consignorDO
.
getNoConsignee
()
&&
!
info
.
getHasConsignee
())
{
//getHasConsignee 是否有收货人
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if
(
consignorDO
!=
null
)
{
if
(
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
21
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
List
<
TargetOfferBackVO
>
offerBackVOList
=
targetLogMapper
.
getTargetOfferBackByOrerId
(
orderId
);
if
(
info
.
getDrawee
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
))
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
customerId
=
consignorDO
.
getId
();
loglev
=
3
;
n_gstype
=
1
;
s_gsf
=
"发货人付运费,有报价单,归发货客户"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
if
(
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
{
if
(
consignorDO
.
getDefaultPay
())
{
//如果是发货人付款且档案设置默认付运费 --层级4 第一个
customerId
=
consignorDO
.
getId
();
loglev
=
2
;
s_gsf
=
"f"
;
loglev
=
4
;
n_gstype
=
1
;
s_gsf
=
"发货人付运费,无报价单,默认付运费,归发货客户"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
consignorDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
21
;
loglev
=
41
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
}
}
else
{
List
<
TargetOfferBackVO
>
offerBackVOList
=
targetLogMapper
.
getTargetOfferBackByOrerId
(
orderId
);
if
(
info
.
getDrawee
()
==
1
)
{
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
))
{
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
customerId
=
consignorDO
.
getId
();
loglev
=
3
;
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
}
}
else
{
if
(
consignorDO
.
getDefaultPay
())
{
//如果是发货人付款且档案设置默认付运费 --层级4 第一个
customerId
=
consignorDO
.
getId
();
loglev
=
4
;
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
41
;
}
}
else
{
//业绩归属方是收货人
loglev
=
5
;
customerId
=
orderConsigneeDO
.
getCustomerId
();
s_gsf
=
"s"
;
//校验客户的客户经理
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
||
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
51
;
}
}
if
(
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
41
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
if
(
info
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
customerId
=
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
consigneeDO
.
getId
();
}
else
{
//业绩归属方是收货人
loglev
=
5
;
s_gsf
=
"s"
;
if
(
consigneeDO
!=
null
&&
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
))
{
//收货人客户经理为空时不算业绩
//客户来源是发货人推荐,不保留业绩记录 customer_source
//2024-06-03 添加的逻辑
if
(
consigneeDO
.
getSource
()
==
12
)
{
//删除业绩记录
targetLogMapper
.
deleteById
(
targetId
);
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
return
;
}
customerId
=
orderConsigneeDO
.
getCustomerId
();
n_gstype
=
2
;
s_gsf
=
"发货人付运费,无报价单,不默认付运费,归收货客户"
;
//校验客户的客户经理
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
51
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
}
else
if
(
info
.
getDrawee
()
==
3
)
{
//自定义付款
List
<
CustomDraweeVO
>
list
=
JSONObject
.
parseArray
(
info
.
getCustomDrawee
(),
CustomDraweeVO
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
if
(
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
51
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
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
();
//清关费
}
else
if
(
info
.
getDrawee
()
==
2
)
{
//收货人付款 层级5 第一个
customerId
=
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
consigneeDO
.
getId
();
loglev
=
5
;
n_gstype
=
2
;
s_gsf
=
"收货人付运费,归收货客户"
;
if
(
consigneeDO
==
null
)
{
s_gsf
+=
",收货客户为空。"
;
customerId
=
0L
;
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
}
}
else
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
32
;
}
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
)
{
//收货人客户经理为空时不算业绩
//客户来源是发货人推荐,不保留业绩记录 customer_source
//2024-06-03 添加的逻辑
s_gsf
+=
",收货人客户经理为空,不算奖金。"
;
customerId
=
0L
;
//删除业绩记录
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
33
;
}
if
(
consigneeDO
.
getSource
()
==
12
)
{
s_gsf
+=
",发货人带来的收货人,归收货人客户经理。"
;
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
loglev
=
4
;
customerId
=
orderConsignorDO
.
getCustomerId
();
s_gsf
=
"f"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
1
;
}
}
else
if
(
info
.
getDrawee
()
==
3
)
{
//自定义付款
List
<
CustomDraweeVO
>
list
=
JSONObject
.
parseArray
(
info
.
getCustomDrawee
(),
CustomDraweeVO
.
class
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
s_gsf
=
"自定义付款,付款人不为空"
;
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
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
s_gsf
+=
"有报价单,发货人付运费,归发货客户"
;
n_gstype
=
1
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
s_gsf
+=
",客户经理为空,不算奖金。"
;
}
}
else
{
customerId
=
orderConsigneeDO
.
getCustomerId
();
loglev
=
5
;
s_gsf
=
"s"
;
//校验客户的客户经理
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
||
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
51
;
}
}
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
31
;
s_gsf
+=
",客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
if
(
CollectionUtil
.
isNotEmpty
(
offerBackVOList
)
&&
(
info
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
s_gsf
+=
"有报价单,发货人付清关费,归发货客户"
;
n_gstype
=
1
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
32
;
s_gsf
+=
",客户经理为空,客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()
==
3
&&
freight
==
1
))
{
//层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
customerId
=
orderConsignorDO
.
getCustomerId
();
loglev
=
3
;
n_gstype
=
1
;
s_gsf
+=
"无报价单,发货人档案设置默认付运费 且发货人付运费,归发货客户"
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
33
;
s_gsf
+=
",客户经理为空,客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
if
(
consignorDO
.
getDefaultPay
()
&&
(
info
.
getDrawee
()
==
3
&&
clearanceFee
==
1
))
{
// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
loglev
=
4
;
customerId
=
orderConsignorDO
.
getCustomerId
();
s_gsf
+=
"无报价单,发货人档案设置默认付运费 且发货人付清关费,归发货客户"
;
n_gstype
=
1
;
//校验客户的客户经理
if
(
consignorDO
.
getCustomerService
()
==
null
||
consignorDO
.
getCustomerService
()
==
0
||
consignorDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
1
;
s_gsf
+=
",客户经理为空,客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
else
{
//业绩归属收货人
if
(
orderConsigneeDO
!=
null
)
{
customerId
=
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
;
loglev
=
5
;
s_gsf
=
"s"
;
//校验客户的客户经理
if
(
consigneeDO
!=
null
)
{
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
||
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
52
;
}
}
customerId
=
orderConsigneeDO
.
getCustomerId
()
;
loglev
=
5
;
s_gsf
+=
",不满足自定义付款人前面的条件,归收货人"
;
n_gstype
=
2
;
//校验客户的客户经理
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
||
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
)
;
loglev
=
51
;
s_gsf
+=
",客户经理为空,客户在公海池,不算奖金。"
;
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
}
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
if
(
loglev
==
0
)
{
loglev
=
-
1
;
//业绩归属收货人
if
(
orderConsigneeDO
==
null
)
{
s_gsf
=
"前4级都不满足,归收货人,收货人为空,不算奖金"
;
customerId
=
0L
;
n_gstype
=
2
;
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
customerId
=
orderConsigneeDO
.
getCustomerId
()
!=
null
?
orderConsigneeDO
.
getCustomerId
()
:
0
;
loglev
=
5
;
s_gsf
=
"前4级都不满足,归收货人"
;
n_gstype
=
2
;
//校验客户的客户经理
if
(
consigneeDO
.
getCustomerService
()
==
null
||
consigneeDO
.
getCustomerService
()
==
0
)
{
saleManid
=
0L
;
s_gsf
+=
",收货人客户经理为空,不算奖金。"
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
52
;
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
if
(
consigneeDO
.
getIsInOpenSea
()
==
true
)
{
saleManid
=
0L
;
s_gsf
+=
",收货人客户在公海池,不算奖金。"
;
saleManid
=
0L
;
orderService
.
updateOrderSalesmanId
(
info
.
getOrderId
(),
0L
);
loglev
=
52
;
TargetLogDO
targetLogDO
=
targetLogMapper
.
selectById
(
targetId
);
//客户ID
targetLogDO
.
setCustomerId
(
customerId
);
//客户经理ID
targetLogDO
.
setUserId
(
saleManid
);
targetLogDO
.
setLoglev
(
loglev
);
targetLogDO
.
setGsf
(
s_gsf
);
targetLogDO
.
setGstype
(
n_gstype
);
targetLogDO
.
setUpdateTime
(
new
Date
());
targetLogMapper
.
updateById
(
targetLogDO
);
return
;
}
}
catch
(
Exception
e
)
{
zTest
m2
=
new
zTest
();
m2
.
setTestname
(
e
.
getMessage
());
m2
.
setTestname
(
e
.
getMessage
()
+
"发生异常,"
+
info
.
getOrderNo
()
);
m2
.
setCreatedate
(
new
Date
());
zTestMapper2
.
insert
(
m2
);
}
...
...
yudao-module-order/yudao-module-order-rest/src/main/java/cn/iocoder/yudao/module/order/task/TargetLogJob.java
View file @
c4f717ee
...
...
@@ -57,7 +57,6 @@ public class TargetLogJob implements JobHandler {
//System.out.println("定时任务参数:" + param);
List
<
TargetLogDO
>
list
=
targetLogService
.
selectList2
(
sDate
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
m
.
setTestname
(
sDate
+
"获取业绩归属数据为空"
);
m
.
setCreatedate
(
new
Date
());
...
...
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