|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
@@ -14,7 +15,9 @@ import org.springblade.land.entity.LandRole;
|
|
import org.springblade.land.entity.LandTypeInfo;
|
|
import org.springblade.land.entity.LandTypeInfo;
|
|
import org.springblade.land.mapper.LandRoleMapper;
|
|
import org.springblade.land.mapper.LandRoleMapper;
|
|
import org.springblade.land.service.ILandRoleService;
|
|
import org.springblade.land.service.ILandRoleService;
|
|
|
|
+import org.springblade.land.service.IRegionTreeInfoService;
|
|
import org.springblade.land.vo.LandRoleVO;
|
|
import org.springblade.land.vo.LandRoleVO;
|
|
|
|
+import org.springblade.land.vo.RegionTreeInfoVO;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -25,9 +28,17 @@ import java.util.List;
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class LandRoleServiceImpl extends BaseServiceImpl<LandRoleMapper, LandRole> implements ILandRoleService {
|
|
public class LandRoleServiceImpl extends BaseServiceImpl<LandRoleMapper, LandRole> implements ILandRoleService {
|
|
|
|
|
|
|
|
+ private final IRegionTreeInfoService treeInfoService;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void addOrUpdate(LandRole landRole) {
|
|
public void addOrUpdate(LandRole landRole) {
|
|
|
|
+ if (StringUtils.isBlank(landRole.getAllUser())){
|
|
|
|
+ throw new ServiceException("请选择用户");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isBlank(landRole.getAllAreaId())){
|
|
|
|
+ throw new ServiceException("请选择区域");
|
|
|
|
+ }
|
|
this.saveOrUpdate(landRole);
|
|
this.saveOrUpdate(landRole);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -35,12 +46,18 @@ public class LandRoleServiceImpl extends BaseServiceImpl<LandRoleMapper, LandRol
|
|
public LandRoleVO detail(Long id) {
|
|
public LandRoleVO detail(Long id) {
|
|
LandRoleVO vo = baseMapper.detail(id);
|
|
LandRoleVO vo = baseMapper.detail(id);
|
|
String allUser = vo.getAllUser();
|
|
String allUser = vo.getAllUser();
|
|
|
|
+ //插入用户集合
|
|
if (StringUtils.isNotBlank(allUser)){
|
|
if (StringUtils.isNotBlank(allUser)){
|
|
-// String[] split = allUser.split(",");
|
|
|
|
List<Long> userIdList = Func.toLongList(allUser);
|
|
List<Long> userIdList = Func.toLongList(allUser);
|
|
List<User> userList = baseMapper.getUserList(userIdList);
|
|
List<User> userList = baseMapper.getUserList(userIdList);
|
|
vo.setAllUserList(userList);
|
|
vo.setAllUserList(userList);
|
|
}
|
|
}
|
|
|
|
+ //插入区域树
|
|
|
|
+ String allAreaId = vo.getAllAreaId();
|
|
|
|
+ if (StringUtils.isNotBlank(allAreaId)){
|
|
|
|
+ List<RegionTreeInfoVO> treeAll = treeInfoService.getTreeAll(vo.getProjectId(),allAreaId);
|
|
|
|
+ vo.setAllAreaTree(treeAll);
|
|
|
|
+ }
|
|
return vo;
|
|
return vo;
|
|
}
|
|
}
|
|
|
|
|