mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-11 09:38:05 +08:00
add dubbo service
This commit is contained in:
@@ -41,6 +41,7 @@ import com.jsowell.common.enums.DelFlagEnum;
|
|||||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.enums.ykc.*;
|
import com.jsowell.common.enums.ykc.*;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.common.service.ProtocolService;
|
||||||
import com.jsowell.common.util.*;
|
import com.jsowell.common.util.*;
|
||||||
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
|
import com.jsowell.common.util.Cp56Time2a.Cp56Time2aUtil;
|
||||||
import com.jsowell.common.util.http.HttpUtils;
|
import com.jsowell.common.util.http.HttpUtils;
|
||||||
@@ -94,6 +95,7 @@ import com.jsowell.wxpay.response.WechatPayRefundRequest;
|
|||||||
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -292,6 +294,15 @@ public class SpringBootTestController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private QcyunsService qcyunsService;
|
private QcyunsService qcyunsService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private ProtocolService protocolService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDubbo() {
|
||||||
|
String s = protocolService.sayHello("jsowell-charger-web");
|
||||||
|
System.out.println(s);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCommonVerificationCode() {
|
public void testCommonVerificationCode() {
|
||||||
String phoneNumber = "18612341234";
|
String phoneNumber = "18612341234";
|
||||||
|
|||||||
@@ -156,6 +156,15 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.dubbo</groupId>
|
||||||
|
<artifactId>dubbo</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.jsowell</groupId>
|
||||||
|
<artifactId>charge-common-api</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@@ -182,4 +191,4 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -849,6 +849,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
|||||||
}
|
}
|
||||||
BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByPileSn(pileSn);
|
BillingTemplateVO billingTemplateVO = pileBillingTemplateMapper.selectBillingTemplateByPileSn(pileSn);
|
||||||
if (billingTemplateVO != null) {
|
if (billingTemplateVO != null) {
|
||||||
|
billingTemplateVO.setPileSn(pileSn);
|
||||||
redisCache.setCacheObject(redisKey, JSON.toJSONString(billingTemplateVO), CacheConstants.cache_expire_time_1d);
|
redisCache.setCacheObject(redisKey, JSON.toJSONString(billingTemplateVO), CacheConstants.cache_expire_time_1d);
|
||||||
}
|
}
|
||||||
return billingTemplateVO;
|
return billingTemplateVO;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import java.util.Map;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class BillingTemplateVO {
|
public class BillingTemplateVO {
|
||||||
|
private String pileSn;
|
||||||
// 站点id
|
// 站点id
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -343,7 +343,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jsowell</groupId>
|
<groupId>com.jsowell</groupId>
|
||||||
<artifactId>charge-common-api</artifactId>
|
<artifactId>charge-common-api</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--dubbo集成springboot依赖-->
|
<!--dubbo集成springboot依赖-->
|
||||||
|
|||||||
Reference in New Issue
Block a user