Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
90b5dfc4
Commit
90b5dfc4
authored
May 13, 2023
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户公海:离职自动释放到公海
parent
bc414567
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
7 deletions
+45
-7
src/main/java/cn/timer/api/bean/crm/CrmClientData.java
+1
-1
src/main/java/cn/timer/api/controller/crm/task/CrmClientPlanTask.java
+34
-5
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
+2
-0
src/main/resources/mapping/crm/CrmClientDataMapper.xml
+8
-1
No files found.
src/main/java/cn/timer/api/bean/crm/CrmClientData.java
View file @
90b5dfc4
...
...
@@ -51,7 +51,7 @@ import lombok.NoArgsConstructor;
@ApiModel
(
"客户数据表"
)
public
class
CrmClientData
extends
Model
<
CrmClientData
>
{
private
static
final
long
serialVersionUID
=
-
536805670479078278
0
L
;
private
static
final
long
serialVersionUID
=
-
536805670479078278
1
L
;
@Id
@GeneratedValue
...
...
src/main/java/cn/timer/api/controller/crm/task/CrmClientPlanTask.java
View file @
90b5dfc4
package
cn
.
timer
.
api
.
controller
.
crm
.
task
;
import
cn.hutool.core.date.DateUtil
;
import
cn.timer.api.bean.crm.CrmClientAssociate
;
import
cn.timer.api.bean.crm.CrmClientData
;
import
cn.timer.api.bean.crm.CrmClientPlan
;
import
cn.timer.api.bean.insure.InsureLog
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.config.exception.CustomException
;
import
cn.timer.api.dao.insure.InsureUserMapper
;
import
cn.timer.api.dao.yggl.YgglMainEmpMapper
;
import
cn.timer.api.dao.crm.CrmClientDataMapper
;
import
cn.timer.api.utils.aliyun.AliyunSMS
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -19,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -35,6 +34,9 @@ public class CrmClientPlanTask {
@Autowired
private
AliyunSMS
aliyunSMS
;
@Resource
private
CrmClientDataMapper
crmClientDataMapper
;
@Scheduled
(
cron
=
"0 0/30 * * * ? "
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateInsureStatusTask
(){
...
...
@@ -58,4 +60,31 @@ public class CrmClientPlanTask {
throw
new
CustomException
(
"客户跟进计划定时任务异常"
);
}
}
/**
* 每天4点半执行一次
* 离职员工,全部客户释放公海
*/
@Scheduled
(
cron
=
"0 30 4 * * ?"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
lzygCrmClientData
()
{
try
{
// 离职用户全部客户
List
<
Integer
>
ids
=
crmClientDataMapper
.
selectLzygCrmClientData
();
if
(
CollectionUtils
.
isEmpty
(
ids
)){
return
;
}
for
(
Integer
id
:
ids
)
{
// 0-进入客户公海
CrmClientData
.
builder
().
id
(
id
).
belongUser
(
0
).
belongUserName
(
null
).
build
().
updateById
();
// 删除协作人列表
CrmClientAssociate
.
builder
().
build
().
delete
(
new
QueryWrapper
<
CrmClientAssociate
>().
lambda
().
eq
(
CrmClientAssociate:
:
getCid
,
id
));
}
System
.
out
.
println
(
"离职员工,全部客户释放公海:"
+
ids
.
size
()+
"个"
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
CustomException
(
"离职员工,全部客户释放公海定时任务异常"
);
}
}
}
src/main/java/cn/timer/api/dao/crm/CrmClientDataMapper.java
View file @
90b5dfc4
...
...
@@ -38,4 +38,6 @@ public interface CrmClientDataMapper extends BaseMapper<CrmClientData> {
@RequestParam
(
name
=
"belongGroup"
,
required
=
false
)
Integer
belongGroup
,
@RequestParam
(
name
=
"startCreateTime"
,
required
=
false
)
String
startCreateTime
,
@RequestParam
(
name
=
"endCreateTime"
,
required
=
false
)
String
endCreateTime
);
List
<
Integer
>
selectLzygCrmClientData
();
}
src/main/resources/mapping/crm/CrmClientDataMapper.xml
View file @
90b5dfc4
...
...
@@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.timer.api.dao.crm.CrmClientDataMapper"
>
<select
id=
"crmCartogram"
resultType=
"cn.timer.api.dto.crm.CrmCartogramDto"
>
SELECT
...
...
@@ -50,4 +49,11 @@
</where>
GROUP BY ccd.belong_user
</select>
<select
id=
"selectLzygCrmClientData"
resultType=
"java.lang.Integer"
>
SELECT c.id FROM crm_client_data as c
LEFT JOIN yggl_main_lzb as y ON y.emp_num = c.belong_user AND y.id
<![CDATA[>]]>
0 AND c.id
<![CDATA[>]]>
0
WHERE y.job_status = 3 AND c.client_status
<![CDATA[<]]>
5
</select>
</mapper>
\ No newline at end of file
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