|
@@ -72,23 +72,23 @@ public class AliPayServiceImpl implements AliPayServiceI {
|
72
|
72
|
@Override
|
73
|
73
|
@Transactional(rollbackFor = Exception.class)
|
74
|
74
|
public String AliPayOrder(Integer billInvoiceId, UserElement userElement) throws Exception {
|
75
|
|
- //Integer userId = userElement.getId();
|
76
|
|
- //
|
77
|
|
- //// 如果是家属/租客, 应该用业主的用户id
|
78
|
|
- //TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
79
|
|
- //TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
|
80
|
|
- //if (null != taSysRole && taSysRole.getId().intValue() != 1) {
|
81
|
|
- // TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
|
82
|
|
- // userId = ownerUser.getId();
|
83
|
|
- //}
|
84
|
|
- //
|
85
|
|
- ////获取支付金额
|
86
|
|
- //TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
|
87
|
|
- //if (null == tpBillInvoice){
|
88
|
|
- // throw new Exception("订单不存在");
|
89
|
|
- //}else if (!tpBillInvoice.getBillStatus().equals("3")){
|
90
|
|
- // throw new Exception("不是正在支付的订单");
|
91
|
|
- //}
|
|
75
|
+ Integer userId = userElement.getId();
|
|
76
|
+
|
|
77
|
+ // 如果是家属/租客, 应该用业主的用户id
|
|
78
|
+ TaUser taUser = taUserMapper.selectByPrimaryKey(userId);
|
|
79
|
+ TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(userId);
|
|
80
|
+ if (null != taSysRole && taSysRole.getId().intValue() != 1) {
|
|
81
|
+ TaUser ownerUser = taUserMapper.selectByPrimaryKey(taUser.getParentId());
|
|
82
|
+ userId = ownerUser.getId();
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ //获取支付金额
|
|
86
|
+ TpBillInvoice tpBillInvoice = tpBillInvoiceMapper.selectByIdAndUserId(billInvoiceId,userId,userElement.getCommunityId());
|
|
87
|
+ if (null == tpBillInvoice){
|
|
88
|
+ throw new Exception("订单不存在");
|
|
89
|
+ }else if (!tpBillInvoice.getBillStatus().equals("3")){
|
|
90
|
+ throw new Exception("不是正在支付的订单");
|
|
91
|
+ }
|
92
|
92
|
|
93
|
93
|
//下单
|
94
|
94
|
AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", ALI_APP_ID, APP_PRIVATE_KEY, "json", CHARSET_UTF8, ALIPAY_PUBLIC_KEY, "RSA2");
|
|
@@ -98,8 +98,7 @@ public class AliPayServiceImpl implements AliPayServiceI {
|
98
|
98
|
AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
|
99
|
99
|
model.setBody("我是测试数据");
|
100
|
100
|
model.setSubject("App支付测试Java");
|
101
|
|
- //model.setOutTradeNo(tpBillInvoice.getOutTradeNo());
|
102
|
|
- model.setOutTradeNo("1");
|
|
101
|
+ model.setOutTradeNo(tpBillInvoice.getOutTradeNo());
|
103
|
102
|
model.setTimeoutExpress("30m");
|
104
|
103
|
model.setTotalAmount("0.01");
|
105
|
104
|
model.setProductCode("QUICK_MSECURITY_PAY");
|