|
@@ -145,7 +145,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
private void open(TenantOrderRecord record) {
|
|
|
//机构产品信息
|
|
|
TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
|
|
|
- .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_",0));
|
|
|
+ .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_", 0));
|
|
|
//修改机构信息
|
|
|
TenantInfo tenantInfo = new TenantInfo();
|
|
|
tenantInfo.setId(record.getTenantId());
|
|
@@ -157,14 +157,14 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
tenantProductInfoService.updateById(productInfo);
|
|
|
}
|
|
|
|
|
|
- private void renew(TenantOrderRecord record){
|
|
|
+ private void renew(TenantOrderRecord record) {
|
|
|
//机构产品信息
|
|
|
TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
|
|
|
- .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_",0));
|
|
|
+ .hasEq("tenant_id_", record.getTenantId()).queryWrapper().eq("using_", 0));
|
|
|
//获取机构续费时长
|
|
|
Integer val = (Integer) tenantInfoService.opsRenewInfo(record.getTenantId()).get();
|
|
|
//修改产品信息
|
|
|
- tenantInfoService.renewSuccess(val,productInfo,record.getActualAmount());
|
|
|
+ tenantInfoService.renewSuccess(val, productInfo, record.getActualAmount());
|
|
|
}
|
|
|
|
|
|
//主动去第三方查询订单状态
|
|
@@ -208,9 +208,10 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
//订单状态/0待支付、1已支付、2支付失败
|
|
|
switch (orderRecord.getOrderState()) {
|
|
|
case 1:
|
|
|
- if (TenantOrderRecordEnum.TENANT_OPEN.getCode().equals(orderRecord.getOrderType())) {
|
|
|
- tenantOrderSuccess(orderRecord, detail);
|
|
|
- }
|
|
|
+ tenantOrderSuccess(orderRecord, detail);
|
|
|
+
|
|
|
+ checkOrder.get(orderRecord.getOrderType()).accept(orderRecord);
|
|
|
+
|
|
|
code = DealStatusEnum.SUCCESS.getCode();
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
orderRecord.setPayDate(now.toLocalDate().toDate());
|
|
@@ -232,7 +233,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
private void tenantOrderSuccess(TenantOrderRecord orderRecord, Map<String, Object> detail) {
|
|
|
//机构产品信息
|
|
|
TenantProductInfo productInfo = tenantProductInfoService.getOne(new WrapperUtil<TenantProductInfo>()
|
|
|
- .hasEq("tenant_id_", orderRecord.getTenantId()).queryWrapper().eq("using_",0));
|
|
|
+ .hasEq("tenant_id_", orderRecord.getTenantId()).queryWrapper().eq("using_", 0));
|
|
|
//获取服务信息
|
|
|
PlatformServe platformServe = platformServeService.getOne(new WrapperUtil<PlatformServe>()
|
|
|
.hasEq("id_", productInfo.getServeId()).queryWrapper());
|
|
@@ -242,19 +243,6 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
detail.put("platformServeName", platformServe.getName());
|
|
|
detail.put("mode", serveDetail.getMode());
|
|
|
detail.put("num", productInfo.getExpiryCount());
|
|
|
-
|
|
|
- orderSuccessOps(orderRecord, productInfo);
|
|
|
- }
|
|
|
-
|
|
|
- private void orderSuccessOps(TenantOrderRecord orderRecord, TenantProductInfo productInfo) {
|
|
|
- TenantInfo tenantInfo = new TenantInfo();
|
|
|
- tenantInfo.setId(orderRecord.getTenantId());
|
|
|
- tenantInfo.setPayState(1);
|
|
|
- tenantInfoService.updateById(tenantInfo);
|
|
|
-
|
|
|
- productInfo.setPayDate(new Date());
|
|
|
- productInfo.setTenantId(orderRecord.getTenantId());
|
|
|
- tenantProductInfoService.updateById(productInfo);
|
|
|
}
|
|
|
|
|
|
private void rechargeSuccess(TenantOrderRecord record) throws Exception {
|
|
@@ -268,7 +256,7 @@ public class TenantOrderRecordServiceImpl extends ServiceImpl<TenantOrderRecordD
|
|
|
|
|
|
@Override
|
|
|
public Boolean rechargeCheck(TenantOrderRecord record, int i) {
|
|
|
- RBucket<Object> bucket = redissonClient.getBucket("tenant_check_order");
|
|
|
+ RBucket<Object> bucket = redissonClient.getBucket("tenant_check_recharge");
|
|
|
if (!bucket.trySet(1, 3L, TimeUnit.SECONDS)) {
|
|
|
return false;
|
|
|
}
|