|
@@ -1,10 +1,13 @@
|
1
|
1
|
package com.community.huiju.service.impl;
|
2
|
2
|
|
|
3
|
+import com.community.commom.session.UserElement;
|
3
|
4
|
import com.community.huiju.dao.TaSysRoleMapper;
|
4
|
5
|
import com.community.huiju.dao.TaUserMapper;
|
|
6
|
+import com.community.huiju.dao.TaUserVerifyMapper;
|
5
|
7
|
import com.community.huiju.dao.TpBillInvoiceMapper;
|
6
|
8
|
import com.community.huiju.model.TaSysRole;
|
7
|
9
|
import com.community.huiju.model.TaUser;
|
|
10
|
+import com.community.huiju.model.TaUserVerify;
|
8
|
11
|
import com.community.huiju.service.BillServiceI;
|
9
|
12
|
import com.github.pagehelper.Page;
|
10
|
13
|
import com.github.pagehelper.PageHelper;
|
|
@@ -30,30 +33,30 @@ public class BillServiceImpl implements BillServiceI {
|
30
|
33
|
|
31
|
34
|
@Autowired
|
32
|
35
|
private TaSysRoleMapper taSysRoleMapper;
|
|
36
|
+
|
|
37
|
+ @Autowired
|
|
38
|
+ private TaUserVerifyMapper taUserVerifyMapper;
|
33
|
39
|
|
34
|
40
|
/**
|
35
|
41
|
* 根据payType分页获取缴费或未缴费的数据
|
36
|
|
- * @param communityId
|
|
42
|
+ * @param userElement
|
37
|
43
|
* @param payType
|
38
|
44
|
* @param pageNum
|
39
|
45
|
* @param pageSize
|
40
|
46
|
* @return
|
41
|
47
|
*/
|
42
|
48
|
@Override
|
43
|
|
- public Map<String, Object> getBillsList(Integer communityId, Integer payType, Integer userId ,Integer pageNum, Integer pageSize) {
|
|
49
|
+ public Map<String, Object> getBillsList(UserElement userElement, Integer payType, Integer pageNum, Integer pageSize) {
|
44
|
50
|
//使用分页插件
|
45
|
51
|
Page<Map<String,Object>> page = PageHelper.startPage(pageNum, pageSize);
|
46
|
52
|
|
47
|
|
- TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
|
53
|
+ /**
|
|
54
|
+ * 账单 关联的是房产, 查询 审核表, 审核表里面的 roomNoId 就是楼栋资料库的id
|
|
55
|
+ */
|
48
|
56
|
|
49
|
|
- TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
|
50
|
|
- // 如果不是业主
|
51
|
|
- if (null != taSysRole && taSysRole.getId().intValue() != 1) {
|
52
|
|
- TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
|
53
|
|
- userId = ownerUser.getId();
|
54
|
|
- }
|
|
57
|
+ TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
|
55
|
58
|
|
56
|
|
- List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(communityId, userId, payType);
|
|
59
|
+ List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(userElement.getCommunityId(), userVerify.getRoomNoId(), payType);
|
57
|
60
|
billsList.forEach(e-> {
|
58
|
61
|
String payPrice = String.valueOf(e.get("payPrice"));
|
59
|
62
|
Double payPriceDouble = Double.parseDouble(payPrice) / 100;
|