update 平台配置页面

This commit is contained in:
2024-04-24 17:08:14 +08:00
parent bf0e3f5334
commit 9ed65fbd23
13 changed files with 375 additions and 42 deletions

View File

@@ -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;
}
}

View File

@@ -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()));
}
}