fix
This commit is contained in:
@@ -89,4 +89,32 @@ public class LinePointBaseInfoVO {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
public static LinePointBaseInfoVO convert(LineInfoDO lineInfo, String username, Map<Long, String> userPortraitMap, HyOpenAreaInfoDO cityArea, Map<Long, Integer> recommendShopNumMap, Map<Long, Integer> selectedShopNumMap){
|
||||
LinePointBaseInfoVO linePointBaseInfo = new LinePointBaseInfoVO(lineInfo.getId(), lineInfo.getUsername(), lineInfo.getMobile());
|
||||
linePointBaseInfo.setWantShopNum(lineInfo.getWantShopNum());
|
||||
linePointBaseInfo.setInvestmentManagerUsername(username);
|
||||
if(Objects.nonNull(cityArea)){
|
||||
linePointBaseInfo.setAreaName(cityArea.getAreaName());
|
||||
linePointBaseInfo.setAreaPath(cityArea.getAreaPath().replace("/", "").trim());
|
||||
}
|
||||
linePointBaseInfo.setRecommendShopNum(recommendShopNumMap.get(lineInfo.getId()));
|
||||
linePointBaseInfo.setSelectedShopNum(selectedShopNumMap.get(lineInfo.getId()));
|
||||
if(StringUtils.isNotBlank(lineInfo.getUserPortrait())){
|
||||
List<String> userPortraitList = new ArrayList<>();
|
||||
String[] parts = lineInfo.getUserPortrait().split(",");
|
||||
for (String part : parts) {
|
||||
String trimmedPart = part.trim();
|
||||
if (StringUtils.isNotBlank(trimmedPart)) {
|
||||
String s = userPortraitMap.get(Long.valueOf(part));
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
userPortraitList.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
linePointBaseInfo.setUserPortraitList(userPortraitList);
|
||||
}
|
||||
return linePointBaseInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -124,6 +124,14 @@ public interface PointService {
|
||||
*/
|
||||
PageInfo<LinePointBaseInfoVO> getLinePage(PointLinePageRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 获取单个加盟商信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
LinePointBaseInfoVO getLineInfo(Long lineId);
|
||||
|
||||
/**
|
||||
* 获取我的数据
|
||||
* @param userId
|
||||
|
||||
@@ -492,6 +492,22 @@ public class PointServiceImpl implements PointService {
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个加盟商信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LinePointBaseInfoVO getLineInfo(Long lineId){
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(lineId);
|
||||
Map<Long, Integer> recommendShopNumMap = pointRecommendDAO.getPushShopNumMap(Arrays.asList(lineId));
|
||||
HyOpenAreaInfoDO cityArea = hyOpenAreaInfoDAO.selectById(lineInfo.getWantShopAreaId());
|
||||
Map<Long, Integer> selectedShopNumMap = shopInfoDAO.getSelectedShopNumMap(Arrays.asList(lineId));
|
||||
String userName = enterpriseUserDAO.getUserName(lineInfo.getInvestmentManager());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(Arrays.asList(lineInfo.getUserPortrait()));
|
||||
return LinePointBaseInfoVO.convert(lineInfo, userName, userPortraitMap, cityArea, recommendShopNumMap, selectedShopNumMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointHomePageDataVO getMyPointData(String userId) {
|
||||
return pointInfoDAO.getMyPointData(userId);
|
||||
|
||||
@@ -126,6 +126,12 @@ public class PointController {
|
||||
return ResponseResult.success(pointService.getLinePage(request));
|
||||
}
|
||||
|
||||
@ApiOperation("获取我负责的加盟商列表")
|
||||
@GetMapping("/getLineInfo")
|
||||
public ResponseResult<LinePointBaseInfoVO> getLineInfo(@RequestParam("lineId") Long lineId) {
|
||||
return ResponseResult.success(pointService.getLineInfo(lineId));
|
||||
}
|
||||
|
||||
@ApiOperation("首页我的数据")
|
||||
@GetMapping("/getMyData")
|
||||
public ResponseResult<PointHomePageDataVO> getMyPointData() {
|
||||
|
||||
Reference in New Issue
Block a user