diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyNotificationController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyNotificationController.java new file mode 100644 index 000000000..362d394bd --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdPartyNotificationController.java @@ -0,0 +1,98 @@ +package com.jsowell.web.controller.thirdparty; + +import com.jsowell.common.core.controller.BaseController; +import com.jsowell.common.core.domain.AjaxResult; +import com.jsowell.thirdparty.common.NotificationDTO; +import com.jsowell.thirdparty.common.NotificationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/thirdparty/notification") +public class ThirdPartyNotificationController extends BaseController { + @Autowired + private NotificationService notificationService; + + /** + * 充电站信息变化推送 + */ + @PostMapping("/notificationStationInfo") + public AjaxResult notificationStationInfo(@RequestBody NotificationDTO dto) { + AjaxResult result; + try { + notificationService.notificationStationInfo(dto); + result = AjaxResult.success(); + } catch (Exception e) { + logger.error("充电站信息变化推送失败", e); + result = AjaxResult.error(); + } + return result; + } + + /** + * 设备状态变化推送 + */ + @PostMapping("/notificationStationStatus") + public AjaxResult notificationStationStatus(@RequestBody NotificationDTO dto) { + AjaxResult result; + try { + notificationService.notificationStationStatus(dto); + result = AjaxResult.success(); + } catch (Exception e) { + logger.error("设备状态变化推送失败", e); + result = AjaxResult.error(); + } + return result; + } + + /** + * 设备充电中状态变化推送 + */ + @PostMapping("/notificationConnectorChargeStatus") + public AjaxResult notificationConnectorChargeStatus(@RequestBody NotificationDTO dto) { + AjaxResult result; + try { + notificationService.notificationConnectorChargeStatus(dto); + result = AjaxResult.success(); + } catch (Exception e) { + logger.error("设备充电中状态变化推送失败", e); + result = AjaxResult.error(); + } + return result; + } + + /** + * 充电订单信息推送 + */ + @PostMapping("/notificationChargeOrderInfo") + public AjaxResult notificationChargeOrderInfo(@RequestBody NotificationDTO dto) { + AjaxResult result; + try { + notificationService.notificationChargeOrderInfo(dto); + result = AjaxResult.success(); + } catch (Exception e) { + logger.error("充电订单信息推送失败", e); + result = AjaxResult.error(); + } + return result; + } + + /** + * 站点费率变化推送 + */ + @PostMapping("/notificationStationFee") + public AjaxResult notificationStationFee(@RequestBody NotificationDTO dto) { + AjaxResult result; + try { + notificationService.notificationStationFee(dto); + result = AjaxResult.success(); + } catch (Exception e) { + logger.error("站点费率变化推送失败", e); + result = AjaxResult.error(); + } + return result; + } +} diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdpartySecretInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdpartySecretInfoController.java index dfaba9266..9f3332269 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdpartySecretInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/thirdparty/ThirdpartySecretInfoController.java @@ -88,4 +88,13 @@ public class ThirdpartySecretInfoController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(thirdpartySecretInfoService.deleteThirdpartySecretInfoByIds(ids)); } + + /** + * 根据第三方平台类型查询对接第三方平台的站点列表 + */ + @PostMapping("/selectStationList") + public AjaxResult selectStationList(@RequestBody ThirdpartySecretInfo thirdpartySecretInfo) { + return AjaxResult.success(thirdpartySecretInfoService.selectStationList(thirdpartySecretInfo.getPlatformType())); + } + } diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index c871e2a65..6d038d457 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -674,8 +674,8 @@ public class SpringBootTestController { */ @Test public void createDeleteSettleAccountRequestTest() throws BaseAdaPayException { - String adapayMemberId = "ACM82792551"; - String settleAccountId = "0523453573196672"; + String adapayMemberId = "AM40919405"; + String settleAccountId = "0540761871278208"; adapayService.createDeleteSettleAccountRequest(adapayMemberId, settleAccountId, wechatAppId1); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java index 389b31e1f..18fa171d9 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java @@ -2,6 +2,7 @@ package com.jsowell.pile.mapper; import com.jsowell.pile.domain.ThirdPartyStationRelation; import com.jsowell.pile.vo.base.MerchantInfoVO; +import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; @@ -87,5 +88,17 @@ public interface ThirdPartyStationRelationMapper { */ int updateRelationDelFlag(@Param("stationId") String stationId, @Param("types") List types); + /** + * 根据第三方平台类型查询对接第三方平台的运营商列表 + * @param thirdPlatformType + * @return + */ List selectMerchantList(String thirdPlatformType); + + /** + * 根据第三方平台类型查询对接第三方平台的站点列表 + * @param thirdPlatformType + * @return + */ + List selectStationList(String thirdPlatformType); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java index c58c731d7..553db052b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java @@ -2,6 +2,7 @@ package com.jsowell.pile.service; import com.jsowell.pile.domain.ThirdPartyStationRelation; import com.jsowell.pile.vo.base.MerchantInfoVO; +import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import java.util.List; @@ -95,5 +96,17 @@ public interface ThirdPartyStationRelationService { int updateRelationDelFlag(String stationId, List types); + /** + * 根据第三方平台类型查询对接第三方平台的运营商列表 + * @param thirdPlatformType + * @return + */ List selectMerchantList(String thirdPlatformType); + + /** + * 根据第三方平台类型查询对接第三方平台的站点列表 + * @param thirdPlatformType + * @return + */ + List selectStationList(String thirdPlatformType); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java index c34da7546..87e3054a7 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java @@ -8,6 +8,7 @@ import com.jsowell.pile.domain.ThirdPartyStationRelation; import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper; import com.jsowell.pile.service.ThirdPartyStationRelationService; import com.jsowell.pile.vo.base.MerchantInfoVO; +import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -171,4 +172,9 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe public List selectMerchantList(String thirdPlatformType) { return thirdPartyStationRelationMapper.selectMerchantList(thirdPlatformType); } + + @Override + public List selectStationList(String thirdPlatformType) { + return thirdPartyStationRelationMapper.selectStationList(thirdPlatformType); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java index 4a50758fd..f69710c30 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/ThirdpartySecretInfoService.java @@ -1,6 +1,7 @@ package com.jsowell.thirdparty.service; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; +import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.thirdparty.domain.ThirdpartySecretInfo; import java.util.List; @@ -80,4 +81,11 @@ public interface ThirdpartySecretInfoService { * @return */ List queryStationToPlatformList(String stationId); + + /** + * 根据第三方平台类型查询对接第三方平台的站点列表 + * @param thirdPlatformType + * @return + */ + List selectStationList(String thirdPlatformType); } diff --git a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java index bcf1978c6..0bddd2f41 100644 --- a/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/thirdparty/service/impl/ThirdpartySecretInfoServiceImpl.java @@ -3,7 +3,9 @@ package com.jsowell.thirdparty.service.impl; import com.jsowell.common.constant.CacheConstants; import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.util.DateUtils; +import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper; import com.jsowell.pile.vo.ThirdPartySecretInfoVO; +import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.thirdparty.domain.ThirdpartySecretInfo; import com.jsowell.thirdparty.mapper.ThirdpartySecretInfoMapper; import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; @@ -24,6 +26,9 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ @Autowired private ThirdpartySecretInfoMapper thirdpartySecretInfoMapper; + @Autowired + private ThirdPartyStationRelationMapper thirdPartyStationRelationMapper; + @Autowired private RedisCache redisCache; @@ -133,4 +138,9 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ List list = thirdpartySecretInfoMapper.queryStationToPlatformList(stationId); return list; } + + @Override + public List selectStationList(String thirdPlatformType) { + return thirdPartyStationRelationMapper.selectStationList(thirdPlatformType); + } } diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml index 9ee30e423..707306acc 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml @@ -227,4 +227,14 @@ and t1.third_party_type = #{thirdPlatformType,jdbcType=VARCHAR} GROUP BY t3.id + + \ No newline at end of file diff --git a/jsowell-ui/src/api/thirdParty/notification.js b/jsowell-ui/src/api/thirdParty/notification.js new file mode 100644 index 000000000..fa336cfd0 --- /dev/null +++ b/jsowell-ui/src/api/thirdParty/notification.js @@ -0,0 +1,41 @@ +import request from '@/utils/request' + +export function notificationStationInfo(data) { + return request({ + url: '/thirdparty/notification/notificationStationInfo', + method: 'post', + data: data + }) +} + +export function notificationStationStatus(data) { + return request({ + url: '/thirdparty/notification/notificationStationStatus', + method: 'post', + data: data + }) +} + +export function notificationConnectorChargeStatus(data) { + return request({ + url: '/thirdparty/notification/notificationConnectorChargeStatus', + method: 'post', + data: data + }) +} + +export function notificationChargeOrderInfo(data) { + return request({ + url: '/thirdparty/notification/notificationChargeOrderInfo', + method: 'post', + data: data + }) +} + +export function notificationStationFee(data) { + return request({ + url: '/thirdparty/notification/notificationStationFee', + method: 'post', + data: data + }) +} diff --git a/jsowell-ui/src/api/thirdParty/secret.js b/jsowell-ui/src/api/thirdParty/secret.js index f14541e4d..37abc24b4 100644 --- a/jsowell-ui/src/api/thirdParty/secret.js +++ b/jsowell-ui/src/api/thirdParty/secret.js @@ -42,3 +42,12 @@ export function delSecret(id) { method: 'delete' }) } + +// 根据第三方平台类型查询对接第三方平台的站点列表 +export function selectStationList(data) { + return request({ + url: '/thirdparty/secret/selectStationList', + method: 'post', + data: data + }) +} diff --git a/jsowell-ui/src/views/order/order/index.vue b/jsowell-ui/src/views/order/order/index.vue index 8a9333b6a..7e9371554 100644 --- a/jsowell-ui/src/views/order/order/index.vue +++ b/jsowell-ui/src/views/order/order/index.vue @@ -1,55 +1,58 @@