Commit a4533103 authored by hezhen's avatar hezhen

修改code

parent abdf1f46
......@@ -76,9 +76,10 @@ public class AuthController {
@RequestMapping(value = "/register", method = RequestMethod.POST)
public JSONObject register(@RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password)throws Exception{
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(username+"----require register...");
JSONObject data=appAuthService.register(username,mobilecode,password);
JSONObject data=appAuthService.register(username,mobilecode,password,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JwtAuthenticationRequest authenticationRequest=new JwtAuthenticationRequest();
authenticationRequest.setUsername(username);
......@@ -98,11 +99,12 @@ public class AuthController {
@RequestParam(value="openid",defaultValue="")String openid,
@RequestParam(value="unionid",defaultValue="")String unionid,
@RequestParam(value="type",defaultValue="0")Integer type,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code
)throws Exception{
log.info(username+"----require wxregister...");
JSONObject data=appAuthService.wxregister( username, mobilecode, password, nickname,
headimgurl, openid, unionid,type,isQQ);
headimgurl, openid, unionid,type,isQQ,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data");
if(result==null){
......
......@@ -28,13 +28,14 @@ public interface IUserService {
@RequestMapping(value = "/api/app/user/register", method = RequestMethod.POST)
public JSONObject register( @RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password);
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code")String code);
@RequestMapping(value = "/api/app/user/wxregister", method = RequestMethod.POST)
public JSONObject wxregister(
@RequestParam(value="username")String username,@RequestParam(value="mobilecode")String mobilecode,
@RequestParam(value="password")String password,@RequestParam(value="nickname")String nickname,
@RequestParam(value="headimgurl")String headimgurl,@RequestParam(value="openid")String openid,
@RequestParam(value="unionid")String unionid,@RequestParam(value="type")Integer type,@RequestParam(value="isQQ")Integer isQQ);
@RequestParam(value="unionid")String unionid,@RequestParam(value="type")Integer type,@RequestParam(value="isQQ")Integer isQQ,@RequestParam(value="code")String code);
@RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST)
public JSONObject checkBindWechat( @RequestParam(value="username")String username);
@RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST)
......
......@@ -10,8 +10,8 @@ public interface AuthService {
String refresh(String oldToken) throws Exception;
void validate(String token) throws Exception;
JSONObject sendsms(String username, Integer type) throws Exception;
JSONObject register(String username, String mobilecode, String password) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception;
JSONObject register(String username, String mobilecode, String password,String code) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception;
JSONObject checkBindWechat(String username) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type) throws Exception;
......
......@@ -51,13 +51,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public JSONObject register(String username, String mobilecode, String password) throws Exception {
return userService.register(username,mobilecode,password);
public JSONObject register(String username, String mobilecode, String password,String code) throws Exception {
return userService.register(username,mobilecode,password,code);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code);
}
@Override
......
......@@ -50,13 +50,13 @@ public class AuthServiceImpl implements AuthService {
return userService.sendsms(username,type);
}
@Override
public JSONObject register(String username, String mobilecode, String password) throws Exception {
return userService.register(username,mobilecode,password);
public JSONObject register(String username, String mobilecode, String password,String code) throws Exception {
return userService.register(username,mobilecode,password,code);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code);
}
@Override
......
......@@ -37,7 +37,7 @@ public interface ActivityFeign {
public ObjectRestResponse cancelUse(@RequestParam(value = "TickerNo",defaultValue ="" ) String TickerNo);
@ApiOperation("新人有礼参加活动")
@RequestMapping(value = "/user", method = RequestMethod.POST)
@RequestMapping(value = "/join/user", method = RequestMethod.POST)
public ObjectRestResponse join(@RequestParam(value = "userId",defaultValue ="0" ) Integer userId);
}
......@@ -45,7 +45,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
userJoin.setActivityId(activityId);
userJoin.setUserId(userId);
Long num=selectCount(userJoin);
if(num!=null||num>0){
if(num!=null&&num>0){
log.error("----用户已经参与活动----userId===="+userId);
return;
}
......@@ -63,11 +63,15 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
ActivityUserJoin userJoin = new ActivityUserJoin();
userJoin.setActivityId(activityId);
userJoin.setUserId(userId);
Long num = selectCount(userJoin);
if (num == null || num == 0) {
userJoin= selectOne(userJoin);
if (userJoin == null ) {
log.error("----用户没有此参与活动----userId====" + userId);
return;
}
if(userJoin.getStatus()!=0){
log.error("----用户已领取----userId====" + userId);
return;
}
String value=rule.getValue();
JSONObject json=JSONObject.parseObject(value);
if(json!=null){
......@@ -81,8 +85,9 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
}
}
userJoin.setStatus(1);
updateById(userJoin);
}
......
......@@ -29,7 +29,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/list/{type}", method = RequestMethod.GET)
public ObjectRestResponse list(@PathVariable Integer type) {
AppUserDTO userInfo = getUserInfo();
Integer userId = userInfo.getId();
Integer userId = userInfo.getUserid();
if(userId==null){
return ObjectRestResponse.createDefaultFail();
}
......@@ -66,7 +66,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/coupon/led", method = RequestMethod.POST)
public ObjectRestResponse led() {
AppUserDTO userInfo = getUserInfo();
Integer userId = userInfo.getId();
Integer userId = userInfo.getUserid();
if (userId == null) {
return ObjectRestResponse.createDefaultFail();
}
......
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