mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
个人桩停止充电
This commit is contained in:
@@ -140,36 +140,7 @@ public class PersonPileController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人桩停止充电
|
||||
* http://localhost:8080/uniapp/personalPile/personPileStopCharging
|
||||
* 管理员可以停自己启动的和别人启动的
|
||||
* 其他人员只能停止自己启动的
|
||||
*/
|
||||
@PostMapping("/personPileStopCharging")
|
||||
public RestApiResponse<?> personPileStopCharging(HttpServletRequest request, PersonPileStopChargingDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String appId = request.getHeader("appId");
|
||||
if (StringUtils.isNotBlank(appId)) {
|
||||
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByWxAppId(appId);
|
||||
if (StringUtils.isNotBlank(firstLevelMerchantId)) {
|
||||
dto.setFirstLevelMerchantId(firstLevelMerchantId);
|
||||
}
|
||||
}
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
dto.setMemberId(memberId);
|
||||
pileReservationInfoService.personPileStopCharging(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.error("个人桩停止充电error", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("个人桩停止充电error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_PERSON_PILE_STOP_CHARGING_ERROR);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -310,6 +281,38 @@ public class PersonPileController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个人桩停止充电
|
||||
* http://localhost:8080/uniapp/personalPile/personPileStopCharging
|
||||
* 管理员可以停自己启动的和别人启动的
|
||||
* 其他人员只能停止自己启动的
|
||||
*/
|
||||
@PostMapping("/personPileStopCharging")
|
||||
public RestApiResponse<?> personPileStopCharging(HttpServletRequest request, PersonPileStopChargingDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String appId = request.getHeader("appId");
|
||||
if (StringUtils.isNotBlank(appId)) {
|
||||
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByWxAppId(appId);
|
||||
if (StringUtils.isNotBlank(firstLevelMerchantId)) {
|
||||
dto.setFirstLevelMerchantId(firstLevelMerchantId);
|
||||
}
|
||||
}
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
dto.setMemberId(memberId);
|
||||
pileReservationInfoService.personPileStopCharging(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.error("个人桩停止充电error", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("个人桩停止充电error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_PERSON_PILE_STOP_CHARGING_ERROR);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加预约充电
|
||||
* http://localhost:8080/uniapp/personalPile/createReserved
|
||||
@@ -431,7 +434,7 @@ public class PersonPileController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据充电桩查询预约状态
|
||||
* 根据充电桩查询预约信息
|
||||
* http://localhost:8080/uniapp/personalPile/queryReservationInfo
|
||||
*/
|
||||
@PostMapping("/queryReservationInfo")
|
||||
|
||||
@@ -260,6 +260,17 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private PileReservationInfoService pileReservationInfoService;
|
||||
|
||||
@Test
|
||||
public void personPileStopChargingTest() {
|
||||
String memberId = "84085683";
|
||||
String pileConnectorCode = "8823000000141001";
|
||||
PersonPileStopChargingDTO dto = PersonPileStopChargingDTO.builder()
|
||||
.memberId(memberId)
|
||||
.pileConnectorCode(pileConnectorCode)
|
||||
.build();
|
||||
pileReservationInfoService.personPileStopCharging(dto);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void selectMemberPlateNumberRelationTest() {
|
||||
String memberId = "25950857";
|
||||
|
||||
Reference in New Issue
Block a user