fix bug
This commit is contained in:
@ -64,8 +64,8 @@ public class ShopAssistantController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mall:shop-assistant:query')")
|
||||
public CommonResult<ShopAssistantRespVO> getShopAssistant(@RequestParam("id") Long id) {
|
||||
ShopAssistantDO shopAssistant = shopAssistantService.getShopAssistant(id);
|
||||
return success(ShopAssistantConvert.INSTANCE.convert(shopAssistant));
|
||||
ShopAssistantRespVO vo = shopAssistantService.getShopAssistant(id);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
|
@ -43,7 +43,7 @@ public interface ShopAssistantService {
|
||||
* @param id 编号
|
||||
* @return 门店店员
|
||||
*/
|
||||
ShopAssistantDO getShopAssistant(Long id);
|
||||
ShopAssistantRespVO getShopAssistant(Long id);
|
||||
|
||||
/**
|
||||
* 获得门店店员列表
|
||||
|
@ -120,8 +120,11 @@ public class ShopAssistantServiceImpl implements ShopAssistantService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopAssistantDO getShopAssistant(Long id) {
|
||||
return shopAssistantMapper.selectById(id);
|
||||
public ShopAssistantRespVO getShopAssistant(Long id) {
|
||||
ShopAssistantDO shopAssistantDO = shopAssistantMapper.selectById(id);
|
||||
ShopAssistantRespVO vo = ShopAssistantConvert.INSTANCE.convert(shopAssistantDO);
|
||||
fillData(vo);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -155,6 +158,14 @@ public class ShopAssistantServiceImpl implements ShopAssistantService {
|
||||
}
|
||||
}
|
||||
|
||||
private void fillData(ShopAssistantRespVO vo) {
|
||||
MemberUserDO user = userService.getUser(vo.getUserId());
|
||||
ShopDO shop = shopService.getShop(vo.getStoreId());
|
||||
vo.setAvatar(user.getAvatar());
|
||||
vo.setNickname(user.getNickname());
|
||||
vo.setStoreName(shop.getStoreName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopAssistantDO> getShopAssistantList(ShopAssistantExportReqVO exportReqVO) {
|
||||
return shopAssistantMapper.selectList(exportReqVO);
|
||||
|
Reference in New Issue
Block a user