mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update 白名单支付
This commit is contained in:
@@ -11,9 +11,11 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.id.IdUtils;
|
||||
import com.jsowell.pile.dto.GetPayModeDTO;
|
||||
import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.dto.PaymentScenarioDTO;
|
||||
import com.jsowell.pile.dto.WeixinPayDTO;
|
||||
import com.jsowell.pile.vo.uniapp.PayModeVO;
|
||||
import com.jsowell.service.MemberService;
|
||||
import com.jsowell.service.OrderService;
|
||||
import com.jsowell.wxpay.dto.WeChatRefundDTO;
|
||||
@@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -82,7 +85,7 @@ public class PayController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付订单
|
||||
* 7002 支付订单
|
||||
* http://localhost:8080/uniapp/pay/payOrder
|
||||
*
|
||||
* @param request
|
||||
@@ -131,6 +134,27 @@ public class PayController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 7003 获取支付方式
|
||||
* http://localhost:8080/uniapp/pay/getPayMode
|
||||
*/
|
||||
@PostMapping("/getPayMode")
|
||||
public RestApiResponse<?> getPayMode(HttpServletRequest request, @RequestBody GetPayModeDTO dto) {
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
// dto.setMemberId(getMemberIdByAuthorization(request));
|
||||
List<PayModeVO> list = orderService.getPayMode(dto);
|
||||
response = new RestApiResponse<>(ImmutableMap.of("list", list));
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("获取支付方式 warn param:{}", dto.toString(), e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("获取支付方式 error param:{}", dto.toString(), e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PAY_MODE);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付回调接口
|
||||
* http://localhost:8080/uniapp/pay/callback
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.jsowell.pile.domain.OrderPayRecord;
|
||||
import com.jsowell.pile.domain.WxpayCallbackRecord;
|
||||
import com.jsowell.pile.dto.BasicPileDTO;
|
||||
import com.jsowell.pile.dto.GenerateOrderDTO;
|
||||
import com.jsowell.pile.dto.GetPayModeDTO;
|
||||
import com.jsowell.pile.dto.ManualSettlementDTO;
|
||||
import com.jsowell.pile.dto.PayOrderDTO;
|
||||
import com.jsowell.pile.dto.PayOrderSuccessCallbackDTO;
|
||||
@@ -56,6 +57,7 @@ import com.jsowell.pile.transaction.service.TransactionService;
|
||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.PayModeVO;
|
||||
import com.jsowell.pile.vo.uniapp.PileConnectorDetailVO;
|
||||
import com.jsowell.pile.vo.uniapp.UniAppOrderVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
@@ -875,4 +877,38 @@ public class OrderService {
|
||||
log.info("人工结算订单-end orderCode:{}", dto.getOrderCode());
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前登录会员 获取支付方式
|
||||
* @param dto
|
||||
*/
|
||||
public List<PayModeVO> getPayMode(GetPayModeDTO dto) {
|
||||
List<PayModeVO> result = Lists.newArrayList();
|
||||
// 查询会员在站点是否是白名单用户
|
||||
boolean flag = false;
|
||||
if (flag) {
|
||||
result.add(
|
||||
PayModeVO.builder()
|
||||
.payModeCode(OrderPayModeEnum.PAYMENT_OF_WHITELIST.getValue())
|
||||
.payModeName(OrderPayModeEnum.PAYMENT_OF_WHITELIST.getLabel())
|
||||
.build()
|
||||
);
|
||||
} else {
|
||||
// 微信支付
|
||||
result.add(
|
||||
PayModeVO.builder()
|
||||
.payModeCode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||||
.payModeName(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getLabel())
|
||||
.build()
|
||||
);
|
||||
// 余额支付
|
||||
result.add(
|
||||
PayModeVO.builder()
|
||||
.payModeCode(OrderPayModeEnum.PAYMENT_OF_BALANCE.getValue())
|
||||
.payModeName(OrderPayModeEnum.PAYMENT_OF_BALANCE.getLabel())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user