b9411514
陈杰
first
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package com.sincere.student.service.impl;
import com.github.pagehelper.PageHelper;
import com.sincere.student.dto.MessageSearchDto;
import com.sincere.student.dto.PointSearchDto;
import com.sincere.student.dto.submit.SubmitLine;
import com.sincere.student.mapper.UniversityPointMapper;
import com.sincere.student.mapper.UniversitySubmitFileMapper;
import com.sincere.student.model.Point;
import com.sincere.student.model.SubmitFile;
import com.sincere.student.service.SubmitService;
import com.sincere.student.utils.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class SubmitServiceImpl implements SubmitService {
@Autowired
|
123dbb81
徐泉
研学代码提交
|
24
|
UniversityPointMapper pointMapper ;
|
b9411514
陈杰
first
|
25
26
|
@Autowired
|
123dbb81
徐泉
研学代码提交
|
27
|
UniversitySubmitFileMapper submitFileMapper ;
|
b9411514
陈杰
first
|
28
29
30
|
@Override
public Page<SubmitFile> getAdminList(MessageSearchDto dto) {
|
123dbb81
徐泉
研学代码提交
|
31
32
33
34
35
|
Page<SubmitFile> result = new Page<>(dto.getPage(),dto.getPageSize());
PageHelper.startPage(dto.getPage(),dto.getPageSize());
result.setList(submitFileMapper.getList(dto));
result.setCount(submitFileMapper.getListCount(dto));
return result;
|
05508d96
陈杰
bug 修复
|
36
37
38
|
}
@Override
|
b9411514
陈杰
first
|
39
40
41
42
43
44
|
public Page<SubmitLine> getAppList(PointSearchDto dto) {
Page<SubmitLine> result = new Page<>(dto.getPage(),dto.getPageSize());
if(StringUtils.isNotBlank(dto.getMajorName())){
dto.setMajorName("%"+dto.getMajorName()+"%");
}
if(StringUtils.isNotBlank(dto.getUniversityName())){
|
123dbb81
徐泉
研学代码提交
|
45
46
47
|
dto.setUniversityName("%"+dto.getUniversityName()+"%");
}
PageHelper.startPage(dto.getPage(),dto.getPageSize());
|
b9411514
陈杰
first
|
48
|
result.setList(submitFileMapper.getAppList(dto));
|
123dbb81
徐泉
研学代码提交
|
49
50
|
result.setCount(submitFileMapper.getAppListCount(dto));
return result;
|
b9411514
陈杰
first
|
51
|
}
|
123dbb81
徐泉
研学代码提交
|
52
|
|
b9411514
陈杰
first
|
53
54
55
56
57
58
59
60
|
@Override
public int create(SubmitFile submitFile) {
submitFileMapper.insert(submitFile);
int i = 0 ;
List<Point> list = new ArrayList<>();
for(Point point :submitFile.getList()){
point.setSubmitId(submitFile.getId());
i++ ;
|
123dbb81
徐泉
研学代码提交
|
61
|
list.add(point);
|
b9411514
陈杰
first
|
62
|
if(i % 100 == 0){
|
123dbb81
徐泉
研学代码提交
|
63
|
pointMapper.insertBatch(list);
|
b9411514
陈杰
first
|
64
|
list = new ArrayList<>();
|
123dbb81
徐泉
研学代码提交
|
65
|
}
|
b9411514
陈杰
first
|
66
|
}
|
123dbb81
徐泉
研学代码提交
|
67
|
if(list.size() > 0){
|
b9411514
陈杰
first
|
68
69
70
71
|
pointMapper.insertBatch(list);
}
return 1;
}
|
123dbb81
徐泉
研学代码提交
|
72
|
|
b9411514
陈杰
first
|
73
74
75
76
77
78
79
80
81
82
83
84
|
@Override
public int delete(int id) {
submitFileMapper.deleteByPrimaryKey(id);
pointMapper.deleteBySubmit(id);
return 1;
}
@Override
public int update(SubmitFile submitFile) {
return submitFileMapper.updateByPrimaryKey(submitFile);
}
}
|
123dbb81
徐泉
研学代码提交
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
05508d96
陈杰
bug 修复
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
05508d96
陈杰
bug 修复
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
05508d96
陈杰
bug 修复
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
05508d96
陈杰
bug 修复
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
05508d96
陈杰
bug 修复
|
|
|
4dbd6f38
陈杰
bug 修复
|
|
|
b9411514
陈杰
first
|
|
|
2f3069be
陈杰
bug 修复
|
|
|
b9411514
陈杰
first
|
|
|