Bladeren bron

缴费的时候, 为当前缴费人

weiximei 6 jaren geleden
bovenliggende
commit
ca8eb334fc

+ 19
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/WxPayServiceImpl.java Bestand weergeven

@@ -126,13 +126,12 @@ public class WxPayServiceImpl implements WxPayServiceI {
126 126
 			return "订单状态出错";
127 127
 		}
128 128
 
129
-		// 根据 app 用户id, 查询用户
130
-		TaUser taUser = taUserMapper.selectByPrimaryKey(tpBillInvoice.getTaUserId());
129
+
130
+		// 缴费人在准备支付状态下更新, 这里是微信的回调所有没有 token
131 131
 
132 132
 		// 更新为正在支付状态
133
-		// 更改收费单的缴费人, 缴费时间, 修改人, 修改时间
133
+		// 更改收费单的 缴费时间, 修改人, 修改时间
134 134
 		tpBillInvoice.setBillStatus("1");
135
-		tpBillInvoice.setPayName(taUser.getUserName());
136 135
 		tpBillInvoice.setPayDate(new Date());
137 136
 		tpBillInvoice.setUpdateDate(new Date());
138 137
 		// 缴费方式  0:微信支付  1:线下缴费
@@ -205,8 +204,9 @@ public class WxPayServiceImpl implements WxPayServiceI {
205 204
 		}else if (!tpBillInvoice.getBillStatus().equals("0")){
206 205
 			throw new Exception("正在支付的订单");
207 206
 		}
207
+
208 208
 		//更新为正在支付状态
209
-		updateBillInvoiceBillStatus(billInvoiceId,"3");
209
+		updateBillInvoiceBillStatus(billInvoiceId, taUser.getUserName(),"3");
210 210
 	}
211 211
 	
212 212
 	/**
@@ -251,4 +251,18 @@ public class WxPayServiceImpl implements WxPayServiceI {
251 251
 		tpBillInvoiceUpdate.setId(billInvoiceId);
252 252
 		tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
253 253
 	}
254
+
255
+	/**
256
+	 * 更新支付状态
257
+	 * @param billInvoiceId
258
+	 * @param userName 缴费人
259
+	 * @param billStatus
260
+	 */
261
+	private void updateBillInvoiceBillStatus(Integer billInvoiceId, String userName, String billStatus) {
262
+		TpBillInvoice tpBillInvoiceUpdate = new TpBillInvoice();
263
+		tpBillInvoiceUpdate.setBillStatus(billStatus);
264
+		tpBillInvoiceUpdate.setId(billInvoiceId);
265
+		tpBillInvoiceUpdate.setPayName(userName);
266
+		tpBillInvoiceMapper.updateByPrimaryKeySelective(tpBillInvoiceUpdate);
267
+	}
254 268
 }