用户信息补漏

yun-zuoyi
wei.peng 6 years ago
parent 12610a45e9
commit 88894c8245

@ -136,6 +136,8 @@ public interface IPersonnelService {
List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentByDepartmentIdList(List<Long> departmentIdList); List<SysRefUserInfoDepartment> findSysRefUserInfoDepartmentByDepartmentIdList(List<Long> departmentIdList);
List<SysDepartment> findSysDepartmentByOrganizeIdList(List<Long> organizeIdList);
@ApiOperation(value = "查询用户部门关系") @ApiOperation(value = "查询用户部门关系")
List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId); List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId);

@ -109,13 +109,19 @@ public class SysDepartmentController extends CoreBaseController {
.notNull("departmentCode", department.getDepartmentCode()) .notNull("departmentCode", department.getDepartmentCode())
.checkNotZero("organizeId",department.getOrganizeId()); .checkNotZero("organizeId",department.getOrganizeId());
SysDepartment sysDepartment = departmentService.getSysDepartmentById(department.getId());
sysDepartment.setName(department.getName());
sysDepartment.setDepartmentCode(department.getDepartmentCode());
sysDepartment.setDepartmentSort(department.getDepartmentSort());
sysDepartment.setParentId(department.getParentId());
ConvertBean.modelUpdate(department, user); ConvertBean.modelUpdate(department, user);
if(department.getParentId() == null || department.getParentId() <= 0){ if(sysDepartment.getParentId() == null || department.getParentId() <= 0){
department.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue()); sysDepartment.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
department.setParentNameRdd("顶级部门"); sysDepartment.setParentNameRdd("顶级部门");
} }
departmentService.updateSysDepartment(department); departmentService.updateSysDepartment(sysDepartment);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

@ -106,14 +106,19 @@ public class SysPositionController extends CoreBaseController {
.notNull("name", position.getName()) .notNull("name", position.getName())
.notNull("positionCode", position.getPositionCode()); .notNull("positionCode", position.getPositionCode());
SysPosition sysPosition = positionService.getSysPositionById(position.getId());
sysPosition.setName(position.getName());
sysPosition.setPositionCode(position.getPositionCode());
sysPosition.setParentId(position.getParentId());
//修改初始化 //修改初始化
ConvertBean.modelUpdate(position, user); ConvertBean.modelUpdate(sysPosition, user);
if (position.getParentId() == null || position.getParentId() <= 0) { if (sysPosition.getParentId() == null || position.getParentId() <= 0) {
position.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue()); sysPosition.setParentId(CommonEnumUtil.PARENT.DEFAULT.getValue());
position.setParentNameRdd("顶级岗位"); sysPosition.setParentNameRdd("顶级岗位");
} }
positionService.updateSysPosition(position); positionService.updateSysPosition(sysPosition);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()); return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) { } catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep); return ResultBean.fail(busExcep);

@ -399,10 +399,10 @@ public class CoreMemTreeService implements ICoreMemTreeService {
// 通过组织获取部门信息 // 通过组织获取部门信息
if (organizeId != null && organizeId > 0) { if (organizeId != null && organizeId > 0) {
List<Long> organizeIdList = findSysOrganizeChildIdList(organizeId); List<Long> organizeIdList = findSysOrganizeChildIdList(organizeId);
List<SysRefUserDepartment> refUserDepartmentList = personnelService.findSysRefUserDepartmentByOrganizeIdList(organizeIdList); List<SysDepartment> departmentList = personnelService.findSysDepartmentByOrganizeIdList(organizeIdList);
if (refUserDepartmentList != null && refUserDepartmentList.size() > 0) { if (departmentList != null && departmentList.size() > 0) {
for (SysRefUserDepartment ref : refUserDepartmentList) { for (SysDepartment department : departmentList) {
refIdList.add(ref.getDepartmentId()); refIdList.add(department.getId());
} }
} }
} }

@ -446,6 +446,16 @@ public class PersonnelServiceService implements IPersonnelService {
} }
@Override @Override
public List<SysDepartment> findSysDepartmentByOrganizeIdList(List<Long> organizeIdList) {
LOGGER.info("平台账号部门 SysRefUserInfoDepartment organizeIdList:{}", organizeIdList);
DdlPackBean packBean = DdlPackBean.getDdlPackBean();
DdlPreparedPack.getInPackList(organizeIdList,"organizeId",packBean);
return departmentRDao.findByHqlWhere(packBean);
}
@Override
@ApiOperation(value = "查询用户部门关系") @ApiOperation(value = "查询用户部门关系")
public List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId) { public List<SysDepartment> findSysUserInfoDepartmentByInfoId(Long infoId) {
LOGGER.info("平台用户部门 SysDepartment infoId:{}", infoId); LOGGER.info("平台用户部门 SysDepartment infoId:{}", infoId);

@ -159,7 +159,7 @@ public class SysDepartmentService implements ISysDepartmentService {
// 查询所属组织名称 // 查询所属组织名称
LOGGER.info("组织信息 ORGANIZE organizeId:{}", department.getOrganizeId()); LOGGER.info("组织信息 ORGANIZE organizeId:{}", department.getOrganizeId());
SysOrganize organize = organizeRDao.getById(department.getOrganizeId()); SysOrganize organize = organizeRDao.getById(department.getOrganizeId());
ValidatorBean.checkNotNull(organize); ValidatorBean.checkNotNull(organize,"不存的组织信息");
department.setOrganizeNameRdd(organize.getName()); department.setOrganizeNameRdd(organize.getName());
department.setOrganizeCode(organize.getOrganizeCode()); department.setOrganizeCode(organize.getOrganizeCode());

Loading…
Cancel
Save