From bf2acefcf5ba801d3e4a4f507c5f064fc93625cc Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 21 八月 2025 00:25:09 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/QianYunTong

---
 UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/UserInfoController.java |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 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 53a2295..fcc3729 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
@@ -56,6 +56,9 @@
     
     @Autowired
     private IDriverService driverService;
+
+    @Autowired
+    private IRegionService regionService;
     
     @Autowired
     private HttpServletRequest request;
@@ -353,10 +356,15 @@
             }
             UserInfo userInfo = userInfoService.selectById(uid);
 
+
+
             // 是否需要绑定司机
-            TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", userInfo.getRegistAreaCode()).ge("startTime", new Date()).lt("endTime", new Date()).last(" limit 1"));
+            TDriverPromotionActivity tDriverPromotionActivity = driverPromotionActivityService.selectOne(new EntityWrapper<TDriverPromotionActivity>().eq("districtCode", userInfo.getRegistAreaCode()).le("startTime", new Date()).ge("endTime", new Date()).last(" limit 1"));
+            System.out.println("111232"+tDriverPromotionActivity);
             if(tDriverPromotionActivity!=null){
+                System.out.println("11111");
                 if(userInfo.getBindDriverId()==null || userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){
+                    System.out.println("222222");
                     Integer bindingDays = tDriverPromotionActivity.getBindingDays();
                     // 当前时间+绑定天数
                     Date endTime = DateUtils.addDays(new Date(), bindingDays);
@@ -364,6 +372,21 @@
                     userInfo.setBindExpireDate(endTime);
                     userInfo.setBindDate(new Date());
                     userInfoService.updateById(userInfo);
+                }
+            }else {
+                Region code = regionService.selectOne(new EntityWrapper<Region>().eq("code", userInfo.getRegistAreaCode()));
+                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);
+                    }
                 }
 
             }
@@ -396,7 +419,7 @@
             }
             UserInfo userInfo = userInfoService.selectById(uid);
             if(ToolUtil.isEmpty(userInfo.getOnconUUID())){
-                String onconUUIDByMobile = UserUtil.getOnconUUIDByMobile("15828353127");
+                String onconUUIDByMobile = UserUtil.getOnconUUIDByMobile(userInfo.getPhone());
                 userInfo.setOnconUUID(onconUUIDByMobile);
                 userInfoService.updateById(userInfo);
             }

--
Gitblit v1.7.1