魏熙美 6 vuotta sitten
vanhempi
commit
70de0972eb
26 muutettua tiedostoa jossa 496 lisäystä ja 133 poistoa
  1. 38
    20
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java
  2. 2
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java
  3. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java
  4. 13
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillOrder.java
  5. 3
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java
  6. 16
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxLoginServiceI.java
  7. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java
  8. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  9. 10
    9
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java
  10. 75
    11
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java
  11. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java
  12. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java
  13. 64
    52
      CODE/smart-community/app-api/src/main/resources/mapper/TpBillOrderMapper.xml
  14. 1
    1
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  15. BIN
      CODE/smart-community/community-common/target/community-common-0.0.1.jar
  16. 4
    0
      CODE/smart-community/community-common/target/maven-archiver/pom.properties
  17. 32
    0
      CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  18. 29
    0
      CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  19. 2
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillStatementController.java
  20. 14
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpBillOrderMapper.java
  21. 30
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBillOrder.java
  22. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillStatementService.java
  23. 50
    9
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillStatementServiceImpl.java
  24. 39
    0
      CODE/smart-community/property-api/src/main/resources/mapper/BillOrderMapper.xml
  25. 1
    1
      VUECODE/smart-property-manage/src/api/billStatement.js
  26. 41
    18
      VUECODE/smart-property-manage/src/views/bill/statement/index.vue

+ 38
- 20
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/hk/HKOpenApi.java Näytä tiedosto

@@ -11,6 +11,7 @@ import org.omg.CORBA.OBJ_ADAPTER;
11 11
 import org.springframework.web.multipart.MultipartFile;
12 12
 
13 13
 import java.io.IOException;
14
+import java.io.UnsupportedEncodingException;
14 15
 import java.util.HashMap;
15 16
 import java.util.List;
16 17
 import java.util.Map;
@@ -613,26 +614,6 @@ public class HKOpenApi {
613 614
     
614 615
         return data;
615 616
     }
616
-    
617
-    public static void main(String[] args) {
618
-//        Map<String,Object> parMap = Maps.newHashMap();
619
-//        parMap.put("pageNo", 1);
620
-//        parMap.put("pageSize", 100);
621
-//        parMap.put("unitUuids", "e2a3606295f34bc5b336734f4894d708");
622
-//        String data = HKOpenApi.HKgetDoorDevicesByUnitUuids(parMap);
623
-
624
-//        Map<String,Object> parMap = Maps.newHashMap();
625
-//        parMap.put("longNums", "10010100000");
626
-//        String data = HKOpenApi.syncControl(parMap);
627
-
628
-//        Map<String, Object> map = new HashMap<>();
629
-//        map.put("pageNo", 1);
630
-//        map.put("pageSize", 100);
631
-//        HKOpenApi.getPersonInfosEx(map);
632
-
633
-        getDoors();
634
-
635
-    }
636 617
 
637 618
 
638 619
     /**
@@ -944,4 +925,41 @@ public class HKOpenApi {
944 925
         return data;
945 926
     }
946 927
 
928
+    /**
929
+     *  获取默认用户UUID
930
+     * @return
931
+     */
932
+    public static String getDefaultUserUuid(){
933
+        Map<String,Object> parMap = Maps.newHashMap();
934
+        String url = HKConstant.OPENAPI_IP_PORT_HTTP + HKConstant.ITF_ADDRESS_GET_DEFAULT_USER_UUID;
935
+        //设置APPKEY
936
+        parMap.put("appkey", HKConstant.APPKEY);
937
+        //设置时间参数
938
+        parMap.put("time", System.currentTimeMillis());
939
+        String params =  JSON.toJSONString(parMap);
940
+        log.info("获取 获取默认用户UUID 请求参数:{}", params);
941
+        String data = null;
942
+        try {
943
+            data = HttpClientSSLUtils.doPost(url + "?token=" + Digests.buildToken(url + "?" + params, params, HKConstant.SECRET), params);
944
+            log.info("获取 获取默认用户UUID 请求返回结果:{}",data);
945
+        } catch (Exception e) {
946
+            e.printStackTrace();
947
+            log.error("获取获取默认用户UUID失败!",e);
948
+            throw new RuntimeException("获取获取默认用户UUID失败!");
949
+        }
950
+
951
+        return data;
952
+    }
953
+
954
+    public static void main(String[] args) {
955
+        // getDefaultUserUuid();
956
+        String nickname = null;
957
+        try {
958
+            nickname = new String("æ\u009D¨é¡º".getBytes("ISO-8859-1"), "UTF-8");
959
+        } catch (UnsupportedEncodingException e) {
960
+            e.printStackTrace();
961
+        }
962
+        System.out.println(nickname);
963
+    }
964
+
947 965
 }

+ 2
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/VistorController.java Näytä tiedosto

@@ -47,10 +47,9 @@ public class VistorController extends BaseController {
47 47
             return responseBean;
48 48
         }
49 49
 
50
-        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
51
-        Integer userId = userElement.getId();
50
+        UserElement userElement = getUserElement(session);
52 51
         TaVisitor taVisitor = JSONObject.parseObject(parameter,TaVisitor.class);
53
-        responseBean = vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
52
+        responseBean = vistorServiceI.insertTaVistor(taVisitor, userElement);
54 53
         return  responseBean;
55 54
     }
56 55
 

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4 5
 import com.community.huiju.service.WxLoginServiceI;
5 6
 import com.community.huiju.vo.TaUserVO;
6 7
 import io.swagger.annotations.Api;
@@ -80,4 +81,28 @@ public class WxLoginController extends BaseController {
80 81
 		}
81 82
 		return responseBean;
82 83
 	}
84
+
85
+	@RequestMapping(value = "/unbundlingWX", method = RequestMethod.PUT)
86
+	@ApiOperation(value = "解绑微信", notes = "解绑微信")
87
+	@ApiImplicitParams({
88
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
89
+	})
90
+	public ResponseBean unbundlingWX(HttpSession session) {
91
+		ResponseBean responseBean = new ResponseBean();
92
+		UserElement userElement = getUserElement(session);
93
+		responseBean = wxLoginService.unbundlingWX(userElement);
94
+		return responseBean;
95
+	}
96
+
97
+	@RequestMapping(value = "/bundlingWX/{wxcode}", method = RequestMethod.POST)
98
+	@ApiOperation(value = "绑定微信", notes = "绑定微信")
99
+	@ApiImplicitParams({
100
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
101
+	})
102
+	public ResponseBean bundlingWX(HttpSession session, @PathVariable("wxcode") String wxcode) {
103
+		ResponseBean responseBean = new ResponseBean();
104
+		UserElement userElement = getUserElement(session);
105
+		responseBean = wxLoginService.bundlingWX(userElement, wxcode);
106
+		return responseBean;
107
+	}
83 108
 }

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillOrder.java Näytä tiedosto

@@ -26,6 +26,11 @@ public class TpBillOrder {
26 26
      */
27 27
     private String orderStatus;
28 28
 
29
+    /**
30
+     * 缴费人手机号
31
+     */
32
+    private String payPhone;
33
+
29 34
     public Integer getId() {
30 35
         return id;
31 36
     }
@@ -105,4 +110,12 @@ public class TpBillOrder {
105 110
     public void setOrderStatus(String orderStatus) {
106 111
         this.orderStatus = orderStatus;
107 112
     }
113
+
114
+    public String getPayPhone() {
115
+        return payPhone;
116
+    }
117
+
118
+    public void setPayPhone(String payPhone) {
119
+        this.payPhone = payPhone;
120
+    }
108 121
 }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaVistorServiceI.java Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4 5
 import com.community.huiju.model.TaVisitor;
5 6
 
6 7
 import java.util.List;
@@ -15,11 +16,10 @@ public interface TaVistorServiceI {
15 16
     /**
16 17
      * 创建访客
17 18
      * @param taVisitor
18
-     * @param communityId
19
-     * @param userId
19
+     * @param userElement
20 20
      * @return
21 21
      */
22
-    ResponseBean insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId);
22
+    ResponseBean insertTaVistor(TaVisitor taVisitor, UserElement userElement);
23 23
 
24 24
     /**
25 25
      * 访客邀请记录

+ 16
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxLoginServiceI.java Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.service;
2 2
 
3 3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4 5
 
5 6
 import javax.servlet.http.HttpServletRequest;
6 7
 
@@ -26,4 +27,19 @@ public interface WxLoginServiceI {
26 27
 	 * @return
27 28
 	 */
28 29
 	ResponseBean register(String parameter, HttpServletRequest request);
30
+
31
+	/**
32
+	 * 解绑微信
33
+	 * @param userElement
34
+	 * @return
35
+	 */
36
+	ResponseBean unbundlingWX(UserElement userElement);
37
+
38
+	/**
39
+	 * 登录成功的状态下,绑定微信
40
+	 * @param userElement
41
+	 * @param wxcode
42
+	 * @return
43
+	 */
44
+	ResponseBean bundlingWX(UserElement userElement, String wxcode);
29 45
 }

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/HKServiceImpl.java Näytä tiedosto

@@ -43,13 +43,14 @@ public class HKServiceImpl implements IHKService {
43 43
         TaUser user = taUserMapper.selectByPrimaryKey(Integer.parseInt(appUserId));
44 44
         // 这两个值一般都是同时存在的
45 45
         // 当这两个值不存在的时候,就添加海康人员
46
-        if (StringUtils.isBlank(user.getHkUserId() + "") && StringUtils.isBlank(user.getHkPersonNo() + "")) {
46
+        if (null == user.getHkUserId() && null == user.getHkPersonNo()) {
47 47
             // 设置 海康id
48 48
             user.setHkPersonNo(idGen.nextId());
49 49
             /**
50 50
              * 1.获取部门(比如 住户)
51 51
              * 2.根据部门编号推送 海康
52 52
              */
53
+            taUserMapper.updateByPrimaryKeySelective(user);
53 54
             addUserAndOpenCard(responseBean, user);
54 55
         }
55 56
 

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Näytä tiedosto

@@ -397,7 +397,8 @@ public class SocialServiceImpl implements SocialServiceI {
397 397
 
398 398
         tpTransactions.stream().forEach(e -> {
399 399
             // 角色
400
-            TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(user.getId());
400
+            TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
401
+            TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
401 402
             e.setRoleId(taSysRole.getId());
402 403
             e.setRoleName(taSysRole.getRoleName());
403 404
             e.setCreateUserName(user.getUserName());

+ 10
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java Näytä tiedosto

@@ -3,6 +3,7 @@ package com.community.huiju.service.impl;
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
6 7
 import com.community.huiju.common.hk.HKOpenApi;
7 8
 import com.community.huiju.dao.TaUserMapper;
8 9
 import com.community.huiju.dao.TaVisitorLicenseMapper;
@@ -42,15 +43,15 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
42 43
 
43 44
     @Override
44 45
     @Transactional(rollbackFor = Exception.class)
45
-    public ResponseBean insertTaVistor(TaVisitor taVisitor, Integer communityId, Integer userId) {
46
+    public ResponseBean insertTaVistor(TaVisitor taVisitor, UserElement userElement) {
46 47
         ResponseBean response = new ResponseBean();
47 48
 
48
-        taVisitor.setTaUserId(userId);
49
-        taVisitor.setUpdateUser(userId);
50
-        taVisitor.setCreateUser(userId);
49
+        taVisitor.setTaUserId(userElement.getId());
50
+        taVisitor.setUpdateUser(userElement.getId());
51
+        taVisitor.setCreateUser(userElement.getId());
51 52
         taVisitor.setCreateDate(new Date());
52 53
         taVisitor.setUpdateDate(new Date());
53
-        taVisitor.setCommunityId(communityId);
54
+        taVisitor.setCommunityId(userElement.getCommunityId());
54 55
 
55 56
         if (taVisitor.getVisitorStartTime().getTime() >= taVisitor.getVisitorEndTime().getTime()) {
56 57
             response.addError("开始时间不能大于等于离开时间!");
@@ -62,12 +63,12 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
62 63
 
63 64
             for (String taCarLicense : taVisitor.getCarLicense()){
64 65
                 TaVisitorLicense taVisitorLicense = new TaVisitorLicense();
65
-                taVisitorLicense.setCommunityId(communityId);
66
+                taVisitorLicense.setCommunityId(userElement.getCommunityId());
66 67
                 taVisitorLicense.setVisitorId(taVisitor.getId());
67 68
                 taVisitorLicense.setLicense(taCarLicense);
68
-                taVisitorLicense.setCreateUser(userId);
69
+                taVisitorLicense.setCreateUser(userElement.getId());
69 70
                 taVisitorLicense.setCreateDate(new Date());
70
-                taVisitorLicense.setUpdateUser(userId);
71
+                taVisitorLicense.setUpdateUser(userElement.getId());
71 72
                 taVisitorLicense.setUpdateDate(new Date());
72 73
                 taVisitorLicenseMapper.insertSelective(taVisitorLicense);
73 74
             }
@@ -76,7 +77,7 @@ public class TaVistorServiceImpl implements TaVistorServiceI {
76 77
         }
77 78
 
78 79
         // 推送海康
79
-        temporaryRegister(userId,taVisitor,response);
80
+        temporaryRegister(userElement.getId(),taVisitor,response);
80 81
 
81 82
         return response;
82 83
     }

+ 75
- 11
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java Näytä tiedosto

@@ -2,6 +2,7 @@ package com.community.huiju.service.impl;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
5 6
 import com.community.commom.utils.BeanTools;
6 7
 import com.community.huiju.common.code.ICode;
7 8
 import com.community.huiju.common.perproties.LoginCodePerproties;
@@ -60,22 +61,15 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
60 61
 	@Override
61 62
 	public ResponseBean getOpenidByWxcode(String wxcode) {
62 63
 		ResponseBean responseBean = new ResponseBean();
63
-		ApiConfig apiConfig = new ApiConfig("wx6070fd3e8ef854e4","cb07709de2f05b824f1ebda220684d3b", true);
64
-		logger.info("获取微信相关信息");
65
-		OauthAPI oauthAPI = new OauthAPI(apiConfig);
66
-		OauthGetTokenResponse codeResponse = oauthAPI.getToken(wxcode);
64
+
65
+		OauthGetTokenResponse codeResponse = getOauthGetTokenResponse(wxcode);
67 66
 		String openId = codeResponse.getOpenid();
68 67
 		logger.info("获取到wxcode:" + wxcode + " 获取到的openid: " + openId + "accesstoken: " + codeResponse.getAccessToken());
69
-		
68
+
70 69
 		//根据openId查询关联的手机号
71 70
 		TaUser taUser = taUserMapper.getByOpenId(openId);
72 71
 		if (null == taUser) {
73
-			//根据OPENID获取用户信息
74
-			RestTemplate restTemplate = new RestTemplate();
75
-			String wxUrl = "https://api.weixin.qq.com/sns/userinfo?access_token="+codeResponse.getAccessToken()+"&openid=" + openId;
76
-			String userInfo = restTemplate.getForEntity(wxUrl,String.class).getBody();
77
-			logger.info("获取到用户信息:" + userInfo);
78
-
72
+			String userInfo = getWXuserInfo(codeResponse.getAccessToken(), openId);
79 73
 			Map<String, Object> result = Maps.newHashMap();
80 74
 			result.put("userInfo", userInfo);
81 75
 			result.put("openid", openId);
@@ -91,6 +85,40 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
91 85
 		return responseBean;
92 86
 	}
93 87
 
88
+	/**
89
+	 * 微信
90
+	 * 公共方法 OauthGetTokenResponse
91
+	 *
92
+	 * 	可以获取 openid, AccessToken 等
93
+	 *
94
+	 * @param wxcode
95
+	 * @return
96
+	 */
97
+	private OauthGetTokenResponse getOauthGetTokenResponse(String wxcode) {
98
+		ApiConfig apiConfig = new ApiConfig("wx6070fd3e8ef854e4","cb07709de2f05b824f1ebda220684d3b", true);
99
+		logger.info("获取微信相关信息");
100
+		OauthAPI oauthAPI = new OauthAPI(apiConfig);
101
+		OauthGetTokenResponse codeResponse = oauthAPI.getToken(wxcode);
102
+		return codeResponse;
103
+	}
104
+
105
+	/**
106
+	 * 微信
107
+	 * 公共方法,获取 微信用户信息
108
+	 * @param accessToken
109
+	 * @param openId
110
+	 * @return
111
+	 */
112
+	private String getWXuserInfo(String accessToken, String openId) {
113
+		//根据OPENID获取用户信息
114
+		RestTemplate restTemplate = new RestTemplate();
115
+		String wxUrl = "https://api.weixin.qq.com/sns/userinfo?access_token=" + accessToken + "&openid=" + openId;
116
+		String userInfo = restTemplate.getForEntity(wxUrl,String.class).getBody();
117
+		logger.info("获取到用户信息:" + userInfo);
118
+
119
+		return userInfo;
120
+	}
121
+
94 122
 	@Override
95 123
 	public ResponseBean associatedWX(String parameter) {
96 124
 		ResponseBean responseBean = new ResponseBean();
@@ -229,4 +257,40 @@ public class WxLoginServiceImpl implements WxLoginServiceI {
229 257
 		return response;
230 258
 	}
231 259
 
260
+
261
+	@Override
262
+	public ResponseBean unbundlingWX(UserElement userElement) {
263
+		ResponseBean responseBean = new ResponseBean();
264
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
265
+		taUser.setOpenid("");
266
+		taUserMapper.updateByPrimaryKeySelective(taUser);
267
+
268
+		responseBean.addSuccess("操作成功!");
269
+		return responseBean;
270
+	}
271
+
272
+	@Override
273
+	public ResponseBean bundlingWX(UserElement userElement, String wxcode) {
274
+		ResponseBean responseBean = new ResponseBean();
275
+
276
+		OauthGetTokenResponse codeResponse = getOauthGetTokenResponse(wxcode);
277
+		String openId = codeResponse.getOpenid();
278
+		logger.info("获取到wxcode:" + wxcode + " 获取到的openid: " + openId + "accesstoken: " + codeResponse.getAccessToken());
279
+
280
+		String userInfo = getWXuserInfo(codeResponse.getAccessToken(), openId);
281
+		JSONObject userInfoJSON = JSONObject.parseObject(userInfo);
282
+		String nickname = userInfoJSON.getString("nickname");
283
+		try {
284
+			nickname = new String(nickname.getBytes("ISO-8859-1"), "UTF-8");
285
+		} catch (UnsupportedEncodingException e) {
286
+			e.printStackTrace();
287
+		}
288
+		TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
289
+		taUser.setOpenid(openId);
290
+		taUser.setNickname(nickname);
291
+		taUserMapper.updateByPrimaryKeySelective(taUser);
292
+
293
+		responseBean.addSuccess("操作成功!");
294
+		return responseBean;
295
+	}
232 296
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java Näytä tiedosto

@@ -262,6 +262,7 @@ public class WxPayServiceImpl implements WxPayServiceI {
262 262
 			tpBillOrder.setUpdateDate(new Date());
263 263
 			tpBillOrder.setUpdateUser(userElement.getId());
264 264
 			tpBillOrder.setOrderBumber(orderNo);
265
+			tpBillOrder.setPayPhone(taUser.getLoginName());
265 266
 
266 267
 			tpBillOrderMapper.insertSelective(tpBillOrder);
267 268
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java Näytä tiedosto

@@ -91,7 +91,7 @@ public class TaUserVO {
91 91
     /**  户号id **/
92 92
     private Integer roomNoId;
93 93
 
94
-    /** 是否绑定了微信 **/
94
+    /** 是否绑定了微信 0 未绑定  1 已绑定**/
95 95
     private Integer bindingWX;
96 96
 
97 97
     /**

+ 64
- 52
CODE/smart-community/app-api/src/main/resources/mapper/TpBillOrderMapper.xml Näytä tiedosto

@@ -11,14 +11,15 @@
11 11
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
12 12
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
13 13
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
14
-    <result column="order_status" property="orderStatus" jdbcType="VARCHAR" />
14
+    <result column="order_status" property="orderStatus" jdbcType="CHAR" />
15
+    <result column="pay_phone" property="payPhone" jdbcType="VARCHAR" />
15 16
   </resultMap>
16 17
   <sql id="Base_Column_List" >
17
-    id, community_id, tp_bill_id, tp_bill_invoice_id, order_bumber, create_user, create_date, 
18
-    update_user, update_date, order_status
18
+    id, community_id, tp_bill_id, tp_bill_invoice_id, order_bumber, create_user, create_date,
19
+    update_user, update_date, order_status, pay_phone
19 20
   </sql>
20 21
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
-    select 
22
+    select
22 23
     <include refid="Base_Column_List" />
23 24
     from tp_bill_order
24 25
     where id = #{id,jdbcType=INTEGER}
@@ -28,15 +29,14 @@
28 29
     where id = #{id,jdbcType=INTEGER}
29 30
   </delete>
30 31
   <insert id="insert" parameterType="com.community.huiju.model.TpBillOrder" >
31
-    insert into tp_bill_order (id, community_id, tp_bill_id, 
32
-      tp_bill_invoice_id, order_bumber, create_user, 
33
-      create_date, update_user, update_date, order_status
34
-      )
35
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tpBillId,jdbcType=INTEGER}, 
36
-      #{tpBillInvoiceId,jdbcType=INTEGER}, #{orderBumber,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER}, 
32
+    insert into tp_bill_order (id, community_id, tp_bill_id,
33
+      tp_bill_invoice_id, order_bumber, create_user,
34
+      create_date, update_user, update_date,
35
+      order_status, pay_phone)
36
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tpBillId,jdbcType=INTEGER},
37
+      #{tpBillInvoiceId,jdbcType=INTEGER}, #{orderBumber,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER},
37 38
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
38
-      #{orderStatus,jdbcType=VARCHAR}
39
-      )
39
+      #{orderStatus,jdbcType=CHAR}, #{payPhone,jdbcType=VARCHAR})
40 40
   </insert>
41 41
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillOrder" >
42 42
     insert into tp_bill_order
@@ -68,9 +68,12 @@
68 68
       <if test="updateDate != null" >
69 69
         update_date,
70 70
       </if>
71
-      <if test="orderStatus != null">
71
+      <if test="orderStatus != null" >
72 72
         order_status,
73 73
       </if>
74
+      <if test="payPhone != null" >
75
+        pay_phone,
76
+      </if>
74 77
     </trim>
75 78
     <trim prefix="values (" suffix=")" suffixOverrides="," >
76 79
       <if test="id != null" >
@@ -100,8 +103,11 @@
100 103
       <if test="updateDate != null" >
101 104
         #{updateDate,jdbcType=TIMESTAMP},
102 105
       </if>
103
-      <if test="orderStatus != null">
104
-        #{orderStatus,jdbcType=VARCHAR},
106
+      <if test="orderStatus != null" >
107
+        #{orderStatus,jdbcType=CHAR},
108
+      </if>
109
+      <if test="payPhone != null" >
110
+        #{payPhone,jdbcType=VARCHAR},
105 111
       </if>
106 112
     </trim>
107 113
   </insert>
@@ -132,8 +138,11 @@
132 138
       <if test="updateDate != null" >
133 139
         update_date = #{updateDate,jdbcType=TIMESTAMP},
134 140
       </if>
135
-      <if test="orderStatus != null">
136
-        order_status = #{orderStatus,jdbcType=VARCHAR}
141
+      <if test="orderStatus != null" >
142
+        order_status = #{orderStatus,jdbcType=CHAR},
143
+      </if>
144
+      <if test="payPhone != null" >
145
+        pay_phone = #{payPhone,jdbcType=VARCHAR},
137 146
       </if>
138 147
     </set>
139 148
     where id = #{id,jdbcType=INTEGER}
@@ -148,46 +157,49 @@
148 157
       create_date = #{createDate,jdbcType=TIMESTAMP},
149 158
       update_user = #{updateUser,jdbcType=INTEGER},
150 159
       update_date = #{updateDate,jdbcType=TIMESTAMP},
151
-      order_status = #{orderStatus,jdbcType=VARCHAR}
160
+      order_status = #{orderStatus,jdbcType=CHAR},
161
+      pay_phone = #{payPhone,jdbcType=VARCHAR}
152 162
     where id = #{id,jdbcType=INTEGER}
153 163
   </update>
154
-
155 164
   <insert id="batchInsertSelective" parameterType="list" >
156 165
     insert into tp_bill_order
157 166
     values
158
-    <foreach collection="list" index="index" item="item" open="(" close=")" separator="," >
159
-      <trim suffixOverrides=",">
160
-        <if test="item.id != null" >
161
-          #{item.id,jdbcType=INTEGER},
162
-        </if>
163
-        <if test="item.communityId != null" >
164
-          #{item.communityId,jdbcType=INTEGER},
165
-        </if>
166
-        <if test="item.tpBillId != null" >
167
-          #{item.tpBillId,jdbcType=INTEGER},
168
-        </if>
169
-        <if test="item.tpBillInvoiceId != null" >
170
-          #{item.tpBillInvoiceId,jdbcType=INTEGER},
171
-        </if>
172
-        <if test="item.orderBumber != null" >
173
-          #{item.orderBumber,jdbcType=VARCHAR},
174
-        </if>
175
-        <if test="item.createUser != null" >
176
-          #{item.createUser,jdbcType=INTEGER},
177
-        </if>
178
-        <if test="item.createDate != null" >
179
-          #{item.createDate,jdbcType=TIMESTAMP},
180
-        </if>
181
-        <if test="item.updateUser != null" >
182
-          #{item.updateUser,jdbcType=INTEGER},
183
-        </if>
184
-        <if test="item.updateDate != null" >
185
-          #{item.updateDate,jdbcType=TIMESTAMP},
186
-        </if>
187
-        <if test="orderStatus != null">
188
-          order_status = #{orderStatus,jdbcType=VARCHAR},
189
-        </if>
190
-      </trim>
167
+    <foreach collection="list" index="index" item="item"  separator="," >
168
+        <trim suffixOverrides="," suffix="(" prefix=")">
169
+          <if test="item.id != null">
170
+            #{item.id,jdbcType=INTEGER},
171
+          </if>
172
+          <if test="item.communityId != null">
173
+            #{item.communityId,jdbcType=INTEGER},
174
+          </if>
175
+          <if test="item.tpBillId != null">
176
+            #{item.tpBillId,jdbcType=INTEGER},
177
+          </if>
178
+          <if test="item.tpBillInvoiceId != null">
179
+            #{item.tpBillInvoiceId,jdbcType=INTEGER},
180
+          </if>
181
+          <if test="item.orderBumber != null">
182
+            #{item.orderBumber,jdbcType=VARCHAR},
183
+          </if>
184
+          <if test="item.createUser != null">
185
+            #{item.createUser,jdbcType=INTEGER},
186
+          </if>
187
+          <if test="item.createDate != null">
188
+            #{item.createDate,jdbcType=TIMESTAMP},
189
+          </if>
190
+          <if test="item.updateUser != null">
191
+            #{item.updateUser,jdbcType=INTEGER},
192
+          </if>
193
+          <if test="item.updateDate != null">
194
+            #{item.updateDate,jdbcType=TIMESTAMP},
195
+          </if>
196
+          <if test="orderStatus != null">
197
+            #{orderStatus,jdbcType=VARCHAR},
198
+          </if>
199
+          <if test="payPhone != null">
200
+            #{payPhone,jdbcType=VARCHAR}
201
+          </if>
202
+        </trim>
191 203
     </foreach>
192 204
   </insert>
193 205
 </mapper>

+ 1
- 1
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Näytä tiedosto

@@ -124,7 +124,7 @@ public class Constant {
124 124
 
125 125
 
126 126
     /** 添加用户所对应的部门 住户 **/
127
-    public static final String DEPT_RESIDENTS = "测试";
127
+    public static final String DEPT_RESIDENTS = "荟房会议室";
128 128
     
129 129
     /**
130 130
      * 报名状态 已报名

BIN
CODE/smart-community/community-common/target/community-common-0.0.1.jar Näytä tiedosto


+ 4
- 0
CODE/smart-community/community-common/target/maven-archiver/pom.properties Näytä tiedosto

@@ -0,0 +1,4 @@
1
+#Created by Apache Maven 3.3.9
2
+version=0.0.1
3
+groupId=com.community
4
+artifactId=community-common

+ 32
- 0
CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst Näytä tiedosto

@@ -0,0 +1,32 @@
1
+com\community\commom\redis\RedisTemplate.class
2
+com\community\commom\redis\RedisConfiguration.class
3
+com\community\commom\utils\OssUtil.class
4
+com\community\commom\redis\SingleRedisTemplate.class
5
+com\community\commom\utils\EnumUtils.class
6
+com\community\commom\hk\HttpClientSSLUtils$2.class
7
+com\community\commom\redis\RedisJsonSerializer.class
8
+com\community\commom\uuid\IdGen.class
9
+com\community\commom\utils\BeanTools.class
10
+com\community\commom\hk\HttpClientSSLUtils.class
11
+com\community\commom\session\UserElement.class
12
+com\community\commom\utils\CommonUtils.class
13
+com\community\commom\redis\RedisSerializer.class
14
+com\community\commom\utils\StringConverter.class
15
+com\community\commom\mode\ResponseBean.class
16
+com\community\commom\utils\DESUtils.class
17
+com\community\commom\redis\FastJsonSerializer.class
18
+com\community\commom\utils\DateUtils.class
19
+com\community\commom\utils\HttpClientUtils.class
20
+com\community\commom\constant\Constant.class
21
+com\community\commom\utils\CookieUtil.class
22
+com\community\commom\mode\HkResponseBean.class
23
+com\community\commom\ailiyun\AESDecode.class
24
+com\community\commom\uuid\IdGen$IdGenHolder.class
25
+com\community\commom\utils\PayPriceUtils.class
26
+com\community\commom\hk\HttpClientSSLUtils$1.class
27
+com\community\commom\utils\MD5Utils.class
28
+com\community\commom\redis\RedisObjectSerializer.class
29
+com\community\commom\utils\QRCodeGeneratorUtils.class
30
+com\community\commom\redis\SerializationFailedException.class
31
+com\community\commom\hk\Digests.class
32
+com\community\commom\utils\AccountValidatorUtil.class

+ 29
- 0
CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst Näytä tiedosto

@@ -0,0 +1,29 @@
1
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisJsonSerializer.java
2
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\ailiyun\AESDecode.java
3
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\hk\HttpClientSSLUtils.java
4
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\PayPriceUtils.java
5
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\DateUtils.java
6
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\HttpClientUtils.java
7
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\DESUtils.java
8
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisSerializer.java
9
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\BeanTools.java
10
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\OssUtil.java
11
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisObjectSerializer.java
12
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\EnumUtils.java
13
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisTemplate.java
14
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\mode\HkResponseBean.java
15
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\SerializationFailedException.java
16
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\CommonUtils.java
17
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\MD5Utils.java
18
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\session\UserElement.java
19
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\SingleRedisTemplate.java
20
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\hk\Digests.java
21
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\QRCodeGeneratorUtils.java
22
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisConfiguration.java
23
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\AccountValidatorUtil.java
24
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\uuid\IdGen.java
25
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\mode\ResponseBean.java
26
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\StringConverter.java
27
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\FastJsonSerializer.java
28
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\constant\Constant.java
29
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\CookieUtil.java

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillStatementController.java Näytä tiedosto

@@ -29,13 +29,13 @@ import java.io.OutputStream;
29 29
 @RestController
30 30
 @RequestMapping("/")
31 31
 @RefreshScope
32
-@Api(value = "流水信息 API", description = "流水信息 API")
32
+@Api(value = "流水/订单 信息 API", description = "流水/订单 信息 API")
33 33
 public class BillStatementController extends BaseController {
34 34
 
35 35
     @Autowired
36 36
     private IBillStatementService iBillStatementService;
37 37
 
38
-    @ApiOperation(value = "获取流水信息", notes = "获取流水信息")
38
+    @ApiOperation(value = "获取订单信息", notes = "获取订单信息")
39 39
     @ApiImplicitParams({
40 40
             @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "id流水编号," +
41 41
                     "billId缴费项编号,billName缴费项名称,billInvoiceId缴费单编号,payName缴费人"),

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpBillOrderMapper.java Näytä tiedosto

@@ -1,8 +1,14 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.community.huiju.model.BillStatement;
4 7
 import com.community.huiju.model.TpBillOrder;
5 8
 import org.apache.ibatis.annotations.Mapper;
9
+import org.apache.ibatis.annotations.Param;
10
+
11
+import java.util.Map;
6 12
 
7 13
 /**
8 14
  * <p>
@@ -15,4 +21,12 @@ import org.apache.ibatis.annotations.Mapper;
15 21
 @Mapper
16 22
 public interface TpBillOrderMapper extends BaseMapper<TpBillOrder> {
17 23
 
24
+    /**
25
+     * 查询订单数据
26
+     * @param page
27
+     * @param map
28
+     * @return
29
+     */
30
+    IPage<TpBillOrder> getBillOrderAll(Page page, @Param("map") Map<String, Object> map);
31
+
18 32
 }

+ 30
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBillOrder.java Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import com.baomidou.mybatisplus.annotation.TableName;
6 7
 import lombok.Data;
@@ -9,6 +10,7 @@ import lombok.experimental.Accessors;
9 10
 
10 11
 import java.io.Serializable;
11 12
 import java.time.LocalDateTime;
13
+import java.util.List;
12 14
 
13 15
 /**
14 16
  * <p>
@@ -74,5 +76,33 @@ public class TpBillOrder implements Serializable {
74 76
      */
75 77
     private String orderStatus;
76 78
 
79
+    /**
80
+     * 缴费人手机号
81
+     */
82
+    private String payPhone;
83
+
84
+    /**
85
+     * 缴费组id列表
86
+     */
87
+    @TableField(exist = false)
88
+    private List<Integer> billIdList;
89
+
90
+
91
+    /**
92
+     * 缴费单id列表
93
+     */
94
+    @TableField(exist = false)
95
+    private List<Integer> billInvoiceIdList;
77 96
 
97
+    /**
98
+     * 缴费金额
99
+     */
100
+    @TableField(exist = false)
101
+    private Long sumPrice;
102
+
103
+    /**
104
+     * 缴费方式
105
+     */
106
+    @TableField(exist = false)
107
+    private String payType;
78 108
 }

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillStatementService.java Näytä tiedosto

@@ -16,7 +16,7 @@ import com.community.huiju.model.BillStatement;
16 16
 public interface IBillStatementService extends IService<BillStatement> {
17 17
 
18 18
     /**
19
-     * 查询流水账单
19
+     * 查询 流水/订单 账单
20 20
      * @param userElement
21 21
      * @param parameter
22 22
      * @return

+ 50
- 9
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillStatementServiceImpl.java Näytä tiedosto

@@ -1,14 +1,18 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 8
 import com.community.commom.mode.ResponseBean;
8 9
 import com.community.commom.session.UserElement;
10
+import com.community.huiju.dao.BillInvoiceMapper;
11
+import com.community.huiju.dao.TpBillOrderMapper;
9 12
 import com.community.huiju.model.BillInvoice;
10 13
 import com.community.huiju.model.BillStatement;
11 14
 import com.community.huiju.dao.BillStatementMapper;
15
+import com.community.huiju.model.TpBillOrder;
12 16
 import com.community.huiju.service.IBillStatementService;
13 17
 import com.google.common.collect.Maps;
14 18
 import org.apache.poi.hssf.usermodel.*;
@@ -18,6 +22,7 @@ import org.springframework.stereotype.Service;
18 22
 import java.text.SimpleDateFormat;
19 23
 import java.util.List;
20 24
 import java.util.Map;
25
+import java.util.stream.Collectors;
21 26
 
22 27
 /**
23 28
  * <p>
@@ -33,6 +38,12 @@ public class BillStatementServiceImpl extends ServiceImpl<BillStatementMapper, B
33 38
     @Autowired
34 39
     private BillStatementMapper billStatementMapper;
35 40
 
41
+    @Autowired
42
+    private TpBillOrderMapper tpBillOrderMapper;
43
+
44
+    @Autowired
45
+    private BillInvoiceMapper billInvoiceMapper;
46
+
36 47
     @Override
37 48
     public ResponseBean getBillStatement(UserElement userElement, String parameter) {
38 49
         ResponseBean responseBean = new ResponseBean();
@@ -48,8 +59,8 @@ public class BillStatementServiceImpl extends ServiceImpl<BillStatementMapper, B
48 59
         String billName = jsonObject.getString("billName");
49 60
         // 缴费单 编号
50 61
         Integer billInvoiceId = jsonObject.getInteger("billInvoiceId");
51
-        // 缴费人
52
-        String payName = jsonObject.getString("payName");
62
+        // 缴费人手机号
63
+        String payPhone = jsonObject.getString("payPhone");
53 64
 
54 65
         // 参数
55 66
         Map<String, Object> map = Maps.newHashMap();
@@ -57,19 +68,49 @@ public class BillStatementServiceImpl extends ServiceImpl<BillStatementMapper, B
57 68
         map.put("billId", billId);
58 69
         map.put("billName", billName);
59 70
         map.put("billInvoiceId", billInvoiceId);
60
-        map.put("payName", payName);
71
+        map.put("payPhone", payPhone);
61 72
         map.put("communityId", userElement.getCommunityId());
62 73
 
63
-        Page<BillStatement> page = new Page<>();
74
+        Page<TpBillOrder> page = new Page<>();
64 75
         page.setCurrent(pageNum);
65 76
         page.setSize(pageSize);
66
-        IPage<BillStatement> billStatementIPage = billStatementMapper.getBillStatementAll(page, map);
77
+        IPage<TpBillOrder> billOrderIPage = tpBillOrderMapper.getBillOrderAll(page, map);
78
+        // 这里拿到的订单数据,都是进过去重之后的
79
+        List<TpBillOrder> orderRecords = billOrderIPage.getRecords();
80
+
81
+        /**
82
+         * 根据去重之后的订单,再去查询每个订单的缴费信息
83
+         */
84
+
85
+        // 1.查询缴费组id集合
86
+        // 2.查询缴费单id集合
87
+        // 3.缴费单总金额
88
+
89
+        orderRecords.forEach(e-> {
90
+            QueryWrapper<TpBillOrder> billOrderQueryWrapper = new QueryWrapper<>();
91
+            billOrderQueryWrapper.eq("order_bumber", e.getOrderBumber());
92
+            List<TpBillOrder> childBillOrderList = tpBillOrderMapper.selectList(billOrderQueryWrapper);
93
+
94
+            // 缴费组id集合
95
+            List<Integer> billIdCollect = childBillOrderList.stream().map(billOrder -> billOrder.getTpBillId()).collect(Collectors.toList());
96
+            // 缴费单id集合
97
+            List<Integer> billInvoiceIdCollect = childBillOrderList.stream().map(billOrder -> billOrder.getTpBillInvoiceId()).collect(Collectors.toList());
98
+            // 总金额
99
+            Long sumPrice = childBillOrderList.stream().map(billOrder -> {
100
+                BillInvoice billInvoice = billInvoiceMapper.selectById(billOrder.getTpBillInvoiceId());
101
+                return billInvoice.getPayPrice();
102
+            }).count();
103
+
104
+            e.setBillIdList(billIdCollect);
105
+            e.setBillInvoiceIdList(billInvoiceIdCollect);
106
+            e.setSumPrice(sumPrice);
107
+        });
67 108
 
68 109
         Map<String, Object> respMap = Maps.newHashMap();
69
-        respMap.put("list", billStatementIPage.getRecords());
70
-        respMap.put("pageNum", billStatementIPage.getCurrent());
71
-        respMap.put("pageSize", billStatementIPage.getSize());
72
-        respMap.put("total", billStatementIPage.getTotal());
110
+        respMap.put("list", orderRecords);
111
+        respMap.put("pageNum", billOrderIPage.getCurrent());
112
+        respMap.put("pageSize", billOrderIPage.getSize());
113
+        respMap.put("total", billOrderIPage.getTotal());
73 114
 
74 115
         responseBean.addSuccess(respMap);
75 116
         return responseBean;

+ 39
- 0
CODE/smart-community/property-api/src/main/resources/mapper/BillOrderMapper.xml Näytä tiedosto

@@ -0,0 +1,39 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.TpBillOrderMapper">
4
+
5
+    <select id="getBillOrderAll" resultType="com.community.huiju.model.TpBillOrder">
6
+        SELECT
7
+        tbo.*,
8
+        tbs.pay_remark as payRemark,
9
+        tbs.pay_type as payType
10
+        FROM
11
+        tp_bill_order tbo LEFT JOIN tp_bill_statement tbs on tbo.tp_bill_invoice_id = tbs.bill_invoice_id
12
+        LEFT JOIN tp_bill tb on tbo.tp_bill_id = tb.id
13
+        <where>
14
+            <trim prefixOverrides="and | or">
15
+                <if test="map.id != null">
16
+                    and tbo.id like CONCAT('%',#{map.id},'%')
17
+                </if>
18
+                <if test="map.billId != null">
19
+                    and tbo.tp_bill_id like CONCAT('%',#{map.billId},'%')
20
+                </if>
21
+                <if test="map.billName != null and map.billName != ''">
22
+                    and tb.bill_name like CONCAT('%',#{map.billName},'%')
23
+                </if>
24
+                <if test="map.billInvoiceId != null">
25
+                    and tbo.tp_bill_invoice_id like CONCAT('%',#{map.billInvoiceId},'%')
26
+                </if>
27
+                <if test="map.payPhone != null and map.payPhone != ''">
28
+                    and tbo.pay_phone like CONCAT('%', #{map.payPhone},'%')
29
+                </if>
30
+                <if test="map.communityId != null">
31
+                    and tbo.community_id = #{map.communityId}
32
+                </if>
33
+            </trim>
34
+        </where>
35
+        group by tbo.order_bumber
36
+        order by tbo.create_date DESC
37
+    </select>
38
+
39
+</mapper>

+ 1
- 1
VUECODE/smart-property-manage/src/api/billStatement.js Näytä tiedosto

@@ -10,7 +10,7 @@ export function getBillStatementAll(data) {
10 10
       billId: data.billId, // 缴费项 id
11 11
       billName: data.billName, //  缴费项 名称
12 12
       billInvoiceId: data.billInvoiceId, // 缴费单 编号
13
-      payName: data.payName, //  缴费人
13
+      payPhone: data.payName, //  缴费人手机号
14 14
       pageNum: data.pageNum,
15 15
       pageSize: data.pageSize
16 16
     }

+ 41
- 18
VUECODE/smart-property-manage/src/views/bill/statement/index.vue Näytä tiedosto

@@ -13,8 +13,8 @@
13 13
       <el-form-item label="收费单号">
14 14
         <el-input v-model="formInline.billInvoiceId" placeholder="收费单号"/>
15 15
       </el-form-item>
16
-      <el-form-item label="缴费人">
17
-        <el-input v-model="formInline.payName" placeholder="缴费人"/>
16
+      <el-form-item label="缴费人手机号">
17
+        <el-input v-model="formInline.payPhone" placeholder="缴费人手机号"/>
18 18
       </el-form-item>
19 19
       <el-form-item>
20 20
         <el-button type="info" @click="clear">清空</el-button>
@@ -24,6 +24,7 @@
24 24
     <el-button type="primary" style="margin-left: 20px; margin-bottom: 20px;" @click="exportExcel">导出数据</el-button>
25 25
     <el-table
26 26
       ref="multipleTable"
27
+      v-loading="loading"
27 28
       :data="list"
28 29
       border
29 30
       tooltip-effect="dark"
@@ -44,33 +45,36 @@
44 45
         align="center"
45 46
         label="收费组编号">
46 47
         <template slot-scope="scope">
47
-          <span style="color: #409EFF;cursor: pointer" @click="getInfo(scope.row.billId)">{{ scope.row.billId }}</span>
48
+          <span v-for="item in scope.row.billIdList">
49
+            <a style="color: #409EFF;cursor: pointer" @click="getInfo(item)">{{ item }}</a>,
50
+          </span>
48 51
         </template>
49 52
       </el-table-column>
50 53
       <el-table-column
51
-        prop="billName"
52
-        label="收费组名称"
54
+        prop="billInvoiceId"
55
+        label="收费单号"
53 56
         align="center"
54
-        show-overflow-tooltip>
57
+        width="120">
55 58
         <template slot-scope="scope">
56
-          <span style="color: #409EFF;cursor: pointer" @click="getInfo(scope.row.billId)">{{ scope.row.billName }}</span>
59
+          <span v-for="item in scope.row.billInvoiceIdList">
60
+            <a style="color: #409EFF;cursor: pointer">{{ item }}</a>,
61
+          </span>
57 62
         </template>
58 63
       </el-table-column>
59
-      <el-table-column
60
-        prop="billInvoiceId"
61
-        label="收费单号"
62
-        align="center"
63
-        width="120"/>
64 64
       <el-table-column
65 65
         prop="payPrice"
66 66
         align="center"
67
-        label="费用金额">
68
-        <template slot-scope="scope">{{ showPayPrice(scope.row.payPrice) }}</template>
67
+        label="总费用金额">
68
+        <template slot-scope="scope">{{ showPayPrice(scope.row.sumPrice) }}</template>
69 69
       </el-table-column>
70 70
       <el-table-column
71
-        prop="payName"
71
+        prop="orderStatus"
72
+        align="center"
73
+        label="订单状态"/>
74
+      <el-table-column
75
+        prop="payPhone"
72 76
         align="center"
73
-        label="缴费人"/>
77
+        label="缴费人手机号"/>
74 78
       <el-table-column
75 79
         prop="payRemark"
76 80
         align="center"
@@ -85,7 +89,13 @@
85 89
         prop="createTime"
86 90
         align="center"
87 91
         label="订单生成时间">
88
-        <template slot-scope="scope">{{ formatDate(scope.row.createTime) }}</template>
92
+        <template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template>
93
+      </el-table-column>
94
+      <el-table-column
95
+        prop="createTime"
96
+        align="center"
97
+        label="缴费完成时间">
98
+        <template slot-scope="scope">{{ formatDate(scope.row.updateDate) }}</template>
89 99
       </el-table-column>
90 100
     </el-table>
91 101
     <div class="foot-page">
@@ -111,10 +121,11 @@ export default {
111 121
         billId: '', // 缴费项 id
112 122
         billName: '', //  缴费项 名称
113 123
         billInvoiceId: '', // 缴费单 编号
114
-        payName: '', //  缴费人
124
+        payPhone: '', //  缴费人手机号
115 125
         pageNum: 1,
116 126
         pageSize: 10
117 127
       },
128
+      loading: false,
118 129
       list: [], // 数据
119 130
       total: 0 // 总数
120 131
     }
@@ -137,13 +148,16 @@ export default {
137 148
       this.getBillStatement()
138 149
     },
139 150
     getBillStatement() { //  获取流水信息
151
+      this.loading = true
140 152
       this.$store.dispatch('GetBillStatementAll', this.formInline).then(res => {
153
+        this.loading = false
141 154
         const resData = res.data
142 155
         this.list = resData.list
143 156
         this.formInline.pageNum = resData.pageNum
144 157
         this.formInline.pageSize = resData.pageSize
145 158
         this.total = resData.total
146 159
       }).catch(() => {
160
+        this.loading = false
147 161
         console.log('error GetBillStatementAll')
148 162
       })
149 163
     },
@@ -211,6 +225,15 @@ export default {
211 225
       }).catch(() => {
212 226
         console.log('error ExportBillStatementExcel')
213 227
       })
228
+    },
229
+    showBillArray(billIdList) { // 收费组id 集合
230
+      let aStr = ''
231
+      billIdList = ['1001', '1002']
232
+      billIdList.map((item, index) => {
233
+        aStr += `<a style="color: #409EFF;cursor: pointer" @click="getInfo(` + item + `)">` + item + `</a>,`
234
+      })
235
+
236
+      return aStr
214 237
     }
215 238
   }
216 239
 }