This commit is contained in:
moxiangrong
2024-02-29 18:36:02 +08:00
parent 025000179a
commit 073b6d8663
3 changed files with 16 additions and 5 deletions

View File

@ -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")

View File

@ -43,7 +43,7 @@ public interface ShopAssistantService {
* @param id 编号
* @return 门店店员
*/
ShopAssistantDO getShopAssistant(Long id);
ShopAssistantRespVO getShopAssistant(Long id);
/**
* 获得门店店员列表

View File

@ -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);