kongdeqiang
2023-09-21 61fae74b4c77a51e77588c741a70f0872ba34ceb
src/main/java/com/boying/controller/OutParkController.java
@@ -71,13 +71,45 @@
        page.setTotal(count);
        return R.ok(page);
    }
    //getById
    @PostMapping("/getById")
    public Object getById(Long id) {
        return R.ok(outParkService.getById(id));
    }
    //道闸code
    @PostMapping("/findByBarrierCode")
    public Object findById(String code) {
       QueryWrapper<Barrier> wrapper = new QueryWrapper<>();
       wrapper.lambda()
               .eq(Barrier::getCode2,code);
        List<Barrier> all = barrierService.list(wrapper);
        if(all.size()==0){
            return R.failed("未找到该设备");
        }else{
            Barrier barrier = all.get(0);
            String carNo = barrier.getCarNo();
            OutPark outPark = outParkService.findByCarNoAndBarrierId(carNo,barrier.getId());
            if(outPark==null){
                return R.failed("未识别到车牌号");
            }else{
                outPark.setParkName(barrier.getName());
                if(outPark.getTime() > 0){
                    outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue()));
                }else {
                    outPark.setTimeStr("不足一分钟");
                }
                return R.ok(outPark);
            }
        }
    }
    //道闸code
    @PostMapping("/findByBarrierCode2")
    public Object findById2(String code2) {
        QueryWrapper<Barrier> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(Barrier::getCode2,code2);
        List<Barrier> all = barrierService.list(wrapper);
        if(all.size()==0){
            return R.failed("未找到该设备");
@@ -214,7 +246,7 @@
    @GetMapping("/statisticParkOrder/count")
    public R statisticParkOrder(String parkIds) {
        Map<String,Object> resultMap = new HashMap<>();
        if(parkIds != null){
        if(StringUtils.isNotBlank(parkIds)){
            String[] split = parkIds.split(",");
            long[] array = Arrays.stream(split).mapToLong(Long::parseLong).toArray();
            List<Long> parkIdList = new ArrayList<>();