update 预约启动

This commit is contained in:
Guoqs
2024-07-08 13:50:12 +08:00
parent f6862471d1
commit 1dd72529ef
2 changed files with 9 additions and 0 deletions

View File

@@ -177,6 +177,8 @@ public enum ReturnCodeEnum {
CODE_UPDATE_RESERVED_STATUS_REFUSED("00400016", "时间与现有预订重叠"), CODE_UPDATE_RESERVED_STATUS_REFUSED("00400016", "时间与现有预订重叠"),
CODE_RESERVATION_ALREADY_EXISTS_ERROR("00400017", "已经存在生效中的预约,请关闭后再试"),
/* 个人桩 end */ /* 个人桩 end */
CODE_THIS_CARNO_HAS_BEEN_BINDING("00500001", "当前车牌号已经绑定,请检查!"), CODE_THIS_CARNO_HAS_BEEN_BINDING("00500001", "当前车牌号已经绑定,请检查!"),

View File

@@ -15,6 +15,7 @@ import com.jsowell.pile.service.PileBasicInfoService;
import com.jsowell.pile.service.PileRemoteService; import com.jsowell.pile.service.PileRemoteService;
import com.jsowell.pile.vo.uniapp.MemberPlateNumberVO; import com.jsowell.pile.vo.uniapp.MemberPlateNumberVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -111,6 +112,12 @@ public class PileReservationInfoServiceImpl implements PileReservationInfoServic
*/ */
@Override @Override
public void activateReserved(PileReservationDTO dto) { public void activateReserved(PileReservationDTO dto) {
// 查询其他生效中的预约
List<PileReservationInfo> infoList = pileReservationInfoMapper.findByMemberIdAndPileSnAndStatus(dto.getMemberId(), dto.getPileSn(), "1");
if (CollectionUtils.isNotEmpty(infoList)) {
throw new BusinessException(ReturnCodeEnum.CODE_RESERVATION_ALREADY_EXISTS_ERROR);
}
PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId())); PileReservationInfo pileReservationInfo = pileReservationInfoMapper.selectByPrimaryKey(Integer.parseInt(dto.getReservedId()));
if (pileReservationInfo == null) { if (pileReservationInfo == null) {
return; return;