|
|
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.dto.WxCUserBasicInfoDto; |
|
|
|
import com.iformall.domain.dto.WxCUserBasicInfoFilterDto; |
|
|
@@ -15,6 +17,7 @@ import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.po.msg.FmInsideBasicUserPushMsg; |
|
|
|
import com.iformall.domain.vo.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.mq.MqBaseProducer; |
|
|
|
import com.iformall.service.*; |
|
|
@@ -687,8 +690,9 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc |
|
|
|
|
|
|
|
@Override |
|
|
|
public WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl) { |
|
|
|
if (StringUtils.isBlank(phone)) |
|
|
|
return null; |
|
|
|
if (StringUtils.isBlank(phone)){ |
|
|
|
throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号为空"); |
|
|
|
} |
|
|
|
|
|
|
|
WxCUserBasicInfo basicInfo = this.findInfoByPhone(tenantEntity, phone); |
|
|
|
if(basicInfo == null){ |
|
|
@@ -702,14 +706,26 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc |
|
|
|
basicInfo.setAvatarUrl(avatarUrl); |
|
|
|
this.save(basicInfo); |
|
|
|
}else{ |
|
|
|
WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo(); |
|
|
|
wxCUserBasicInfo.setId(basicInfo.getId()); |
|
|
|
wxCUserBasicInfo.setFinalTenantId(basicInfo.getFinalTenantId()); |
|
|
|
wxCUserBasicInfo.setName(name); |
|
|
|
wxCUserBasicInfo.setNickName(nickName); |
|
|
|
wxCUserBasicInfo.setSex(sex); |
|
|
|
wxCUserBasicInfo.setAvatarUrl(avatarUrl); |
|
|
|
wxCUserBasicInfoMapper.updateById(wxCUserBasicInfo); |
|
|
|
WxCUserBasicInfo basicInfoUpd = new WxCUserBasicInfo(); |
|
|
|
basicInfoUpd.setId(basicInfo.getId()); |
|
|
|
basicInfoUpd.setFinalTenantId(basicInfo.getFinalTenantId()); |
|
|
|
if(StringUtils.isNotBlank(name)){ |
|
|
|
basicInfoUpd.setName(name); |
|
|
|
basicInfo.setName(name); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(nickName)){ |
|
|
|
basicInfoUpd.setNickName(nickName); |
|
|
|
basicInfo.setNickName(nickName); |
|
|
|
} |
|
|
|
if(sex != null){ |
|
|
|
basicInfoUpd.setSex(sex); |
|
|
|
basicInfo.setSex(sex); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(avatarUrl)){ |
|
|
|
basicInfoUpd.setAvatarUrl(avatarUrl); |
|
|
|
basicInfo.setAvatarUrl(avatarUrl); |
|
|
|
} |
|
|
|
wxCUserBasicInfoMapper.updateById(basicInfoUpd); |
|
|
|
} |
|
|
|
|
|
|
|
return basicInfo; |
|
|
|