|
|
@ -10,7 +10,6 @@ package com.elink.esua.epdc.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import cn.hutool.core.collection.CollUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; |
|
|
import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
@ -61,8 +60,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
private SysRoleUserService sysRoleUserService; |
|
|
private SysRoleUserService sysRoleUserService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysDeptService sysDeptService; |
|
|
private SysDeptService sysDeptService; |
|
|
@Autowired |
|
|
|
|
|
private UserRelationFeignClient userRelationFeignClient; |
|
|
|
|
|
@Resource |
|
|
@Resource |
|
|
private SysDeptDao sysDeptDao; |
|
|
private SysDeptDao sysDeptDao; |
|
|
@Resource |
|
|
@Resource |
|
|
@ -264,9 +261,9 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
staffEntity.setActiveFlag("active"); |
|
|
staffEntity.setActiveFlag("active"); |
|
|
staffEntity.setActiveTime(new Date()); |
|
|
staffEntity.setActiveTime(new Date()); |
|
|
staffEntity.setEnableFlag("enable"); |
|
|
staffEntity.setEnableFlag("enable"); |
|
|
if(StringUtils.isEmpty(entity.getPassword())){ |
|
|
if (StringUtils.isEmpty(entity.getPassword())) { |
|
|
staffEntity.setPassword(PasswordUtils.encode(sysUserEntity.getPassword())); |
|
|
staffEntity.setPassword(PasswordUtils.encode(sysUserEntity.getPassword())); |
|
|
}else { |
|
|
} else { |
|
|
staffEntity.setPassword(PasswordUtils.encode(entity.getPassword())); |
|
|
staffEntity.setPassword(PasswordUtils.encode(entity.getPassword())); |
|
|
} |
|
|
} |
|
|
customerStaffDao.insert(staffEntity); |
|
|
customerStaffDao.insert(staffEntity); |
|
|
@ -286,7 +283,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
wrapper.eq("STAFF_ID", dto.getId().toString()); |
|
|
wrapper.eq("STAFF_ID", dto.getId().toString()); |
|
|
StaffOrgRelationEntity staffOrgRelationEntity = staffOrgRelationDao.selectOne(wrapper); |
|
|
StaffOrgRelationEntity staffOrgRelationEntity = staffOrgRelationDao.selectOne(wrapper); |
|
|
String typeKey = deptEntity.getTypeKey(); |
|
|
String typeKey = deptEntity.getTypeKey(); |
|
|
if(staffOrgRelationEntity==null){ |
|
|
if (staffOrgRelationEntity == null) { |
|
|
StaffOrgRelationEntity orgRelationEntity = new StaffOrgRelationEntity(); |
|
|
StaffOrgRelationEntity orgRelationEntity = new StaffOrgRelationEntity(); |
|
|
orgRelationEntity.setId(entity.getId().toString()); |
|
|
orgRelationEntity.setId(entity.getId().toString()); |
|
|
orgRelationEntity.setCustomerId(sysDictEntity.getDictValue()); |
|
|
orgRelationEntity.setCustomerId(sysDictEntity.getDictValue()); |
|
|
@ -301,7 +298,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
orgRelationEntity.setOrgType("agency"); |
|
|
orgRelationEntity.setOrgType("agency"); |
|
|
} |
|
|
} |
|
|
staffOrgRelationDao.insert(orgRelationEntity); |
|
|
staffOrgRelationDao.insert(orgRelationEntity); |
|
|
}else { |
|
|
} else { |
|
|
staffOrgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); |
|
|
staffOrgRelationEntity.setPids(StringUtils.join(StringUtils.split(deptEntity.getPids(), ","), ":")); |
|
|
staffOrgRelationEntity.setOrgId(deptEntity.getId().toString()); |
|
|
staffOrgRelationEntity.setOrgId(deptEntity.getId().toString()); |
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { |
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(typeKey)) { |
|
|
@ -734,12 +731,11 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit |
|
|
@Override |
|
|
@Override |
|
|
public Result getAppMenu(AppUserIdMenuDTO dto) { |
|
|
public Result getAppMenu(AppUserIdMenuDTO dto) { |
|
|
// 是否有菜单权限 :0:否;1:是
|
|
|
// 是否有菜单权限 :0:否;1:是
|
|
|
Integer flag = 0; |
|
|
int flag = 0; |
|
|
List<String> list = baseDao.getAppMenu(dto); |
|
|
List<Long> list = baseDao.getAppMenu(dto); |
|
|
if(list != null && list.size() > 0){ |
|
|
if (CollUtil.isNotEmpty(list) && list.contains(dto.getGridId()) && list.contains(Long.parseLong(dto.getDeptId()))) { |
|
|
flag = 1; |
|
|
flag = 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return new Result().ok(flag); |
|
|
return new Result().ok(flag); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|