c端用户

This commit is contained in:
wangxiaopeng
2024-03-20 20:47:11 +08:00
parent b07be9cde8
commit cab0b90e38
8 changed files with 255 additions and 12 deletions

View File

@@ -10,6 +10,7 @@ import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.UserChannelEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.WechatRest;
import com.cool.store.mapper.HyPartnerUserChannelMapper;
import com.cool.store.request.MobileUpdateRequest;
import com.cool.store.service.WechatMiniAppService;
import com.cool.store.utils.RedisUtilPool;
@@ -17,11 +18,13 @@ import com.cool.store.utils.UUIDUtils;
import com.cool.store.vo.PartnerUserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.Objects;
/**
* @author zhangchenbiao
@@ -39,6 +42,10 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
private WechatRest wechatRest;
@Resource
private HyPartnerUserInfoDAO hyPartnerUserInfoDAO;
@Autowired
private HyPartnerUserChannelMapper hyPartnerUserChannelMapper;
@Resource
private LineInfoDAO lineInfoDAO;
@Resource
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@Value("${weixin.appId}")
@@ -106,6 +113,12 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
}else {
if (StringUtils.isNumeric(userChannel)) {
channelId = Integer.valueOf(userChannel);
HyPartnerUserChannelDO hyPartnerUserChannelDO = hyPartnerUserChannelMapper.selectByChannelId(Long.valueOf(channelId));
if (Objects.isNull(hyPartnerUserChannelDO)|| hyPartnerUserChannelDO.getChannelId() == null ) {
//用户渠道不存在
throw new ServiceException(ErrorCodeEnum.USER_CHANNEL_NOT_EXISTS);
}
}
}
}
@@ -117,6 +130,11 @@ public class WechatMiniAppServiceImpl implements WechatMiniAppService {
}
}
BeanUtil.copyProperties(hyPartnerUserInfoDO, userInfoVO);
/*LineInfoDO lineInfoDO = lineInfoDAO.getByPartnerId(hyPartnerUserInfoDO.getPartnerId());
if (lineInfoDO != null){
userInfoVO.setPartnerLineId(lineInfoDO.getId());
userInfoVO.setLineStatus(lineInfoDO.getLineStatus());
}*/
}
userInfoVO.setOpenid(openid);
userInfoVO.setUnionId(unionId);