修复NPE异常

This commit is contained in:
ap007 2021-07-21 09:37:54 +08:00
parent f78e6b8cb5
commit 0363925a9f
2 changed files with 20 additions and 8 deletions

View File

@ -87,6 +87,9 @@ public class CorpusSourceCheck {
return sResult; return sResult;
} }
String fcStage = this.getFcStageByProjectId(); String fcStage = this.getFcStageByProjectId();
if("-2".equals(fcStage)){
return "获取状态信息出现错误,请联系系统管理员!";
}
if ("AP".equals(fcStage)||"1".equals(fcStage)) { if ("AP".equals(fcStage)||"1".equals(fcStage)) {
sResult = "S"; sResult = "S";
} else { } else {
@ -106,9 +109,12 @@ public class CorpusSourceCheck {
String sResult = null; String sResult = null;
try { try {
String fcStage = this.getFcStageByProjectId(); String fcStage = this.getFcStageByProjectId();
if("-2".equals(fcStage)){
return "获取状态信息出现错误,请联系系统管理员!";
}
if("2".equals(fcStage)||"AP".equals(fcStage)){ if("2".equals(fcStage)||"AP".equals(fcStage)){
return "S"; return "S";
}else{ } else {
sResult = "客户还未和资方签署合同"; sResult = "客户还未和资方签署合同";
} }
} catch (JBOException e) { } catch (JBOException e) {
@ -135,7 +141,7 @@ public class CorpusSourceCheck {
fcStage = "AP" ; fcStage = "AP" ;
}else{ }else{
BizObjectManager bomFR = JBOFactory.getBizObjectManager(FC_REQUEST.CLASS_NAME); BizObjectManager bomFR = JBOFactory.getBizObjectManager(FC_REQUEST.CLASS_NAME);
BizObject boFR = bomFR.createQuery("id=:projectId and del_flag='0'").setParameter("projectId", projectId).getSingleResult(false); BizObject boFR = bomFR.createQuery("PROJECT_ID=:projectId and del_flag='0'").setParameter("projectId", projectId).getSingleResult(false);
if(boFR!=null){ if(boFR!=null){
fcStage = boFR.getAttribute("FC_STAGE").toString(); fcStage = boFR.getAttribute("FC_STAGE").toString();
} }

View File

@ -101,12 +101,18 @@ public class DocListAction {
BizObjectManager BBMbom = null; BizObjectManager BBMbom = null;
BizObject BBMBo = null; BizObject BBMBo = null;
BBMbom = JBOFactory.getBizObjectManager(BT_BUSSINESS_MESSAGE.CLASS_NAME,tx); BBMbom = JBOFactory.getBizObjectManager(BT_BUSSINESS_MESSAGE.CLASS_NAME,tx);
BBMBo = BBMbom.createQuery("ID=:id").setParameter("id",messageId).getSingleResult(true); if(messageId!=null&&!"".equals(messageId)){
BBMBo.setAttributeValue("is_read","has_read"); BBMBo = BBMbom.createQuery("ID=:id").setParameter("id",messageId).getSingleResult(true);
BBMBo.setAttributeValue("message_status","has_process"); }else {
BBMBo.setAttributeValue("read_time",currentTime); BBMBo = BBMbom.createQuery("cparam like '%fcRequestId="+fcRequestId+"%'").getSingleResult(true);
BBMBo.setAttributeValue("finish_time",currentTime); }
BBMbom.saveObject(BBMBo); if(BBMBo!=null){
BBMBo.setAttributeValue("is_read","has_read");
BBMBo.setAttributeValue("message_status","has_process");
BBMBo.setAttributeValue("read_time",currentTime);
BBMBo.setAttributeValue("finish_time",currentTime);
BBMbom.saveObject(BBMBo);
}
} }
public String getFrfId() { public String getFrfId() {