提交 8556b74a 作者: 刘明祎-运维用途

新增订单课程微信支付

上级 b3527854
流水线 #7488 已通过 于阶段
in 2 分 52 秒
...@@ -24,7 +24,7 @@ public class CommonPaymentVO { ...@@ -24,7 +24,7 @@ public class CommonPaymentVO {
@ApiModelProperty(value = "商品描述") @ApiModelProperty(value = "商品描述")
private String description; private String description;
@ApiModelProperty(value = "订单来源 0:产品商城 1:租赁订单 2:培训订单 3发布需求 4服务需求发布 5充值 ...其他后续加") @ApiModelProperty(value = "订单来源 0:产品商城 1:租赁订单 2:培训订单 3发布需求 4服务需求发布 5充值 6购买课程...其他后续加")
private Integer orderPort; private Integer orderPort;
@ApiModelProperty(value = "金额:单位(分)") @ApiModelProperty(value = "金额:单位(分)")
......
...@@ -112,11 +112,37 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService ...@@ -112,11 +112,37 @@ public class DemandReleaseOrderServiceImpl implements DemandReleaseOrderService
return publishServicePay(commonPaymentVO, token, userAccountId, request); return publishServicePay(commonPaymentVO, token, userAccountId, request);
case "5": case "5":
return topUpOrder(commonPaymentVO, token, userAccountId); return topUpOrder(commonPaymentVO, token, userAccountId);
case "6":
return payCurriculumOrder(commonPaymentVO, token);
default: default:
return ResultBody.error("无效的订单类型操作!"); return ResultBody.error("无效的订单类型操作!");
} }
} }
private ResultBody payCurriculumOrder(CommonPaymentVO commonPaymentVO, String token) {
if ("6".equals(commonPaymentVO.getOrderPort().toString())) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
String orderNumber = commonPaymentVO.getOrderNumber();
String json = stringRedisTemplate.opsForValue().get(orderNumber);
GetOrderNumberDTO getOrderNumberDTO = JSONObject.parseObject(json, GetOrderNumberDTO.class);
GetOrderNumberDO getOrderNumberDO = new GetOrderNumberDO(getOrderNumberDTO);
releaseOrderDao.insertService(getOrderNumberDO);
BigDecimal paramMoney = getOrderNumberDO.getWeChatPay();
BigDecimal multiply = paramMoney.multiply(new BigDecimal(100));
int i = multiply.intValue();
OrderRequestParamsVO orderRequestParamsVO = getOrderNumberDO.orderRequestParamsVO();
orderRequestParamsVO.setAmount(i);
ResultBody resultBody = releaseOrder(orderRequestParamsVO, token);
stringRedisTemplate.opsForValue().set(getOrderNumberDO.getPaymentOrderNumber() + getOrderNumberDO.getUserAccountId(), JsonUtil.parseObjToJson(getOrderNumberDO));
return resultBody;
}
return ResultBody.success();
}
private ResultBody payLeaseOrder(CommonPaymentVO commonPaymentVO, String token) { private ResultBody payLeaseOrder(CommonPaymentVO commonPaymentVO, String token) {
OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO(); OrderRequestParamsVO orderRequestParamsVO = new OrderRequestParamsVO();
orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber()); orderRequestParamsVO.setOrderNo(commonPaymentVO.getOrderNumber());
......
...@@ -13,6 +13,13 @@ spring: ...@@ -13,6 +13,13 @@ spring:
jedis: jedis:
pool: pool:
max-active: 2 max-active: 2
#rabbitMQ
rabbitmq:
host: 8.139.4.51
port: 5672
username: MjphbXFwLWNuLXp2cDJvemhuajAwMTpMVEFJNEZ6Q3B5ckEzM1BlZ254V1M2WFY=
password: RTg3OUMxQzk4NzU0NDQ4RkQ1RDg4MkEzQjY4M0M3MkQxOTM2QkEyNDoxNjUyNDA4NDk0NDg4
virtual-host: dev
main: main:
allow-circular-references: true allow-circular-references: true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论