private SysUser modifyPoByDTO(IBaseDTO dto) { SysUser su = (SysUser) dao.loadEntity(SysUser.class, dto.get("userId").toString()); // su.setUserId(null !=dto.get("userId") && !"".equals("userId")? // dto.get("userId").toString():""); SysRole sr = new SysRole(); sr.setId(dto.get("sysRole").toString()); su.setSysRole(sr); SysGroup sg = new SysGroup(); sg.setId(dto.get("sysGroup").toString()); su.setSysGroup(sg); su.setPassword( null != dto.get("password") && !"".equals("password") ? dto.get("password").toString() : ""); SysDepartment sd = new SysDepartment(); if (null != dto.get("departmentId") && !"".equals("departmentId")) sd.setId(dto.get("departmentId").toString()); su.setSysDepartment(sd); su.setUserName( null != dto.get("userName") && !"".equals("userName") ? dto.get("userName").toString() : ""); su.setDeleteMark( null != dto.get("freezeMark") && !"".equals("freezeMark") ? dto.get("freezeMark").toString() : ""); su.setRemark( null != dto.get("remark") && !"".equals("remark") ? dto.get("remark").toString() : ""); // su.setIsSys("0"); return su; }
private SysUser createPoByDTO(IBaseDTO dto) { SysUser su = new SysUser(); su.setUserId( null != dto.get("userId") && !"".equals("userId") ? dto.get("userId").toString() : ""); SysRole sr = new SysRole(); sr.setId(dto.get("sysRole").toString()); su.setSysRole(sr); SysGroup sg = new SysGroup(); sg.setId(dto.get("sysGroup").toString()); su.setSysGroup(sg); Password_encrypt pe = new Password_encrypt(); su.setPassword( null != dto.get("password") && !"".equals("password") ? pe.pw_encrypt(dto.get("password").toString()) : ""); SysDepartment sd = new SysDepartment(); if (null != dto.get("departmentId") && !"".equals("departmentId")) sd.setId(dto.get("departmentId").toString()); su.setSysDepartment(sd); su.setUserName( null != dto.get("userName") && !"".equals("userName") ? dto.get("userName").toString() : ""); su.setDeleteMark( null != dto.get("freezeMark") && !"".equals("freezeMark") ? dto.get("freezeMark").toString() : ""); su.setRemark( null != dto.get("remark") && !"".equals("remark") ? dto.get("remark").toString() : ""); su.setIsSys("0"); return su; }