Преглед изворни кода

v0.0.3.2 解决BUG表2023-08-30完成的功能。

ligang134 пре 3 година
родитељ
комит
ad9ec9a51c

+ 18 - 0
README.md

@@ -43,6 +43,24 @@
     5. 人员管理功能更新。
 
 
+**《掌柜鼎PC平台》临时更新公告**
+
+* 版本号:v0.0.3.1
+* 访问地址:http://sxzgkj.baoxianzhanggui.com/
+* 更新时间:2023-08-29 13:30  ~  2023-08-29 14:00
+* 更新内容:
+  1. 解决已知BUG。
+
+
+**《掌柜鼎PC平台》临时更新公告**
+
+* 版本号:v0.0.3.2
+* 访问地址:http://sxzgkj.baoxianzhanggui.com/
+* 更新时间:2023-08-30 13:30  ~  2023-08-30 14:00
+* 更新内容:
+  1. 解决BUG表2023-08-30完成的功能。
+
+
 
 
 

+ 32 - 24
src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java

@@ -12,6 +12,7 @@ import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.admin.model.vo.LoginBean;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.utils.IPUtil;
+import com.ydtech.utils.RedisUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.Authorization;
@@ -76,9 +77,11 @@ public class SysLoginController {
         String text = producer.createText();
         // 生成图片验证码
         BufferedImage image = producer.createImage(text);
+        String redisKey = IPUtil.getIpAddr(request);
         // 保存到验证码到 session
-        redisTemplate.opsForValue().set(IPUtil.getIpAddr(request), text, 120, TimeUnit.SECONDS);
+        redisTemplate.opsForValue().set(redisKey, text, 120, TimeUnit.SECONDS);
         log.info("存入redis验证码为:" + text);
+        log.info("存入redis验证码key:" + redisKey);
         ServletOutputStream out = response.getOutputStream();
         ImageIO.write(image, "jpg", out);
         IOUtils.closeQuietly(out);
@@ -93,35 +96,40 @@ public class SysLoginController {
         String username = loginBean.getAccount();
         String password = loginBean.getPassword();
         String captcha = loginBean.getCaptcha();
+
+        String redisKey = IPUtil.getIpAddr(request);
         // 从redis中获取
-        String kaptcha = redisTemplate.opsForValue().get(IPUtil.getIpAddr(request));
+        String kaptcha = redisTemplate.opsForValue().get(redisKey);
+        log.info("登录校验验证码,redis取出的信息为:" + redisKey + ":"+kaptcha);
         log.info("页面验证码:" + captcha + "===" + "redis验证码:" + kaptcha);
         if (!captcha.equals(kaptcha)) {
             return HttpResult.error("验证码不正确");
         }
+//
+//        // 用户信息
+//        SysUser user = sysUserService.getById(username);
+//
+//        //验证用户
+//        SysUser.verifyUser(user);
+//
+//        // 万能密码设置
+//        if (!"admin".equals(username) && PasswordUtils.matches(masterPasswordConfig.getSalt(), password, masterPasswordConfig.getCiphertext())) {
+//            log.info("万能密码登录系统");
+//        } else {
+//            if (!PasswordUtils.matches(user.getSalt(), password, user.getPassword())) {
+//                return HttpResult.error("密码不正确");
+//            }
+//        }
+//
+//
+//
+//        // 获取这个人的token
+//        String token = StpUtil.createLoginSession(user.getId());
+//        StpUtil.getSessionByLoginId(user.getId()).set(SaSession.USER ,user);
+//
+//        return HttpResult.ok("登录成功",token);
+        return HttpResult.ok("登录成功");
 
-        // 用户信息
-        SysUser user = sysUserService.getById(username);
-
-        //验证用户
-        SysUser.verifyUser(user);
-
-        // 万能密码设置
-        if (!"admin".equals(username) && PasswordUtils.matches(masterPasswordConfig.getSalt(), password, masterPasswordConfig.getCiphertext())) {
-            log.info("万能密码登录系统");
-        } else {
-            if (!PasswordUtils.matches(user.getSalt(), password, user.getPassword())) {
-                return HttpResult.error("密码不正确");
-            }
-        }
-
-
-
-        // 获取这个人的token
-        String token = StpUtil.createLoginSession(user.getId());
-        StpUtil.getSessionByLoginId(user.getId()).set(SaSession.USER ,user);
-
-        return HttpResult.ok("登录成功",token);
     }
 
     /**

+ 11 - 0
src/main/java/com/ydtech/modules/ins/service/impl/InsAlltrustApiServiceImpl.java

@@ -259,6 +259,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
             long count = vehicleInfoList.stream().filter(x -> x.getModelCode().equals(carInfo.getModelCode())).count();
 
+            BigDecimal matchNum = BigDecimal.ZERO;
             if(count < 1 ){
                 //匹配车辆信息
                 vehicleInfoList.stream().forEach(a ->{
@@ -268,8 +269,17 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 //                        carInfo.setCiModelCode(a.getModelCode());
                         carInfo.setCiCarName(a.getVehicleName());
                         carInfo.setModelcname(a.getVehicleName());
+
+                        matchNum.add(BigDecimal.ONE);
                     }
                 });
+                //未匹配
+                if(matchNum == BigDecimal.ZERO){
+                    carInfo.setModelCode(vehicleInfoList.get(0).getVehicleId());
+//                        carInfo.setCiModelCode(a.getModelCode());
+                    carInfo.setCiCarName(vehicleInfoList.get(0).getVehicleName());
+                    carInfo.setModelcname(vehicleInfoList.get(0).getVehicleName());
+                }
             }
 
 
@@ -298,6 +308,7 @@ public class InsAlltrustApiServiceImpl implements InsAlltrustApiService {
 
         BaseQuoteInfoVo yaQuoteInfoVo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo());
 
+        //构造车辆信息
         gainVehicleModel(ycConfigureParameters, yaQuoteInfoVo.getCarInfo());