WendyYang 5 месяцев назад
Родитель
Сommit
dcd520436e
3 измененных файлов: 24 добавлений и 23 удалений
  1. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/AppointRuleVO.java
  2. +2
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/AvoidInfoVO.java
  3. +20
    -21
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java

+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/AppointRuleVO.java Просмотреть файл

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Collection;
import java.util.List;

/**
@@ -22,6 +23,6 @@ public class AppointRuleVO {
private String inviteDesc;

@ApiModelProperty("指定邀请专家")
private List<ExpertBasicInfoVO> experts;
private Collection<ExpertBasicInfoVO> experts;

}

+ 2
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/AvoidInfoVO.java Просмотреть файл

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Collection;
import java.util.List;

/**
@@ -37,6 +38,6 @@ public class AvoidInfoVO {
private Integer weekInviteCount;

@ApiModelProperty("回避专家")
private List<ExpertBasicInfoVO> experts;
private Collection<ExpertBasicInfoVO> experts;

}

+ 20
- 21
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Просмотреть файл

@@ -584,33 +584,32 @@ public class MeetingManage {
InviteRuleDetailVO result = new InviteRuleDetailVO();
List<ExpertInviteRule> inviteRules = inviteRuleService.listByMeetingId(meetingId);
result.setRandomRules(new ArrayList<>());
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules, w -> ExpertInviteTypeEnum.getByCode(w.getInviteType()));
Map<ExpertInviteTypeEnum, List<ExpertInviteRule>> groupByType = CollUtils.group(inviteRules,
w -> ExpertInviteTypeEnum.getByCode(w.getInviteType()));
List<ExpertInviteRule> randoms = groupByType.get(ExpertInviteTypeEnum.RANDOM);
if (CollUtil.isNotEmpty(randoms)) {
randoms.forEach(random -> {
RandomInviteRuleVO randomRule = JSON.parseObject(random.getInviteRule(), RandomInviteRuleVO.class);
randomRule.setId(random.getId());
if (randomRule.getExpertTags() != null) {
randomRule.getExpertTags().forEach(w -> {
List<String> tagNames = CollUtils.convert(w.getTagCodes(), tagCode -> tagCache.getByTagCode(tagCode).getTagName());
w.setTagCodes(tagNames);
});
}
if (randomRule.getExpertDicts() != null) {
randomRule.getExpertDicts().forEach(w -> {
List<String> dictNames = CollUtils.convert(w.getDictCodes(), this::getDictName);
w.setDictCodes(dictNames);
});
}
if (StrUtil.isNotEmpty(randomRule.getIntentionRegionCode())) {
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel());
BizUtils.notEmpty(randomRule.getExpertTags(), tags -> tags.forEach(w -> {
List<String> tagNames = CollUtils.convert(w.getTagCodes(),
tagCode -> tagCache.getByTagCode(tagCode).getTagName());
w.setTagCodes(tagNames);
}));
BizUtils.notEmpty(randomRule.getExpertDicts(), dicts -> dicts.forEach(w -> {
List<String> dictNames = CollUtils.convert(w.getDictCodes(), this::getDictName);
w.setDictCodes(dictNames);
}));
Integer intentionRegionLevel = randomRule.getIntentionRegionLevel();
BizUtils.notBlank(randomRule.getIntentionRegionCode(), regionCode -> {
List<RegionDTO> intentionRegions = regionCache.listParents(regionCode, intentionRegionLevel);
randomRule.setIntentionRegions(intentionRegions);
}
if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) {
List<RegionDTO> regions = CollUtils.convert(randomRule.getExpertRegionList(),
});
BizUtils.notEmpty(randomRule.getExpertRegionList(), expertRegionList -> {
List<RegionDTO> regions = CollUtils.convert(expertRegionList,
w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel()));
randomRule.setExpertRegions(regions);
}
});
result.getRandomRules().add(randomRule);
});
AvoidRuleDTO avoidInfo = inviteAvoidRuleService.getAvoidInfo(meetingId);
@@ -626,7 +625,7 @@ public class MeetingManage {
vo.setAvoidUnits(dingOrganizationService.listNameByCodes(avoidInfo.getAvoidUnitIdList()));
}
if (CollUtil.isNotEmpty(avoidInfo.getExpertIds())) {
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values()));
vo.setExperts(meetingManageHelper.getExpertBasicInfo(avoidInfo.getExpertIds()).values());
}
result.setAvoidInfo(vo);
} else {
@@ -637,7 +636,7 @@ public class MeetingManage {
appointRule.setId(appoint.getId());
AppointRuleVO vo = new AppointRuleVO();
vo.setInviteDesc(appointRule.getInviteDesc());
vo.setExperts(new ArrayList<>(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values()));
vo.setExperts(meetingManageHelper.getExpertBasicInfo(appointRule.getExpertIdList()).values());
result.setAppointRule(vo);
}
}


Загрузка…
Отмена
Сохранить