|
@@ -3,8 +3,7 @@ package com.caimei365.user.service.impl;
|
|
|
import com.caimei365.user.mapper.BaseMapper;
|
|
|
import com.caimei365.user.mapper.ClubMapper;
|
|
|
import com.caimei365.user.model.ResponseJson;
|
|
|
-import com.caimei365.user.model.po.ClubPo;
|
|
|
-import com.caimei365.user.model.po.UserPo;
|
|
|
+import com.caimei365.user.model.vo.*;
|
|
|
import com.caimei365.user.service.ClubService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -28,6 +27,8 @@ public class ClubServiceImpl implements ClubService {
|
|
|
|
|
|
@Resource
|
|
|
private ClubMapper clubMapper;
|
|
|
+ @Resource
|
|
|
+ private BaseMapper baseMapper;
|
|
|
|
|
|
/**
|
|
|
* 根据用户Id查询机构资料
|
|
@@ -37,14 +38,39 @@ public class ClubServiceImpl implements ClubService {
|
|
|
*/
|
|
|
@Override
|
|
|
public ResponseJson<Map<String, Object>> getClubUserInfo(Integer userId) {
|
|
|
- UserPo user = clubMapper.getUserByUserId(userId);
|
|
|
+ if (null == userId) {
|
|
|
+ return ResponseJson.error("参数异常", null);
|
|
|
+ }
|
|
|
+ // 用户信息
|
|
|
+ UserVo user = clubMapper.getUserByUserId(userId);
|
|
|
if (user == null) {
|
|
|
return ResponseJson.error("用户信息不存在", null);
|
|
|
}
|
|
|
- ClubPo club = clubMapper.getClubById(user.getClubId());
|
|
|
+ if (!StringUtils.isBlank(user.getAuditNote()) && "2".equals(user.getAuditStatus())) {
|
|
|
+ List<String> list = new ArrayList();
|
|
|
+ if (user.getAuditNote().contains(",")) {
|
|
|
+ String[] auditNoteArray = user.getAuditNote().split(",");
|
|
|
+ for (String note : auditNoteArray) {
|
|
|
+ if (!StringUtils.isBlank(note)) {
|
|
|
+ list.add(note);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list.add(user.getAuditStatus());
|
|
|
+ }
|
|
|
+ user.setAuditNoteList(list);
|
|
|
+ }
|
|
|
+ // 机构信息
|
|
|
+ ClubVo club = clubMapper.getClubById(user.getClubId());
|
|
|
if (club == null) {
|
|
|
return ResponseJson.error("机构信息不存在", null);
|
|
|
}
|
|
|
+ if (null != club.getTownId()) {
|
|
|
+ TownVo town = baseMapper.getTown(club.getTownId());
|
|
|
+ CityVo city = baseMapper.getCity(town.getCityId());
|
|
|
+ ProvinceVo province = baseMapper.getProvince(city.getProvinceId());
|
|
|
+ club.setProvincialAddress(province.getName() + "" + city.getName() + "" + town.getName());
|
|
|
+ }
|
|
|
Map<String, Object> map = new HashMap(2);
|
|
|
map.put("user", user);
|
|
|
map.put("club", club);
|