|
@@ -13,6 +13,7 @@ import com.ylx.common.core.domain.AjaxResult;
|
|
|
import com.ylx.common.core.domain.model.WxLoginUser;
|
|
|
import com.ylx.common.enums.BusinessType;
|
|
|
import com.ylx.common.utils.MessageUtils;
|
|
|
+import com.ylx.common.utils.StringUtils;
|
|
|
import com.ylx.common.utils.file.FileUploadUtils;
|
|
|
import com.ylx.framework.manager.AsyncManager;
|
|
|
import com.ylx.framework.manager.factory.AsyncFactory;
|
|
@@ -300,17 +301,20 @@ public class WeSqController extends BaseController {
|
|
|
LambdaQueryWrapper<TWxUser> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
objectLambdaQueryWrapper.eq(TWxUser::getcOpenid, openid);
|
|
|
TWxUser user = wxUserService.getOne(objectLambdaQueryWrapper);
|
|
|
- if (user == null || user.getcNickName() == null) {
|
|
|
- user = new TWxUser();
|
|
|
+ if (user == null || StringUtils.isEmpty(user.getcNickName())) {
|
|
|
+ if(user == null){
|
|
|
+ user = new TWxUser();
|
|
|
+ user.setcOpenid(openid);
|
|
|
+ TWxUser finalUser = user;
|
|
|
+ //异步 添加新人优惠卷
|
|
|
+ threadPoolTaskExecutor.submit(() -> couponReceiveService.submit(new CouponReceive().setOpenid(finalUser.getcOpenid()).setCouponId("1")));
|
|
|
+ }
|
|
|
user.setcOpenid(openid);
|
|
|
user.setcNickName(jsonObject.get("nickname").toString());
|
|
|
user.setcIcon(jsonObject.get("headimgurl").toString());
|
|
|
user.setcSessionKey(refreshToken);
|
|
|
// user.setcPhone(phoneNumber);
|
|
|
wxUserService.saveOrUpdate(user);
|
|
|
- //异步 添加新人优惠卷
|
|
|
- TWxUser finalUser = user;
|
|
|
- threadPoolTaskExecutor.submit(() -> couponReceiveService.submit(new CouponReceive().setOpenid(finalUser.getcOpenid()).setCouponId("1")));
|
|
|
user.setId(user.getId());
|
|
|
}
|
|
|
|