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 | 122 ++++++++++++++++++++++++++++++++++------
1 files changed, 103 insertions(+), 19 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 99ae18e..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
@@ -7,11 +7,19 @@
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.account.server.UserWithdrawalService;
import com.stylefeng.guns.modular.account.util.OssUploadUtil;
+import com.stylefeng.guns.modular.shunfeng.model.DriverRide;
+import com.stylefeng.guns.modular.shunfeng.service.IDriverRideService;
import com.stylefeng.guns.modular.system.model.*;
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.EmployeeUtil;
import com.stylefeng.guns.modular.system.util.qianyuntong.UserUtil;
+import com.stylefeng.guns.modular.system.util.zhenglian.TokenUtil;
+import com.stylefeng.guns.modular.system.util.zhenglian.ZhengLianUtil;
+import com.stylefeng.guns.modular.system.util.zhenglian.model.TokenRequest;
+import com.stylefeng.guns.modular.system.util.zhenglian.model.TradeTerminalInfo;
+import com.stylefeng.guns.modular.system.util.zhenglian.model.ZLUserInfo;
import com.stylefeng.guns.modular.system.warpper.LoginWarpper;
import com.stylefeng.guns.modular.system.warpper.UserInfoWarpper;
import com.stylefeng.guns.modular.system.warpper.VerifiedWarpper;
@@ -27,6 +35,8 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -41,6 +51,9 @@
@Autowired
private IUserInfoService userInfoService;
+ /*顺风车司机*/
+ @Autowired
+ private IDriverRideService driverRideService;
@Autowired
private IVerifiedService verifiedService;
@@ -121,6 +134,9 @@
return ResultUtil.runErr();
}
}
+
+
+
@ResponseBody
@PostMapping("/base/user/oneClickLogin")
@@ -267,6 +283,11 @@
return ResultUtil.runErr();
}
}
+
+
+
+
+
@ResponseBody
@PostMapping("/base/user/wxLogin")
@ApiOperation(value = "微信授权登录", tags = {"用户端-登录"}, notes = "")
@@ -290,6 +311,12 @@
return ResultUtil.runErr();
}
}
+
+
+
+
+
+
@ResponseBody
@PostMapping("/base/user/wxLoginIsBind")
@ApiOperation(value = "微信授权登录--查看是否绑定手机号", tags = {"用户端-登录"}, notes = "")
@@ -355,13 +382,15 @@
return ResultUtil.tokenErr();
}
UserInfo userInfo = userInfoService.selectById(uid);
-
-
-
+ Driver driver = driverService.selectById(driverId);
// 是否需要绑定司机
- 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", driver.getPlaceOfEmployment()).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);
@@ -371,18 +400,20 @@
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()).ge("startTime", new Date()).lt("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);
+ Region code = regionService.selectOne(new EntityWrapper<Region>().eq("code", driver.getPlaceOfEmployment()));
+ 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);
+ }
}
}
@@ -416,10 +447,11 @@
}
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);
}
+
Map<String, Object> map = userInfoService.queryUserInfo(uid);
UserWithdrawal userWithdrawal1 = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>()
.eq("phone", map.get("phone"))
@@ -857,6 +889,9 @@
return ResultUtil.runErr();
}
}
+
+
+
@ResponseBody
@GetMapping("/base/user/getDriverCode")
@ApiOperation(value = "获取司机端的二维码", tags = {"获取司机端的二维码"}, notes = "")
@@ -896,9 +931,9 @@
*/
@ResponseBody
@PostMapping("/base/user/addAppUser")
- public String addAppUser(String phone, String code, String areaCode){
+ public String addAppUser(String phone, String code, String areaCode, String onconUUID){
try {
- return userInfoService.addAppUser(phone, code, areaCode);
+ return userInfoService.addAppUser(phone, code, areaCode, onconUUID);
}catch (Exception e){
e.printStackTrace();
}
@@ -942,4 +977,53 @@
}
return null;
}
+
+
+ @ResponseBody
+ @PostMapping("/api/driver/getZLToken")
+ @ApiOperation(value = "获取证联token(黔云通)", tags = {"司机端-首页"}, notes = "")
+ @ApiImplicitParams({
+ @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+ @ApiImplicitParam(value = "当前设备IP地址", name = "ip", required = true, dataType = "String"),
+ @ApiImplicitParam(value = "当前设备mac地址", name = "mac", required = true, dataType = "String"),
+ @ApiImplicitParam(value = "01 证联收银台支付\n" +
+ "\t 04 HOME 页\n" +
+ "\t 06 申请免密签约\n" +
+ "\t 07 商户收银台支付\n" +
+ "\t 08 开户(绑卡)\n" +
+ "\t 09 开通支付账户\n" +
+ "\t 10 打开付款码", name = "type", required = true, dataType = "String"),
+ })
+ public ResultUtil<String> getZLToken(String ip, String mac, String type, HttpServletRequest request){
+ try {
+ Integer userId = userInfoService.getUserIdFormRedis(request);
+ if (null == userId) {
+ return ResultUtil.tokenErr();
+ }
+ UserInfo userInfo = userInfoService.selectById(userId);
+ if(null == userInfo.getDriverId()){
+ return ResultUtil.error("请先开通顺风车司机");
+ }
+ if(null == userInfo.getIdCard()){
+ return ResultUtil.error("请先完成实名认证");
+ }
+ DriverRide driverRide = driverRideService.selectById(userInfo.getDriverId());
+ TokenRequest tokenRequest = new TokenRequest();
+ tokenRequest.setAppUserId(driverRide.getEmpId().toString());
+ tokenRequest.setUserName(userInfo.getName());
+ tokenRequest.setCertNo(userInfo.getIdCard());
+ tokenRequest.setPhone(userInfo.getPhone());
+ TradeTerminalInfo tradeTerminalInfo = new TradeTerminalInfo();
+ tradeTerminalInfo.setIp(ip);
+ tradeTerminalInfo.setTerminal("1");
+ tradeTerminalInfo.setMac(mac);
+ tokenRequest.setTradeTerminalInfo(tradeTerminalInfo);
+ tokenRequest.setType(type);
+ String token = TokenUtil.getToken(tokenRequest);
+ return ResultUtil.success(token);
+ }catch (Exception e){
+ e.printStackTrace();
+ return ResultUtil.runErr();
+ }
+ }
}
--
Gitblit v1.7.1