From 84fd23e5e865bd5529441a0c318809a00362f44c Mon Sep 17 00:00:00 2001 From: wjli <591616088@qq.com> Date: 星期一, 18 三月 2024 16:15:03 +0800 Subject: [PATCH] 添加签收图片对比功能 --- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java index 83d86bb..fba72ed 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java +++ b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/DrivingRecordController.java @@ -84,6 +84,12 @@ @RequestMapping(value = "/updateMileage", method = RequestMethod.POST) @ApiOperation(value = "娣诲姞琛岃溅璁板綍") public Result<DrivingRecord> updateMileage(String carId,int mileage,String userId,String inDate) { + if(StrUtil.isEmpty(userId)){ + return ResultUtil.error("鍙傛暟涓嶅畬鏁�"); + } + if(StrUtil.isEmpty(carId)){ + return ResultUtil.error("鍙傛暟涓嶅畬鏁�"); + } String format = DateUtil.format(new Date(), "yyyy-MM-dd"); QueryWrapper<DrivingRecord> wrapper = new QueryWrapper<>(); wrapper.eq("driving_date",format); @@ -91,6 +97,7 @@ DrivingRecord drivingRecord = iDrivingRecordService.getOne(wrapper); if(drivingRecord==null){ drivingRecord = new DrivingRecord(); + drivingRecord.setCarId(carId); } drivingRecord.setMileage(mileage); drivingRecord.setInTime(DateUtil.parseDate(inDate)); @@ -117,9 +124,11 @@ @RequestMapping(value = "/getByPage", method = RequestMethod.GET) @ApiOperation(value = "鍒嗛〉鑾峰彇") - public Result<IPage<DrivingRecord>> getByPage(PageVo page) { - - IPage<DrivingRecord> data = iDrivingRecordService.page(PageUtil.initMpPage(page)); + public Result<IPage<DrivingRecord>> getByPage(PageVo page,String carNo) { + QueryWrapper<DrivingRecord> wrapper = new QueryWrapper<>(); + if(!StrUtil.isEmpty(carNo)) + wrapper.like("b.car_no","%"+carNo+"%"); + IPage<DrivingRecord> data = iDrivingRecordService.page2(PageUtil.initMpPage(page),wrapper); return new ResultUtil<IPage<DrivingRecord>>().setData(data); } -- Gitblit v1.9.1