与小程序联调

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

@@ -57,6 +57,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
limitUri.add("/api/index.html");
limitUri.add("/api/merchantOrder/posScanPay");
limitUri.add("/api/merchantOrder/pos/tradeQuery");
limitUri.add("/api/merchantOrder/returnOrder");
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
if (passFlag) {
return true;

View File

@@ -73,6 +73,7 @@ public class IdCard implements Serializable {
*/
@NotEmpty(message = "请输入证件号", groups = {IdCard.Common.class})
@TableField("certNo")
@NotEmpty(message = "证件号未填写")
private String certNo;
@@ -81,6 +82,7 @@ public class IdCard implements Serializable {
*/
@NotEmpty(message = "请输入证件人名称", groups = {IdCard.Common.class})
@TableField("certName")
@NotEmpty(message = "证件姓名未填写")
private String certName;

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);
}