|
@@ -7,11 +7,13 @@ import com.tzld.piaoquan.growth.common.dao.mapper.StaffMapper;
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.StaffWithUserMapper;
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.StaffWithUserMapper;
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.WeComUserMapper;
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.WeComUserMapper;
|
|
import com.tzld.piaoquan.growth.common.model.po.*;
|
|
import com.tzld.piaoquan.growth.common.model.po.*;
|
|
|
|
+import com.tzld.piaoquan.growth.common.model.vo.WeComUserVo;
|
|
import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
|
|
import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
|
|
import com.tzld.piaoquan.growth.common.service.WeComUserService;
|
|
import com.tzld.piaoquan.growth.common.service.WeComUserService;
|
|
import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
|
|
import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
@@ -217,4 +219,25 @@ public class WeComUserServiceImpl implements WeComUserService {
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<WeComUserVo> getWeComUserByNameAvatar(String name, String avatar) {
|
|
|
|
+ WeComUserExample example = new WeComUserExample();
|
|
|
|
+ example.createCriteria().andNameEqualTo(name).andAvatarEqualTo(avatar);
|
|
|
|
+ List<WeComUser> list = weComUserMapper.selectByExample(example);
|
|
|
|
+ return buildWeComUserVo(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private List<WeComUserVo> buildWeComUserVo(List<WeComUser> list) {
|
|
|
|
+ List<WeComUserVo> voList = new ArrayList<>();
|
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
|
+ return voList;
|
|
|
|
+ }
|
|
|
|
+ for (WeComUser weComUser : list) {
|
|
|
|
+ WeComUserVo vo = new WeComUserVo();
|
|
|
|
+ BeanUtils.copyProperties(weComUser, vo);
|
|
|
|
+ voList.add(vo);
|
|
|
|
+ }
|
|
|
|
+ return voList;
|
|
|
|
+ }
|
|
}
|
|
}
|