/** | /** | ||||
* 河长 | * 河长 | ||||
*/ | */ | ||||
@NotEmpty(message = "河长不能为空") | |||||
@Length(min = 2, max = 30, message = "河长长度为2-30个字") | |||||
@NotNull(message = "河长不能为空") | |||||
private Integer driverManager; | private Integer driverManager; | ||||
/** | /** |
String cityName = cityService.getCityName(item.getDriverArea()); | String cityName = cityService.getCityName(item.getDriverArea()); | ||||
driverListVo.setDriverAreaName(cityName); | 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); | driverListVoList.add(driverListVo); | ||||
}); | }); | ||||
} | } | ||||
*/ | */ | ||||
@Override | @Override | ||||
public Response add(TauvDriver driver) { | public Response add(TauvDriver driver) { | ||||
if (driver == null || driver.getId() == 0) { | |||||
return response.failure("实体对象不存在"); | |||||
} | |||||
String name = driver.getName(); | String name = driver.getName(); | ||||
TauvDriver info = getInfoByName(name); | TauvDriver info = getInfoByName(name); | ||||
if (!StringUtils.isEmpty(info)) { | if (!StringUtils.isEmpty(info)) { | ||||
String cityName = cityService.getCityName(item.getDriverArea()); | String cityName = cityService.getCityName(item.getDriverArea()); | ||||
driverListVo.setDriverAreaName(cityName); | 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); | driverListVoList.add(driverListVo); | ||||
}); | }); | ||||
} | } |
import com.taauav.common.bean.Response; | import com.taauav.common.bean.Response; | ||||
import com.taauav.front.dto.LoginDto; | 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.beans.factory.annotation.Autowired; | ||||
import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
import org.springframework.web.bind.annotation.RequestBody; | import org.springframework.web.bind.annotation.RequestBody; | ||||
@RestController | @RestController | ||||
@RequestMapping("/front/login") | @RequestMapping("/front/login") | ||||
public class LsLoginController extends FrontBaseController { | |||||
public class LSLoginController extends FrontBaseController { | |||||
@Autowired | @Autowired | ||||
private ILsLoginService loginService; | |||||
private ILSLoginService loginService; | |||||
@Autowired | @Autowired | ||||
private Response response; | private Response response; |
* @author dyg | * @author dyg | ||||
* @since 2020-04-01 | * @since 2020-04-01 | ||||
*/ | */ | ||||
public interface ILsLoginService { | |||||
public interface ILSLoginService { | |||||
/** | /** | ||||
* 系统登录 | * 系统登录 |
import com.taauav.front.dto.LoginDto; | import com.taauav.front.dto.LoginDto; | ||||
import com.taauav.admin.entity.LsAdmin; | import com.taauav.admin.entity.LsAdmin; | ||||
import com.taauav.admin.mapper.LsAdminMapper; | 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.beans.factory.annotation.Autowired; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
* @since 2020-04-01 | * @since 2020-04-01 | ||||
*/ | */ | ||||
@Service | @Service | ||||
public class LsLoginServiceImpl extends ServiceImpl<LsAdminMapper, LsAdmin> implements ILsLoginService { | |||||
public class LSLoginServiceImpl extends ServiceImpl<LsAdminMapper, LsAdmin> implements ILSLoginService { | |||||
@Autowired | @Autowired | ||||
private Response response; | private Response response; |