9e476657
张志伟
|
1
2
|
package cn.fw.valhalla.service.data.impl;
|
9e476657
张志伟
|
3
|
import cn.fw.valhalla.dao.mapper.CustomerMapper;
|
67ad6e9a
张志伟
|
4
|
import cn.fw.valhalla.domain.db.customer.Customer;
|
03c1a9b3
张志伟
|
5
|
import cn.fw.valhalla.domain.dto.CustomerDetailDto;
|
240a6575
张志伟
|
6
|
import cn.fw.valhalla.domain.dto.StammkundeAnalyseDTO;
|
03c1a9b3
张志伟
|
7
|
import cn.fw.valhalla.domain.query.CustomCustomerQuery;
|
6c848e1d
张志伟
|
8
|
import cn.fw.valhalla.domain.query.CustomerQueryVO;
|
240a6575
张志伟
|
9
|
import cn.fw.valhalla.domain.query.StammkundeAnalyseQueryVO;
|
6c848e1d
张志伟
|
10
|
import cn.fw.valhalla.domain.vo.customer.CustomerListVO;
|
3bddceac
夏天
查询保有客档案sdk
|
11
|
import cn.fw.valhalla.sdk.param.CusCntReq;
|
1983befb
张志伟
feat(api): :spark...
|
12
|
import cn.fw.valhalla.sdk.result.BasicsCustomerDTO;
|
3bddceac
夏天
查询保有客档案sdk
|
13
|
import cn.fw.valhalla.sdk.result.CusCntResult;
|
9e476657
张志伟
|
14
|
import cn.fw.valhalla.service.data.CustomerService;
|
67ad6e9a
张志伟
|
15
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
9e476657
张志伟
|
16
17
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
|
2b628098
张志伟
🚀 v1.0.1 服务顾问离职分配...
|
18
19
|
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
|
9e476657
张志伟
|
20
|
import org.springframework.stereotype.Service;
|
1331548a
张志伟
|
21
|
import org.springframework.transaction.annotation.Transactional;
|
67ad6e9a
张志伟
|
22
|
import org.springframework.util.CollectionUtils;
|
67ad6e9a
张志伟
|
23
24
25
|
import java.util.ArrayList;
import java.util.List;
|
240a6575
张志伟
|
26
|
import java.util.Optional;
|
9e476657
张志伟
|
27
28
29
30
31
32
33
34
35
36
|
/**
* @author : kurisu
* @className : CustomerServiceImpl
* @description : 档案
* @date: 2020-08-12 11:20
*/
@Service
@Slf4j
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {
|
67ad6e9a
张志伟
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
@Override
public List<CustomerListVO> getAppPageList(Integer startIndex, Integer pageSize, CustomerQueryVO queryVO) {
List<CustomerListVO> appPageList = getBaseMapper().getAppPageList(startIndex, queryVO.getPageSize(), queryVO);
return CollectionUtils.isEmpty(appPageList) ? new ArrayList<>() : appPageList;
}
@Override
public Customer queryById(Long id) {
return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getId, id)
.eq(Customer::getYn, Boolean.TRUE)
.last("limit 1"));
}
@Override
|
71d72b4c
张志伟
|
52
53
54
55
56
57
58
|
public Customer queryByIdWithInvalid(Long id) {
return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getId, id)
.last("limit 1"));
}
@Override
|
758162a4
张志伟
|
59
|
public Customer queryByPlateNo(String plateNo, Long groupId) {
|
67ad6e9a
张志伟
|
60
61
62
|
return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getPlateNo, plateNo)
.eq(Customer::getYn, Boolean.TRUE)
|
758162a4
张志伟
|
63
|
.eq(Customer::getGroupId, groupId)
|
36f2c44d
张志伟
|
64
|
.orderByDesc(Customer::getUpdateTime)
|
67ad6e9a
张志伟
|
65
66
67
68
|
.last("limit 1"));
}
@Override
|
758162a4
张志伟
|
69
|
public Customer queryByFrameNo(String frameNo, Long groupId) {
|
67ad6e9a
张志伟
|
70
71
72
|
return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getFrameNo, frameNo)
.eq(Customer::getYn, Boolean.TRUE)
|
758162a4
张志伟
|
73
|
.eq(Customer::getGroupId, groupId)
|
36f2c44d
张志伟
|
74
|
.orderByDesc(Customer::getUpdateTime)
|
67ad6e9a
张志伟
|
75
76
|
.last("limit 1"));
}
|
6c848e1d
张志伟
|
77
78
|
@Override
|
3145890c
张志伟
|
79
80
81
82
83
84
85
86
87
88
|
public Customer queryByEngineNo(String engineNo, Long groupId) {
return this.getBaseMapper().selectOne(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getEngineNo, engineNo)
.eq(Customer::getYn, Boolean.TRUE)
.eq(Customer::getGroupId, groupId)
.orderByDesc(Customer::getUpdateTime)
.last("limit 1"));
}
@Override
|
758162a4
张志伟
|
89
90
91
92
93
94
95
96
|
public List<Customer> queryByBaseId(Long baseId) {
return this.list(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getBaseId, baseId)
.eq(Customer::getYn, Boolean.TRUE)
);
}
@Override
|
6c848e1d
张志伟
|
97
98
99
100
101
102
|
public void forbidden(Long customerId) {
this.update(Wrappers.<Customer>lambdaUpdate()
.set(Customer::getYn, Boolean.FALSE)
.eq(Customer::getId, customerId)
);
}
|
376d3231
张志伟
✨ 主动放弃跟进 100%
|
103
104
|
@Override
|
598e44a8
张志伟
|
105
106
107
108
109
110
|
public void forbiddenPlate(String plateNo) {
this.update(Wrappers.<Customer>lambdaUpdate()
.set(Customer::getYn, Boolean.FALSE)
.eq(Customer::getPlateNo, plateNo)
.eq(Customer::getYn, Boolean.TRUE)
);
|
376d3231
张志伟
✨ 主动放弃跟进 100%
|
111
|
}
|
2b628098
张志伟
🚀 v1.0.1 服务顾问离职分配...
|
112
113
114
115
116
117
118
119
120
|
@Override
@Nullable
public List<Customer> queryByAdviserId(@NonNull Long adviserId) {
return this.list(Wrappers.<Customer>lambdaQuery()
.eq(Customer::getAdviserId, adviserId)
.eq(Customer::getYn, Boolean.TRUE)
);
}
|
240a6575
张志伟
|
121
122
123
124
125
126
|
@Override
public List<StammkundeAnalyseDTO> analyseList(final StammkundeAnalyseQueryVO queryVO) {
List<StammkundeAnalyseDTO> list = this.getBaseMapper().analyseList(queryVO);
return Optional.ofNullable(list).orElse(new ArrayList<>());
}
|
03c1a9b3
张志伟
|
127
128
129
130
131
|
@Override
public List<CustomerDetailDto> queryCustomList(CustomCustomerQuery query) {
return Optional.ofNullable(getBaseMapper().queryCustomList(query)).orElse(new ArrayList<>());
}
|
1ca0a771
张志伟
新增查询档案数量接口
|
132
133
134
135
136
|
@Override
public Long queryCustomListCount(CustomCustomerQuery query) {
return Optional.ofNullable(getBaseMapper().queryCustomCount(query)).orElse(0L);
}
|
1983befb
张志伟
feat(api): :spark...
|
137
138
139
140
141
|
@Override
public List<BasicsCustomerDTO> queryByKeyword(String keyword, Long groupId) {
return Optional.ofNullable(this.getBaseMapper().queryByKeyword(keyword, groupId)).orElse(new ArrayList<>());
}
|
1331548a
张志伟
|
142
143
144
145
146
147
148
|
@Override
@Transactional(rollbackFor = Exception.class)
public void afterDistributePubClue(final List<String> vinList, final Long userId, final Long shopId, final Long groupId) {
update(Wrappers.<Customer>lambdaUpdate()
.set(Customer::getAdviserId, userId)
.set(Customer::getShopId, shopId)
|
4f92d929
张志伟
bug 修复
|
149
|
.set(Customer::getTemporary, Boolean.TRUE)
|
1331548a
张志伟
|
150
151
152
153
154
155
|
.eq(Customer::getYn, Boolean.TRUE)
.eq(Customer::getGroupId, groupId)
.in(Customer::getFrameNo, vinList)
.isNull(Customer::getAdviserId)
);
}
|
3bddceac
夏天
查询保有客档案sdk
|
156
157
158
159
160
161
162
163
|
@Override
public List<CusCntResult> queryCusCnt(final CusCntReq req) {
if(!CollectionUtils.isEmpty(req.getShopIds())){
return getBaseMapper().queryShopCusCnt(req);
}
return getBaseMapper().queryAdviserCusCnt(req);
}
|
9e476657
张志伟
|
164
|
}
|