From 998bc10d74f370f7f99331d9df53d43311949f53 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 14 八月 2025 19:15:12 +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 | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 44 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 b1de16d..e012fb9 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 @@ -11,6 +11,7 @@ import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.ResultUtil; import com.stylefeng.guns.modular.system.util.WeChatUtil; +import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil; import com.stylefeng.guns.modular.system.warpper.LoginWarpper; import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper; import com.stylefeng.guns.modular.system.warpper.VerifiedWarpper; @@ -55,6 +56,9 @@ @Autowired private IDriverService driverService; + + @Autowired + private IRegionService regionService; @Autowired private HttpServletRequest request; @@ -352,8 +356,10 @@ } 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")); if(tDriverPromotionActivity!=null){ if(userInfo.getBindDriverId()==null || userInfo.getBindExpireDate().getTime()<=System.currentTimeMillis()){ Integer bindingDays = tDriverPromotionActivity.getBindingDays(); @@ -363,6 +369,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); + } } } @@ -392,6 +413,12 @@ Integer uid = userInfoService.getUserIdFormRedis(request); if(null == uid){ return ResultUtil.tokenErr(); + } + UserInfo userInfo = userInfoService.selectById(uid); + if(ToolUtil.isEmpty(userInfo.getOnconUUID())){ + String onconUUIDByMobile = UserUtil.getOnconUUIDByMobile("15828353127"); + userInfo.setOnconUUID(onconUUIDByMobile); + userInfoService.updateById(userInfo); } Map<String, Object> map = userInfoService.queryUserInfo(uid); UserWithdrawal userWithdrawal1 = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() @@ -868,7 +895,7 @@ * @return */ @ResponseBody - @GetMapping("/base/user/addAppUser") + @PostMapping("/base/user/addAppUser") public String addAppUser(String phone, String code, String areaCode){ try { return userInfoService.addAppUser(phone, code, areaCode); @@ -900,4 +927,19 @@ return false; } } + + /** + * 代驾系统验根据用户id获取电话号码 + * @param id + * @return + */ + @ResponseBody + @GetMapping("/base/user/getUserPhone/{id}") + public String getUserPhone(@PathVariable("id") Integer id){ + UserInfo userInfo = userInfoService.selectById(id); + if(null != userInfo){ + return userInfo.getPhone(); + } + return null; + } } -- Gitblit v1.7.1