|
@@ -64,7 +64,7 @@ public class SysUserCompanyServiceImpl extends ServiceImpl<SysUserCompanyMapper,
|
|
sysUserCompany.setCompanyName(companyName);
|
|
sysUserCompany.setCompanyName(companyName);
|
|
|
|
|
|
|
|
|
|
- SysUserCompany userCompany = sysUserCompanyMapper.getCompany(sysUserCompany.getCompanyName(),sysUserCompany.getCompanyCode());
|
|
|
|
|
|
+ SysUserCompany userCompany = sysUserCompanyMapper.getCompany(sysUserCompany.getCompanyName(), sysUserCompany.getCompanyCode());
|
|
if (null != userCompany) {
|
|
if (null != userCompany) {
|
|
return Result.error("公司已经存在,请勿重复添加");
|
|
return Result.error("公司已经存在,请勿重复添加");
|
|
}
|
|
}
|
|
@@ -87,22 +87,26 @@ public class SysUserCompanyServiceImpl extends ServiceImpl<SysUserCompanyMapper,
|
|
String id = sysUserCompany.getId();
|
|
String id = sysUserCompany.getId();
|
|
SysUserCompany byId = this.getById(id);
|
|
SysUserCompany byId = this.getById(id);
|
|
String companyCode1 = byId.getCompanyCode();
|
|
String companyCode1 = byId.getCompanyCode();
|
|
- SysUser user = sysUserService.getUserbyUsername(companyCode1);
|
|
|
|
|
|
|
|
- String salt = oConvertUtils.randomGen(8);
|
|
|
|
- user.setSalt(salt);
|
|
|
|
- String passwordEncode = PasswordUtil.encrypt(companyCode, password, salt);
|
|
|
|
|
|
+ if (!password.equals(byId.getPassword())) {
|
|
|
|
+ SysUser user = sysUserService.getUserbyUsername(companyCode1);
|
|
|
|
+ String salt = oConvertUtils.randomGen(8);
|
|
|
|
+ user.setSalt(salt);
|
|
|
|
+ String passwordEncode = PasswordUtil.encrypt(companyCode, password, salt);
|
|
|
|
+ sysUserCompany.setPassword(passwordEncode);
|
|
|
|
+ user.setYzh(yzh);
|
|
|
|
+ user.setRealname(companyName);
|
|
|
|
+ user.setUsername(companyCode);
|
|
|
|
+ user.setPassword(passwordEncode);
|
|
|
|
+ sysUserService.editUser(user, "1671322266401476610", null);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
- sysUserCompany.setPassword(passwordEncode);
|
|
|
|
sysUserCompany.setCompanyName(companyName);
|
|
sysUserCompany.setCompanyName(companyName);
|
|
sysUserCompany.setCompanyCode(companyCode);
|
|
sysUserCompany.setCompanyCode(companyCode);
|
|
|
|
|
|
- user.setYzh(yzh);
|
|
|
|
- user.setRealname(companyName);
|
|
|
|
- user.setUsername(companyCode);
|
|
|
|
- user.setPassword(passwordEncode);
|
|
|
|
|
|
+
|
|
sysUserCompanyMapper.updateById(sysUserCompany);
|
|
sysUserCompanyMapper.updateById(sysUserCompany);
|
|
- sysUserService.editUser(user, "1671322266401476610", null);
|
|
|
|
|
|
|
|
|
|
|
|
return Result.ok("操作成功");
|
|
return Result.ok("操作成功");
|