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
16a10b13
Commit
16a10b13
authored
Aug 23, 2023
by
284718418@qq.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feature_20230426_test' into feature_20230426_test
parents
fe7a31f7
16338669
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
67 deletions
+67
-67
sql/V2.3.sql
+4
-0
src/main/java/cn/timer/api/bean/crm/CrmRemindRule.java
+6
-0
src/main/java/cn/timer/api/controller/crm/CrmController.java
+26
-44
src/main/java/cn/timer/api/controller/crm/task/CrmRuleTaskTiming.java
+22
-22
src/main/resources/mapping/crm/CrmRemindRuleMapper.xml
+9
-1
No files found.
sql/V2.3.sql
View file @
16a10b13
...
@@ -84,3 +84,7 @@ ALTER TABLE `timer_test_0620`.`crm_client_follow`
...
@@ -84,3 +84,7 @@ ALTER TABLE `timer_test_0620`.`crm_client_follow`
ADD COLUMN `
contract_end_date
` datetime NULL COMMENT '合同到期时间' AFTER `
client_status
`,
ADD COLUMN `
contract_end_date
` datetime NULL COMMENT '合同到期时间' AFTER `
client_status
`,
ADD COLUMN `
contract_signing_date
` varchar(50) NULL COMMENT '签约时间' AFTER `
contract_end_date
`;
ADD COLUMN `
contract_signing_date
` varchar(50) NULL COMMENT '签约时间' AFTER `
contract_end_date
`;
ALTER TABLE `
crm_remind_rule
`
ADD COLUMN `
crm_client_follow_id
` int(11) NULL DEFAULT NULL COMMENT '跟进记录id' AFTER `
user_name
`;
ADD COLUMN `
is_remind
` tinyint(1) NULL DEFAULT 0 COMMENT '是否已提醒0.未 1.已提醒' AFTER `
crm_client_follow_id
`;
src/main/java/cn/timer/api/bean/crm/CrmRemindRule.java
View file @
16a10b13
...
@@ -69,4 +69,10 @@ public class CrmRemindRule extends Model<CrmRemindRule> {
...
@@ -69,4 +69,10 @@ public class CrmRemindRule extends Model<CrmRemindRule> {
private
String
userName
;
private
String
userName
;
private
Integer
crmClientFollowId
;
private
Integer
isRemind
;
}
}
src/main/java/cn/timer/api/controller/crm/CrmController.java
View file @
16a10b13
...
@@ -13,6 +13,7 @@ import java.util.*;
...
@@ -13,6 +13,7 @@ import java.util.*;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.timer.api.bean.crm.*
;
import
cn.timer.api.bean.crm.*
;
import
cn.timer.api.bean.htzz.HtzzAssoHtgx
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsureProductPlan
;
import
cn.timer.api.bean.insure.InsureProductPlan
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
import
cn.timer.api.bean.qyzx.QyzxEmpLogin
;
...
@@ -24,6 +25,7 @@ import cn.timer.api.dto.crm.*;
...
@@ -24,6 +25,7 @@ import cn.timer.api.dto.crm.*;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.yggl.YgCityDto
;
import
cn.timer.api.dto.yggl.YgCityDto
;
import
cn.timer.api.utils.ExcelUtils
;
import
cn.timer.api.utils.ExcelUtils
;
import
io.swagger.models.auth.In
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.checkerframework.checker.units.qual.A
;
import
org.checkerframework.checker.units.qual.A
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -1066,6 +1068,7 @@ public class CrmController {
...
@@ -1066,6 +1068,7 @@ public class CrmController {
crmRemindRule
.
setOrgCode
(
userBean
.
getOrgCode
());
crmRemindRule
.
setOrgCode
(
userBean
.
getOrgCode
());
crmRemindRule
.
setUserName
(
oldData
.
getClientName
());
crmRemindRule
.
setUserName
(
oldData
.
getClientName
());
crmRemindRule
.
setCreateTime
(
new
Date
());
crmRemindRule
.
setCreateTime
(
new
Date
());
crmRemindRule
.
setCrmClientFollowId
(
crmClientFollow
.
getId
());
crmRemindRule
.
insert
();
crmRemindRule
.
insert
();
}
}
/*** 客户跟进动态日志 ***/
/*** 客户跟进动态日志 ***/
...
@@ -2050,58 +2053,16 @@ public class CrmController {
...
@@ -2050,58 +2053,16 @@ public class CrmController {
if
(
endFollowTime
!=
null
&&
!(
""
).
equals
(
endFollowTime
))
{
if
(
endFollowTime
!=
null
&&
!(
""
).
equals
(
endFollowTime
))
{
endFollowTime
=
endFollowTime
.
substring
(
0
,
10
)
+
" 23:59:59"
;
endFollowTime
=
endFollowTime
.
substring
(
0
,
10
)
+
" 23:59:59"
;
}
}
QyzxEmpEntAsso
qyzxEmpEntAsso
=
QyzxEmpEntAsso
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
orgCode
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
));
if
(
qyzxEmpEntAsso
!=
null
&&
qyzxEmpEntAsso
.
getUserType
()
!=
null
&&
(
qyzxEmpEntAsso
.
getUserType
()
==
SysRoleType
.
U_TYPE_ADMIN
.
getType
()
||
qyzxEmpEntAsso
.
getUserType
()
==
SysRoleType
.
U_TYPE_C_ADMIN
.
getType
()))
{
IPage
<
CrmClientData
>
page
=
new
Page
<
CrmClientData
>(
pageNumber
,
pageSize
);
List
<
CrmBusinessGroupMember
>
grouplis
=
CrmBusinessGroupMember
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
CrmBusinessGroupMember
>().
lambda
().
eq
(
CrmBusinessGroupMember:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
CrmBusinessGroupMember:
:
getOrgCode
,
userBean
.
getOrgCode
()));
String
keywordStr
=
""
;
IPage
<
CrmClientData
>
datas
;
Integer
count
=
new
LambdaQueryChainWrapper
<
QyzxEmpEntAsso
>(
qyzxEmpEntAssoMapper
)
.
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
userBean
.
getEmpNum
())
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
"0,1"
)
.
count
();
if
(
count
>
0
)
{
datas
=
crmClientDataMapper
.
getCrmClientData4
(
page
,
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
type
,
ifPhone
,
customerowner
,
unfollowedDays
,
followNumber
,
industry
,
remindDay
);
}
else
{
if
(
grouplis
.
size
()>
0
&&
grouplis
!=
null
)
{
StringBuffer
sb
=
new
StringBuffer
();
for
(
CrmBusinessGroupMember
grp
:
grouplis
)
{
sb
.
append
(
grp
.
getGid
()).
append
(
","
);
}
keywordStr
=
sb
.
deleteCharAt
(
sb
.
length
()
-
1
).
toString
();
}
datas
=
crmClientDataMapper
.
getCrmClientData5
(
page
,
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
type
,
ifPhone
,
customerowner
,
unfollowedDays
,
followNumber
,
industry
,
remindDay
);
}
return
ResultUtil
.
pageData
(
datas
.
getRecords
(),
datas
.
getTotal
(),
"查询成功"
);
}
else
{
// 当前用户管理的组
List
<
Integer
>
gids
=
MyManageGroup
(
empNum
,
orgCode
);
List
<
CrmClientData
>
crmClientDatas
=
new
ArrayList
<
CrmClientData
>();
List
<
CrmClientData
>
crmClientDatas
=
new
ArrayList
<
CrmClientData
>();
if
(
gids
.
size
()>
0
)
{
List
<
CrmClientData
>
datas
=
crmClientDataMapper
.
getCrmClientData6
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
type
,
ifPhone
,
customerowner
,
unfollowedDays
,
followNumber
,
industry
,
null
,
remindDay
);
for
(
Integer
gid
:
gids
)
{
for
(
CrmClientData
data
:
datas
){
List
<
CrmClientData
>
datas
=
crmClientDataMapper
.
getCrmClientData6
(
empNum
,
orgCode
,
groupId
,
status
,
like
,
startCreateTime
,
endCreateTime
,
startFollowTime
,
endFollowTime
,
type
,
ifPhone
,
customerowner
,
unfollowedDays
,
followNumber
,
industry
,
gid
,
remindDay
);
for
(
CrmClientData
data
:
datas
)
crmClientDatas
.
add
(
data
);
crmClientDatas
.
add
(
data
);
}
}
}
List
<
CrmClientData
>
result
=
getPageList
(
crmClientDatas
,
pageNumber
,
pageSize
,
List
<
CrmClientData
>
result
=
getPageList
(
crmClientDatas
,
pageNumber
,
pageSize
,
Comparator
.
comparing
(
CrmClientData:
:
getCreateTime
).
reversed
());
Comparator
.
comparing
(
CrmClientData:
:
getCreateTime
).
reversed
());
return
ResultUtil
.
pageData
(
result
,
(
long
)
crmClientDatas
.
size
(),
"查询成功"
);
return
ResultUtil
.
pageData
(
result
,
(
long
)
crmClientDatas
.
size
(),
"查询成功"
);
}
}
}
@PostMapping
(
value
=
"/get_crm_top_count"
)
@PostMapping
(
value
=
"/get_crm_top_count"
)
@ApiOperation
(
value
=
"所有客户头部统计"
,
httpMethod
=
"POST"
,
notes
=
"所有客户头部统计"
)
@ApiOperation
(
value
=
"所有客户头部统计"
,
httpMethod
=
"POST"
,
notes
=
"所有客户头部统计"
)
...
@@ -2134,4 +2095,25 @@ public class CrmController {
...
@@ -2134,4 +2095,25 @@ public class CrmController {
return
ResultUtil
.
data
(
crmClientFollowMapper
.
getFollowLine
(
param
),
"成功"
);
return
ResultUtil
.
data
(
crmClientFollowMapper
.
getFollowLine
(
param
),
"成功"
);
}
}
@ApiOperation
(
value
=
"获取待提醒跟进客户列表"
)
@PostMapping
(
value
=
"/get_remind_follow_List"
)
public
Result
<
Object
>
get_remind_follow_List
(
@CurrentUser
UserBean
userBean
)
{
String
today
=
DateUtil
.
today
();
List
<
CrmRemindRule
>
crmRemindRuleList
=
CrmRemindRule
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
CrmRemindRule
>().
lambda
()
.
eq
(
CrmRemindRule:
:
getCrmGroupMember
,
userBean
.
getEmpNum
()).
eq
(
CrmRemindRule:
:
getDeleteFlag
,
0
)
.
eq
(
CrmRemindRule:
:
getOrgCode
,
userBean
.
getOrgCode
()).
le
(
CrmRemindRule:
:
getRemindDay
,
today
));
return
ResultUtil
.
data
(
crmRemindRuleList
,
"成功"
);
}
@ApiOperation
(
value
=
"更改为已读状态"
)
@GetMapping
(
value
=
"/updateRemindRule"
)
public
Result
<
Object
>
updateRemindRule
(
@CurrentUser
UserBean
userBean
,
@RequestParam
(
"id"
)
Integer
id
)
{
CrmRemindRule
crmRemindRule
=
CrmRemindRule
.
builder
().
id
(
id
).
build
();
if
(
crmRemindRule
!=
null
)
{
crmRemindRule
.
setIsRemind
(
1
);
crmRemindRule
.
updateById
();
}
return
ResultUtil
.
data
(
"成功"
);
}
}
}
src/main/java/cn/timer/api/controller/crm/task/CrmRuleTaskTiming.java
View file @
16a10b13
...
@@ -46,27 +46,27 @@ public class CrmRuleTaskTiming {
...
@@ -46,27 +46,27 @@ public class CrmRuleTaskTiming {
private
CrmRemindRuleMapper
crmRemindRuleMapper
;
private
CrmRemindRuleMapper
crmRemindRuleMapper
;
//提醒时间到了
//提醒时间到了
@Scheduled
(
cron
=
"0 0 4 * * ?"
)
// 每日4点
扫描
// @Scheduled(cron = "0 0 0/10 * * ? ") // 每日十小时
扫描
@Transactional
//
@Transactional
public
void
getTimeRules
()
{
//
public void getTimeRules() {
String
today
=
DateUtil
.
today
();
//
String today=DateUtil.today();
List
<
CrmRemindRule
>
crmRemindRuleList
=
crmRemindRuleMapper
.
selectCrmRemindRuleList
(
today
);
//
List<CrmRemindRule> crmRemindRuleList = crmRemindRuleMapper.selectCrmRemindRuleList(today);
if
(
crmRemindRuleList
!=
null
&&
crmRemindRuleList
.
size
()>
0
){
//
if(crmRemindRuleList!=null&&crmRemindRuleList.size()>0){
//发送系统通知
//
//发送系统通知
crmRemindRuleList
.
forEach
(
v
->{
//
crmRemindRuleList.forEach(v->{
AdminAssoTxjlb
adminAssoTxjlb
=
AdminAssoTxjlb
.
builder
().
build
();
//
AdminAssoTxjlb adminAssoTxjlb = AdminAssoTxjlb.builder().build();
adminAssoTxjlb
.
setEmpNum
(
v
.
getCrmGroupMember
());
//
adminAssoTxjlb.setEmpNum(v.getCrmGroupMember());
adminAssoTxjlb
.
setOrgCode
(
v
.
getOrgCode
());
//
adminAssoTxjlb.setOrgCode(v.getOrgCode());
adminAssoTxjlb
.
setUserName
(
v
.
getUserName
());
//
adminAssoTxjlb.setUserName(v.getUserName());
adminAssoTxjlb
.
setTxType
(
1
);
//
adminAssoTxjlb.setTxType(1);
adminAssoTxjlb
.
setTxstate
(
0
);
//
adminAssoTxjlb.setTxstate(0);
adminAssoTxjlb
.
setContent
(
"您有一位客户["
+
v
.
getUserName
()+
"]需要跟进"
);
//
adminAssoTxjlb.setContent("您有一位客户["+v.getUserName()+"]需要跟进");
adminAssoTxjlb
.
setAddtime
(
new
Date
().
getTime
());
//
adminAssoTxjlb.setAddtime(new Date().getTime());
adminAssoTxjlb
.
insert
();
//
adminAssoTxjlb.insert();
v
.
setDeleteFlag
(
1
);
// v.setIsRemind
(1);
v
.
updateById
();
//
v.updateById();
});
//
});
}
//
}
}
//
}
}
}
src/main/resources/mapping/crm/CrmRemindRuleMapper.xml
View file @
16a10b13
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
<result
property=
"orgCode"
column=
"org_code"
/>
<result
property=
"orgCode"
column=
"org_code"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"userName"
column=
"user_name"
/>
<result
property=
"crmClientFollowId"
column=
"crm_client_follow_id"
/>
<result
property=
"isRemind"
column=
"is_remind"
/>
</resultMap>
</resultMap>
<select
id=
"selectById"
resultType=
"cn.timer.api.bean.crm.CrmRemindRule"
>
<select
id=
"selectById"
resultType=
"cn.timer.api.bean.crm.CrmRemindRule"
>
...
@@ -35,6 +37,8 @@
...
@@ -35,6 +37,8 @@
<if
test=
"deleteFlag != null"
>
,`delete_flag`
</if>
<if
test=
"deleteFlag != null"
>
,`delete_flag`
</if>
<if
test=
"orgCode != null"
>
,`org_code`
</if>
<if
test=
"orgCode != null"
>
,`org_code`
</if>
<if
test=
"userName != null"
>
,`user_name`
</if>
<if
test=
"userName != null"
>
,`user_name`
</if>
<if
test=
"crmClientFollowId != null"
>
,`crm_client_follow_id`
</if>
<if
test=
"isRemind != null"
>
,`is_remind`
</if>
)
)
values
values
(
(
...
@@ -46,6 +50,8 @@
...
@@ -46,6 +50,8 @@
<if
test=
"deleteFlag != null"
>
,#{deleteFlag}
</if>
<if
test=
"deleteFlag != null"
>
,#{deleteFlag}
</if>
<if
test=
"orgCode != null"
>
,#{orgCode}
</if>
<if
test=
"orgCode != null"
>
,#{orgCode}
</if>
<if
test=
"userName != null"
>
,#{userName}
</if>
<if
test=
"userName != null"
>
,#{userName}
</if>
<if
test=
"crmClientFollowId != null"
>
,#{crmClientFollowId}
</if>
<if
test=
"isRemind != null"
>
,#{isRemind}
</if>
)
)
</insert>
</insert>
...
@@ -61,6 +67,8 @@
...
@@ -61,6 +67,8 @@
<if
test=
"deleteFlag != null"
>
`create_time` = #{delete_flag}
</if>
<if
test=
"deleteFlag != null"
>
`create_time` = #{delete_flag}
</if>
<if
test=
"orgCode != null"
>
`org_code` = #{orgCode}
</if>
<if
test=
"orgCode != null"
>
`org_code` = #{orgCode}
</if>
<if
test=
"userName != null"
>
`user_name` = #{userName}
</if>
<if
test=
"userName != null"
>
`user_name` = #{userName}
</if>
<if
test=
"crmClientFollowId != null"
>
`crm_client_follow_id` = #{crmClientFollowId}
</if>
<if
test=
"isRemind != null"
>
`is_remind` = #{isRemind}
</if>
</set>
</set>
where id = #{id}
where id = #{id}
</update>
</update>
...
@@ -81,7 +89,7 @@
...
@@ -81,7 +89,7 @@
<select
id=
"selectCrmRemindRuleList"
resultType=
"cn.timer.api.bean.crm.CrmRemindRule"
>
<select
id=
"selectCrmRemindRuleList"
resultType=
"cn.timer.api.bean.crm.CrmRemindRule"
>
select *
select *
from crm_remind_rule
from crm_remind_rule
where delete_flag = 0 and remind_day>=#{remindDay}
where delete_flag = 0 and
is_remind=0 and
remind_day>=#{remindDay}
</select>
</select>
</mapper>
</mapper>
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