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
72f35ef0
Commit
72f35ef0
authored
Oct 27, 2024
by
yanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 客户更新 更新时可更新多条
parent
45923591
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
47 deletions
+72
-47
CustomerFollowupServiceImpl.java
...service/customerFollowup/CustomerFollowupServiceImpl.java
+66
-47
CustomerFollowupUpdateStatusReqVO.java
...o/customerFollowup/CustomerFollowupUpdateStatusReqVO.java
+6
-0
No files found.
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/service/customerFollowup/CustomerFollowupServiceImpl.java
View file @
72f35ef0
package
cn
.
iocoder
.
yudao
.
module
.
customer
.
service
.
customerFollowup
;
import
java.text.MessageFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.util.*
;
import
javax.annotation.Resource
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.iocoder.yudao.framework.apollo.core.event.OrderNumberLogEvent
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.common.util.code.CodeUtils
;
import
cn.iocoder.yudao.framework.i18n.core.I18nMessage
;
import
cn.iocoder.yudao.framework.mybatis.core.
query.LambdaQueryWrapperX
;
import
cn.iocoder.yudao.framework.mybatis.core.
service.AbstractService
;
import
cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.security.core.LoginUser
;
import
cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils
;
import
cn.iocoder.yudao.module.customer.convert.customerFollowup.CustomerFollowupConvert
;
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.customerFollowup.CustomerFollowupDO
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customerContacts.CustomerContactsMapper
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customerFollowup.CustomerFollowupMapper
;
import
cn.iocoder.yudao.module.customer.enums.ErrorCodeConstants
;
import
cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService
;
import
cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupCreateReqVO
;
import
cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupQueryVO
;
import
cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupUpdateReqVO
;
import
cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupUpdateStatusReqVO
;
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
;
...
...
@@ -29,15 +32,15 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.validation.annotation.Validated
;
import
cn.iocoder.yudao.framework.mybatis.core.vo.PageVO
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.module.customer.vo.customerFollowup.*
;
import
cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO
;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.module.customer.convert.customerFollowup.CustomerFollowupConvert
;
import
cn.iocoder.yudao.module.customer.dal.mysql.customerFollowup.CustomerFollowupMapper
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
customer
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
customer
.
enums
.
ErrorCodeConstants
.
FOLLOWUP_ALREADY_SUBMITTED
;
import
static
cn
.
iocoder
.
yudao
.
module
.
customer
.
enums
.
ErrorCodeConstants
.
FOLLOWUP_NOT_EXISTS
;
/**
* 客户跟进 Service 实现类
...
...
@@ -194,42 +197,58 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Override
public
void
updateFollowupStatus
(
CustomerFollowupUpdateStatusReqVO
updateStatusReqVO
)
{
Long
id
=
updateStatusReqVO
.
getId
();
CustomerFollowupDO
customerFollowupDO
=
followupMapper
.
selectById
(
id
);
if
(
customerFollowupDO
==
null
)
{
throw
exception
(
FOLLOWUP_NOT_EXISTS
);
}
Long
updateId
=
updateStatusReqVO
.
getId
();
List
<
Long
>
ids
=
updateStatusReqVO
.
getIds
();
if
(
CustomerFollowupStatusEnum
.
Commited
.
getValue
().
equals
(
customerFollowupDO
.
getStatus
()))
{
throw
exception
(
FOLLOWUP_ALREADY_SUBMITTED
);
List
<
Long
>
idList
=
new
ArrayList
<>();
// id + ids 到idList
if
(
updateId
!=
null
)
{
idList
.
add
(
updateId
);
}
if
(
CollectionUtil
.
isNotEmpty
(
ids
))
{
idList
.
addAll
(
ids
);
}
customerFollowupDO
.
setStatus
(
updateStatusReqVO
.
getStatus
());
followupMapper
.
updateById
(
customerFollowupDO
);
for
(
Long
id
:
idList
)
{
CustomerFollowupDO
customerFollowupDO
=
followupMapper
.
selectById
(
id
);
if
(
customerFollowupDO
==
null
)
{
throw
exception
(
FOLLOWUP_NOT_EXISTS
);
}
Long
customerId
=
customerFollowupDO
.
getCustomerId
();
if
(
customerId
!=
null
)
{
CustomerDO
customer
=
customerMapper
.
selectById
(
customerId
);
if
(
customer
!=
null
)
{
if
(
CustomerFollowupStatusEnum
.
Commited
.
getValue
().
equals
(
customerFollowupDO
.
getStatus
()))
{
throw
exception
(
FOLLOWUP_ALREADY_SUBMITTED
);
}
}
// 插入日志
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
);
for
(
Long
id
:
idList
)
{
CustomerFollowupDO
customerFollowupDO
=
followupMapper
.
selectById
(
id
);
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
);
}
}
}
}
...
...
yudao-module-customer/yudao-module-customer-core/src/main/java/cn/iocoder/yudao/module/customer/vo/customerFollowup/CustomerFollowupUpdateStatusReqVO.java
View file @
72f35ef0
...
...
@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import
lombok.ToString
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@ApiModel
(
"管理后台 - 客户跟进更新状态 Request VO"
)
@Data
...
...
@@ -17,6 +18,11 @@ public class CustomerFollowupUpdateStatusReqVO {
@NotNull
(
message
=
"主键不能为空"
)
private
Long
id
;
//ids
@ApiModelProperty
(
value
=
"主键列表"
,
required
=
true
)
@NotNull
(
message
=
"主键列表不能为空"
)
private
List
<
Long
>
ids
;
@ApiModelProperty
(
value
=
"状态 字典customer_followup_status"
)
private
Integer
status
;
...
...
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