|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomer.CrmCustomer; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomer.CrmCustomerFeign; |
|
|
|
import com.yxt.anrui.portal.api.sms.SmsFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
|
import com.yxt.anrui.portal.api.sysrole.SysRoleQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfo; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffinfo.SysStaffinfoVo; |
|
|
@ -123,7 +124,6 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
if (StringUtils.isNotBlank(query.getRoleSid())) { |
|
|
|
qw.eq("role.sid", query.getRoleSid()); |
|
|
|
} |
|
|
|
|
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
@ -131,7 +131,30 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
SysUserQuery query = pq.getParams(); |
|
|
|
QueryWrapper<SysUser> qw = createQueryWrapper(query); |
|
|
|
IPage<SysUser> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<SysUserVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
IPage<SysUserVo> pagging = baseMapper.selectPageVo(page, qw,query.getOrgName()); |
|
|
|
List<SysUserVo> records = pagging.getRecords(); |
|
|
|
for (SysUserVo record : records) { |
|
|
|
String departmentSid = record.getDepartmentSid(); |
|
|
|
String orgName = ""; |
|
|
|
if (StringUtils.isNotBlank(departmentSid)) { |
|
|
|
String[] split = departmentSid.split(","); |
|
|
|
for (String s : split) { |
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(s); |
|
|
|
//从本级部门信息中获取上级sid
|
|
|
|
String psid = sysOrganization.getPsid(); |
|
|
|
//从本级部门信息中获取本级部门名称
|
|
|
|
String bjName = sysOrganization.getName(); |
|
|
|
//获取上级sid获取上级部门信息
|
|
|
|
SysOrganization sysOrganization1 = sysOrganizationService.fetchBySid(psid); |
|
|
|
//从上级部门信息中获取上级部门名称
|
|
|
|
String sjName = sysOrganization1.getName(); |
|
|
|
orgName += sjName + "-" + bjName + ","; |
|
|
|
} |
|
|
|
orgName = orgName.substring(0, orgName.length() - 1); |
|
|
|
record.setDepartmentName(orgName); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<SysUserVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
@ -204,7 +227,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
return baseMapper.updatePassword(sid, password); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean updatePasswordApp(SysUser user, String oldPassword, String newPassword,String token) { |
|
|
|
public ResultBean updatePasswordApp(SysUser user, String oldPassword, String newPassword, String token) { |
|
|
|
String oldPasswordMd5 = Encodes.md5(oldPassword); |
|
|
|
if (!oldPasswordMd5.equals(user.getPassword())) { |
|
|
|
return ResultBean.fireFail().setMsg("原始密码输入错误"); |
|
|
@ -493,7 +516,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
* @param newPwd |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean resetPwdApp(String mobile, String newPwd,String token) { |
|
|
|
public ResultBean resetPwdApp(String mobile, String newPwd, String token) { |
|
|
|
if (!newPwd.matches("^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[a-zA-Z0-9]{8,10}$")) { |
|
|
|
return ResultBean.fireFail().setMsg("密码格式错误,必须为8至10位大小写字母和数字的组合"); |
|
|
|
} |
|
|
@ -507,7 +530,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
} |
|
|
|
int i = baseMapper.updatePassword(user.getSid(), newPwdMd5); |
|
|
|
if (i == 1) { |
|
|
|
if (StringUtils.isNotNull(token)){ |
|
|
|
if (StringUtils.isNotNull(token)) { |
|
|
|
redisUtil.remove(token); |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("修改成功"); |
|
|
|