Selaa lähdekoodia

增加判空

master
CMM 1 vuosi sitten
vanhempi
commit
429b1bd611
1 muutettua tiedostoa jossa 11 lisäystä ja 7 poistoa
  1. +11
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java

+ 11
- 7
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java Näytä tiedosto

@@ -15,6 +15,7 @@ import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.util.List;
@@ -52,13 +53,16 @@ public class NotifyManage {
.map(n -> {
NotifyVO notifyVo = new NotifyVO();
BeanUtil.copyProperties(n,notifyVo);
JSONObject jsonObject = JSON.parseObject(n.getExtraInfo());
Long projectId = jsonObject.getLong(WorkNoticeContant.PROJECT_ID);
String instanceId = jsonObject.getString(WorkNoticeContant.INSTANCE_ID);
Long meetingId = jsonObject.getLong(WorkNoticeContant.MEETING_ID);
notifyVo.setProjectId(projectId);
notifyVo.setInstanceId(instanceId);
notifyVo.setMeetingId(meetingId);
String extraInfo = n.getExtraInfo();
if (StringUtils.isNotBlank(extraInfo)) {
JSONObject jsonObject = JSON.parseObject(extraInfo);
Long projectId = jsonObject.getLong(WorkNoticeContant.PROJECT_ID);
String instanceId = jsonObject.getString(WorkNoticeContant.INSTANCE_ID);
Long meetingId = jsonObject.getLong(WorkNoticeContant.MEETING_ID);
notifyVo.setProjectId(projectId);
notifyVo.setInstanceId(instanceId);
notifyVo.setMeetingId(meetingId);
}
return notifyVo;
})
.collect(Collectors.toList());


Loading…
Peruuta
Tallenna