Procházet zdrojové kódy

[b端][添加]:新增b端用户详情接口

release_toaliyun_real
hupeng před 7 roky
rodič
revize
774bf3d90b
3 změnil soubory, kde provedl 56 přidání a 5 odebrání
  1. +38
    -0
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java
  2. +7
    -2
      mallinkService/src/main/java/com/simple/service/WxMallService.java
  3. +11
    -3
      mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java

+ 38
- 0
mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java Zobrazit soubor

@@ -4,6 +4,10 @@ import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import com.simple.annotation.AuthIgnore; import com.simple.annotation.AuthIgnore;
import com.simple.common.ErrorCode; import com.simple.common.ErrorCode;
import com.simple.domain.po.WxMall;
import com.simple.domain.po.WxMerchant;
import com.simple.service.WxMallService;
import com.simple.service.WxMerchantService;
import com.simple.utils.IPUtil; import com.simple.utils.IPUtil;
import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxErrorException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -38,6 +42,40 @@ public class WxMerchantBUserController extends BaseController
@Autowired @Autowired
private WxMerchantBUserService wxMerchantBUserService; private WxMerchantBUserService wxMerchantBUserService;


@Autowired
private WxMerchantService wxMerchantService;

@Autowired
private WxMallService wxMallService;


@ApiOperation("查寻当bUser详情接口")
@GetMapping("/detail")
public ResultData detail() {
Map resultMap = new HashMap();

WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId());

if (user==null)
return new ResultData(ErrorCode.USER_IS_EMPTY, ErrorCode.USER_IS_EMPTY.getMessage());

WxMerchant merchant = wxMerchantService.getById(user.getMerchantId());

if (merchant==null)
return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage());

WxMall mall = wxMallService.getByTenantId(merchant.getTenantId());
if (mall==null)
return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage());

resultMap.put("phone",user.getPhone());
resultMap.put("name",user.getName());
resultMap.put("merchant_name",merchant.getName());
resultMap.put("mall_name",mall.getName());

return new ResultData(Result.SUCCESS,"查询成功",resultMap);
}

/** /**
* 用户登录 * 用户登录
* @param map * @param map


+ 7
- 2
mallinkService/src/main/java/com/simple/service/WxMallService.java Zobrazit soubor

@@ -37,8 +37,13 @@ public interface WxMallService {
* @param id * @param id
*/ */
void deleteById(Long id); void deleteById(Long id);

/**
* 根据tenant Id查寻
*
* @param id
*/
WxMall getByTenantId(String id);




+ 11
- 3
mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java Zobrazit soubor

@@ -45,9 +45,17 @@ public class WxMallServiceImpl implements WxMallService {
public void deleteById(Long id) { public void deleteById(Long id) {
wxMallMapper.deleteByPrimaryKey(id); wxMallMapper.deleteByPrimaryKey(id);
} }

@Override
public WxMall getByTenantId(String id) {
WxMall wxMall = new WxMall();
wxMall.setTenantId(id);
try {
return wxMallMapper.selectOne(wxMall);
} catch (Exception e){
return null;
}
}


Načítá se…
Zrušit
Uložit