平台超管密码

master
shijie 4 years ago
parent d6ab84c4f6
commit b508824cc7
  1. 4
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java
  2. 7
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  3. 7
      dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml

@ -33,4 +33,8 @@ public interface UserLoginDao extends BaseMapper<UserEntity> {
Integer countWeChatId(String weChatId); Integer countWeChatId(String weChatId);
String getNameByUserId(Long userId); String getNameByUserId(Long userId);
UserEntity selectByManagerId();
int updateManagePassword(String newMD5);
} }

@ -228,7 +228,8 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
} }
//根据手机号查询相关信息 //根据手机号查询相关信息
UserEntity userEntity = baseMapper.selectByPhoneAccount(user.getPhoneAccount()); //UserEntity userEntity = baseMapper.selectByPhoneAccount(user.getPhoneAccount());
UserEntity userEntity=baseMapper.selectByManagerId();
if(userEntity == null){ if(userEntity == null){
ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EXIST); ExceptionCast.cast(HrmsCode.PHNOE_ACCOUNT_NOT_EXIST);
} }
@ -249,8 +250,8 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
} }
String newMD5 = Md5Util.md5(user.getNewPwd()+userEntity.getId()); String newMD5 = Md5Util.md5(user.getNewPwd()+userEntity.getId());
//根据手机号码修改密码 //修改平台超管密码
int i = userLoginDao.updatePasswordByPhoneAccount(user.getPhoneAccount(),newMD5); int i = userLoginDao.updateManagePassword(newMD5);
return i > 0; return i > 0;
} }

@ -66,5 +66,12 @@
<select id="getNameByUserId" parameterType="long" resultType="string"> <select id="getNameByUserId" parameterType="long" resultType="string">
SELECT `name` FROM hrms_employee WHERE user_id = #{userId} SELECT `name` FROM hrms_employee WHERE user_id = #{userId}
</select> </select>
<select id="selectByManagerId" resultType="com.daqing.framework.domain.hrms.UserEntity">
select * from hrms_user where id=1
</select>
<update id="updateManagePassword">
update hrms_user set password = #{password} where id=1
</update>
</mapper> </mapper>
Loading…
Cancel
Save