feat(REQ-3300) - 调整处理枚举转换逻辑
This commit is contained in:
parent
d4ef303ca7
commit
2c0c3266ee
@ -5,7 +5,6 @@ import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -30,10 +29,6 @@ public enum VisaTypeEnum {
|
||||
private static final Set<VisaTypeEnum> changeApprovedSet = Sets.newHashSet(DESIGN_CHANGE, TECHNOLOGY_APPROVED);
|
||||
private static final Set<VisaTypeEnum> projectVisaSet = Sets.newHashSet(PROJECT_VISA);
|
||||
|
||||
public static VisaTypeEnum valueOfCode(String code) {
|
||||
return Arrays.stream(VisaTypeEnum.values()).filter(item -> item.getCode().equals(code)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设计变更/技术核定
|
||||
*/
|
||||
|
||||
@ -88,7 +88,7 @@ public class ImGroupAddMembersEventHandler implements EventHandler, Initializing
|
||||
notice.setBizCode(String.valueOf(visaId));
|
||||
notice.setBizExtParams(new JSONObject(Maps.of(
|
||||
"initiatorName", ownerProfile.getRealName(),
|
||||
"visaType", StringUtils.isNotBlank(visaType) ? VisaTypeEnum.valueOfCode(visaType).getDesc() : "",
|
||||
"visaType", StringUtils.isNotBlank(visaType) ? VisaTypeEnum.valueOf(visaType).getDesc() : "",
|
||||
"topic", group.getName())));
|
||||
noticeApi.send(notice);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ public class ImGroupsCreatedEventHandler implements EventHandler, InitializingBe
|
||||
"reason", visa.getReason(),
|
||||
"initiatorName", profile.getRealName(),
|
||||
"initiatorUnitName", unitInfo.getName(),
|
||||
"visaType", StringUtils.isNotBlank(visaType) ? VisaTypeEnum.valueOfCode(visaType).getDesc() : "",
|
||||
"visaType", StringUtils.isNotBlank(visaType) ? VisaTypeEnum.valueOf(visaType).getDesc() : "",
|
||||
"amountChange", VisaHelper.buildChangeAmount(visa.getAmountChange())
|
||||
)));
|
||||
msgCenterGateway.sendCardToCroup(cardRequest);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user