瀏覽代碼

完成缴费

魏熙美 6 年之前
父節點
當前提交
24afdbb855
共有 15 個檔案被更改,包括 455 行新增129 行删除
  1. 14
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/PayNotifyPerproties.java
  2. 31
    11
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AliPayController.java
  3. 47
    17
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxPayController.java
  4. 9
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserLicenseOrderMapper.java
  5. 3
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillInvoice.java
  6. 3
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillOrder.java
  7. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AliPayServiceI.java
  8. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserLicenseService.java
  9. 25
    5
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxPayServiceI.java
  10. 12
    16
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AliPayServiceImpl.java
  11. 6
    6
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java
  12. 32
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserLicenseServiceImpl.java
  13. 249
    60
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java
  14. 8
    4
      CODE/smart-community/app-api/src/main/resources/application.yml
  15. 7
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java

+ 14
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/PayNotifyPerproties.java 查看文件

4
 import org.springframework.boot.context.properties.ConfigurationProperties;
4
 import org.springframework.boot.context.properties.ConfigurationProperties;
5
 import org.springframework.stereotype.Component;
5
 import org.springframework.stereotype.Component;
6
 
6
 
7
+import java.math.BigDecimal;
8
+
7
 /**
9
 /**
8
  * 支付回调地址配置
10
  * 支付回调地址配置
9
  * @author weiximei
11
  * @author weiximei
14
 public class PayNotifyPerproties {
16
 public class PayNotifyPerproties {
15
 
17
 
16
     /**
18
     /**
17
-     * 微信回调
19
+     * 微信回调 物业缴费
18
      */
20
      */
19
     private String wxBillNotify;
21
     private String wxBillNotify;
20
 
22
 
21
     /**
23
     /**
22
-     * 支付宝回调
24
+     * 支付宝回调 物业缴费
23
      */
25
      */
24
     private String aliBillNotify;
26
     private String aliBillNotify;
25
 
27
 
28
+    /**
29
+     * 微信回调 车缴费
30
+     */
31
+    private String wxCarNotify;
32
+
33
+    /**
34
+     * 支付宝回调 车缴费
35
+     */
36
+    private String aliCarNotify;
37
+
26
 }
38
 }

+ 31
- 11
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/AliPayController.java 查看文件

19
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.beans.factory.annotation.Autowired;
20
 import org.springframework.beans.factory.annotation.Value;
20
 import org.springframework.beans.factory.annotation.Value;
21
 import org.springframework.cloud.context.config.annotation.RefreshScope;
21
 import org.springframework.cloud.context.config.annotation.RefreshScope;
22
-import org.springframework.web.bind.annotation.PathVariable;
23
-import org.springframework.web.bind.annotation.RequestMapping;
24
-import org.springframework.web.bind.annotation.RequestMethod;
25
-import org.springframework.web.bind.annotation.RestController;
22
+import org.springframework.web.bind.annotation.*;
26
 
23
 
27
 import javax.servlet.http.HttpServletRequest;
24
 import javax.servlet.http.HttpServletRequest;
28
 import javax.servlet.http.HttpServletResponse;
25
 import javax.servlet.http.HttpServletResponse;
57
 	private String ALIPAY_PUBLIC_KEY;
54
 	private String ALIPAY_PUBLIC_KEY;
58
 	
55
 	
59
 	@ApiOperation(value = "统一下单", notes = "统一下单")
56
 	@ApiOperation(value = "统一下单", notes = "统一下单")
60
-	@ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "billInvoiceId", value = "账单Id"),
57
+	@ApiImplicitParams({
58
+			@ApiImplicitParam(paramType = "path", dataType = "String", name = "outTradeNo", value = "订单号"),
59
+			@ApiImplicitParam(paramType = "form", dataType = "String", name = "type", value = "订单类型:type: 类型(car 车缴费, bill 物业缴费)"),
61
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token") })
60
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token") })
62
 	@RequestMapping(value = "/aliPayOrder/{outTradeNo}",method = RequestMethod.GET)
61
 	@RequestMapping(value = "/aliPayOrder/{outTradeNo}",method = RequestMethod.GET)
63
-	public ResponseBean wxUnifiedOrder(@PathVariable("outTradeNo") String outTradeNo, HttpSession session){
62
+	public ResponseBean wxUnifiedOrder(@PathVariable("outTradeNo") String outTradeNo, @RequestParam("type") String type, HttpSession session){
64
 		ResponseBean responseBean = new ResponseBean();
63
 		ResponseBean responseBean = new ResponseBean();
65
 		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
64
 		UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
66
 		String resp = "";
65
 		String resp = "";
67
 		try {
66
 		try {
68
-			resp = aliPayService.AliPayOrder(outTradeNo,userElement);
67
+			resp = aliPayService.AliPayOrder(outTradeNo, type,userElement);
69
 		} catch (Exception e) {
68
 		} catch (Exception e) {
70
 			e.printStackTrace();
69
 			e.printStackTrace();
71
 			responseBean.addError(e.getMessage());
70
 			responseBean.addError(e.getMessage());
75
 		return responseBean;
74
 		return responseBean;
76
 	}
75
 	}
77
 	
76
 	
78
-	@ApiOperation(value = "支付宝手机订单支付完成后回调", notes = "支付宝手机订单支付完成后回调")
79
-	@RequestMapping(value = "/aliPayNotify",method = RequestMethod.POST)
80
-	public void aliPayNotify(HttpServletRequest request, HttpServletResponse response){
77
+	@ApiOperation(value = "支付宝手机订单支付完成后回调 物业缴费", notes = "支付宝手机订单支付完成后回调")
78
+	@RequestMapping(value = "/aliPayBillNotify",method = RequestMethod.POST)
79
+	public void aliPayBillNotify(HttpServletRequest request, HttpServletResponse response){
80
+		wxNotify(request, Constant.PAY_TYPE_BILL);
81
+	}
82
+
83
+	@ApiOperation(value = "支付宝手机订单支付完成后回调 车缴费", notes = "支付宝手机订单支付完成后回调 车缴费")
84
+	@RequestMapping(value = "/aliPayCarNotify",method = RequestMethod.POST)
85
+	public void aliPayCarNotify(HttpServletRequest request, HttpServletResponse response){
86
+		wxNotify(request, Constant.PAY_TYPE_CAR);
87
+	}
88
+
89
+	/**
90
+	 * 支付回调
91
+	 * @param request
92
+	 * @param type
93
+	 */
94
+	private void wxNotify(HttpServletRequest request, String type) {
81
 		System.out.println("alipay result  start =======");
95
 		System.out.println("alipay result  start =======");
82
 		Map<String,String> params = new HashMap<String,String>();
96
 		Map<String,String> params = new HashMap<String,String>();
83
 		Map requestParams = request.getParameterMap();
97
 		Map requestParams = request.getParameterMap();
98
 			boolean flag = AlipaySignature.rsaCheckV1(params, ALIPAY_PUBLIC_KEY, CHARSET_UTF8,"RSA2");
112
 			boolean flag = AlipaySignature.rsaCheckV1(params, ALIPAY_PUBLIC_KEY, CHARSET_UTF8,"RSA2");
99
 			if (flag){
113
 			if (flag){
100
 				params.put("pay_type","2");
114
 				params.put("pay_type","2");
101
-				wxPayService.wxNotify(params);
115
+				if (Constant.PAY_TYPE_BILL.equals(type)) {
116
+					wxPayService.wxBillNotify(params);
117
+				} else if (Constant.PAY_TYPE_CAR.equals(type)){
118
+					wxPayService.wxCarNotify(params);
119
+				}
120
+
102
 			}
121
 			}
103
 		} catch (AlipayApiException e) {
122
 		} catch (AlipayApiException e) {
104
 			e.printStackTrace();
123
 			e.printStackTrace();
106
 			e.printStackTrace();
125
 			e.printStackTrace();
107
 		}
126
 		}
108
 	}
127
 	}
128
+
109
 }
129
 }

+ 47
- 17
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxPayController.java 查看文件

70
 		return responseBean;
70
 		return responseBean;
71
 	}
71
 	}
72
 	
72
 	
73
-	@ApiOperation(value = "手机订单支付完成后回调", notes = "手机订单支付完成后回调")
74
-	@RequestMapping(value = "/wxNotify",method = RequestMethod.POST)
75
-	public String wxNotify(HttpServletRequest request, HttpServletResponse response){
73
+	@ApiOperation(value = "手机订单支付完成后回调 物业缴费", notes = "手机订单支付完成后回调 物业缴费")
74
+	@RequestMapping(value = "/wxBillNotify",method = RequestMethod.POST)
75
+	public String wxBillNotify(HttpServletRequest request, HttpServletResponse response){
76
+		return wxNotify(request, Constant.PAY_TYPE_BILL);
77
+	}
78
+
79
+
80
+	@ApiOperation(value = "手机订单支付完成后回调 车缴费", notes = "手机订单支付完成后回调 车缴费")
81
+	@RequestMapping(value = "/wxCarNotify",method = RequestMethod.POST)
82
+	public String wxCarNotify(HttpServletRequest request, HttpServletResponse response){
83
+
84
+		return wxNotify(request, Constant.PAY_TYPE_CAR);
85
+	}
86
+
87
+	/**
88
+	 * 微信支付回调
89
+	 * @param request
90
+	 * @param type
91
+	 * @return
92
+	 */
93
+	private String wxNotify(HttpServletRequest request, String type) {
76
 		String failResult = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[失败]]></return_msg>" + "</xml> ";
94
 		String failResult = "<xml>" + "<return_code><![CDATA[FAIL]]></return_code>" + "<return_msg><![CDATA[失败]]></return_msg>" + "</xml> ";
77
 		String successResult = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
95
 		String successResult = "<xml>" + "<return_code><![CDATA[SUCCESS]]></return_code>" + "<return_msg><![CDATA[OK]]></return_msg>" + "</xml> ";
78
 		InputStream inStream;
96
 		InputStream inStream;
79
 		try {
97
 		try {
80
-			
98
+
81
 			inStream = request.getInputStream();
99
 			inStream = request.getInputStream();
82
 			ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
100
 			ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
83
 			byte[] buffer = new byte[1024];
101
 			byte[] buffer = new byte[1024];
85
 			while ((len = inStream.read(buffer)) != -1) {
103
 			while ((len = inStream.read(buffer)) != -1) {
86
 				outSteam.write(buffer, 0, len);
104
 				outSteam.write(buffer, 0, len);
87
 			}
105
 			}
88
-			
106
+
89
 			// 获取微信调用我们notify_url的返回信息
107
 			// 获取微信调用我们notify_url的返回信息
90
 			String result = new String(outSteam.toByteArray(), "utf-8");
108
 			String result = new String(outSteam.toByteArray(), "utf-8");
91
 			WXPayUtil.getLogger().info("wxnotify:微信支付----result----=" + result);
109
 			WXPayUtil.getLogger().info("wxnotify:微信支付----result----=" + result);
92
-			
110
+
93
 			// 关闭流
111
 			// 关闭流
94
 			outSteam.close();
112
 			outSteam.close();
95
 			inStream.close();
113
 			inStream.close();
96
-			
114
+
97
 			// xml转换为map
115
 			// xml转换为map
98
 			Map<String, String> resultMap = WXPayUtil.xmlToMap(result);
116
 			Map<String, String> resultMap = WXPayUtil.xmlToMap(result);
99
 			if (WXPayConstants.SUCCESS.equalsIgnoreCase(resultMap.get("result_code"))) {
117
 			if (WXPayConstants.SUCCESS.equalsIgnoreCase(resultMap.get("result_code"))) {
100
 				//处理业务逻辑 修改订单状态等
118
 				//处理业务逻辑 修改订单状态等
101
 				resultMap.put("pay_type","0");
119
 				resultMap.put("pay_type","0");
102
-				String state = wxPayService.wxNotify(resultMap);
120
+				String state = "";
121
+				if (Constant.PAY_TYPE_CAR.equals(type)) {
122
+					state = wxPayService.wxCarNotify(resultMap);
123
+				} else if (Constant.PAY_TYPE_BILL.equals(type)) {
124
+					state = wxPayService.wxBillNotify(resultMap);
125
+				}
126
+
103
 				if (state.equals("success")){
127
 				if (state.equals("success")){
104
 					log.info("微信支付成功。。");
128
 					log.info("微信支付成功。。");
105
 					return successResult;
129
 					return successResult;
107
 			}else{
131
 			}else{
108
 				return failResult;
132
 				return failResult;
109
 			}
133
 			}
110
-			
134
+
111
 		} catch (Exception e) {
135
 		} catch (Exception e) {
112
 			log.error("手机支付回调通知失败",e);
136
 			log.error("手机支付回调通知失败",e);
113
 			return failResult;
137
 			return failResult;
114
-			
138
+
115
 		}
139
 		}
140
+
116
 		return failResult;
141
 		return failResult;
117
 	}
142
 	}
143
+
118
 	
144
 	
119
 	@ApiOperation(value = "订单查询", notes = "订单查询")
145
 	@ApiOperation(value = "订单查询", notes = "订单查询")
120
 	@ApiImplicitParams({
146
 	@ApiImplicitParams({
137
 	
163
 	
138
 	@ApiOperation(value = "准备开始支付", notes = "准备开始支付")
164
 	@ApiOperation(value = "准备开始支付", notes = "准备开始支付")
139
 	@ApiImplicitParams({
165
 	@ApiImplicitParams({
140
-			@ApiImplicitParam(paramType = "body", dataType = "Integer", name = "billInvoiceIdList", value = "账单Id集合"),
166
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "parameter", value = "idArray:账单Id集合, type: 类型(car 车缴费, bill 物业缴费), extensionMonth: 延期月份,也就是延期几个月!只有在 车缴费的时候才有效"),
141
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
167
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
142
 	})
168
 	})
143
 	@RequestMapping(value = "/wxStartPay",method = RequestMethod.POST)
169
 	@RequestMapping(value = "/wxStartPay",method = RequestMethod.POST)
144
-	public ResponseBean wxStartPay(@RequestBody String billInvoiceIdList, HttpSession session){
170
+	public ResponseBean wxStartPay(@RequestBody String parameter, HttpSession session){
145
 		ResponseBean responseBean = new ResponseBean();
171
 		ResponseBean responseBean = new ResponseBean();
146
 		try {
172
 		try {
147
 			UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
173
 			UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
148
-			 Integer[] integers = JSONObject.parseArray(billInvoiceIdList).toArray(new Integer[]{});
174
+			JSONObject jsonObject = JSONObject.parseObject(parameter);
175
+			Integer[] integers = jsonObject.getJSONArray("idArray").toArray(new Integer[]{});
176
+			String type = jsonObject.getString("type");
177
+			Integer extensionMonth = jsonObject.getInteger("extensionMonth");
149
 
178
 
150
-			String outTradeNo = wxPayService.wxStartPay( Arrays.asList(integers), userElement);
179
+			String outTradeNo = wxPayService.wxStartPay(Arrays.asList(integers), type, extensionMonth,userElement);
151
 			Map<String,Object> resultMap = Maps.newHashMap();
180
 			Map<String,Object> resultMap = Maps.newHashMap();
152
 			resultMap.put("outTradeNo", outTradeNo);
181
 			resultMap.put("outTradeNo", outTradeNo);
153
 			responseBean.addSuccess(resultMap);
182
 			responseBean.addSuccess(resultMap);
161
 	
190
 	
162
 	@ApiOperation(value = "取消支付", notes = "取消支付")
191
 	@ApiOperation(value = "取消支付", notes = "取消支付")
163
 	@ApiImplicitParams({
192
 	@ApiImplicitParams({
164
-			@ApiImplicitParam(paramType = "path", dataType = "Integer", name = "outTradeNo", value = "订单号"),
193
+			@ApiImplicitParam(paramType = "path", dataType = "String", name = "outTradeNo", value = "订单号"),
194
+			@ApiImplicitParam(paramType = "form", dataType = "String", name = "outTradeNo", value = "type: 类型(car 车缴费, bill 物业缴费)"),
165
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
195
 			@ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
166
 	})
196
 	})
167
 	@RequestMapping(value = "/wxCancelPay/{outTradeNo}",method = RequestMethod.POST)
197
 	@RequestMapping(value = "/wxCancelPay/{outTradeNo}",method = RequestMethod.POST)
168
-	public ResponseBean wxCancelPay(@PathVariable("outTradeNo") String outTradeNo, HttpSession session){
198
+	public ResponseBean wxCancelPay(@PathVariable("outTradeNo") String outTradeNo, @RequestParam("type") String type,HttpSession session){
169
 		ResponseBean responseBean = new ResponseBean();
199
 		ResponseBean responseBean = new ResponseBean();
170
 		try {
200
 		try {
171
 			UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
201
 			UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
172
-			wxPayService.wxCancelPay(outTradeNo,userElement);
202
+			wxPayService.wxCancelPay(outTradeNo, type,userElement);
173
 		} catch (Exception e) {
203
 		} catch (Exception e) {
174
 			e.printStackTrace();
204
 			e.printStackTrace();
175
 			responseBean.addError(e.getMessage());
205
 			responseBean.addError(e.getMessage());

+ 9
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserLicenseOrderMapper.java 查看文件

29
     @ResultMap("BaseResultMap")
29
     @ResultMap("BaseResultMap")
30
     @Select("select * from ta_user_license_order where community_id = #{communityId} and ta_user_id = #{userId} and order_status = 1")
30
     @Select("select * from ta_user_license_order where community_id = #{communityId} and ta_user_id = #{userId} and order_status = 1")
31
     List<TaUserLicenseOrder> selectRecords(@Param("communityId") Integer communityId, @Param("userId") Integer userId);
31
     List<TaUserLicenseOrder> selectRecords(@Param("communityId") Integer communityId, @Param("userId") Integer userId);
32
+
33
+    /**
34
+     * 根据订单号查询
35
+     * @param orderNo
36
+     * @return
37
+     */
38
+    @ResultMap("BaseResultMap")
39
+    @Select("select * from ta_user_license_order where order_number=#{orderNo}")
40
+    List<TaUserLicenseOrder> selectByOrderNumber(String orderNo);
32
 }
41
 }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillInvoice.java 查看文件

47
     /**
47
     /**
48
      * 转换后金额,用于支付
48
      * 转换后金额,用于支付
49
      */
49
      */
50
-    private String sumPayPrice;
50
+    private Double sumPayPrice;
51
 
51
 
52
     public Integer getId() {
52
     public Integer getId() {
53
         return id;
53
         return id;
193
         this.payType = payType;
193
         this.payType = payType;
194
     }
194
     }
195
 
195
 
196
-    public String getSumPayPrice() {
196
+    public Double getSumPayPrice() {
197
         return sumPayPrice;
197
         return sumPayPrice;
198
     }
198
     }
199
 
199
 
200
-    public void setSumPayPrice(String sumPayPrice) {
200
+    public void setSumPayPrice(Double sumPayPrice) {
201
         this.sumPayPrice = sumPayPrice;
201
         this.sumPayPrice = sumPayPrice;
202
     }
202
     }
203
 }
203
 }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBillOrder.java 查看文件

35
     /**
35
     /**
36
      * 订单总额
36
      * 订单总额
37
      */
37
      */
38
-    private String sumPrice;
38
+    private Double sumPrice;
39
 
39
 
40
     /**
40
     /**
41
      * 缴费单集合
41
      * 缴费单集合
138
         this.billList = billList;
138
         this.billList = billList;
139
     }
139
     }
140
 
140
 
141
-    public String getSumPrice() {
141
+    public Double getSumPrice() {
142
         return sumPrice;
142
         return sumPrice;
143
     }
143
     }
144
 
144
 
145
-    public void setSumPrice(String sumPrice) {
145
+    public void setSumPrice(Double sumPrice) {
146
         this.sumPrice = sumPrice;
146
         this.sumPrice = sumPrice;
147
     }
147
     }
148
 }
148
 }

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/AliPayServiceI.java 查看文件

9
 	 * 微信支付统一下单
9
 	 * 微信支付统一下单
10
 	 * @return
10
 	 * @return
11
 	 * @param outTradeNo
11
 	 * @param outTradeNo
12
+	 * @param type  类型(car 车缴费, bill 物业缴费)
12
 	 * @param userElement
13
 	 * @param userElement
13
 	 */
14
 	 */
14
-	String AliPayOrder(String outTradeNo, UserElement userElement) throws Exception;
15
+	String AliPayOrder(String outTradeNo, String type, UserElement userElement) throws Exception;
15
 	
16
 	
16
 }
17
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserLicenseService.java 查看文件

16
      */
16
      */
17
     ResponseBean associatedLicense(UserElement userElement, String carNo);
17
     ResponseBean associatedLicense(UserElement userElement, String carNo);
18
 
18
 
19
+    /**
20
+     * 用户查询车牌
21
+     * @param carNo
22
+     * @return
23
+     */
24
+    ResponseBean getLicense(UserElement userElement, String carNo);
25
+
19
     /**
26
     /**
20
      * 获取用户所有车牌
27
      * 获取用户所有车牌
21
      * @param userElement
28
      * @param userElement

+ 25
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/WxPayServiceI.java 查看文件

16
 	Map<String, String> wxUnifiedOrder(String outTradeNo, String type, UserElement userElement) throws Exception;
16
 	Map<String, String> wxUnifiedOrder(String outTradeNo, String type, UserElement userElement) throws Exception;
17
 	
17
 	
18
 	/**
18
 	/**
19
-	 * 支付成功的回调
19
+	 * 支付成功的回调 物业缴费
20
 	 * @return
20
 	 * @return
21
 	 * @param resultMap
21
 	 * @param resultMap
22
 	 */
22
 	 */
23
-	String wxNotify(Map<String, String> resultMap) throws Exception;
23
+	String wxBillNotify(Map<String, String> resultMap) throws Exception;
24
 	
24
 	
25
 	/**
25
 	/**
26
 	 * 订单查询
26
 	 * 订单查询
30
 	
30
 	
31
 	/**
31
 	/**
32
 	 * 准备支付
32
 	 * 准备支付
33
-	 * @param billInvoiceIdArray
33
+	 * @param idArray 账单的id
34
 	 * @param userElement
34
 	 * @param userElement
35
+	 * @param type 订单类型  car 车缴费 , bill 物业缴费
36
+	 * @param extensionMonth 延期月份,也就是延期几个月!
37
+	 *                        	只有在 车缴费的时候才有效
35
 	 * @throws Exception
38
 	 * @throws Exception
36
 	 */
39
 	 */
37
-	String wxStartPay(List<Integer> billInvoiceIdArray, UserElement userElement) throws Exception;
40
+	String wxStartPay(List<Integer> idArray, String type,  Integer extensionMonth, UserElement userElement) throws Exception;
38
 	
41
 	
39
 	/**
42
 	/**
40
 	 * 取消支付
43
 	 * 取消支付
41
 	 * @param outTradeNo 订单号
44
 	 * @param outTradeNo 订单号
45
+	 * @param type  订单类型  car 车缴费 , bill 物业缴费
42
 	 * @param userElement
46
 	 * @param userElement
43
 	 */
47
 	 */
44
-	void wxCancelPay(String outTradeNo, UserElement userElement) throws Exception;
48
+	void wxCancelPay(String outTradeNo, String type, UserElement userElement) throws Exception;
49
+
50
+	/**
51
+	 * 支付成功的回调 车缴费
52
+	 * @param resultMap
53
+	 * @return
54
+	 */
55
+	String wxCarNotify(Map<String, String> resultMap);
56
+
57
+	/**
58
+	 * 根据订单类型获取 金额 和 回调地址
59
+	 * @param type
60
+	 * @param orderNo
61
+	 * @return
62
+	 * @throws Exception
63
+	 */
64
+	Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo) throws Exception;
45
 }
65
 }

+ 12
- 16
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/AliPayServiceImpl.java 查看文件

6
 import com.alipay.api.domain.AlipayTradeAppPayModel;
6
 import com.alipay.api.domain.AlipayTradeAppPayModel;
7
 import com.alipay.api.request.AlipayTradeAppPayRequest;
7
 import com.alipay.api.request.AlipayTradeAppPayRequest;
8
 import com.alipay.api.response.AlipayTradeAppPayResponse;
8
 import com.alipay.api.response.AlipayTradeAppPayResponse;
9
+import com.community.commom.constant.Constant;
9
 import com.community.commom.session.UserElement;
10
 import com.community.commom.session.UserElement;
10
 import com.community.huiju.common.perproties.PayNotifyPerproties;
11
 import com.community.huiju.common.perproties.PayNotifyPerproties;
11
 import com.community.huiju.common.wxpay.HfWxConfig;
12
 import com.community.huiju.common.wxpay.HfWxConfig;
18
 import com.community.huiju.model.TpBillInvoice;
19
 import com.community.huiju.model.TpBillInvoice;
19
 import com.community.huiju.model.TpBillOrder;
20
 import com.community.huiju.model.TpBillOrder;
20
 import com.community.huiju.service.AliPayServiceI;
21
 import com.community.huiju.service.AliPayServiceI;
22
+import com.community.huiju.service.WxPayServiceI;
21
 import org.apache.commons.collections.CollectionUtils;
23
 import org.apache.commons.collections.CollectionUtils;
22
 import org.slf4j.Logger;
24
 import org.slf4j.Logger;
23
 import org.slf4j.LoggerFactory;
25
 import org.slf4j.LoggerFactory;
28
 
30
 
29
 import java.math.BigDecimal;
31
 import java.math.BigDecimal;
30
 import java.util.List;
32
 import java.util.List;
33
+import java.util.Map;
31
 
34
 
32
 import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
35
 import static com.alipay.api.AlipayConstants.CHARSET_UTF8;
33
 
36
 
68
 	private String ALIPAY_PUBLIC_KEY;
71
 	private String ALIPAY_PUBLIC_KEY;
69
 
72
 
70
 	@Autowired
73
 	@Autowired
71
-	private PayNotifyPerproties payNotifyPerproties;
74
+	private WxPayServiceI wxPayServiceI;
75
+
72
 
76
 
73
 	/**
77
 	/**
74
 	 * 支付宝统一下单
78
 	 * 支付宝统一下单
79
 	 */
83
 	 */
80
 	@Override
84
 	@Override
81
 	@Transactional(rollbackFor = Exception.class)
85
 	@Transactional(rollbackFor = Exception.class)
82
-	public String AliPayOrder(String outTradeNo, UserElement userElement) throws Exception {
83
-		Integer userId = userElement.getId();
84
-
85
-		//获取支付金额
86
-		List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
87
-		if (CollectionUtils.isEmpty(billOrderList)){
88
-			throw new Exception("订单不存在");
89
-		}
90
-
91
-		// 计算金额
92
-		Integer payPrice = billOrderList.stream().mapToInt(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
86
+	public String AliPayOrder(String outTradeNo, String type, UserElement userElement) throws Exception {
93
 
87
 
88
+		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
89
+		Map<String, Object> orderPriceAndNotifyUrl = wxPayServiceI.getOrderPriceAndNotifyUrl(type, outTradeNo);
94
 		
90
 		
95
 		//下单
91
 		//下单
96
 		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");
92
 		AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");
98
 		AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
94
 		AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
99
 		//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
95
 		//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
100
 		AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
96
 		AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
101
-		model.setBody("缴费");
102
-		model.setSubject("缴费");
97
+		model.setBody(typeName);
98
+		model.setSubject(typeName);
103
 		model.setOutTradeNo(outTradeNo);
99
 		model.setOutTradeNo(outTradeNo);
104
 		model.setTimeoutExpress("30m");
100
 		model.setTimeoutExpress("30m");
105
-		model.setTotalAmount(BigDecimal.valueOf(Long.valueOf(payPrice)).divide(new BigDecimal(100)).toString());
101
+		model.setTotalAmount(BigDecimal.valueOf(Long.valueOf(String.valueOf(orderPriceAndNotifyUrl.get("payPrice")))).divide(new BigDecimal(100)).toString());
106
 		model.setProductCode("QUICK_MSECURITY_PAY");
102
 		model.setProductCode("QUICK_MSECURITY_PAY");
107
 		request.setBizModel(model);
103
 		request.setBizModel(model);
108
-		request.setNotifyUrl(payNotifyPerproties.getAliBillNotify());
104
+		request.setNotifyUrl(String.valueOf(orderPriceAndNotifyUrl.get("notifyUrl")));
109
 		try {
105
 		try {
110
 			//这里和普通的接口调用不同,使用的是sdkExecute
106
 			//这里和普通的接口调用不同,使用的是sdkExecute
111
 			AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);
107
 			AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request);

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

71
 		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(userElement.getCommunityId(), userElement.getRoomNoId(), payType);
71
 		List<Map<String,Object>> billsList = tpBillInvoiceMapper.getBillsList(userElement.getCommunityId(), userElement.getRoomNoId(), payType);
72
 		billsList.forEach(e-> {
72
 		billsList.forEach(e-> {
73
 			String payPrice = String.valueOf(e.get("payPrice"));
73
 			String payPrice = String.valueOf(e.get("payPrice"));
74
-			String payPriceDouble = BigDecimal.valueOf(Long.valueOf(payPrice)).divide(new BigDecimal(100)).toString();
74
+			Double payPriceDouble = Double.valueOf(payPrice) / 100;
75
 			e.put("payPrice", payPriceDouble);
75
 			e.put("payPrice", payPriceDouble);
76
 		});
76
 		});
77
 		Map<String,Object> result = Maps.newHashMap();
77
 		Map<String,Object> result = Maps.newHashMap();
89
 	public Map<String, Object> getBillInvoiceDetail(Integer communityId,Integer billInvoiceId) {
89
 	public Map<String, Object> getBillInvoiceDetail(Integer communityId,Integer billInvoiceId) {
90
 		Map<String, Object> billInvoiceDetail = tpBillInvoiceMapper.getBillInvoiceDetail(communityId, billInvoiceId);
90
 		Map<String, Object> billInvoiceDetail = tpBillInvoiceMapper.getBillInvoiceDetail(communityId, billInvoiceId);
91
 		String payPrice = String.valueOf(billInvoiceDetail.get("payPrice"));
91
 		String payPrice = String.valueOf(billInvoiceDetail.get("payPrice"));
92
-		String payPriceDouble = BigDecimal.valueOf(Long.valueOf(payPrice)).divide(new BigDecimal(100)).toString();
92
+		Double payPriceDouble = Double.valueOf(payPrice) / 100;
93
 		billInvoiceDetail.put("payPrice", payPriceDouble);
93
 		billInvoiceDetail.put("payPrice", payPriceDouble);
94
 		return billInvoiceDetail;
94
 		return billInvoiceDetail;
95
 	}
95
 	}
110
 
110
 
111
 			// 缴费组
111
 			// 缴费组
112
 			List<TpBillInvoice> tpBillInvoices = orderList.stream().map(billOrder -> tpBillInvoiceMapper.selectByIdBillInvoiceInfo(billOrder.getTpBillInvoiceId())).collect(Collectors.toList());
112
 			List<TpBillInvoice> tpBillInvoices = orderList.stream().map(billOrder -> tpBillInvoiceMapper.selectByIdBillInvoiceInfo(billOrder.getTpBillInvoiceId())).collect(Collectors.toList());
113
-			tpBillInvoices.forEach( billInvoice -> billInvoice.setSumPayPrice(BigDecimal.valueOf(Long.valueOf(billInvoice.getPayPrice())).divide(new BigDecimal(100)).toString()));
113
+			tpBillInvoices.forEach( billInvoice -> billInvoice.setSumPayPrice(Double.valueOf(billInvoice.getPayPrice() + "") / 100));
114
 
114
 
115
 			// 所有缴费组的总额
115
 			// 所有缴费组的总额
116
-			String billCountPrice = BigDecimal.valueOf(Long.valueOf(tpBillInvoices.stream().map(billCount -> billCount.getPayPrice()).count())).divide(new BigDecimal(100)).toString();
116
+			Double billCountPrice = Double.valueOf(tpBillInvoices.stream().map(billCount -> billCount.getPayPrice()).count() + "") / 100;
117
 
117
 
118
 
118
 
119
 			e.setBillList(tpBillInvoices);
119
 			e.setBillList(tpBillInvoices);
143
 		}
143
 		}
144
 		// 每个缴费单数据
144
 		// 每个缴费单数据
145
 		List<TpBillInvoice> tpBillInvoices = billOrderList.stream().map(e -> tpBillInvoiceMapper.selectByIdBillInvoiceInfo(e.getTpBillInvoiceId())).collect(Collectors.toList());
145
 		List<TpBillInvoice> tpBillInvoices = billOrderList.stream().map(e -> tpBillInvoiceMapper.selectByIdBillInvoiceInfo(e.getTpBillInvoiceId())).collect(Collectors.toList());
146
-		tpBillInvoices.forEach(e -> e.setSumPayPrice(BigDecimal.valueOf(Long.valueOf(e.getPayPrice())).divide(new BigDecimal(100)).toString()));
146
+		tpBillInvoices.forEach(e -> e.setSumPayPrice(Double.valueOf(e.getPayPrice() + "") / 100));
147
 
147
 
148
 		// 这个订单总额
148
 		// 这个订单总额
149
-		String billCountPrice = BigDecimal.valueOf(Long.valueOf(tpBillInvoices.stream().map(e -> e.getPayPrice()).count())).divide(new BigDecimal(100)).toString();
149
+		Double billCountPrice = Double.valueOf(tpBillInvoices.stream().map(e -> e.getPayPrice()).count() + "") / 100;
150
 
150
 
151
 		// 因为订单号是多条,取第一条即可
151
 		// 因为订单号是多条,取第一条即可
152
 		TpBillOrder tpBillOrder = billOrderList.get(0);
152
 		TpBillOrder tpBillOrder = billOrderList.get(0);

+ 32
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserLicenseServiceImpl.java 查看文件

10
 import lombok.extern.slf4j.Slf4j;
10
 import lombok.extern.slf4j.Slf4j;
11
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.stereotype.Service;
12
 import org.springframework.stereotype.Service;
13
+import org.springframework.transaction.annotation.Transactional;
13
 
14
 
14
 import java.math.BigDecimal;
15
 import java.math.BigDecimal;
15
 import java.text.ParseException;
16
 import java.text.ParseException;
35
     private IFuShiService iFuShiService;
36
     private IFuShiService iFuShiService;
36
 
37
 
37
     @Override
38
     @Override
39
+    @Transactional(rollbackFor = Exception.class)
38
     public ResponseBean associatedLicense(UserElement userElement, String carNo) {
40
     public ResponseBean associatedLicense(UserElement userElement, String carNo) {
39
         ResponseBean responseBean = new ResponseBean();
41
         ResponseBean responseBean = new ResponseBean();
40
 
42
 
55
         if (null == taUserLicense.getId()) {
57
         if (null == taUserLicense.getId()) {
56
             rows = taUserLicenseMapper.insertSelective(taUserLicense);
58
             rows = taUserLicenseMapper.insertSelective(taUserLicense);
57
         } else {
59
         } else {
60
+            taUserLicense.setUpdateUser(userElement.getId());
61
+            taUserLicense.setUpdateDate(new Date());
58
             rows = taUserLicenseMapper.updateByPrimaryKeySelective(taUserLicense);
62
             rows = taUserLicenseMapper.updateByPrimaryKeySelective(taUserLicense);
59
         }
63
         }
60
 
64
 
61
 
65
 
62
         if (rows > 0) {
66
         if (rows > 0) {
67
+            taUserLicense.setUnitPrice(String.valueOf(Double.valueOf(taUserLicense.getUnitPrice()) / 100));
63
             responseBean.addSuccess(taUserLicense);
68
             responseBean.addSuccess(taUserLicense);
64
             return responseBean;
69
             return responseBean;
65
         }
70
         }
68
         return responseBean;
73
         return responseBean;
69
     }
74
     }
70
 
75
 
76
+    @Override
77
+    @Transactional(rollbackFor = Exception.class)
78
+    public ResponseBean getLicense(UserElement userElement, String carNo) {
79
+        ResponseBean responseBean = new ResponseBean();
80
+        TaUserLicense taUserLicense = taUserLicenseMapper.selectByUserIdAndCommunityIdAndLicensePlate(userElement.getCommunityId(), userElement.getId(), carNo);
81
+        if (null != taUserLicense) {
82
+            taUserLicense = getTaUserLicense(carNo, taUserLicense);
83
+            taUserLicense.setUpdateUser(userElement.getId());
84
+            taUserLicense.setUpdateDate(new Date());
85
+            taUserLicenseMapper.updateByPrimaryKeySelective(taUserLicense);
86
+        }
87
+
88
+        responseBean.addSuccess(taUserLicense);
89
+        return responseBean;
90
+    }
71
 
91
 
72
     @Override
92
     @Override
93
+    @Transactional(rollbackFor = Exception.class)
73
     public ResponseBean getAllUserLicense(UserElement userElement) {
94
     public ResponseBean getAllUserLicense(UserElement userElement) {
74
         ResponseBean responseBean = new ResponseBean();
95
         ResponseBean responseBean = new ResponseBean();
75
         List<TaUserLicense> taUserLicenses = taUserLicenseMapper.selectAllByCommunityIdAndUserId(userElement.getCommunityId(), userElement.getId());
96
         List<TaUserLicense> taUserLicenses = taUserLicenseMapper.selectAllByCommunityIdAndUserId(userElement.getCommunityId(), userElement.getId());
79
 
100
 
80
         taUserLicenses = taUserLicenses.stream().map(e-> {
101
         taUserLicenses = taUserLicenses.stream().map(e-> {
81
             TaUserLicense taUserLicense = getTaUserLicense(e.getLicensePlate(), e);
102
             TaUserLicense taUserLicense = getTaUserLicense(e.getLicensePlate(), e);
103
+            taUserLicense.setUpdateUser(userElement.getId());
104
+            taUserLicense.setUpdateDate(new Date());
82
             taUserLicenseMapper.updateByPrimaryKeySelective(taUserLicense);
105
             taUserLicenseMapper.updateByPrimaryKeySelective(taUserLicense);
106
+            taUserLicense.setUnitPrice(String.valueOf(Double.valueOf(taUserLicense.getUnitPrice()) / 100));
83
             return taUserLicense;
107
             return taUserLicense;
84
         }).collect(Collectors.toList());
108
         }).collect(Collectors.toList());
85
 
109
 
105
 
129
 
106
         // 获取到的车牌信息
130
         // 获取到的车牌信息
107
         Map<String,Object> map = (Map<String,Object>)resultCar;
131
         Map<String,Object> map = (Map<String,Object>)resultCar;
132
+        Integer dataType = (Integer) map.get("DataType");
133
+        if (dataType.intValue() != 1) {
134
+            throw new WisdomException("该车牌不是月租车!");
135
+        }
136
+
108
         Map<String,Object> jsonParam = (Map<String, Object>) map.get("JsonParam");
137
         Map<String,Object> jsonParam = (Map<String, Object>) map.get("JsonParam");
109
 
138
 
110
         taUserLicense.setLicensePlate(carNo);
139
         taUserLicense.setLicensePlate(carNo);
111
-        taUserLicense.setUnitPrice(BigDecimal.valueOf(Long.valueOf(String.valueOf(jsonParam.get("Cost")))).multiply(new BigDecimal(100)).toString());
140
+        String price = String.valueOf(Double.valueOf(((BigDecimal) jsonParam.get("Cost")).toString()) * 100);
141
+        taUserLicense.setUnitPrice(price.substring(0, price.lastIndexOf(".")));
112
         taUserLicense.setCreateDate(new Date());
142
         taUserLicense.setCreateDate(new Date());
113
         taUserLicense.setParkingLot(String.valueOf(jsonParam.get("ParkingName")));
143
         taUserLicense.setParkingLot(String.valueOf(jsonParam.get("ParkingName")));
114
 
144
 
123
     }
153
     }
124
 
154
 
125
     @Override
155
     @Override
156
+    @Transactional(rollbackFor = Exception.class)
126
     public ResponseBean deleteUserLicense(UserElement userElement, Integer licenseId) {
157
     public ResponseBean deleteUserLicense(UserElement userElement, Integer licenseId) {
127
         ResponseBean responseBean = new ResponseBean();
158
         ResponseBean responseBean = new ResponseBean();
128
 
159
 

+ 249
- 60
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java 查看文件

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
3
 import com.community.commom.session.UserElement;
5
 import com.community.commom.session.UserElement;
4
 import com.community.huiju.common.perproties.PayNotifyPerproties;
6
 import com.community.huiju.common.perproties.PayNotifyPerproties;
5
 import com.community.huiju.common.wxpay.HfWxConfig;
7
 import com.community.huiju.common.wxpay.HfWxConfig;
9
 import com.community.huiju.dao.*;
11
 import com.community.huiju.dao.*;
10
 import com.community.huiju.exception.WisdomException;
12
 import com.community.huiju.exception.WisdomException;
11
 import com.community.huiju.model.*;
13
 import com.community.huiju.model.*;
14
+import com.community.huiju.service.IFuShiService;
15
+import com.community.huiju.service.ITaUserLicenseService;
12
 import com.community.huiju.service.WxPayServiceI;
16
 import com.community.huiju.service.WxPayServiceI;
13
 import com.google.common.collect.Lists;
17
 import com.google.common.collect.Lists;
14
 import com.google.common.collect.Maps;
18
 import com.google.common.collect.Maps;
15
 import org.apache.commons.collections.CollectionUtils;
19
 import org.apache.commons.collections.CollectionUtils;
20
+import org.apache.commons.lang.StringUtils;
16
 import org.slf4j.Logger;
21
 import org.slf4j.Logger;
17
 import org.slf4j.LoggerFactory;
22
 import org.slf4j.LoggerFactory;
18
 import org.springframework.beans.factory.annotation.Autowired;
23
 import org.springframework.beans.factory.annotation.Autowired;
19
 import org.springframework.stereotype.Service;
24
 import org.springframework.stereotype.Service;
20
 import org.springframework.transaction.annotation.Transactional;
25
 import org.springframework.transaction.annotation.Transactional;
21
 
26
 
27
+import java.math.BigDecimal;
22
 import java.time.Instant;
28
 import java.time.Instant;
29
+import java.time.LocalDateTime;
30
+import java.time.ZoneId;
23
 import java.util.*;
31
 import java.util.*;
24
 import java.util.concurrent.atomic.AtomicReference;
32
 import java.util.concurrent.atomic.AtomicReference;
25
 import java.util.stream.Collectors;
33
 import java.util.stream.Collectors;
63
 	@Autowired
71
 	@Autowired
64
 	private PayNotifyPerproties payNotifyPerproties;
72
 	private PayNotifyPerproties payNotifyPerproties;
65
 
73
 
74
+	@Autowired
75
+	private TaUserLicenseOrderMapper taUserLicenseOrderMapper;
76
+
77
+	@Autowired
78
+	private IFuShiService iFuShiService;
79
+
80
+	@Autowired
81
+	private TaUserLicenseMapper taUserLicenseMapper;
82
+
83
+	@Autowired
84
+	private ITaUserLicenseService iTaUserLicenseService;
85
+
86
+
66
 	/**
87
 	/**
67
 	 * 微信支付统一下单
88
 	 * 微信支付统一下单
68
 	 *
89
 	 *
78
 
99
 
79
 		Map<String, Object> orderPriceAndNotifyUrl = getOrderPriceAndNotifyUrl(type, orderNo);
100
 		Map<String, Object> orderPriceAndNotifyUrl = getOrderPriceAndNotifyUrl(type, orderNo);
80
 
101
 
102
+		String typeName = Constant.PAY_TYPE_BILL.equals(type) ? "物业缴费" : Constant.PAY_TYPE_CAR.equals(type) ? "车缴费" : "缴费";
103
+
81
 		//下单
104
 		//下单
82
 		Map<String, String> data = new HashMap<String, String>();
105
 		Map<String, String> data = new HashMap<String, String>();
83
-		data.put("body", "缴费");
106
+		data.put("body", typeName);
84
 		//商品号唯一
107
 		//商品号唯一
85
 		data.put("out_trade_no", orderNo);
108
 		data.put("out_trade_no", orderNo);
86
 		data.put("device_info", "");
109
 		data.put("device_info", "");
111
 		secondSignData.put("package", "Sign=WXPay");
134
 		secondSignData.put("package", "Sign=WXPay");
112
 		secondSignData.put("sign", WXPayUtil.generateSignature(secondSignData, config.getKey(), WXPayConstants.SignType.MD5));
135
 		secondSignData.put("sign", WXPayUtil.generateSignature(secondSignData, config.getKey(), WXPayConstants.SignType.MD5));
113
 
136
 
114
-		log.info("订单: {}, 状态变更为正在支付", orderNo);
137
+		log.info("订单: {},订单类型: {}, 状态变更为正在支付", orderNo, type);
115
 
138
 
116
 		// 更改订单状态 为正在支付
139
 		// 更改订单状态 为正在支付
117
-		List<TpBillOrder> billOrders = tpBillOrderMapper.selectByOrderBumber(orderNo);
118
-		billOrders.forEach(e-> {
119
-			e.setOrderStatus("3");
120
-			tpBillOrderMapper.updateByPrimaryKeySelective(e);
121
-		});
122
-
140
+		updateOrderStatus(orderNo, type, "2");
123
 		return secondSignData;
141
 		return secondSignData;
124
 	}
142
 	}
125
 
143
 
130
 	 * @return
148
 	 * @return
131
 	 * @throws Exception
149
 	 * @throws Exception
132
 	 */
150
 	 */
133
-	private Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo) throws Exception {
151
+	@Override
152
+	public Map<String,Object> getOrderPriceAndNotifyUrl(String type, String orderNo) throws Exception {
134
 		Map<String,Object> orderMap = Maps.newHashMap();
153
 		Map<String,Object> orderMap = Maps.newHashMap();
135
 
154
 
136
 		// 物业缴费
155
 		// 物业缴费
137
-		if ("bill".equals(type)) {
156
+		if (Constant.PAY_TYPE_BILL.equals(type)) {
138
 			//获取支付金额
157
 			//获取支付金额
139
 			List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(orderNo);
158
 			List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(orderNo);
140
 			if (CollectionUtils.isEmpty(billOrderList)){
159
 			if (CollectionUtils.isEmpty(billOrderList)){
147
 				}
166
 				}
148
 			});
167
 			});
149
 			// 计算金额
168
 			// 计算金额
150
-			Integer payPrice = billOrderList.stream().mapToInt(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
151
-
169
+			Long payPrice = billOrderList.stream().mapToLong(e -> tpBillInvoiceMapper.selectByPrimaryKey(e.getTpBillInvoiceId()).getPayPrice()).sum();
152
 			orderMap.put("orderNo", orderNo);
170
 			orderMap.put("orderNo", orderNo);
153
 			orderMap.put("payPrice", String.valueOf(payPrice));
171
 			orderMap.put("payPrice", String.valueOf(payPrice));
154
 			orderMap.put("notifyUrl", payNotifyPerproties.getWxBillNotify());
172
 			orderMap.put("notifyUrl", payNotifyPerproties.getWxBillNotify());
155
 
173
 
156
-		} else if ("car".equals(type)) {
174
+		} else if (Constant.PAY_TYPE_CAR.equals(type)) { // 车缴费
175
+			List<TaUserLicenseOrder> userLicenseOrders = taUserLicenseOrderMapper.selectByOrderNumber(orderNo);
176
+			if (CollectionUtils.isEmpty(userLicenseOrders)) {
177
+				throw new Exception("订单不存在");
178
+			}
179
+			// 检测订单是否 已关闭
180
+			userLicenseOrders.forEach(e-> {
181
+				if ("3".equals(e.getOrderStatus())) {
182
+					throw new WisdomException("无法支付已关闭的订单!");
183
+				}
184
+			});
157
 
185
 
186
+			// 总额
187
+			Long payPrice = userLicenseOrders.stream().map(e -> Long.parseLong(e.getExtensionPrice())).count();
188
+			orderMap.put("orderNo", orderNo);
189
+			orderMap.put("payPrice", String.valueOf(payPrice));
190
+			orderMap.put("notifyUrl", payNotifyPerproties.getWxCarNotify());
158
 		}
191
 		}
159
 
192
 
160
 		return orderMap;
193
 		return orderMap;
161
 	}
194
 	}
162
 
195
 
163
 
196
 
197
+
198
+
164
 	/**
199
 	/**
165
 	 * 支付成功的回调
200
 	 * 支付成功的回调
166
 	 *
201
 	 *
169
 	 */
204
 	 */
170
 	@Override
205
 	@Override
171
 	@Transactional(rollbackFor = Exception.class)
206
 	@Transactional(rollbackFor = Exception.class)
172
-	public String wxNotify(Map<String, String> resultMap) throws Exception {
207
+	public String wxBillNotify(Map<String, String> resultMap) throws Exception {
173
 		String outTradeNo = resultMap.get("out_trade_no");
208
 		String outTradeNo = resultMap.get("out_trade_no");
174
 		List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
209
 		List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
175
 		if (CollectionUtils.isEmpty(billOrderList)){
210
 		if (CollectionUtils.isEmpty(billOrderList)){
227
 //			tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
262
 //			tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
228
 		}
263
 		}
229
 
264
 
230
-		log.info("订单: {}, 状态变更为支付成功", outTradeNo);
265
+		log.info("订单: {},订单类型: {}, 状态变更为支付成功", outTradeNo, Constant.PAY_TYPE_BILL);
231
 
266
 
232
 		// 更改订单状态 为支付成功
267
 		// 更改订单状态 为支付成功
233
-		List<TpBillOrder> billOrders = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
234
-		billOrders.forEach(e-> {
235
-			e.setOrderStatus("1");
236
-			tpBillOrderMapper.updateByPrimaryKeySelective(e);
237
-		});
268
+		updateOrderStatus(outTradeNo, Constant.PAY_TYPE_BILL, "1");
238
 
269
 
239
 		return "success";
270
 		return "success";
240
 	}
271
 	}
256
 	
287
 	
257
 	@Override
288
 	@Override
258
 	@Transactional(rollbackFor = Exception.class)
289
 	@Transactional(rollbackFor = Exception.class)
259
-	public String wxStartPay(List<Integer> billInvoiceIdArray, UserElement userElement) throws Exception {
290
+	public String wxStartPay(List<Integer> idArray, String type, Integer extensionMonth, UserElement userElement) throws Exception {
291
+		if (StringUtils.isBlank(type)) {
292
+			throw new WisdomException("type 不能为空!");
293
+		}
260
 
294
 
261
-		// 如果是家属/租客, 应该用业主的用户id
295
+		// 缴费的用户
262
 		TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
296
 		TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
263
 
297
 
264
 		Random random = new Random();
298
 		Random random = new Random();
265
 		String orderNo = String.valueOf(System.currentTimeMillis()) + random.nextInt();
299
 		String orderNo = String.valueOf(System.currentTimeMillis()) + random.nextInt();
266
 
300
 
267
-		//获取支付金额
268
-		for (Integer billInvoiceId : billInvoiceIdArray) {
269
-			TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByPrimaryKey(billInvoiceId);
270
-			if (null == tpBillInvoice){
271
-				throw new Exception("订单不存在");
272
-			}else if (!tpBillInvoice.getBillStatus().equals("0")){
273
-				throw new Exception("正在支付的订单");
301
+		// 创建订单
302
+		createOrder(idArray, type, taUser, userElement, orderNo, extensionMonth, null);
303
+
304
+		return orderNo;
305
+	}
306
+
307
+	/**
308
+	 * 创建订单
309
+	 * @param idArray
310
+	 * @param type
311
+	 * @param taUser
312
+	 * @param userElement
313
+	 * @param orderNo
314
+	 * @param extensionMonth 延期月份,也就是延期几个月!
315
+	 *                       	只有在 车缴费的时候才有效
316
+	 * @param paymentType 缴费方式 1是支付宝 2是微信支付
317
+	 * @throws Exception
318
+	 */
319
+	private void createOrder(List<Integer> idArray, String type, TaUser taUser, UserElement userElement, String orderNo, Integer extensionMonth, String paymentType) throws Exception {
320
+		// 物业缴费
321
+		if (Constant.PAY_TYPE_BILL.equals(type)) {
322
+			//获取支付金额
323
+			for (Integer billInvoiceId : idArray) {
324
+				TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByPrimaryKey(billInvoiceId);
325
+				if (null == tpBillInvoice){
326
+					throw new Exception("订单不存在");
327
+				}else if (!tpBillInvoice.getBillStatus().equals("0")){
328
+					throw new Exception("正在支付的订单");
329
+				}
330
+
331
+				TpBillOrder tpBillOrder = new TpBillOrder();
332
+				tpBillOrder.setCommunityId(userElement.getCommunityId());
333
+				tpBillOrder.setTpBillId(tpBillInvoice.getBillId());
334
+				tpBillOrder.setTpBillInvoiceId(tpBillInvoice.getId());
335
+				tpBillOrder.setCreateDate(new Date());
336
+				tpBillOrder.setCreateUser(userElement.getId());
337
+				tpBillOrder.setUpdateDate(new Date());
338
+				tpBillOrder.setUpdateUser(userElement.getId());
339
+				tpBillOrder.setOrderBumber(orderNo);
340
+				tpBillOrder.setPayPhone(taUser.getLoginName());
341
+				tpBillOrder.setOrderStatus("0");
342
+
343
+				tpBillOrderMapper.insertSelective(tpBillOrder);
344
+
345
+			}
346
+			// 修改缴费人, 修改为正在缴费
347
+			updateBillInvoiceBillStatus(idArray, taUser.getUserName(), "2");
348
+
349
+			// 车缴费
350
+		} else if (Constant.PAY_TYPE_CAR.equals(type)) {
351
+			if (null == extensionMonth && extensionMonth > 0) {
352
+				throw new Exception("延期月份不能为空,并且要大于0!");
274
 			}
353
 			}
275
 
354
 
276
-			TpBillOrder tpBillOrder = new TpBillOrder();
277
-			tpBillOrder.setCommunityId(userElement.getCommunityId());
278
-			tpBillOrder.setTpBillId(tpBillInvoice.getBillId());
279
-			tpBillOrder.setTpBillInvoiceId(tpBillInvoice.getId());
280
-			tpBillOrder.setCreateDate(new Date());
281
-			tpBillOrder.setCreateUser(userElement.getId());
282
-			tpBillOrder.setUpdateDate(new Date());
283
-			tpBillOrder.setUpdateUser(userElement.getId());
284
-			tpBillOrder.setOrderBumber(orderNo);
285
-			tpBillOrder.setPayPhone(taUser.getLoginName());
286
-			tpBillOrder.setOrderStatus("0");
355
+			for (Integer clicenseId : idArray) {
356
+				// 根据车牌id,查询车牌
357
+				TaUserLicense taUserLicense = taUserLicenseMapper.selectByPrimaryKey(clicenseId);
358
+				// 获取车牌最新信息
359
+				ResponseBean responseLicense = iTaUserLicenseService.getLicense(userElement, taUserLicense.getLicensePlate());
360
+				Object licenseData = responseLicense.getData();
361
+				if (null != licenseData && licenseData instanceof TaUserLicense) {
362
+					taUserLicense = (TaUserLicense) licenseData;
363
+				}
287
 
364
 
288
-			tpBillOrderMapper.insertSelective(tpBillOrder);
365
+				TaUserLicenseOrder taUserLicenseOrder = new TaUserLicenseOrder();
366
+				taUserLicenseOrder.setCommunityId(userElement.getCommunityId());
367
+				taUserLicenseOrder.setTaUserId(userElement.getId());
368
+				taUserLicenseOrder.setOrderNumber(orderNo);
369
+				taUserLicenseOrder.setOrderStatus("0");
370
+				taUserLicenseOrder.setCreateDate(new Date());
371
+				taUserLicenseOrder.setCreateUser(userElement.getId());
372
+				taUserLicenseOrder.setExtensionMonth(extensionMonth);
373
+
374
+				// 费用
375
+				String extensionPrice = BigDecimal.valueOf(Double.valueOf(taUserLicense.getUnitPrice()) / 100).multiply(BigDecimal.valueOf(extensionMonth)).toString();
376
+				String price = String.valueOf(Double.valueOf(extensionPrice) * 100);
377
+				taUserLicenseOrder.setExtensionPrice(price.substring(0, price.lastIndexOf(".")));
378
+
379
+				taUserLicenseOrder.setPaymentTel(taUser.getLoginName());
380
+				taUserLicenseOrder.setPaymentName(taUser.getUserName());
381
+				taUserLicenseOrder.setPaymentType(paymentType);
382
+
383
+				// 到期时间 (具体的到期时候,在支付回调里面以车辆管理系统为准)
384
+				LocalDateTime localDateTime = LocalDateTime.ofInstant(taUserLicense.getExpireDate().toInstant(), ZoneId.systemDefault());
385
+				localDateTime.plusMonths(extensionMonth);
386
+				taUserLicenseOrder.setExpireDate(Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant()));
387
+				taUserLicenseOrder.setUnitPrice(taUserLicense.getUnitPrice());
388
+				taUserLicenseOrder.setParkingLot(taUserLicense.getParkingLot());
389
+				taUserLicenseOrder.setLicensePlate(taUserLicense.getLicensePlate());
390
+
391
+				// 插入数据
392
+				taUserLicenseOrderMapper.insertSelective(taUserLicenseOrder);
289
 
393
 
290
-		}
394
+			}
291
 
395
 
292
-		// 修改缴费人
293
-		 updateBillInvoiceBillStatus(billInvoiceIdArray, taUser.getUserName(), "3");
294
-		return orderNo;
396
+		}
295
 	}
397
 	}
296
-	
398
+
399
+
400
+
297
 	/**
401
 	/**
298
 	 * 取消支付
402
 	 * 取消支付
299
 	 *
403
 	 *
302
 	 */
406
 	 */
303
 	@Override
407
 	@Override
304
 	@Transactional(rollbackFor = Exception.class)
408
 	@Transactional(rollbackFor = Exception.class)
305
-	public void wxCancelPay(String outTradeNo, UserElement userElement) throws Exception {
409
+	public void wxCancelPay(String outTradeNo, String type, UserElement userElement) throws Exception {
410
+
411
+		/**
412
+		 * 如果是车缴费订单,就只直接更新 订单状态为关闭
413
+		 */
414
+		// 如果是车缴费
415
+		if (Constant.PAY_TYPE_CAR.equals(type)) {
416
+			// 更改订单状态 为订单已关闭
417
+			updateOrderStatus(outTradeNo, type, "3");
418
+			return;
419
+		}
420
+
421
+		// --------------------------- 物业缴费 --------------------------------
306
 
422
 
307
 		//获取支付金额
423
 		//获取支付金额
308
 		List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
424
 		List<TpBillOrder> billOrderList = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
313
 		List<TpBillInvoice> billInvoiceList = Lists.newArrayList();
429
 		List<TpBillInvoice> billInvoiceList = Lists.newArrayList();
314
 		for (TpBillOrder tpBillOrder : billOrderList) {
430
 		for (TpBillOrder tpBillOrder : billOrderList) {
315
 			TpBillInvoice billInvoice = tpBillInvoiceMapper.selectByPrimaryKey(tpBillOrder.getTpBillInvoiceId());
431
 			TpBillInvoice billInvoice = tpBillInvoiceMapper.selectByPrimaryKey(tpBillOrder.getTpBillInvoiceId());
316
-			if (!billInvoice.getBillStatus().equals("3")){
432
+			if (!billInvoice.getBillStatus().equals("2")){
317
 				throw new Exception("不是正在支付的订单");
433
 				throw new Exception("不是正在支付的订单");
318
 			}
434
 			}
319
 			billInvoiceList.add(billInvoice);
435
 			billInvoiceList.add(billInvoice);
324
 
440
 
325
 		//更新为 未支付状态
441
 		//更新为 未支付状态
326
 		updateBillInvoiceBillStatus(billInvoiceIdList, "","0");
442
 		updateBillInvoiceBillStatus(billInvoiceIdList, "","0");
327
-		log.info("订单: {}, 状态变更为取消支付", outTradeNo);
443
+		log.info("订单: {}, 订单类型: {}, 状态变更为取消支付", outTradeNo, type);
328
 
444
 
329
 		// 更改订单状态 为订单已关闭
445
 		// 更改订单状态 为订单已关闭
330
-		List<TpBillOrder> billOrders = tpBillOrderMapper.selectByOrderBumber(outTradeNo);
331
-		billOrders.forEach(e-> {
332
-			e.setOrderStatus("3");
333
-			tpBillOrderMapper.updateByPrimaryKeySelective(e);
446
+		updateOrderStatus(outTradeNo, type, "3");
447
+
448
+	}
449
+
450
+	@Override
451
+	public String wxCarNotify(Map<String, String> resultMap) {
452
+
453
+		String outTradeNo = resultMap.get("out_trade_no");
454
+		String pay_type = resultMap.get("pay_type");
455
+		String payTypeName = pay_type.equals("0") ? "微信支付" : pay_type.equals("2") ? "支付宝" : "未知";
456
+
457
+		List<TaUserLicenseOrder> userLicenseOrderList = taUserLicenseOrderMapper.selectByOrderNumber(outTradeNo);
458
+		if (CollectionUtils.isEmpty(userLicenseOrderList)){
459
+			return "不存在的订单";
460
+		}
461
+
462
+		userLicenseOrderList.forEach(e-> {
463
+			e.setPaymentType(pay_type);
464
+			UserElement userElement = new UserElement();
465
+			userElement.setCommunityId(e.getCommunityId());
466
+			userElement.setId(e.getTaUserId());
467
+			ResponseBean responseLicense = iTaUserLicenseService.getLicense(userElement, e.getLicensePlate());
468
+			Object licenseData = responseLicense.getData();
469
+			TaUserLicense taUserLicense = null;
470
+			if (null != licenseData && licenseData instanceof TaUserLicense) {
471
+				taUserLicense = (TaUserLicense) licenseData;
472
+			}
473
+
474
+			e.setExpireDate(taUserLicense.getExpireDate());
475
+
476
+			taUserLicenseOrderMapper.updateByPrimaryKeySelective(e);
477
+
334
 		});
478
 		});
479
+
480
+
481
+		log.info("订单: {},订单类型: {}, 状态变更为支付成功", outTradeNo, Constant.PAY_TYPE_CAR);
482
+
483
+		// 更改订单状态 为支付成功
484
+		updateOrderStatus(outTradeNo, Constant.PAY_TYPE_CAR, "1");
485
+
486
+		log.info("订单:{},订单类型: {} 开始推送到 车辆管理系统 ", outTradeNo, Constant.PAY_TYPE_CAR);
487
+
488
+		TaUserLicenseOrder taUserLicenseOrder = userLicenseOrderList.get(0);
489
+
490
+		TaUser taUser = taUserMapper.selectByPrimaryKey(taUserLicenseOrder.getTaUserId());
491
+
492
+
493
+		// 推送到车辆管理系统
494
+		iFuShiService.apiThirdPartyMonthCardPay(taUser.getLoginName(), "2",
495
+								String.valueOf(taUserLicenseOrder.getExtensionMonth()),
496
+								payTypeName, taUserLicenseOrder.getLicensePlate(),
497
+								null, String.valueOf(Double.valueOf(taUserLicenseOrder.getExtensionPrice()) / 100));
498
+
499
+		return "success";
335
 	}
500
 	}
336
-	
501
+
337
 	/**
502
 	/**
338
 	 * 更新支付状态
503
 	 * 更新支付状态
339
 	 * @param billInvoiceIdList
504
 	 * @param billInvoiceIdList
340
-	 * @param billStatus
505
+	 * @param status
341
 	 */
506
 	 */
342
-	private void updateBillInvoiceBillStatus(List<Integer> billInvoiceIdList, String billStatus) {
507
+	private void updateBillInvoiceBillStatus(List<Integer> billInvoiceIdList, String status) {
343
 		billInvoiceIdList.forEach(e -> {
508
 		billInvoiceIdList.forEach(e -> {
344
 			TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
509
 			TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
345
-			tpBillInvoiceUpdate.setBillStatus(billStatus);
510
+			tpBillInvoiceUpdate.setBillStatus(status);
346
 			tpBillInvoiceUpdate.setId(e);
511
 			tpBillInvoiceUpdate.setId(e);
347
 			tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
512
 			tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
348
 		});
513
 		});
353
 	 * 更新支付状态
518
 	 * 更新支付状态
354
 	 * @param billInvoiceIdList
519
 	 * @param billInvoiceIdList
355
 	 * @param userName 缴费人
520
 	 * @param userName 缴费人
356
-	 * @param billStatus
521
+	 * @param status
357
 	 */
522
 	 */
358
-	private void updateBillInvoiceBillStatus(List<Integer> billInvoiceIdList, String userName, String billStatus) {
523
+	private void updateBillInvoiceBillStatus(List<Integer> billInvoiceIdList, String userName, String status) {
359
 		billInvoiceIdList.forEach(e -> {
524
 		billInvoiceIdList.forEach(e -> {
360
 			TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
525
 			TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
361
-			tpBillInvoiceUpdate.setBillStatus(billStatus);
526
+			tpBillInvoiceUpdate.setBillStatus(status);
362
 			tpBillInvoiceUpdate.setId(e);
527
 			tpBillInvoiceUpdate.setId(e);
363
 			tpBillInvoiceUpdate.setPayName(userName);
528
 			tpBillInvoiceUpdate.setPayName(userName);
364
 			tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
529
 			tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
365
 		});
530
 		});
531
+	}
366
 
532
 
533
+	/**
534
+	 * 更改订单状态
535
+	 * @param orderNumber
536
+	 * @param type
537
+	 * @param status
538
+	 */
539
+	private void updateOrderStatus(String orderNumber, String type, String status){
540
+		// 物业缴费
541
+		if (Constant.PAY_TYPE_BILL.equals(type)) {
542
+			List<TpBillOrder> billOrders = tpBillOrderMapper.selectByOrderBumber(orderNumber);
543
+			billOrders.forEach(e-> {
544
+				e.setOrderStatus(status);
545
+				tpBillOrderMapper.updateByPrimaryKeySelective(e);
546
+			});
547
+
548
+			// 车缴费
549
+		} else if (Constant.PAY_TYPE_CAR.equals(type)) {
550
+			List<TaUserLicenseOrder> taUserLicenseOrders = taUserLicenseOrderMapper.selectByOrderNumber(orderNumber);
551
+			taUserLicenseOrders.forEach(e-> {
552
+				e.setOrderStatus(status);
553
+				taUserLicenseOrderMapper.updateByPrimaryKeySelective(e);
554
+			});
555
+		}
367
 	}
556
 	}
368
 }
557
 }

+ 8
- 4
CODE/smart-community/app-api/src/main/resources/application.yml 查看文件

52
 
52
 
53
 # 支付回调
53
 # 支付回调
54
 pay-notify:
54
 pay-notify:
55
-  wx-bill-notify: http://106.14.20.193:8086/app-api/wxNotify
56
-  ali-bill-notify: http://106.14.20.193:8086/app-api/aliPayNotify
57
-#  wx-bill-notify: http://ycapi.jcjyhn.com/app-api/wxNotify
58
-#  ali-bill-notify: http://ycapi.jcjyhn.com/app-api/aliPayNotify
55
+  wx-bill-notify: http://106.14.20.193:8086/app-api/wxBillNotify
56
+  ali-bill-notify: http://106.14.20.193:8086/app-api/aliPayBillNotify
57
+  wx-car-notify: http://106.14.20.193:8086/app-api/wxCarNotify
58
+  ali-car-notify: http://106.14.20.193:8086/app-api/aliPayCarNotify
59
+#  wx-bill-notify: http://ycapi.jcjyhn.com/app-api/wxBillNotify
60
+#  ali-bill-notify: http://ycapi.jcjyhn.com/app-api/aliPayBillNotify
61
+#  wx-car-notify: http://ycapi.jcjyhn.com/app-api/wxCarNotify
62
+#  ali-car-notify: http://ycapi.jcjyhn.com/app-api/aliPayCarNotify
59
 
63
 
60
 # 大苏
64
 # 大苏
61
 da-su:
65
 da-su:

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

234
 
234
 
235
     /** 用户待审核 **/
235
     /** 用户待审核 **/
236
     public static final String TO_AUDIT = "0";
236
     public static final String TO_AUDIT = "0";
237
+
238
+    /** 缴费类型 物业 **/
239
+    public static final String PAY_TYPE_BILL = "bill";
240
+
241
+
242
+    /** 缴费类型 车缴费 **/
243
+    public static final String PAY_TYPE_CAR = "car";
237
 }
244
 }