mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-23 16:49:49 +08:00
update 充值余额接口获取openid通过数据库获取
This commit is contained in:
@@ -11,11 +11,14 @@ import com.jsowell.common.exception.BusinessException;
|
|||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.common.util.id.IdUtils;
|
import com.jsowell.common.util.id.IdUtils;
|
||||||
|
import com.jsowell.pile.domain.MemberBasicInfo;
|
||||||
import com.jsowell.pile.dto.GetPayModeDTO;
|
import com.jsowell.pile.dto.GetPayModeDTO;
|
||||||
import com.jsowell.pile.dto.PayOrderDTO;
|
import com.jsowell.pile.dto.PayOrderDTO;
|
||||||
import com.jsowell.pile.dto.PaymentScenarioDTO;
|
import com.jsowell.pile.dto.PaymentScenarioDTO;
|
||||||
import com.jsowell.pile.dto.WeixinPayDTO;
|
import com.jsowell.pile.dto.WeixinPayDTO;
|
||||||
|
import com.jsowell.pile.service.IMemberBasicInfoService;
|
||||||
import com.jsowell.pile.vo.uniapp.PayModeVO;
|
import com.jsowell.pile.vo.uniapp.PayModeVO;
|
||||||
|
import com.jsowell.service.AgentDevService;
|
||||||
import com.jsowell.service.MemberService;
|
import com.jsowell.service.MemberService;
|
||||||
import com.jsowell.service.OrderService;
|
import com.jsowell.service.OrderService;
|
||||||
import com.jsowell.pile.dto.ApplyRefundDTO;
|
import com.jsowell.pile.dto.ApplyRefundDTO;
|
||||||
@@ -47,6 +50,8 @@ public class PayController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMemberBasicInfoService memberBasicInfoService;
|
||||||
/**
|
/**
|
||||||
* 充值余额支付/微信余额充值
|
* 充值余额支付/微信余额充值
|
||||||
* 提供给小程序使用
|
* 提供给小程序使用
|
||||||
@@ -258,11 +263,14 @@ public class PayController extends BaseController {
|
|||||||
// 设置appId
|
// 设置appId
|
||||||
dto.setAppId(request.getHeader("appId"));
|
dto.setAppId(request.getHeader("appId"));
|
||||||
// 获取openId
|
// 获取openId
|
||||||
String openId = memberService.getOpenIdByCode(dto.getCode());
|
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMemberId(memberId);
|
||||||
if (StringUtils.isBlank(openId)) {
|
if (memberBasicInfo == null) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_HANDLE_USER_INFO_ERROR);
|
||||||
}
|
}
|
||||||
dto.setOpenId(openId);
|
// if (StringUtils.isBlank(openId)) {
|
||||||
|
// throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
||||||
|
// }
|
||||||
|
dto.setOpenId(memberBasicInfo.getOpenId());
|
||||||
// 充值余额 附加参数
|
// 充值余额 附加参数
|
||||||
Map<String, Object> weixinMap = memberService.rechargeBalanceWithAdapay(dto);
|
Map<String, Object> weixinMap = memberService.rechargeBalanceWithAdapay(dto);
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("weixinMap", weixinMap));
|
response = new RestApiResponse<>(ImmutableMap.of("weixinMap", weixinMap));
|
||||||
|
|||||||
@@ -629,6 +629,26 @@ public class SpringBootTestController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testFault() {
|
||||||
|
StringBuffer sb = new StringBuffer("0100");
|
||||||
|
String lowOrder = sb.substring(0, 2);
|
||||||
|
String highOrder = sb.substring(2, 4);
|
||||||
|
|
||||||
|
// String hardwareFault = highOrder + lowOrder;
|
||||||
|
byte[] hardwareFaultByteArr = BytesUtil.str2Bcd(highOrder + lowOrder);
|
||||||
|
String binStr = BytesUtil.bytes2BinStr(hardwareFaultByteArr);
|
||||||
|
// log.info("binStr:{}", binStr); // 0000 0000 0000 0001
|
||||||
|
int faultCode = 0;
|
||||||
|
for (int i = 0; i < binStr.length(); i++) {
|
||||||
|
if (binStr.charAt(i) == '1') {
|
||||||
|
faultCode = 15 - i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String faultReason = YKCPileFaultReasonEnum.getValueByCode(faultCode);
|
||||||
|
System.out.println(faultReason);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ public class InitializeAdapayConfig implements CommandLineRunner {
|
|||||||
/*
|
/*
|
||||||
单商户
|
单商户
|
||||||
*/
|
*/
|
||||||
singleMerchant();
|
// singleMerchant();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
多商户
|
多商户
|
||||||
目前有jsowell和xixiao
|
目前有jsowell和xixiao
|
||||||
*/
|
*/
|
||||||
// multiMerchant();
|
multiMerchant();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user