| @@ -191,13 +191,19 @@ public class WxCUserController extends BaseController { | |||||
| @PostMapping("/findUserInfo") | @PostMapping("/findUserInfo") | ||||
| @ApiOperation(value = "获取会员信息", notes = "") | @ApiOperation(value = "获取会员信息", notes = "") | ||||
| public ResultData findUserInfo(@RequestBody WxCUserFromBDto wxCUserFromBDto) { | public ResultData findUserInfo(@RequestBody WxCUserFromBDto wxCUserFromBDto) { | ||||
| logger.info("WxCUserController::updateUserInfo"); | |||||
| logger.info("WxCUserController::findUserInfo"); | |||||
| if (wxCUserFromBDto == null) { | if (wxCUserFromBDto == null) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "没有传入用户信息"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "没有传入用户信息"); | ||||
| } | } | ||||
| if (StringUtils.isEmpty(wxCUserFromBDto.getOpenid())) { | if (StringUtils.isEmpty(wxCUserFromBDto.getOpenid())) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端openid不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "C端openid不能为空"); | ||||
| } | } | ||||
| 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不能为空"); | |||||
| } | |||||
| WxCUserFromB wxCUserFromB = wxCUserFromBService.getByOpenidAndAppId(wxCUserFromBDto); | WxCUserFromB wxCUserFromB = wxCUserFromBService.getByOpenidAndAppId(wxCUserFromBDto); | ||||
| if(wxCUserFromB!=null){ | if(wxCUserFromB!=null){ | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(wxCUserFromB.getcUserId()); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(wxCUserFromB.getcUserId()); | ||||
| @@ -23,6 +23,8 @@ public class WxCUserFromBDto implements Serializable { | |||||
| private String address; | private String address; | ||||
| @io.swagger.annotations.ApiModelProperty(value="C端会员手机号",name="phone") | @io.swagger.annotations.ApiModelProperty(value="C端会员手机号",name="phone") | ||||
| private String phone; | private String phone; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId") | |||||
| private Long merchantId; | |||||
| public Long getbUserId() { | public Long getbUserId() { | ||||
| return bUserId; | return bUserId; | ||||
| @@ -87,4 +89,12 @@ public class WxCUserFromBDto implements Serializable { | |||||
| public void setAppId(String appId) { | public void setAppId(String appId) { | ||||
| this.appId = appId; | this.appId = appId; | ||||
| } | } | ||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long merchantId) { | |||||
| this.merchantId = merchantId; | |||||
| } | |||||
| } | } | ||||
| @@ -6,7 +6,9 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxCUserFromBDto; | import com.iformall.domain.dto.WxCUserFromBDto; | ||||
| import com.iformall.domain.po.WxCUserFromB; | import com.iformall.domain.po.WxCUserFromB; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | |||||
| import com.iformall.mapper.WxCUserFromBMapper; | import com.iformall.mapper.WxCUserFromBMapper; | ||||
| import com.iformall.mapper.WxMerchantBUserMapper; | |||||
| import com.iformall.service.WxCUserFromBService; | import com.iformall.service.WxCUserFromBService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -23,6 +25,8 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { | |||||
| @Autowired | @Autowired | ||||
| WxCUserFromBMapper wxCUserFromBMapper; | WxCUserFromBMapper wxCUserFromBMapper; | ||||
| @Autowired | |||||
| WxMerchantBUserMapper wxMerchantBUserMapper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxCUserFromB> listAsPage(WxCUserFromB record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCUserFromB> listAsPage(WxCUserFromB record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -56,6 +60,11 @@ public class WxCUserFromBServiceImpl implements WxCUserFromBService { | |||||
| @Override | @Override | ||||
| public WxCUserFromB getByOpenidAndAppId(WxCUserFromBDto wxCUserFromBDto) { | public WxCUserFromB getByOpenidAndAppId(WxCUserFromBDto wxCUserFromBDto) { | ||||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(wxCUserFromBDto.getbUserId()); | |||||
| if (wxMerchantBUser == null) { | |||||
| return null; | |||||
| } | |||||
| wxCUserFromBDto.setMerchantId(wxMerchantBUser.getMerchantId()); | |||||
| return wxCUserFromBMapper.getByOpenidAndAppId(wxCUserFromBDto); | return wxCUserFromBMapper.getByOpenidAndAppId(wxCUserFromBDto); | ||||
| } | } | ||||
| @@ -44,10 +44,11 @@ | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCUserFromB" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxCUserFromB" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns" /> from wx_c_user_from_b | select <include refid="allColumns" /> from wx_c_user_from_b | ||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| order by id desc | |||||
| </select> | </select> | ||||
| <select id="getByOpenidAndAppId" resultMap="BaseResultMap" parameterType="com.iformall.domain.dto.WxCUserFromBDto"> | <select id="getByOpenidAndAppId" resultMap="BaseResultMap" parameterType="com.iformall.domain.dto.WxCUserFromBDto"> | ||||
| select * from wx_c_user_from_b where app_id=#{appId} and openid=#{openid} | |||||
| select * from wx_c_user_from_b where app_id=#{appId} and openid=#{openid} and merchant_id=#{merchantId} | |||||
| </select> | </select> | ||||