mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-15 23:38:32 +08:00
update 预约充电
This commit is contained in:
@@ -369,8 +369,12 @@ public class PersonPileController extends BaseController {
|
|||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
pileReservationInfoService.updateReservation(dto);
|
int i = pileReservationInfoService.updateReservation(dto);
|
||||||
response = new RestApiResponse<>();
|
if (i > 0) {
|
||||||
|
response = new RestApiResponse<>();
|
||||||
|
} else {
|
||||||
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_UPDATE_RESERVED_STATUS_ERROR.getValue(), ReturnCodeEnum.CODE_UPDATE_RESERVED_STATUS_ERROR.getLabel() + ": 充电桩返回修改失败");
|
||||||
|
}
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("修改预约充电信息error, params:{}", dto, e);
|
logger.error("修改预约充电信息error, params:{}", dto, e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public enum ReturnCodeEnum {
|
|||||||
|
|
||||||
CODE_CREATE_RESERVED_ERROR("00400013", "创建预约失败"),
|
CODE_CREATE_RESERVED_ERROR("00400013", "创建预约失败"),
|
||||||
|
|
||||||
CODE_UPDATE_RESERVED_STATUS_ERROR("00400014", "修改预约充电状态失败"),
|
CODE_UPDATE_RESERVED_STATUS_ERROR("00400014", "修改预约充电信息失败"),
|
||||||
|
|
||||||
CODE_QUERY_RESERVED_LIST_ERROR("00400015", "查询预约充电列表失败"),
|
CODE_QUERY_RESERVED_LIST_ERROR("00400015", "查询预约充电列表失败"),
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public interface PileReservationInfoService {
|
|||||||
|
|
||||||
void updateReservationStatus(PileReservationDTO dto);
|
void updateReservationStatus(PileReservationDTO dto);
|
||||||
|
|
||||||
void updateReservation(PileReservationDTO dto);
|
int updateReservation(PileReservationDTO dto);
|
||||||
|
|
||||||
void personPileStopCharging(PersonPileStopChargingDTO dto);
|
void personPileStopCharging(PersonPileStopChargingDTO dto);
|
||||||
|
|
||||||
|
|||||||
@@ -407,10 +407,10 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
|||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateReservation(PileReservationDTO dto) {
|
public int updateReservation(PileReservationDTO dto) {
|
||||||
PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.valueOf(dto.getReservedId()));
|
PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.valueOf(dto.getReservedId()));
|
||||||
if (pileReservationInfo == null) {
|
if (pileReservationInfo == null) {
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 操作 0x01:启动 0x02:取消 0x03:修改
|
// 操作 0x01:启动 0x02:取消 0x03:修改
|
||||||
@@ -473,8 +473,9 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
|
|||||||
.build();
|
.build();
|
||||||
String result = pileRemoteService.reservationCharging(command);
|
String result = pileRemoteService.reservationCharging(command);
|
||||||
if (StringUtils.equals(result, Constants.ONE)) {
|
if (StringUtils.equals(result, Constants.ONE)) {
|
||||||
this.insertOrUpdateSelective(pileReservationInfo);
|
return this.insertOrUpdateSelective(pileReservationInfo);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user