Commit b07481d2 authored by hezhen's avatar hezhen

123

parent 0e5a177a
......@@ -106,19 +106,12 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
}
Integer userid=entity.getUserid();
AppUserLogin appUserLogin=new AppUserLogin();
if (StringUtils.isNotBlank(userVo.getWxOpenid())){
appUserLogin.setWxOpenid(userVo.getWxOpenid());
appUserLogin.setUnionid(userVo.getUnionid());
}
if (StringUtils.isNotBlank(userVo.getOpenid())){
appUserLogin.setOpenid(userVo.getOpenid());
}
if (appUserLogin!=null){
appUserLogin.setId(userid);
appUserLogin.setUsername(userVo.getUsername());
userLoginBiz.updateSelectiveById(appUserLogin);
}
userLoginBiz.bindOpenid(appUserLogin);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -48,6 +48,11 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
super.updateSelectiveById(entity);
}
@CacheClear(pre = "user{1.username}")
public int bindOpenid(AppUserLogin entity) {
return mapper.bindOpenId(entity);
}
@CacheClear(pre = "user{1.username}")
public void updatePasswordById(AppUserLogin entity) {
String password = new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(entity.getPassword());
......
......@@ -146,14 +146,14 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
if (freeDays > 0 && freeDays >= days) {
freeDays = freeDays - days;
baseUserMember.setRentFreeDays(freeDays);
}
Integer payCount = userMemberVo.getPayCount() == null ? 0 : userMemberVo.getPayCount();
if (days > 0) {
/* if (days > 0) {
payCount = payCount + 1;
}
}*/
baseUserMember.setPayCount(payCount);
getMyBiz().updateSelectiveById(baseUserMember);
num = freeDays;
}
} else if (type == 2) {
/*Integer payCount=userMemberVo.getPayCount()==null?0:userMemberVo.getPayCount();
payCount=payCount+1;
......
......@@ -22,4 +22,6 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList
void updateLoginUserInfoById(@Param("userId") Integer userId,@Param("ip") String ip, @Param("lastTime") long lastTime);
List<AppUserLogin> selectbyPhones(@Param("phones") List<String> phones);
int bindOpenId(AppUserLogin appUserLogin);
}
\ No newline at end of file
......@@ -8,4 +8,8 @@
#{phone}
</foreach>
</select>
<update id="bindOpenId" parameterType="com.github.wxiaoqi.security.admin.entity.AppUserLogin">
UPDATE app_user_login SET wx_openid=#{wxOpenid},unionid=#{unionid},openid=#{openid} where id=#{id}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment