魏熙美 6 年前
父节点
当前提交
70de0972eb
共有 26 个文件被更改,包括 496 次插入133 次删除
  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. 二进制
      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 查看文件

11
 import org.springframework.web.multipart.MultipartFile;
11
 import org.springframework.web.multipart.MultipartFile;
12
 
12
 
13
 import java.io.IOException;
13
 import java.io.IOException;
14
+import java.io.UnsupportedEncodingException;
14
 import java.util.HashMap;
15
 import java.util.HashMap;
15
 import java.util.List;
16
 import java.util.List;
16
 import java.util.Map;
17
 import java.util.Map;
613
     
614
     
614
         return data;
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
         return data;
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 查看文件

47
             return responseBean;
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
         TaVisitor taVisitor = JSONObject.parseObject(parameter,TaVisitor.class);
51
         TaVisitor taVisitor = JSONObject.parseObject(parameter,TaVisitor.class);
53
-        responseBean = vistorServiceI.insertTaVistor(taVisitor, communityId, userId);
52
+        responseBean = vistorServiceI.insertTaVistor(taVisitor, userElement);
54
         return  responseBean;
53
         return  responseBean;
55
     }
54
     }
56
 
55
 

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java 查看文件

1
 package com.community.huiju.controller;
1
 package com.community.huiju.controller;
2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4
 import com.community.huiju.service.WxLoginServiceI;
5
 import com.community.huiju.service.WxLoginServiceI;
5
 import com.community.huiju.vo.TaUserVO;
6
 import com.community.huiju.vo.TaUserVO;
6
 import io.swagger.annotations.Api;
7
 import io.swagger.annotations.Api;
80
 		}
81
 		}
81
 		return responseBean;
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 查看文件

26
      */
26
      */
27
     private String orderStatus;
27
     private String orderStatus;
28
 
28
 
29
+    /**
30
+     * 缴费人手机号
31
+     */
32
+    private String payPhone;
33
+
29
     public Integer getId() {
34
     public Integer getId() {
30
         return id;
35
         return id;
31
     }
36
     }
105
     public void setOrderStatus(String orderStatus) {
110
     public void setOrderStatus(String orderStatus) {
106
         this.orderStatus = orderStatus;
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 查看文件

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4
 import com.community.huiju.model.TaVisitor;
5
 import com.community.huiju.model.TaVisitor;
5
 
6
 
6
 import java.util.List;
7
 import java.util.List;
15
     /**
16
     /**
16
      * 创建访客
17
      * 创建访客
17
      * @param taVisitor
18
      * @param taVisitor
18
-     * @param communityId
19
-     * @param userId
19
+     * @param userElement
20
      * @return
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 查看文件

1
 package com.community.huiju.service;
1
 package com.community.huiju.service;
2
 
2
 
3
 import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.session.UserElement;
4
 
5
 
5
 import javax.servlet.http.HttpServletRequest;
6
 import javax.servlet.http.HttpServletRequest;
6
 
7
 
26
 	 * @return
27
 	 * @return
27
 	 */
28
 	 */
28
 	ResponseBean register(String parameter, HttpServletRequest request);
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 查看文件

43
         TaUser user = taUserMapper.selectByPrimaryKey(Integer.parseInt(appUserId));
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
             // 设置 海康id
47
             // 设置 海康id
48
             user.setHkPersonNo(idGen.nextId());
48
             user.setHkPersonNo(idGen.nextId());
49
             /**
49
             /**
50
              * 1.获取部门(比如 住户)
50
              * 1.获取部门(比如 住户)
51
              * 2.根据部门编号推送 海康
51
              * 2.根据部门编号推送 海康
52
              */
52
              */
53
+            taUserMapper.updateByPrimaryKeySelective(user);
53
             addUserAndOpenCard(responseBean, user);
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 查看文件

397
 
397
 
398
         tpTransactions.stream().forEach(e -> {
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
             e.setRoleId(taSysRole.getId());
402
             e.setRoleId(taSysRole.getId());
402
             e.setRoleName(taSysRole.getRoleName());
403
             e.setRoleName(taSysRole.getRoleName());
403
             e.setCreateUserName(user.getUserName());
404
             e.setCreateUserName(user.getUserName());

+ 10
- 9
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaVistorServiceImpl.java 查看文件

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

+ 75
- 11
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxLoginServiceImpl.java 查看文件

2
 
2
 
3
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.community.commom.mode.ResponseBean;
4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
5
 import com.community.commom.utils.BeanTools;
6
 import com.community.commom.utils.BeanTools;
6
 import com.community.huiju.common.code.ICode;
7
 import com.community.huiju.common.code.ICode;
7
 import com.community.huiju.common.perproties.LoginCodePerproties;
8
 import com.community.huiju.common.perproties.LoginCodePerproties;
60
 	@Override
61
 	@Override
61
 	public ResponseBean getOpenidByWxcode(String wxcode) {
62
 	public ResponseBean getOpenidByWxcode(String wxcode) {
62
 		ResponseBean responseBean = new ResponseBean();
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
 		String openId = codeResponse.getOpenid();
66
 		String openId = codeResponse.getOpenid();
68
 		logger.info("获取到wxcode:" + wxcode + " 获取到的openid: " + openId + "accesstoken: " + codeResponse.getAccessToken());
67
 		logger.info("获取到wxcode:" + wxcode + " 获取到的openid: " + openId + "accesstoken: " + codeResponse.getAccessToken());
69
-		
68
+
70
 		//根据openId查询关联的手机号
69
 		//根据openId查询关联的手机号
71
 		TaUser taUser = taUserMapper.getByOpenId(openId);
70
 		TaUser taUser = taUserMapper.getByOpenId(openId);
72
 		if (null == taUser) {
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
 			Map<String, Object> result = Maps.newHashMap();
73
 			Map<String, Object> result = Maps.newHashMap();
80
 			result.put("userInfo", userInfo);
74
 			result.put("userInfo", userInfo);
81
 			result.put("openid", openId);
75
 			result.put("openid", openId);
91
 		return responseBean;
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
 	@Override
122
 	@Override
95
 	public ResponseBean associatedWX(String parameter) {
123
 	public ResponseBean associatedWX(String parameter) {
96
 		ResponseBean responseBean = new ResponseBean();
124
 		ResponseBean responseBean = new ResponseBean();
229
 		return response;
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 查看文件

262
 			tpBillOrder.setUpdateDate(new Date());
262
 			tpBillOrder.setUpdateDate(new Date());
263
 			tpBillOrder.setUpdateUser(userElement.getId());
263
 			tpBillOrder.setUpdateUser(userElement.getId());
264
 			tpBillOrder.setOrderBumber(orderNo);
264
 			tpBillOrder.setOrderBumber(orderNo);
265
+			tpBillOrder.setPayPhone(taUser.getLoginName());
265
 
266
 
266
 			tpBillOrderMapper.insertSelective(tpBillOrder);
267
 			tpBillOrderMapper.insertSelective(tpBillOrder);
267
 
268
 

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java 查看文件

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

+ 64
- 52
CODE/smart-community/app-api/src/main/resources/mapper/TpBillOrderMapper.xml 查看文件

11
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
12
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
12
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
13
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
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
   </resultMap>
16
   </resultMap>
16
   <sql id="Base_Column_List" >
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
   </sql>
20
   </sql>
20
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
-    select 
22
+    select
22
     <include refid="Base_Column_List" />
23
     <include refid="Base_Column_List" />
23
     from tp_bill_order
24
     from tp_bill_order
24
     where id = #{id,jdbcType=INTEGER}
25
     where id = #{id,jdbcType=INTEGER}
28
     where id = #{id,jdbcType=INTEGER}
29
     where id = #{id,jdbcType=INTEGER}
29
   </delete>
30
   </delete>
30
   <insert id="insert" parameterType="com.community.huiju.model.TpBillOrder" >
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
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
38
       #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
38
-      #{orderStatus,jdbcType=VARCHAR}
39
-      )
39
+      #{orderStatus,jdbcType=CHAR}, #{payPhone,jdbcType=VARCHAR})
40
   </insert>
40
   </insert>
41
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillOrder" >
41
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillOrder" >
42
     insert into tp_bill_order
42
     insert into tp_bill_order
68
       <if test="updateDate != null" >
68
       <if test="updateDate != null" >
69
         update_date,
69
         update_date,
70
       </if>
70
       </if>
71
-      <if test="orderStatus != null">
71
+      <if test="orderStatus != null" >
72
         order_status,
72
         order_status,
73
       </if>
73
       </if>
74
+      <if test="payPhone != null" >
75
+        pay_phone,
76
+      </if>
74
     </trim>
77
     </trim>
75
     <trim prefix="values (" suffix=")" suffixOverrides="," >
78
     <trim prefix="values (" suffix=")" suffixOverrides="," >
76
       <if test="id != null" >
79
       <if test="id != null" >
100
       <if test="updateDate != null" >
103
       <if test="updateDate != null" >
101
         #{updateDate,jdbcType=TIMESTAMP},
104
         #{updateDate,jdbcType=TIMESTAMP},
102
       </if>
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
       </if>
111
       </if>
106
     </trim>
112
     </trim>
107
   </insert>
113
   </insert>
132
       <if test="updateDate != null" >
138
       <if test="updateDate != null" >
133
         update_date = #{updateDate,jdbcType=TIMESTAMP},
139
         update_date = #{updateDate,jdbcType=TIMESTAMP},
134
       </if>
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
       </if>
146
       </if>
138
     </set>
147
     </set>
139
     where id = #{id,jdbcType=INTEGER}
148
     where id = #{id,jdbcType=INTEGER}
148
       create_date = #{createDate,jdbcType=TIMESTAMP},
157
       create_date = #{createDate,jdbcType=TIMESTAMP},
149
       update_user = #{updateUser,jdbcType=INTEGER},
158
       update_user = #{updateUser,jdbcType=INTEGER},
150
       update_date = #{updateDate,jdbcType=TIMESTAMP},
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
     where id = #{id,jdbcType=INTEGER}
162
     where id = #{id,jdbcType=INTEGER}
153
   </update>
163
   </update>
154
-
155
   <insert id="batchInsertSelective" parameterType="list" >
164
   <insert id="batchInsertSelective" parameterType="list" >
156
     insert into tp_bill_order
165
     insert into tp_bill_order
157
     values
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
     </foreach>
203
     </foreach>
192
   </insert>
204
   </insert>
193
 </mapper>
205
 </mapper>

+ 1
- 1
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java 查看文件

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
      * 报名状态 已报名

二进制
CODE/smart-community/community-common/target/community-common-0.0.1.jar 查看文件


+ 4
- 0
CODE/smart-community/community-common/target/maven-archiver/pom.properties 查看文件

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 查看文件

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 查看文件

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 查看文件

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

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpBillOrderMapper.java 查看文件

1
 package com.community.huiju.dao;
1
 package com.community.huiju.dao;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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
 import com.community.huiju.model.TpBillOrder;
7
 import com.community.huiju.model.TpBillOrder;
5
 import org.apache.ibatis.annotations.Mapper;
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
  * <p>
14
  * <p>
15
 @Mapper
21
 @Mapper
16
 public interface TpBillOrderMapper extends BaseMapper<TpBillOrder> {
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 查看文件

1
 package com.community.huiju.model;
1
 package com.community.huiju.model;
2
 
2
 
3
 import com.baomidou.mybatisplus.annotation.IdType;
3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4
 import com.baomidou.mybatisplus.annotation.TableId;
5
 import com.baomidou.mybatisplus.annotation.TableId;
5
 import com.baomidou.mybatisplus.annotation.TableName;
6
 import com.baomidou.mybatisplus.annotation.TableName;
6
 import lombok.Data;
7
 import lombok.Data;
9
 
10
 
10
 import java.io.Serializable;
11
 import java.io.Serializable;
11
 import java.time.LocalDateTime;
12
 import java.time.LocalDateTime;
13
+import java.util.List;
12
 
14
 
13
 /**
15
 /**
14
  * <p>
16
  * <p>
74
      */
76
      */
75
     private String orderStatus;
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 查看文件

16
 public interface IBillStatementService extends IService<BillStatement> {
16
 public interface IBillStatementService extends IService<BillStatement> {
17
 
17
 
18
     /**
18
     /**
19
-     * 查询流水账单
19
+     * 查询 流水/订单 账单
20
      * @param userElement
20
      * @param userElement
21
      * @param parameter
21
      * @param parameter
22
      * @return
22
      * @return

+ 50
- 9
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillStatementServiceImpl.java 查看文件

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
 import com.community.commom.mode.ResponseBean;
8
 import com.community.commom.mode.ResponseBean;
8
 import com.community.commom.session.UserElement;
9
 import com.community.commom.session.UserElement;
10
+import com.community.huiju.dao.BillInvoiceMapper;
11
+import com.community.huiju.dao.TpBillOrderMapper;
9
 import com.community.huiju.model.BillInvoice;
12
 import com.community.huiju.model.BillInvoice;
10
 import com.community.huiju.model.BillStatement;
13
 import com.community.huiju.model.BillStatement;
11
 import com.community.huiju.dao.BillStatementMapper;
14
 import com.community.huiju.dao.BillStatementMapper;
15
+import com.community.huiju.model.TpBillOrder;
12
 import com.community.huiju.service.IBillStatementService;
16
 import com.community.huiju.service.IBillStatementService;
13
 import com.google.common.collect.Maps;
17
 import com.google.common.collect.Maps;
14
 import org.apache.poi.hssf.usermodel.*;
18
 import org.apache.poi.hssf.usermodel.*;
18
 import java.text.SimpleDateFormat;
22
 import java.text.SimpleDateFormat;
19
 import java.util.List;
23
 import java.util.List;
20
 import java.util.Map;
24
 import java.util.Map;
25
+import java.util.stream.Collectors;
21
 
26
 
22
 /**
27
 /**
23
  * <p>
28
  * <p>
33
     @Autowired
38
     @Autowired
34
     private BillStatementMapper billStatementMapper;
39
     private BillStatementMapper billStatementMapper;
35
 
40
 
41
+    @Autowired
42
+    private TpBillOrderMapper tpBillOrderMapper;
43
+
44
+    @Autowired
45
+    private BillInvoiceMapper billInvoiceMapper;
46
+
36
     @Override
47
     @Override
37
     public ResponseBean getBillStatement(UserElement userElement, String parameter) {
48
     public ResponseBean getBillStatement(UserElement userElement, String parameter) {
38
         ResponseBean responseBean = new ResponseBean();
49
         ResponseBean responseBean = new ResponseBean();
48
         String billName = jsonObject.getString("billName");
59
         String billName = jsonObject.getString("billName");
49
         // 缴费单 编号
60
         // 缴费单 编号
50
         Integer billInvoiceId = jsonObject.getInteger("billInvoiceId");
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
         Map<String, Object> map = Maps.newHashMap();
66
         Map<String, Object> map = Maps.newHashMap();
57
         map.put("billId", billId);
68
         map.put("billId", billId);
58
         map.put("billName", billName);
69
         map.put("billName", billName);
59
         map.put("billInvoiceId", billInvoiceId);
70
         map.put("billInvoiceId", billInvoiceId);
60
-        map.put("payName", payName);
71
+        map.put("payPhone", payPhone);
61
         map.put("communityId", userElement.getCommunityId());
72
         map.put("communityId", userElement.getCommunityId());
62
 
73
 
63
-        Page<BillStatement> page = new Page<>();
74
+        Page<TpBillOrder> page = new Page<>();
64
         page.setCurrent(pageNum);
75
         page.setCurrent(pageNum);
65
         page.setSize(pageSize);
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
         Map<String, Object> respMap = Maps.newHashMap();
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
         responseBean.addSuccess(respMap);
115
         responseBean.addSuccess(respMap);
75
         return responseBean;
116
         return responseBean;

+ 39
- 0
CODE/smart-community/property-api/src/main/resources/mapper/BillOrderMapper.xml 查看文件

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 查看文件

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

+ 41
- 18
VUECODE/smart-property-manage/src/views/bill/statement/index.vue 查看文件

13
       <el-form-item label="收费单号">
13
       <el-form-item label="收费单号">
14
         <el-input v-model="formInline.billInvoiceId" placeholder="收费单号"/>
14
         <el-input v-model="formInline.billInvoiceId" placeholder="收费单号"/>
15
       </el-form-item>
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
       </el-form-item>
18
       </el-form-item>
19
       <el-form-item>
19
       <el-form-item>
20
         <el-button type="info" @click="clear">清空</el-button>
20
         <el-button type="info" @click="clear">清空</el-button>
24
     <el-button type="primary" style="margin-left: 20px; margin-bottom: 20px;" @click="exportExcel">导出数据</el-button>
24
     <el-button type="primary" style="margin-left: 20px; margin-bottom: 20px;" @click="exportExcel">导出数据</el-button>
25
     <el-table
25
     <el-table
26
       ref="multipleTable"
26
       ref="multipleTable"
27
+      v-loading="loading"
27
       :data="list"
28
       :data="list"
28
       border
29
       border
29
       tooltip-effect="dark"
30
       tooltip-effect="dark"
44
         align="center"
45
         align="center"
45
         label="收费组编号">
46
         label="收费组编号">
46
         <template slot-scope="scope">
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
         </template>
51
         </template>
49
       </el-table-column>
52
       </el-table-column>
50
       <el-table-column
53
       <el-table-column
51
-        prop="billName"
52
-        label="收费组名称"
54
+        prop="billInvoiceId"
55
+        label="收费单号"
53
         align="center"
56
         align="center"
54
-        show-overflow-tooltip>
57
+        width="120">
55
         <template slot-scope="scope">
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
         </template>
62
         </template>
58
       </el-table-column>
63
       </el-table-column>
59
-      <el-table-column
60
-        prop="billInvoiceId"
61
-        label="收费单号"
62
-        align="center"
63
-        width="120"/>
64
       <el-table-column
64
       <el-table-column
65
         prop="payPrice"
65
         prop="payPrice"
66
         align="center"
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
       </el-table-column>
69
       </el-table-column>
70
       <el-table-column
70
       <el-table-column
71
-        prop="payName"
71
+        prop="orderStatus"
72
+        align="center"
73
+        label="订单状态"/>
74
+      <el-table-column
75
+        prop="payPhone"
72
         align="center"
76
         align="center"
73
-        label="缴费人"/>
77
+        label="缴费人手机号"/>
74
       <el-table-column
78
       <el-table-column
75
         prop="payRemark"
79
         prop="payRemark"
76
         align="center"
80
         align="center"
85
         prop="createTime"
89
         prop="createTime"
86
         align="center"
90
         align="center"
87
         label="订单生成时间">
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
       </el-table-column>
99
       </el-table-column>
90
     </el-table>
100
     </el-table>
91
     <div class="foot-page">
101
     <div class="foot-page">
111
         billId: '', // 缴费项 id
121
         billId: '', // 缴费项 id
112
         billName: '', //  缴费项 名称
122
         billName: '', //  缴费项 名称
113
         billInvoiceId: '', // 缴费单 编号
123
         billInvoiceId: '', // 缴费单 编号
114
-        payName: '', //  缴费人
124
+        payPhone: '', //  缴费人手机号
115
         pageNum: 1,
125
         pageNum: 1,
116
         pageSize: 10
126
         pageSize: 10
117
       },
127
       },
128
+      loading: false,
118
       list: [], // 数据
129
       list: [], // 数据
119
       total: 0 // 总数
130
       total: 0 // 总数
120
     }
131
     }
137
       this.getBillStatement()
148
       this.getBillStatement()
138
     },
149
     },
139
     getBillStatement() { //  获取流水信息
150
     getBillStatement() { //  获取流水信息
151
+      this.loading = true
140
       this.$store.dispatch('GetBillStatementAll', this.formInline).then(res => {
152
       this.$store.dispatch('GetBillStatementAll', this.formInline).then(res => {
153
+        this.loading = false
141
         const resData = res.data
154
         const resData = res.data
142
         this.list = resData.list
155
         this.list = resData.list
143
         this.formInline.pageNum = resData.pageNum
156
         this.formInline.pageNum = resData.pageNum
144
         this.formInline.pageSize = resData.pageSize
157
         this.formInline.pageSize = resData.pageSize
145
         this.total = resData.total
158
         this.total = resData.total
146
       }).catch(() => {
159
       }).catch(() => {
160
+        this.loading = false
147
         console.log('error GetBillStatementAll')
161
         console.log('error GetBillStatementAll')
148
       })
162
       })
149
     },
163
     },
211
       }).catch(() => {
225
       }).catch(() => {
212
         console.log('error ExportBillStatementExcel')
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
 }