Commit 700bc693 authored by libin's avatar libin

钱包

parent 6ce02a22
......@@ -9,6 +9,8 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.ParseException;
......@@ -107,5 +109,10 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
return isToday;
}
@Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
public int createWalletByUserId(Integer userId){
MyWallet myWallet = new MyWallet();
myWallet.setUserId(userId);
return mapper.insertSelective(myWallet);
}
}
\ No newline at end of file
......@@ -38,12 +38,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.concurrent.TimeUnit;
......@@ -76,6 +74,9 @@ public class AppPermissionService {
@Resource
private RegionFeign regionFeign;
@Autowired
private MyWaterBiz walletBiz;
private BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(12);
@Autowired
private RedisTemplate userRedisTemplate;
......@@ -264,6 +265,8 @@ public class AppPermissionService {
insertUserMemberByUserIdAndPhone(userid, username);
//自动登录获取优惠卷
authCoupn(userid);
//创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname);
// 到im注册,获取返回结果
......@@ -794,6 +797,8 @@ public class AppPermissionService {
relationBiz.bindByUserId(userid, small_id);
//发送短信通知用户
thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE);
//创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname);
// 到im注册,获取返回结果
......
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