| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | @Autowired |
| | | private HttpServletRequest request; |
| | |
| | | } |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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>() |
| | | .eq("phone", map.get("phone")) |