03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
1
2
3
|
package cn.fw.valhalla.service.data.impl;
import cn.fw.valhalla.dao.mapper.PublicPoolMapper;
|
7c9f5c47
张志伟
|
4
|
import cn.fw.valhalla.domain.db.pool.PublicPool;
|
1d36107f
张志伟
|
5
|
import cn.fw.valhalla.domain.dto.PublicPoolDTO;
|
bfac3874
xianpengcheng
public_report_dat...
|
6
7
|
import cn.fw.valhalla.domain.dto.PublicPoolReportDTO;
import cn.fw.valhalla.domain.dto.PublicPoolReportQueryDTO;
|
1d36107f
张志伟
|
8
|
import cn.fw.valhalla.domain.query.PublicPoolQueryVO;
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
9
10
11
12
13
|
import cn.fw.valhalla.service.data.PublicPoolService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
|
1943d0bc
张志伟
feature(*): 公共线索池
|
14
|
import org.springframework.transaction.annotation.Transactional;
|
364db3cc
张志伟
|
15
|
import org.springframework.util.CollectionUtils;
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
16
|
|
1d36107f
张志伟
|
17
|
import java.util.ArrayList;
|
364db3cc
张志伟
|
18
|
import java.util.Collections;
|
1d36107f
张志伟
|
19
|
import java.util.List;
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
20
21
22
23
24
25
26
27
28
29
30
|
import java.util.Optional;
/**
* @author : kurisu
* @className : PublicPoolServiceImpl
* @description : 公共池
* @date: 2020-08-12 11:22
*/
@Slf4j
@Service
public class PublicPoolServiceImpl extends ServiceImpl<PublicPoolMapper, PublicPool> implements PublicPoolService {
|
33a55d43
张志伟
feature(*): bug修复
|
31
|
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
32
|
@Override
|
33a55d43
张志伟
feature(*): bug修复
|
33
34
|
public PublicPool queryByVin(final String vin, final Long groupId) {
return getOne(Wrappers.<PublicPool>lambdaQuery()
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
35
|
.eq(PublicPool::getGroupId, groupId)
|
33a55d43
张志伟
feature(*): bug修复
|
36
|
.eq(PublicPool::getFrameNo, vin)
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
37
38
|
.last("limit 1")
);
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
39
|
}
|
27291f56
张志伟
|
40
|
|
1943d0bc
张志伟
feature(*): 公共线索池
|
41
|
@Transactional(rollbackFor = Exception.class)
|
27291f56
张志伟
|
42
43
44
45
46
47
48
|
@Override
public void removeByCustomerId(Long customerId, Long groupId) {
remove(Wrappers.<PublicPool>lambdaQuery()
.eq(PublicPool::getCustomerId, customerId)
.eq(PublicPool::getGroupId, groupId)
);
}
|
1d36107f
张志伟
|
49
|
|
364db3cc
张志伟
|
50
51
52
53
54
55
56
57
58
|
@Transactional(rollbackFor = Exception.class)
@Override
public void removeByVin(final String vin, final Long groupId) {
remove(Wrappers.<PublicPool>lambdaQuery()
.eq(PublicPool::getFrameNo, vin)
.eq(PublicPool::getGroupId, groupId)
);
}
|
1d36107f
张志伟
|
59
|
@Override
|
1331548a
张志伟
|
60
61
62
63
64
65
66
67
68
69
70
71
|
@Transactional(rollbackFor = Exception.class)
public void removeBatchByVin(final List<String> vinList, final Long groupId) {
if (CollectionUtils.isEmpty(vinList)) {
return;
}
remove(Wrappers.<PublicPool>lambdaQuery()
.in(PublicPool::getFrameNo, vinList)
.eq(PublicPool::getGroupId, groupId)
);
}
@Override
|
1d36107f
张志伟
|
72
73
74
75
76
77
78
79
80
81
82
|
public List<PublicPoolDTO> publicList(PublicPoolQueryVO queryVO) {
Integer current = queryVO.getCurrent();
Integer pageSize = queryVO.getPageSize();
Integer startIndex = (current - 1) * pageSize;
return Optional.ofNullable(getBaseMapper().publicList(startIndex, pageSize, queryVO)).orElse(new ArrayList<>());
}
@Override
public Long publicListCount(PublicPoolQueryVO queryVO) {
return Optional.ofNullable(getBaseMapper().publicListCount(queryVO)).orElse(0L);
}
|
364db3cc
张志伟
|
83
84
85
86
87
88
89
90
91
|
@Override
public List<String> queryIdListByShops(final List<Long> shopIds) {
if (CollectionUtils.isEmpty(shopIds)) {
return Collections.emptyList();
}
// mybatis plus 性能有问题 不使用
return Optional.ofNullable(this.getBaseMapper().queryIdListByShops(shopIds)).orElse(Collections.emptyList());
}
|
bfac3874
xianpengcheng
public_report_dat...
|
92
93
94
95
96
|
@Override
public List<PublicPoolReportDTO> countPublicPoolList(PublicPoolReportQueryDTO dto) {
return Optional.ofNullable(this.getBaseMapper().countPublicPoolList(dto)).orElse(Collections.emptyList());
}
|
03b7b995
张志伟
✨ 公共池后端逻辑 100%
|
97
|
}
|