kongdeqiang
2024-04-22 86c29c1a7d83b8fca6ff26f1171dde89989af5f9
src/main/java/com/boying/controller/OutParkController.java
@@ -319,6 +319,34 @@
            return R.failed(null,"未找到数据");
        }
    }
    //扫码修改出场(模糊车牌)
    @GetMapping("/editOutPark")
    public Object editOutPark(Integer outParkId,Integer enterParkId,Integer type) {
        double money = 0.0;
        OutPark outPark = outParkService.getById(outParkId);
        EnterPark enterPark = enterParkService.getById(enterParkId);
        if(type == 0){ //入场正确,替换出场,更新出场记录
            outPark.setCarNo(enterPark.getCarNo());
        }else { //出场正确,替换入场,更新出场记录
            enterPark.setCarNo(outPark.getCarNo());
        }
        outPark.setEnterTime(enterPark.getCreateTime());
        try {
            long l = outPark.getCreateTime().toInstant(ZoneOffset.of("+8")).toEpochMilli() - enterPark.getCreateTime().toInstant(ZoneOffset.of("+8")).toEpochMilli();
            outPark.setTime(l/(1000*60));
            money = costRuleService.getMoney(outPark.getParkId(), outPark.getEnterTime(), outPark.getCreateTime(), 1);
            //入场记录保存一下
            enterPark.setPrice(money);
            enterPark.setIsPay(0);
            enterParkService.updateById(enterPark);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        outPark.setPrice(money);
        outParkService.saveOrUpdate(outPark);
        return R.ok(outPark,"更新成功");
    }
    @GetMapping("/editEnterPark")
    public Object editEnterPark(String carNo ,Integer parkId,String time) {
        QueryWrapper<Barrier> wrapper = new QueryWrapper<>();