@@ -59,8 +59,7 @@ public class TauvDriver extends Entity { | |||
/** | |||
* 河长 | |||
*/ | |||
@NotEmpty(message = "河长不能为空") | |||
@Length(min = 2, max = 30, message = "河长长度为2-30个字") | |||
@NotNull(message = "河长不能为空") | |||
private Integer driverManager; | |||
/** |
@@ -89,8 +89,12 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
String cityName = cityService.getCityName(item.getDriverArea()); | |||
driverListVo.setDriverAreaName(cityName); | |||
// 河长名称 | |||
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager()); | |||
driverListVo.setDriverManagerName(lsAdmin.getRealname()); | |||
if (item.getDriverManager() != null && item.getDriverManager() > 0) { | |||
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager()); | |||
if (lsAdmin != null) { | |||
driverListVo.setDriverManagerName(lsAdmin.getRealname()); | |||
} | |||
} | |||
driverListVoList.add(driverListVo); | |||
}); | |||
} | |||
@@ -135,9 +139,6 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
*/ | |||
@Override | |||
public Response add(TauvDriver driver) { | |||
if (driver == null || driver.getId() == 0) { | |||
return response.failure("实体对象不存在"); | |||
} | |||
String name = driver.getName(); | |||
TauvDriver info = getInfoByName(name); | |||
if (!StringUtils.isEmpty(info)) { | |||
@@ -269,8 +270,13 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau | |||
String cityName = cityService.getCityName(item.getDriverArea()); | |||
driverListVo.setDriverAreaName(cityName); | |||
// 河长名称 | |||
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager()); | |||
driverListVo.setDriverManagerName(lsAdmin.getRealname()); | |||
// 河长名称 | |||
if (item.getDriverManager() != null && item.getDriverManager() > 0) { | |||
LsAdmin lsAdmin = lsAdminMapper.selectById(item.getDriverManager()); | |||
if (lsAdmin != null) { | |||
driverListVo.setDriverManagerName(lsAdmin.getRealname()); | |||
} | |||
} | |||
driverListVoList.add(driverListVo); | |||
}); | |||
} |
@@ -2,7 +2,7 @@ package com.taauav.front.controller; | |||
import com.taauav.common.bean.Response; | |||
import com.taauav.front.dto.LoginDto; | |||
import com.taauav.front.service.ILsLoginService; | |||
import com.taauav.front.service.ILSLoginService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.PostMapping; | |||
import org.springframework.web.bind.annotation.RequestBody; | |||
@@ -11,10 +11,10 @@ import org.springframework.web.bind.annotation.RestController; | |||
@RestController | |||
@RequestMapping("/front/login") | |||
public class LsLoginController extends FrontBaseController { | |||
public class LSLoginController extends FrontBaseController { | |||
@Autowired | |||
private ILsLoginService loginService; | |||
private ILSLoginService loginService; | |||
@Autowired | |||
private Response response; |
@@ -11,7 +11,7 @@ import com.taauav.front.dto.LoginDto; | |||
* @author dyg | |||
* @since 2020-04-01 | |||
*/ | |||
public interface ILsLoginService { | |||
public interface ILSLoginService { | |||
/** | |||
* 系统登录 |
@@ -9,7 +9,7 @@ import com.taauav.common.util.StringUtils; | |||
import com.taauav.front.dto.LoginDto; | |||
import com.taauav.admin.entity.LsAdmin; | |||
import com.taauav.admin.mapper.LsAdminMapper; | |||
import com.taauav.front.service.ILsLoginService; | |||
import com.taauav.front.service.ILSLoginService; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
@@ -25,7 +25,7 @@ import java.util.Map; | |||
* @since 2020-04-01 | |||
*/ | |||
@Service | |||
public class LsLoginServiceImpl extends ServiceImpl<LsAdminMapper, LsAdmin> implements ILsLoginService { | |||
public class LSLoginServiceImpl extends ServiceImpl<LsAdminMapper, LsAdmin> implements ILSLoginService { | |||
@Autowired | |||
private Response response; |