| @@ -75,11 +75,11 @@ public class WxCUserController extends BaseController { | |||
| if (StringUtils.isEmpty(wxCUserFromBDto.getAppId())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端appId不能为空"); | |||
| } | |||
| if (wxCUserFromBDto.getBUserId() == null) { | |||
| if (wxCUserFromBDto.getUserId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "bUserId不能为空"); | |||
| } | |||
| //根据bUserId查询B端用户是否存在 | |||
| WxMerchantBUser bUser = wxMerchantBUserService.getById(wxCUserFromBDto.getBUserId()); | |||
| WxMerchantBUser bUser = wxMerchantBUserService.getById(wxCUserFromBDto.getUserId()); | |||
| if (bUser == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "B端用户不存在"); | |||
| } | |||
| @@ -121,7 +121,7 @@ public class WxCUserController extends BaseController { | |||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, wxCUserBasicInfo); | |||
| //新增来自B端的会员关联数据 | |||
| wxCUserFromB = new WxCUserFromB(); | |||
| wxCUserFromB.setBUserId(wxCUserFromBDto.getBUserId()); | |||
| wxCUserFromB.setBUserId(wxCUserFromBDto.getUserId()); | |||
| wxCUserFromB.setCUserId(wxCUserBasicInfo.getId()); | |||
| wxCUserFromB.setOpenid(wxCUserFromBDto.getOpenid()); | |||
| wxCUserFromB.setMerchantId(bUser.getMerchantId()); | |||
| @@ -151,7 +151,7 @@ public class WxCUserController extends BaseController { | |||
| wxCUserBasicInfoService.save(wxCUserBasicInfo); | |||
| //新增来自B端的会员关联数据 | |||
| wxCUserFromB = new WxCUserFromB(); | |||
| wxCUserFromB.setBUserId(wxCUserFromBDto.getBUserId()); | |||
| wxCUserFromB.setBUserId(wxCUserFromBDto.getUserId()); | |||
| wxCUserFromB.setCUserId(cUserId); | |||
| wxCUserFromB.setOpenid(wxCUserFromBDto.getOpenid()); | |||
| wxCUserFromB.setMerchantId(bUser.getMerchantId()); | |||
| @@ -217,8 +217,8 @@ public class WxCUserController extends BaseController { | |||
| if (StringUtils.isEmpty(wxCUserFromBDto.getAppId())) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端appid不能为空"); | |||
| } | |||
| if (wxCUserFromBDto.getBUserId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "bUserId不能为空"); | |||
| if (wxCUserFromBDto.getUserId() == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "B端userId不能为空"); | |||
| } | |||
| WxCUserFromB wxCUserFromB = wxCUserFromBService.getByOpenidAndAppId(wxCUserFromBDto); | |||
| if(wxCUserFromB!=null){ | |||
| @@ -10,8 +10,6 @@ import java.util.Date; | |||
| public class WxCUserFromBDto implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @io.swagger.annotations.ApiModelProperty(value="B端登录者ID",name="bUserId") | |||
| private Long bUserId; | |||
| @io.swagger.annotations.ApiModelProperty(value="C端openid",name="openid") | |||
| private String openid; | |||
| @io.swagger.annotations.ApiModelProperty(value="C端appid",name="appId") | |||
| @@ -28,4 +26,7 @@ public class WxCUserFromBDto implements Serializable { | |||
| private String phone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "B端登录者ID", name = "userId") | |||
| private Long userId; | |||
| } | |||
| @@ -3,7 +3,6 @@ package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxCUserFromBDto; | |||
| import com.iformall.domain.po.WxCUserFromB; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| @@ -14,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.UUID; | |||
| /** | |||
| * @author gongbiao | |||
| @@ -60,7 +58,7 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { | |||
| @Override | |||
| public WxCUserFromB getByOpenidAndAppId(WxCUserFromBDto wxCUserFromBDto) { | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(wxCUserFromBDto.getBUserId()); | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(wxCUserFromBDto.getUserId()); | |||
| if (wxMerchantBUser == null) { | |||
| return null; | |||
| } | |||
| @@ -71,7 +69,7 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { | |||
| @Override | |||
| public PageInfo<WxCUserFromB> listCUser(WxCUserFromBDto wxCUserFromBDto, Integer pageIndex, Integer pageSize) { | |||
| WxCUserFromB record = new WxCUserFromB(); | |||
| record.setBUserId(wxCUserFromBDto.getBUserId()); | |||
| record.setBUserId(wxCUserFromBDto.getUserId()); | |||
| return PageHelper.startPage(pageIndex, pageSize) | |||
| .doSelectPageInfo(() -> wxCUserFromBMapper.findList(record)); | |||
| } | |||