Pārlūkot izejas kodu

提交新增企业查询

chenxiaofei 11 stundas atpakaļ
vecāks
revīzija
99dfda6d5e

+ 6 - 2
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/model/vo/DriverRegisterResultVo.java

@@ -50,14 +50,17 @@ public class DriverRegisterResultVo implements Serializable {
      * 账号状态。
      */
     private Integer status;
-
+    /**
+     * 密码
+     */
+    private String password;
     /**
      * 根据司机实体构建注册响应对象。
      *
      * @param driver 司机实体
      * @return 注册响应对象
      */
-    public static DriverRegisterResultVo from(KwfDriver driver) {
+    public static DriverRegisterResultVo from(KwfDriver driver, String phone) {
         if (driver == null) {
             return null;
         }
@@ -69,6 +72,7 @@ public class DriverRegisterResultVo implements Serializable {
         resultVo.setIdcard(driver.getIdcard());
         resultVo.setAuthStatus(driver.getAuthStatus());
         resultVo.setStatus(driver.getStatus());
+        resultVo.setPassword(phone);
         return resultVo;
     }
 }

+ 1 - 1
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -674,7 +674,7 @@ public class KwfDriverService {
 
         log.info("司机自助注册成功,driverId={}, phone={}, entId={}, firmName={}",
                 driver.getId(), maskPhone(params.getPhone()), params.getEntId(), entCache.getFirmName());
-        return HttpResult.ok("注册成功", DriverRegisterResultVo.from(driver));
+        return HttpResult.ok("注册成功", DriverRegisterResultVo.from(driver, params.getPhone()));
     }
 
     /**

+ 0 - 47
sckw-modules/sckw-fleet/src/test/java/com/sckw/fleet/model/DriverRegisterResultVoTest.java

@@ -1,47 +0,0 @@
-package com.sckw.fleet.model;
-
-import com.sckw.fleet.model.vo.DriverRegisterResultVo;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * 司机自助注册响应对象单元测试。
- */
-public class DriverRegisterResultVoTest {
-
-    /**
-     * 司机实体应转换为注册响应对象,避免接口直接返回 KwfDriver 实体。
-     */
-    @Test
-    public void fromWhenDriverExists() {
-        KwfDriver driver = new KwfDriver();
-        driver.setId(1001L);
-        driver.setEntId(2001L);
-        driver.setName("张三");
-        driver.setPhone("13800000000");
-        driver.setIdcard("110101199001010011");
-        driver.setAuthStatus(2);
-        driver.setStatus(0);
-        driver.setPassword("secret");
-        driver.setSalt("salt");
-
-        DriverRegisterResultVo resultVo = DriverRegisterResultVo.from(driver);
-
-        Assert.assertNotNull(resultVo);
-        Assert.assertEquals(Long.valueOf(1001L), resultVo.getDriverId());
-        Assert.assertEquals(Long.valueOf(2001L), resultVo.getEntId());
-        Assert.assertEquals("张三", resultVo.getName());
-        Assert.assertEquals("13800000000", resultVo.getPhone());
-        Assert.assertEquals("110101199001010011", resultVo.getIdcard());
-        Assert.assertEquals(Integer.valueOf(2), resultVo.getAuthStatus());
-        Assert.assertEquals(Integer.valueOf(0), resultVo.getStatus());
-    }
-
-    /**
-     * 空司机实体应返回空,调用方可按原有空值逻辑处理。
-     */
-    @Test
-    public void fromWhenDriverIsNull() {
-        Assert.assertNull(DriverRegisterResultVo.from(null));
-    }
-}