Bladeren bron

积分商城-商户列表增加 联系人和联系方式

tags/V1.7.0
wanghaoran 1 jaar geleden
bovenliggende
commit
efd8da0414
2 gewijzigde bestanden met toevoegingen van 25 en 0 verwijderingen
  1. +13
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Merchant.java
  2. +12
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/MerchantServiceImpl.java

+ 13
- 0
tuoheng-api/src/main/java/com/tuoheng/api/entity/domain/Merchant.java Bestand weergeven

@@ -1,5 +1,6 @@
package com.tuoheng.api.entity.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
@@ -58,5 +59,17 @@ public class Merchant extends BaseEntity {
*/
private String latitude;

/**
* 用户名称
*/
@TableField(exist = false)
private String realname;

/**
* 用户手机号
*/
@TableField(exist = false)
private String mobile;


}

+ 12
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/MerchantServiceImpl.java Bestand weergeven

@@ -1,13 +1,16 @@
package com.tuoheng.api.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.api.entity.domain.Merchant;
import com.tuoheng.api.entity.domain.User;
import com.tuoheng.api.entity.domain.WestreamAct;
import com.tuoheng.api.entity.request.MerchantQuery;
import com.tuoheng.api.mapper.IdentityMapper;
import com.tuoheng.api.mapper.MerchantMapper;
import com.tuoheng.api.mapper.UserMapper;
import com.tuoheng.api.service.IMerchantService;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.utils.CommonUtils;
@@ -28,6 +31,9 @@ public class MerchantServiceImpl extends BaseServiceImpl<MerchantMapper, Merchan
@Autowired
private MerchantMapper merchantMapper;

@Autowired
private UserMapper userMapper;

@Override
public JsonResult queryPage(MerchantQuery query) {
if (null == query.getPage() || null == query.getLimit()) {
@@ -47,6 +53,12 @@ public class MerchantServiceImpl extends BaseServiceImpl<MerchantMapper, Merchan
.orderByDesc(Merchant::getCreateTime));

for (Merchant record : pageData.getRecords()) {

User user = userMapper.selectById(record.getUserId());
if(ObjectUtil.isNotNull(user)){
record.setRealname(user.getRealname());
record.setMobile(user.getMobile());
}
if(StringUtils.isNotEmpty(record.getShopsImage())){
record.setShopsImage(CommonUtils.getMultipleUrl(record.getShopsImage()));
}

Laden…
Annuleren
Opslaan