Browse Source

update

feature/dangjian
YUJT 4 years ago
parent
commit
7dbc2a267b
  1. 2
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java
  2. 18
      esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java
  3. 18
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml

2
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/dao/SysUserDao.java

@ -172,5 +172,5 @@ public interface SysUserDao extends BaseDao<SysUserEntity> {
void updateTotalUserDepartmentBatch(@Param("ids") List<String> customerDepartmentIds); void updateTotalUserDepartmentBatch(@Param("ids") List<String> customerDepartmentIds);
void updateTotalUserAgencyBatch(@Param("ids") List<String> customerAgencyIds); void updateTotalUserAgencyBatch(@Param("ids") List<String> customerAgencyIds);
List<String> getAppMenu(AppUserIdMenuDTO dto); List<Long> getAppMenu(AppUserIdMenuDTO dto);
} }

18
esua-epdc/epdc-admin/epdc-admin-server/src/main/java/com/elink/esua/epdc/service/impl/SysUserServiceImpl.java

@ -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);
} }

18
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml

@ -302,18 +302,14 @@
#{id} #{id}
</foreach> </foreach>
</update> </update>
<select id="getAppMenu" parameterType="com.elink.esua.epdc.dto.AppUserIdMenuDTO" resultType="java.lang.String"> <select id="getAppMenu" parameterType="com.elink.esua.epdc.dto.AppUserIdMenuDTO" resultType="java.lang.Long">
SELECT SELECT
sd.name sd.id
FROM sys_dept sd FROM
left join sys_dict dict on sd.PID = dict.dict_value and dict.pid != '0' sys_dept sd
where sd.del_flag = 0 WHERE
and dict.del_flag = 0 sd.pid IN ( SELECT dict.dict_value FROM sys_dict dict WHERE dict.dict_type = 'xlroute_testrun' AND dict.pid != '0' )
and dict.ID is not null AND sd.del_flag = 0
and dict.dict_type = 'xlroute_testrun'
and sd.ID = #{deptId}
and sd.ID = #{gridId}
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save