与小程序联调

This commit is contained in:
liuyingfang
2023-04-14 13:56:28 +08:00
parent 6491ed9c7f
commit c9df5137cb
4 changed files with 17 additions and 10 deletions

View File

@@ -404,13 +404,13 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}
//TODO
// 如果不存在D1的结算信息则直接将D0的结算信息带过来
// LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
// qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
// int countD0 = baseMapper.selectCount(qWrapperAccountD0);
// if (countD0 == 0) {
// account.setChannelType(Account.CHANNEL_TYPE_D1);
// save(account);
// }
LambdaQueryWrapper<Account> qWrapperAccountD0 = Wrappers.lambdaQuery();
qWrapperAccountD0.eq(Account::getUserId, accountDTO.getUserId()).eq(Account::getChannelType, Account.CHANNEL_TYPE_D1);
int countD0 = baseMapper.selectCount(qWrapperAccountD0);
if (countD0 == 0) {
account.setChannelType(Account.CHANNEL_TYPE_D1);
save(account);
}
}
@Override

View File

@@ -1,6 +1,7 @@
package cn.pluss.platform.pay.impl;
import cn.hutool.json.JSON;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultCode;
import cn.pluss.platform.api.ResultGenerator;
@@ -154,7 +155,7 @@ public class ApiPayServiceImpl implements ApiPayService {
checSign(jsonObject,jsonObject.getString("merchantCode"));
store = checkTransPayParams(jsonObject,jsonObject.getString("merchantCode"));
}
String payData = checkMercOrder(store,jsonObject);
String payData = checkMercOrder(store, jsonObject);
if(StringUtil.isNotEmpty(payData)){
return payData;
}
@@ -233,13 +234,15 @@ public class ApiPayServiceImpl implements ApiPayService {
}
}
private String checkMercOrder(MerchantStore store,JSONObject jsonObject) {
private String checkMercOrder(MerchantStore store, JSONObject jsonObject) {
QueryWrapper<MerchantOrder> queryMercWrapper = new QueryWrapper<MerchantOrder>().eq("mercOrderNo", jsonObject.getString("mercOrderNo"));
List<MerchantOrder> list = merchantOrderService.list(queryMercWrapper);
if (!list.isEmpty()) {
MerchantOrder order = list.get(0);
if(StringUtil.isNotEmpty(order.getPayData())){
return order.getPayData();
StringBuilder payData = new StringBuilder(order.getPayData());
payData.insert(payData.length()-1,",\"orderNumber\":"+"\""+order.getOrderNumber()+"\"");
return payData.toString();
}
throw new MsgException("订单号重复!");
}
@@ -443,6 +446,7 @@ public class ApiPayServiceImpl implements ApiPayService {
order.setPayData(payData.toJSONString());
merchantOrderService.save(order);
payData.put("payAmt",order.getConsumeFee().toString());
payData.put("orderNumber", order.getOrderNumber().toString());
return ResultGenerator.genSuccessJsonResult("处理成功", payData);
}