Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
dsk-cr20g
Commits
24879f28
Commit
24879f28
authored
May 18, 2023
by
lcl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户跟进记录相关功能添加
parent
977ddd29
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
234 additions
and
8 deletions
+234
-8
CustomerController.java
...a/com/dsk/web/controller/customer/CustomerController.java
+4
-7
CustomerFollowRecordController.java
...b/controller/customer/CustomerFollowRecordController.java
+51
-0
CustomerFollowRecord.java
.../com/dsk/system/domain/customer/CustomerFollowRecord.java
+59
-0
CustomerFollowRecordSearchDto.java
...em/domain/customer/dto/CustomerFollowRecordSearchDto.java
+24
-0
CustomerFollowRecordMapper.java
...ava/com/dsk/system/mapper/CustomerFollowRecordMapper.java
+18
-0
ICustomerFollowRecordService.java
.../com/dsk/system/service/ICustomerFollowRecordService.java
+21
-0
CustomerFollowRecordServiceImpl.java
.../system/service/impl/CustomerFollowRecordServiceImpl.java
+49
-0
CustomerServiceImpl.java
...java/com/dsk/system/service/impl/CustomerServiceImpl.java
+1
-1
CustomerFollowRecordMapper.xml
...ces/mapper/system/customer/CustomerFollowRecordMapper.xml
+7
-0
No files found.
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerController.java
View file @
24879f28
...
...
@@ -10,10 +10,7 @@ import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import
com.dsk.system.service.ICustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
/**
* 客户相关
...
...
@@ -44,7 +41,7 @@ public class CustomerController extends BaseController {
@PreAuthorize
(
"@ss.hasPermi('customer:add')"
)
@PostMapping
()
@RepeatSubmit
public
AjaxResult
add
(
Customer
customer
){
public
AjaxResult
add
(
@RequestBody
Customer
customer
){
return
AjaxResult
.
success
(
baseService
.
add
(
customer
));
}
...
...
@@ -52,9 +49,9 @@ public class CustomerController extends BaseController {
* 编辑客户
*/
@PreAuthorize
(
"@ss.hasPermi('customer:edit')"
)
@P
os
tMapping
()
@P
u
tMapping
()
@RepeatSubmit
public
AjaxResult
edit
(
Customer
customer
){
public
AjaxResult
edit
(
@RequestBody
Customer
customer
){
return
AjaxResult
.
success
(
baseService
.
edit
(
customer
));
}
...
...
dsk-admin/src/main/java/com/dsk/web/controller/customer/CustomerFollowRecordController.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
web
.
controller
.
customer
;
import
com.dsk.common.annotation.RepeatSubmit
;
import
com.dsk.common.core.controller.BaseController
;
import
com.dsk.common.core.domain.AjaxResult
;
import
com.dsk.common.core.page.TableDataInfo
;
import
com.dsk.system.domain.customer.Customer
;
import
com.dsk.system.domain.customer.CustomerFollowRecord
;
import
com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto
;
import
com.dsk.system.domain.customer.dto.CustomerSearchDto
;
import
com.dsk.system.service.ICustomerFollowRecordService
;
import
com.dsk.system.service.ICustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
/**
* 客户跟进记录相关
*
* @author lcl
* @create 2023/5/18
*/
@RestController
@RequestMapping
(
"/customer/follow/record"
)
public
class
CustomerFollowRecordController
extends
BaseController
{
@Autowired
private
ICustomerFollowRecordService
baseService
;
/**
* 查询客户跟进记录列表
*/
// @PreAuthorize("@ss.hasPermi('customer:follow:record:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
selectPageList
(
CustomerFollowRecordSearchDto
dto
){
startPage
();
return
getDataTable
(
baseService
.
selectList
(
dto
));
}
/**
* 添加客户跟进记录
*/
// @PreAuthorize("@ss.hasPermi('customer:follow:record:add')")
@PostMapping
()
@RepeatSubmit
public
AjaxResult
add
(
@RequestBody
CustomerFollowRecord
followRecord
){
return
AjaxResult
.
success
(
baseService
.
add
(
followRecord
));
}
}
dsk-system/src/main/java/com/dsk/system/domain/customer/CustomerFollowRecord.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
system
.
domain
.
customer
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 客户跟进记录(CustomerFollowRecord)实体类
*
* @author makejava
* @since 2023-05-18 15:07:59
*/
@Data
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@TableName
(
"customer_follow_record"
)
public
class
CustomerFollowRecord
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
17639570424991398L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 客户id
*/
private
String
customerId
;
/**
* 用户id
*/
private
Long
userId
;
/**
* 拜访方式(visit_mode_type)
*/
private
String
visitMode
;
/**
* 下次拜访时间
*/
private
Date
nextVisitTime
;
/**
* 拜访对象姓名
*/
private
String
name
;
/**
* 拜访对象职务
*/
private
String
position
;
/**
* 拜访内容
*/
private
String
content
;
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createTime
;
}
dsk-system/src/main/java/com/dsk/system/domain/customer/dto/CustomerFollowRecordSearchDto.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
system
.
domain
.
customer
.
dto
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 客户跟进记录筛选对象
*
* @author lcl
* @create 2023/5/18
*/
@Data
public
class
CustomerFollowRecordSearchDto
implements
Serializable
{
/**
* 客户id
*/
private
String
customerId
;
/**
* 用户id
*/
private
Long
userId
;
}
dsk-system/src/main/java/com/dsk/system/mapper/CustomerFollowRecordMapper.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
system
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.dsk.system.domain.customer.CustomerFollowRecord
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 客户跟进记录(CustomerFollowRecord)表数据库访问层
*
* @author makejava
* @since 2023-05-18 15:07:59
*/
@Mapper
public
interface
CustomerFollowRecordMapper
extends
BaseMapper
<
CustomerFollowRecord
>
{
}
dsk-system/src/main/java/com/dsk/system/service/ICustomerFollowRecordService.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
system
.
service
;
import
com.dsk.system.domain.customer.CustomerFollowRecord
;
import
com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto
;
import
java.util.List
;
/**
* 客户跟进记录(CustomerFollowRecord)表服务接口
*
* @author makejava
* @since 2023-05-18 15:07:59
*/
public
interface
ICustomerFollowRecordService
{
List
<
CustomerFollowRecord
>
selectList
(
CustomerFollowRecordSearchDto
dto
);
boolean
add
(
CustomerFollowRecord
followRecord
);
}
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerFollowRecordServiceImpl.java
0 → 100644
View file @
24879f28
package
com
.
dsk
.
system
.
service
.
impl
;
import
cn.hutool.core.bean.BeanException
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dsk.common.utils.SecurityUtils
;
import
com.dsk.system.domain.customer.CustomerFollowRecord
;
import
com.dsk.system.domain.customer.dto.CustomerFollowRecordSearchDto
;
import
com.dsk.system.mapper.CustomerFollowRecordMapper
;
import
com.dsk.system.service.ICustomerFollowRecordService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 客户跟进记录(CustomerFollowRecord)表服务实现类
*
* @author makejava
* @since 2023-05-18 15:07:59
*/
@Slf4j
@Service
public
class
CustomerFollowRecordServiceImpl
implements
ICustomerFollowRecordService
{
@Resource
private
CustomerFollowRecordMapper
baseMapper
;
@Override
public
List
<
CustomerFollowRecord
>
selectList
(
CustomerFollowRecordSearchDto
dto
)
{
LambdaQueryWrapper
<
CustomerFollowRecord
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(!
ObjectUtils
.
isEmpty
(
dto
.
getCustomerId
()))
{
wrapper
.
eq
(
CustomerFollowRecord:
:
getCustomerId
,
dto
.
getCustomerId
());
}
wrapper
.
eq
(
CustomerFollowRecord:
:
getUserId
,
SecurityUtils
.
getUserId
())
.
orderByDesc
(
CustomerFollowRecord:
:
getCreateTime
);
return
baseMapper
.
selectList
(
wrapper
);
}
@Override
public
boolean
add
(
CustomerFollowRecord
followRecord
)
{
if
(
ObjectUtils
.
isEmpty
(
followRecord
.
getContent
()))
throw
new
BeanException
(
"跟进内容不能为空"
);
if
(
ObjectUtils
.
isEmpty
(
followRecord
.
getCustomerId
()))
throw
new
BeanException
(
"跟进客户不能为空"
);
followRecord
.
setUserId
(
SecurityUtils
.
getUserId
());
return
baseMapper
.
insert
(
followRecord
)
!=
0
;
}
}
dsk-system/src/main/java/com/dsk/system/service/impl/CustomerServiceImpl.java
View file @
24879f28
...
...
@@ -69,7 +69,7 @@ public class CustomerServiceImpl implements ICustomerService {
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
edit
(
Customer
customer
)
{
if
(
ObjectUtils
.
isEmpty
(
customer
.
getC
ompany
Id
()))
throw
new
BeanException
(
"客户id不能为空"
);
if
(
ObjectUtils
.
isEmpty
(
customer
.
getC
ustomer
Id
()))
throw
new
BeanException
(
"客户id不能为空"
);
customer
.
setUpdateId
(
SecurityUtils
.
getUserId
());
int
u
=
baseMapper
.
updateById
(
customer
);
return
u
!=
0
;
...
...
dsk-system/src/main/resources/mapper/system/customer/CustomerFollowRecordMapper.xml
0 → 100644
View file @
24879f28
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.dsk.system.mapper.CustomerFollowRecordMapper"
>
</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