Commit 4fa8a048c8f277444707214be452d1f80fe56073
1 parent
e4b45c2e
优化管理员代领钥匙逻辑
Showing
1 changed file
with
4 additions
and
3 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| @@ -336,11 +336,12 @@ public class KeyBoxController extends BaseController { | @@ -336,11 +336,12 @@ public class KeyBoxController extends BaseController { | ||
| 336 | String date = DateFormatUtils.format(DateUtils.getNowDate(),"yyyy-MM-dd"); | 336 | String date = DateFormatUtils.format(DateUtils.getNowDate(),"yyyy-MM-dd"); |
| 337 | LambdaQueryWrapper<LinggangScheduling> wrapper = new LambdaQueryWrapper<>(); | 337 | LambdaQueryWrapper<LinggangScheduling> wrapper = new LambdaQueryWrapper<>(); |
| 338 | wrapper.eq(LinggangScheduling::getNbbm,dto.getKeyItem().get(0).getPlate()).and(i -> i.and(j -> j.apply("DATE_FORMAT(schedule_date, '%Y-%m-%d') LIKE {0}", date+"%"))) | 338 | wrapper.eq(LinggangScheduling::getNbbm,dto.getKeyItem().get(0).getPlate()).and(i -> i.and(j -> j.apply("DATE_FORMAT(schedule_date, '%Y-%m-%d') LIKE {0}", date+"%"))) |
| 339 | - .and(i -> i.eq(LinggangScheduling::getBcType,"out")).and(i -> i.eq(LinggangScheduling::getPosts,"驾驶员")).last("ORDER BY ABS(fcsj_t - UNIX_TIMESTAMP() * 1000)") | ||
| 340 | - .last("limit 1"); | 339 | + .and(i -> i.eq(LinggangScheduling::getBcType,"out")).and(i -> i.eq(LinggangScheduling::getPosts,"驾驶员")) |
| 340 | + .last("ORDER BY ABS(fcsj_t - UNIX_TIMESTAMP() * 1000) LIMIT 1"); | ||
| 341 | //sql 语句: | 341 | //sql 语句: |
| 342 | // SELECT * FROM `linggang_scheduling` | 342 | // SELECT * FROM `linggang_scheduling` |
| 343 | - // WHERE nbbm = 'A01' AND DATE_FORMAT(schedule_date, '%Y-%m-%d') LIKE '2023-07-08%' AND bc_type = 'out' AND posts = '驾驶员' ORDER BY ABS(fcsj_t - UNIX_TIMESTAMP() * 100) | 343 | + // WHERE nbbm = 'A01' AND DATE_FORMAT(schedule_date, '%Y-%m-%d') LIKE '2023-07-08%' AND bc_type = 'out' AND posts = '驾驶员' |
| 344 | + // ORDER BY ABS(fcsj_t - UNIX_TIMESTAMP() * 100) | ||
| 344 | // LIMIT 1 | 345 | // LIMIT 1 |
| 345 | List<LinggangScheduling> scheduling = schedulingService.list(wrapper); | 346 | List<LinggangScheduling> scheduling = schedulingService.list(wrapper); |
| 346 | if(!scheduling.isEmpty()){ | 347 | if(!scheduling.isEmpty()){ |