fix:修改用于测试跳转金额

pull/17/head
tangqian 2023-06-15 14:07:00 +08:00
parent 27d4c6b2ee
commit 692263438c
2 changed files with 31 additions and 24 deletions

View File

@ -167,6 +167,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
private StoreOrderMapper storeOrderMapper; private StoreOrderMapper storeOrderMapper;
@Autowired @Autowired
private TenantApi tenantApi; private TenantApi tenantApi;
/** /**
* PC * PC
* *
@ -1187,6 +1188,9 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
// 初始化订单 // 初始化订单
String code = OrderUtil.generateBillNo("MEMBER"); String code = OrderUtil.generateBillNo("MEMBER");
RechargeOrderDO orderDO = initializeOrder(request, code, user, promoterDTO); RechargeOrderDO orderDO = initializeOrder(request, code, user, promoterDTO);
// 用于测试 ---- TODO
addPhoneRecord(orderDO, orderDO.getId().toString());
// 用于测试 ---- TODO
// 获取支付策略 // 获取支付策略
IPayStrategy payStrategy = strategySupport.getPayStrategy(request.getPayType()); IPayStrategy payStrategy = strategySupport.getPayStrategy(request.getPayType());
@ -1319,7 +1323,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
}); });
phoneRecordMapper.insertBatch(recordDOS); phoneRecordMapper.insertBatch(recordDOS);
try { try {
phoneRecordService.insertPhone(phoneRecordAdds); // 用于支付测试 TODO
// phoneRecordService.insertPhone(phoneRecordAdds);
} catch (Exception e) { } catch (Exception e) {
log.info("调取提报新增报错{}", e); log.info("调取提报新增报错{}", e);
} }
@ -1488,7 +1493,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime()); List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime());
Map<Long, List<StatementAllReqDataVo>> collect = dataVos.stream().collect(Collectors.groupingBy(StatementAllReqDataVo::getTenantId)); Map<Long, List<StatementAllReqDataVo>> collect = dataVos.stream().collect(Collectors.groupingBy(StatementAllReqDataVo::getTenantId));
List<StatisticsPageVo> vos = new ArrayList<>(); List<StatisticsPageVo> vos = new ArrayList<>();
tenantPage.getList().forEach(e->{ tenantPage.getList().forEach(e -> {
List<StatementAllReqDataVo> dataVos1 = collect.get(e.getId()); List<StatementAllReqDataVo> dataVos1 = collect.get(e.getId());
StatisticsPageVo vo = new StatisticsPageVo(); StatisticsPageVo vo = new StatisticsPageVo();
if (!CollectionUtils.isEmpty(dataVos1)) { if (!CollectionUtils.isEmpty(dataVos1)) {
@ -1538,6 +1543,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
orderDO.setPromoterId(user.getPromoterId()); orderDO.setPromoterId(user.getPromoterId());
orderDO.setDeptId(deptId); orderDO.setDeptId(deptId);
orderDO.setTenantId(tenantId); orderDO.setTenantId(tenantId);
// 用于测试 TODO
orderDO.setPaid(1);
rechargeOrderMapper.insert(orderDO); rechargeOrderMapper.insert(orderDO);
List<RechargeOrderInfoDO> infoDOS = new ArrayList<>(); List<RechargeOrderInfoDO> infoDOS = new ArrayList<>();
orderInfos.forEach(info -> { orderInfos.forEach(info -> {

View File

@ -47,28 +47,28 @@ public class WxPayStrategy implements IPayStrategy{
Long requiredTenantId = TenantContextHolder.getRequiredTenantId(); Long requiredTenantId = TenantContextHolder.getRequiredTenantId();
TenantDTO tenant = tenantApi.getTenant(requiredTenantId); TenantDTO tenant = tenantApi.getTenant(requiredTenantId);
InitOrderResponse response = new InitOrderResponse(); InitOrderResponse response = new InitOrderResponse();
WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService(); // WxPayService wxPayService = wxPayOneAutoConfiguration.wxPayOneService();
Assert.notNull(wxPayService, "获取微信支付配置失败!"); // Assert.notNull(wxPayService, "获取微信支付配置失败!");
WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request(); // WxPayUnifiedOrderV3Request wxPayRequest = new WxPayUnifiedOrderV3Request();
int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue(); // int sum = orderDO.getPayPrice().multiply(new BigDecimal("100")).intValue();
wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum)); // wxPayRequest.setAmount(new WxPayUnifiedOrderV3Request.Amount().setTotal(sum));
wxPayRequest.setDescription(tenant.getName()); // wxPayRequest.setDescription(tenant.getName());
wxPayRequest.setOutTradeNo(orderDO.getOrderId()); // wxPayRequest.setOutTradeNo(orderDO.getOrderId());
wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl()); // wxPayRequest.setNotifyUrl(payProperties.getNotifyUrl());
wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid)); // wxPayRequest.setPayer(new WxPayUnifiedOrderV3Request.Payer().setOpenid(openid));
wxPayRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(ServletUtils.getClientIP(servletRequest))); // wxPayRequest.setSceneInfo(new WxPayUnifiedOrderV3Request.SceneInfo().setPayerClientIp(ServletUtils.getClientIP(servletRequest)));
wxPayRequest.setAppid(payProperties.getAppId()); // wxPayRequest.setAppid(payProperties.getAppId());
wxPayRequest.setMchid(payProperties.getMchId()); // wxPayRequest.setMchid(payProperties.getMchId());
try { // try {
WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest); // WxPayUnifiedOrderV3Result wxPayUnifiedOrderV3Result = wxPayService.unifiedOrderV3(TradeTypeEnum.JSAPI, wxPayRequest);
WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxPayUnifiedOrderV3Result.getPayInfo(TradeTypeEnum.JSAPI, payProperties.getAppId(), payProperties.getMchId(), wxPayService.getConfig().getPrivateKey()); // WxPayUnifiedOrderV3Result.JsapiResult jsapiResult = wxPayUnifiedOrderV3Result.getPayInfo(TradeTypeEnum.JSAPI, payProperties.getAppId(), payProperties.getMchId(), wxPayService.getConfig().getPrivateKey());
InitOrderResponse.JsapiResult jsapiResultNew = new InitOrderResponse.JsapiResult(); // InitOrderResponse.JsapiResult jsapiResultNew = new InitOrderResponse.JsapiResult();
BeanUtils.copyProperties(jsapiResult, jsapiResultNew); // BeanUtils.copyProperties(jsapiResult, jsapiResultNew);
response.setJsapiResult(jsapiResultNew); // response.setJsapiResult(jsapiResultNew);
BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response); // BeanUtils.copyProperties(wxPayUnifiedOrderV3Result, response);
} catch (Exception e) { // } catch (Exception e) {
log.error(e.getMessage()); // log.error(e.getMessage());
} // }
return response; return response;
} }