From 1c40baaf9ca0183945b9881d11ceed5aeebc8290 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 23 十月 2025 11:35:44 +0800
Subject: [PATCH] 修改bug
---
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
index 83ea472..9e89d3f 100644
--- a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
+++ b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java
@@ -401,17 +401,19 @@
}
}else {
Region code = regionService.selectOne(new EntityWrapper<Region>().eq("code", driver.getPlaceOfEmployment()));
- Region region = regionService.selectById(code.getParentId());
- TDriverPromotionActivity tDriverPromotionActivity1 = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("cityCode", region.getCode()).le("startTime", new Date()).ge("endTime", new Date()).last(" limit 1"));
- if(tDriverPromotionActivity1!=null) {
- if (userInfo.getBindDriverId() == null || userInfo.getBindExpireDate().getTime() <= System.currentTimeMillis()) {
- Integer bindingDays = tDriverPromotionActivity1.getBindingDays();
- // 当前时间+绑定天数
- Date endTime = DateUtils.addDays(new Date(), bindingDays);
- userInfo.setBindDriverId(driverId);
- userInfo.setBindExpireDate(endTime);
- userInfo.setBindDate(new Date());
- userInfoService.updateById(userInfo);
+ if(null != code){
+ Region region = regionService.selectById(code.getParentId());
+ TDriverPromotionActivity tDriverPromotionActivity1 = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("cityCode", region.getCode()).le("startTime", new Date()).ge("endTime", new Date()).last(" limit 1"));
+ if(tDriverPromotionActivity1!=null) {
+ if (userInfo.getBindDriverId() == null || userInfo.getBindExpireDate().getTime() <= System.currentTimeMillis()) {
+ Integer bindingDays = tDriverPromotionActivity1.getBindingDays();
+ // 当前时间+绑定天数
+ Date endTime = DateUtils.addDays(new Date(), bindingDays);
+ userInfo.setBindDriverId(driverId);
+ userInfo.setBindExpireDate(endTime);
+ userInfo.setBindDate(new Date());
+ userInfoService.updateById(userInfo);
+ }
}
}
--
Gitblit v1.7.1