add dubbo service

This commit is contained in:
Guoqs
2025-06-17 15:08:03 +08:00
parent e470d4bede
commit 4d5c4b866e
6 changed files with 54 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ import com.jsowell.common.enums.DelFlagEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.enums.ykc.*;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.service.ProtocolService;
import com.jsowell.common.util.*;
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
import com.jsowell.common.util.http.HttpUtils;
@@ -94,6 +95,7 @@ import com.jsowell.wxpay.response.WechatPayRefundRequest;
import com.jsowell.wxpay.service.WxAppletRemoteService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.dubbo.config.annotation.DubboReference;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@@ -292,6 +294,15 @@ public class SpringBootTestController {
@Autowired
private QcyunsService qcyunsService;
@DubboReference
private ProtocolService protocolService;
@Test
public void testDubbo() {
String s = protocolService.sayHello("jsowell-charger-web");
System.out.println(s);
}
@Test
public void testCommonVerificationCode() {
String phoneNumber = "18612341234";

View File

@@ -156,6 +156,15 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.jsowell</groupId>
<artifactId>charge-common-api</artifactId>
</dependency>
</dependencies>
<properties>
@@ -182,4 +191,4 @@
</build>
</project>
</project>

View File

@@ -0,0 +1,30 @@
package com.jsowell.dubbo;
import com.jsowell.common.service.ProtocolService;
import org.apache.dubbo.config.annotation.DubboReference;
import java.math.BigDecimal;
public class JCPPService {
@DubboReference
ProtocolService protocolService;
/**
* 调用jcpp的下发计费模板
*/
/**
* 调用jcpp的启动充电
*/
public void startCharge(String pileCode, String gunCode, BigDecimal limitYuan, String orderNo) {
protocolService.startCharge(pileCode, gunCode, limitYuan, orderNo);
}
/**
* 调用jcpp的停止充电
*/
public void stopCharge(String pileCode, String gunCode, String orderNo) {
// protocolService.stopCharge(pileCode, gunCode, orderNo);
}
}

View File

@@ -849,6 +849,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
}
BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByPileSn(pileSn);
if (billingTemplateVO != null) {
billingTemplateVO.setPileSn(pileSn);
redisCache.setCacheObject(redisKey, JSON.toJSONString(billingTemplateVO), CacheConstants.cache_expire_time_1d);
}
return billingTemplateVO;

View File

@@ -19,6 +19,7 @@ import java.util.Map;
@AllArgsConstructor
@Builder
public class BillingTemplateVO {
private String pileSn;
// 站点id
private String stationId;

View File

@@ -343,7 +343,7 @@
<dependency>
<groupId>com.jsowell</groupId>
<artifactId>charge-common-api</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
<!--dubbo集成springboot依赖-->