kongdeqiang
2024-03-25 d6aa1029a1c538cd2227f0026ad5adbaa1739726
src/main/java/com/boying/service/impl/OutParkServiceImpl.java
@@ -19,6 +19,7 @@
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -190,6 +191,29 @@
    }
    @Override
    public OutPark findBy5min(String carNo, Integer parkId,LocalDateTime dateTime) {
        LocalDateTime localDateTime = dateTime.minusMinutes(5);
        QueryWrapper<OutPark> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(OutPark::getCarNo,carNo)
                .eq(OutPark::getParkId,parkId)
                .ge(OutPark::getCreateTime,localDateTime)
                .isNotNull(OutPark::getEnterTime);
        List<OutPark> outParks = outParkMapper.selectList(wrapper);
        if(outParks != null && outParks.size()>0){
            for (OutPark outPark : outParks) {
                if(outPark.getPrice() == 0){
                    return outPark;
                }
                if(outPark.getPrice() != 0 && outPark.getStatus() == 1){
                    return outPark;
                }
            }
        }
        return null;
    }
    @Override
    public List<OutPark> getList(long current, long size, String carNo, Long parkId, String payCode, String date) {
        return outParkMapper.getList((current-1)*size,size,carNo,parkId,payCode,date);
    }