|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|