|
@@ -5,8 +5,11 @@ import com.community.huiju.dao.TpTicketMapper;
|
5
|
5
|
import com.community.huiju.model.TpTicket;
|
6
|
6
|
import com.community.huiju.service.ITicketService;
|
7
|
7
|
import com.community.huiju.vo.TpTicketVO;
|
|
8
|
+import com.github.pagehelper.PageHelper;
|
|
9
|
+import com.google.common.collect.Lists;
|
8
|
10
|
import com.google.common.collect.Maps;
|
9
|
11
|
import lombok.extern.slf4j.Slf4j;
|
|
12
|
+import org.springframework.beans.BeanUtils;
|
10
|
13
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
14
|
import org.springframework.stereotype.Service;
|
12
|
15
|
|
|
@@ -14,6 +17,7 @@ import java.util.List;
|
14
|
17
|
import java.util.Map;
|
15
|
18
|
|
16
|
19
|
/**
|
|
20
|
+ * 工单业务 实现
|
17
|
21
|
* @author weiximei
|
18
|
22
|
*/
|
19
|
23
|
@Service("iTicketService")
|
|
@@ -24,14 +28,59 @@ public class TicketServiceImpl implements ITicketService {
|
24
|
28
|
private TpTicketMapper tpTicketMapper;
|
25
|
29
|
|
26
|
30
|
@Override
|
27
|
|
- public ResponseBean getList(TpTicket tpTicket) {
|
|
31
|
+ public ResponseBean getList(TpTicket tpTicket,Integer pageCode, Integer pageSize) {
|
|
32
|
+
|
|
33
|
+ ResponseBean<Map<String,Object>> responseBean = new ResponseBean();
|
|
34
|
+ Map<String,Object> result = Maps.newHashMap();
|
28
|
35
|
|
29
|
36
|
Map<String,Object> parameter = Maps.newHashMap();
|
30
|
37
|
parameter.put("communityId",tpTicket.getCommunityId());
|
31
|
38
|
parameter.put("taUserId",tpTicket.getTaUserId());
|
32
|
|
- parameter.put("type",tpTicket.getType());
|
33
|
|
- List<TpTicket> tpTicketList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
|
|
39
|
+ // 0 代表 报修 1 代表 投诉 2代表 联系单
|
|
40
|
+ parameter.put("type",0);
|
|
41
|
+
|
|
42
|
+ // 报修
|
|
43
|
+ PageHelper.startPage(pageCode,pageSize);
|
|
44
|
+ List<TpTicket> tpTicketRepairsList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
|
|
45
|
+
|
|
46
|
+ List<TpTicketVO> repairsList = Lists.newArrayList();
|
|
47
|
+ tpTicketRepairsList.stream().forEach(e->{
|
|
48
|
+ TpTicketVO tpTicketVO = new TpTicketVO();
|
|
49
|
+ BeanUtils.copyProperties(e,tpTicketVO);
|
|
50
|
+ repairsList.add(tpTicketVO);
|
|
51
|
+ });
|
|
52
|
+
|
|
53
|
+ // 投诉
|
|
54
|
+ // 0 代表 报修 1 代表 投诉 2代表 联系单
|
|
55
|
+ parameter.put("type",1);
|
|
56
|
+ PageHelper.startPage(pageCode,pageSize);
|
|
57
|
+ List<TpTicket> tpTicketComplaintList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
|
|
58
|
+
|
|
59
|
+ List<TpTicketVO> complaintList = Lists.newArrayList();
|
|
60
|
+ tpTicketComplaintList.stream().forEach(e->{
|
|
61
|
+ TpTicketVO tpTicketVO = new TpTicketVO();
|
|
62
|
+ BeanUtils.copyProperties(e,tpTicketVO);
|
|
63
|
+ complaintList.add(tpTicketVO);
|
|
64
|
+ });
|
|
65
|
+
|
|
66
|
+ // 联系工单
|
|
67
|
+ // 0 代表 报修 1 代表 投诉 2代表 联系单
|
|
68
|
+ parameter.put("type",2);
|
|
69
|
+ PageHelper.startPage(pageCode,pageSize);
|
|
70
|
+ List<TpTicket> tpTicketLiaisonList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
|
|
71
|
+
|
|
72
|
+ List<TpTicketVO> liaisonList = Lists.newArrayList();
|
|
73
|
+ tpTicketLiaisonList.stream().forEach(e->{
|
|
74
|
+ TpTicketVO tpTicketVO = new TpTicketVO();
|
|
75
|
+ BeanUtils.copyProperties(e,tpTicketVO);
|
|
76
|
+ liaisonList.add(tpTicketVO);
|
|
77
|
+ });
|
|
78
|
+
|
|
79
|
+ result.put("repairs",repairsList);
|
|
80
|
+ result.put("complaint",complaintList);
|
|
81
|
+ result.put("liaison",liaisonList);
|
34
|
82
|
|
35
|
|
- return null;
|
|
83
|
+ responseBean.addSuccess(result);
|
|
84
|
+ return responseBean;
|
36
|
85
|
}
|
37
|
86
|
}
|