fix
This commit is contained in:
@@ -7,6 +7,7 @@ import com.starry.admin.modules.custom.module.vo.PlayCustomRankingQueryVo;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomRankingReturnVo;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomUserQueryVo;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomUserReturnVo;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
@@ -121,5 +122,5 @@ public interface IPlayCustomUserInfoService extends IService<PlayCustomUserInfoE
|
||||
|
||||
List<PlayCustomUserInfoEntity> simpleList();
|
||||
|
||||
void saveOrderTime(String id);
|
||||
void saveOrderInfo(PlayOrderInfoEntity entity);
|
||||
}
|
||||
|
||||
@@ -284,12 +284,14 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl<PlayCustomUserInf
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrderTime(String id) {
|
||||
public void saveOrderInfo(PlayOrderInfoEntity entity) {
|
||||
String id = entity.getPurchaserBy();
|
||||
LambdaUpdateWrapper<PlayCustomUserInfoEntity> wrapper = Wrappers.lambdaUpdate(PlayCustomUserInfoEntity.class).eq(PlayCustomUserInfoEntity::getId, id).set(PlayCustomUserInfoEntity::getLastPurchaseTime, new Date());
|
||||
PlayCustomUserInfoEntity userInfoEntity = selectById(id);
|
||||
if(Objects.isNull(userInfoEntity.getFirstPurchaseTime())){
|
||||
wrapper.set(PlayCustomUserInfoEntity::getFirstPurchaseTime,new Date());
|
||||
}
|
||||
wrapper.set(PlayCustomUserInfoEntity::getWeiChatCode,entity.getWeiChatCode());
|
||||
this.update(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, P
|
||||
entity.setOrderStartTime(LocalDateTime.now());
|
||||
entity.setOrderEndTime(LocalDateTime.now());
|
||||
}
|
||||
userInfoService.saveOrderTime(purchaserBy);
|
||||
userInfoService.saveOrderInfo(entity);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.starry.admin.common.exception.ServiceException;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clerk.service.IPlayClerkLevelInfoService;
|
||||
@@ -11,6 +11,7 @@ import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomLevelInfoService;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
||||
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
||||
@@ -92,6 +93,7 @@ public class WxOauthService {
|
||||
WxOAuth2AccessToken token = getWxOAuth2AccessToken(code);
|
||||
String openId = getOpenId(token);
|
||||
WxOAuth2UserInfo userInfo = getWxOAuth2UserInfo(token);
|
||||
log.info("微信登录返回用户信息:" + JSONObject.toJSONString(userInfo));
|
||||
PlayCustomUserInfoEntity entity = ConvertUtil.entityToVo(userInfo, PlayCustomUserInfoEntity.class);
|
||||
entity.setAvatar(userInfo.getHeadImgUrl());
|
||||
PlayCustomUserInfoEntity item = customUserInfoService.selectByOpenid(openId);
|
||||
|
||||
Reference in New Issue
Block a user