司机工作状态业务补充初始化司机工作状态

main
topsun 2 years ago
parent e0aba138ac
commit 23f00f568b

@ -79,17 +79,11 @@ public class VerficationCodeService {
CommonStatusEnum.VERIFICATION_CODE_ERROR.setMessage("验证码输入有误!");
return ResponseResult.fail(CommonStatusEnum.VERIFICATION_CODE_ERROR);
} else {
// //三、判断这个手机号是否存在用户,并进行对应的处理
// VerificationCodeDTO verificationCodeDTO = new VerificationCodeDTO();
// verificationCodeDTO.setPassengerPhone(driverPhone);
// serviceDriverUserClient.getUser(verificationCodeDTO);
/**
* tokenredis
*/
TokenResponse tokenResponse = proDoubleTokenAndSaveRedis(stringRedisTemplate,
driverPhone);
return ResponseResult.success(tokenResponse);
}
} else {

@ -29,5 +29,17 @@ public class DriverCarConstant {
*
*/
public static final int DRIVER_NOT_EXISTS = 0;
/**
*
*/
public static final int DRIVER_WORK_STATUS_START = 0;
/**
*
*/
public static final int DRIVER_WORK_STATUS_STOP = 0;
/**
*
*/
public static final int DRIVER_WORK_STATUS_SUSPEND = 0;
}

@ -3,8 +3,10 @@ package com.taxi.servicedriveruser.service;
import com.internal.contant.CommonStatusEnum;
import com.internal.contant.DriverCarConstant;
import com.internal.dto.DriverUser;
import com.internal.dto.DriverUserWorkStatus;
import com.internal.dto.ResponseResult;
import com.taxi.servicedriveruser.mapper.DriverUserMapper;
import com.taxi.servicedriveruser.mapper.DriverUserWorkStatusMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -18,12 +20,23 @@ public class DriverUserService {
@Autowired
private DriverUserMapper driverUserMapper;
@Autowired
private DriverUserWorkStatusMapper driverUserWorkStatusMapper;
public ResponseResult addDriverUser(DriverUser driverUser){
LocalDateTime localDate = LocalDateTime.now();
driverUser.setGmtCreate(localDate);
driverUser.setGmtModified(localDate);
driverUserMapper.insert(driverUser);
//初始化 司机工作状态表
DriverUserWorkStatus driverUserWorkStatus = new DriverUserWorkStatus();
driverUserWorkStatus.setDriverId(driverUser.getId());
driverUserWorkStatus.setWorkStatus(DriverCarConstant.DRIVER_WORK_STATUS_STOP);
driverUserWorkStatus.setGmtCreate(localDate);
driverUserWorkStatus.setGmtModified(localDate);
driverUserWorkStatusMapper.insert(driverUserWorkStatus);
return ResponseResult.success();
}

Loading…
Cancel
Save