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
cb90d9cb
Commit
cb90d9cb
authored
Sep 05, 2024
by
yanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 跟进纪录添加客户日志
parent
7c8be878
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
0 deletions
+104
-0
20240903.sql
sql/v2.1/20240903.sql
+7
-0
CustomerFollowupServiceImpl.java
...service/customerFollowup/CustomerFollowupServiceImpl.java
+93
-0
CustomerOperateTypeEnum.java
...coder/yudao/module/ecw/enums/CustomerOperateTypeEnum.java
+4
-0
No files found.
sql/v2.1/20240903.sql
View file @
cb90d9cb
...
...
@@ -5,3 +5,10 @@ INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type
VALUES
(
23
,
'23'
,
'设置默认付款'
,
'Set Customer Default Pay'
,
'customer_operate_type'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
now
(),
'115'
,
now
(),
b
'0'
);
INSERT
INTO
`system_dict_data`
(
`sort`
,
`value`
,
`label`
,
`label_en`
,
`dict_type`
,
`status`
,
`color_type`
,
`css_class`
,
`remark`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
)
VALUES
(
24
,
'24'
,
'设置默认开票'
,
'Set Customer Default Billing'
,
'customer_operate_type'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
now
(),
'115'
,
now
(),
b
'0'
);
INSERT
INTO
`system_dict_data`
(
`sort`
,
`value`
,
`label`
,
`label_en`
,
`dict_type`
,
`status`
,
`color_type`
,
`css_class`
,
`remark`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
)
VALUES
(
25
,
'25'
,
'新增跟进纪录'
,
'Create Customer Followup'
,
'customer_operate_type'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
now
(),
'115'
,
now
(),
b
'0'
);
INSERT
INTO
`system_dict_data`
(
`sort`
,
`value`
,
`label`
,
`label_en`
,
`dict_type`
,
`status`
,
`color_type`
,
`css_class`
,
`remark`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
)
VALUES
(
26
,
'26'
,
'编辑跟进纪录'
,
'Update Customer Followup'
,
'customer_operate_type'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
now
(),
'115'
,
now
(),
b
'0'
);
INSERT
INTO
`system_dict_data`
(
`sort`
,
`value`
,
`label`
,
`label_en`
,
`dict_type`
,
`status`
,
`color_type`
,
`css_class`
,
`remark`
,
`creator`
,
`create_time`
,
`updater`
,
`update_time`
,
`deleted`
)
VALUES
(
27
,
'27'
,
'提交跟进纪录'
,
'Commit Customer Followup'
,
'customer_operate_type'
,
0
,
'default'
,
''
,
NULL
,
'1'
,
now
(),
'115'
,
now
(),
b
'0'
);
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customerFollowup/CustomerFollowupServiceImpl.java
View file @
cb90d9cb
...
...
@@ -9,8 +9,14 @@ import javax.annotation.Resource;
import
cn.iocoder.yudao.framework.i18n.core.I18nMessage
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper
;
import
cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService
;
import
cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum
;
import
cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -36,6 +42,13 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Resource
private
CustomerFollowupMapper
followupMapper
;
@Resource
private
CustomerOperateLogService
customerOperateLogService
;
@Resource
private
CustomerMapper
customerMapper
;
/**
* 跟进单编号生成方式:GJ+年份+六位数字,按年份累计
* @return
...
...
@@ -66,6 +79,31 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 插入
CustomerFollowupDO
followup
=
CustomerFollowupConvert
.
INSTANCE
.
convert
(
createReqVO
);
followupMapper
.
insert
(
followup
);
Long
customerId
=
createReqVO
.
getCustomerId
();
if
(
customerId
!=
null
)
{
CustomerDO
customer
=
customerMapper
.
selectById
(
customerId
);
if
(
customer
==
null
)
{
// 插入日志
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
//保存客户捞取记录
CustomerOperateLogCreateReqVO
customerOperateLogCreateReqVO
=
new
CustomerOperateLogCreateReqVO
()
.
setOperator
(
loginUser
==
null
?
null
:
loginUser
.
getId
())
.
setOperatorName
(
loginUser
==
null
?
null
:
loginUser
.
getNickname
())
.
setCustomerId
(
customer
.
getId
())
.
setNumber
(
customer
.
getNumber
())
.
setName
(
customer
.
getName
())
.
setNewCustomerService
(
customer
.
getCustomerService
())
.
setOldCustomerService
(
customer
.
getCustomerService
())
.
setOldEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setNewEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setOperateType
(
CustomerOperateTypeEnum
.
FOLLOWUP_CREATE
.
getValue
())
.
setRemark
(
"新增跟进纪录"
+
(
CustomerFollowupStatusEnum
.
UnCommited
.
getValue
().
equals
(
createReqVO
.
getStatus
())
?
""
:
",并提交"
));
customerOperateLogService
.
createOperateLog
(
customerOperateLogCreateReqVO
);
}
}
// 返回
return
followup
.
getId
();
}
...
...
@@ -84,6 +122,30 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 更新
CustomerFollowupDO
updateObj
=
CustomerFollowupConvert
.
INSTANCE
.
convert
(
updateReqVO
);
followupMapper
.
updateById
(
updateObj
);
Long
customerId
=
updateReqVO
.
getCustomerId
();
if
(
customerId
!=
null
)
{
CustomerDO
customer
=
customerMapper
.
selectById
(
customerId
);
if
(
customer
==
null
)
{
// 插入日志
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
//保存客户捞取记录
CustomerOperateLogCreateReqVO
customerOperateLogCreateReqVO
=
new
CustomerOperateLogCreateReqVO
()
.
setOperator
(
loginUser
==
null
?
null
:
loginUser
.
getId
())
.
setOperatorName
(
loginUser
==
null
?
null
:
loginUser
.
getNickname
())
.
setCustomerId
(
customer
.
getId
())
.
setNumber
(
customer
.
getNumber
())
.
setName
(
customer
.
getName
())
.
setNewCustomerService
(
customer
.
getCustomerService
())
.
setOldCustomerService
(
customer
.
getCustomerService
())
.
setOldEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setNewEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setOperateType
(
CustomerOperateTypeEnum
.
FOLLOWUP_UPDATE
.
getValue
())
.
setRemark
(
"更新跟进纪录"
+
(
CustomerFollowupStatusEnum
.
UnCommited
.
getValue
().
equals
(
updateReqVO
.
getStatus
())
?
""
:
",并提交"
));
customerOperateLogService
.
createOperateLog
(
customerOperateLogCreateReqVO
);
}
}
}
@Override
...
...
@@ -94,8 +156,39 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
if
(
customerFollowupDO
==
null
)
{
throw
exception
(
FOLLOWUP_NOT_EXISTS
);
}
if
(
CustomerFollowupStatusEnum
.
Commited
.
getValue
().
equals
(
customerFollowupDO
.
getStatus
()))
{
throw
exception
(
FOLLOWUP_ALREADY_SUBMITTED
);
}
customerFollowupDO
.
setStatus
(
updateStatusReqVO
.
getStatus
());
followupMapper
.
updateById
(
customerFollowupDO
);
Long
customerId
=
customerFollowupDO
.
getCustomerId
();
if
(
customerId
!=
null
)
{
CustomerDO
customer
=
customerMapper
.
selectById
(
customerId
);
if
(
customer
==
null
)
{
// 插入日志
LoginUser
loginUser
=
SecurityFrameworkUtils
.
getLoginUser
();
//保存客户捞取记录
CustomerOperateLogCreateReqVO
customerOperateLogCreateReqVO
=
new
CustomerOperateLogCreateReqVO
()
.
setOperator
(
loginUser
==
null
?
null
:
loginUser
.
getId
())
.
setOperatorName
(
loginUser
==
null
?
null
:
loginUser
.
getNickname
())
.
setCustomerId
(
customer
.
getId
())
.
setNumber
(
customer
.
getNumber
())
.
setName
(
customer
.
getName
())
.
setNewCustomerService
(
customer
.
getCustomerService
())
.
setOldCustomerService
(
customer
.
getCustomerService
())
.
setOldEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setNewEstimateEnterOpenSeaTime
(
customer
.
getEstimateEnterOpenSeaTime
())
.
setOperateType
(
CustomerOperateTypeEnum
.
FOLLOWUP_COMMIT
.
getValue
())
.
setRemark
(
"提交跟进纪录"
);
customerOperateLogService
.
createOperateLog
(
customerOperateLogCreateReqVO
);
}
}
}
@Override
...
...
yudao-module-ecw/yudao-module-ecw-api/src/main/java/cn/iocoder/yudao/module/ecw/enums/CustomerOperateTypeEnum.java
View file @
cb90d9cb
...
...
@@ -54,6 +54,10 @@ public enum CustomerOperateTypeEnum {
CHANGE_DEFAULT_BILLING
(
24
,
"设置默认开票"
),
FOLLOWUP_CREATE
(
25
,
"新增跟进纪录"
),
FOLLOWUP_UPDATE
(
26
,
"编辑跟进纪录"
),
FOLLOWUP_COMMIT
(
27
,
"提交跟进纪录"
),
DELETE
(
100
,
"删除"
),
...
...
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