修复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;
}
String fcStage = this.getFcStageByProjectId();
if("-2".equals(fcStage)){
return "获取状态信息出现错误,请联系系统管理员!";
}
if ("AP".equals(fcStage)||"1".equals(fcStage)) {
sResult = "S";
} else {
@ -106,9 +109,12 @@ public class CorpusSourceCheck {
String sResult = null;
try {
String fcStage = this.getFcStageByProjectId();
if("-2".equals(fcStage)){
return "获取状态信息出现错误,请联系系统管理员!";
}
if("2".equals(fcStage)||"AP".equals(fcStage)){
return "S";
}else{
} else {
sResult = "客户还未和资方签署合同";
}
} catch (JBOException e) {
@ -135,7 +141,7 @@ public class CorpusSourceCheck {
fcStage = "AP" ;
}else{
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){
fcStage = boFR.getAttribute("FC_STAGE").toString();
}

View File

@ -101,12 +101,18 @@ public class DocListAction {
BizObjectManager BBMbom = null;
BizObject BBMBo = null;
BBMbom = JBOFactory.getBizObjectManager(BT_BUSSINESS_MESSAGE.CLASS_NAME,tx);
BBMBo = BBMbom.createQuery("ID=:id").setParameter("id",messageId).getSingleResult(true);
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);
if(messageId!=null&&!"".equals(messageId)){
BBMBo = BBMbom.createQuery("ID=:id").setParameter("id",messageId).getSingleResult(true);
}else {
BBMBo = BBMbom.createQuery("cparam like '%fcRequestId="+fcRequestId+"%'").getSingleResult(true);
}
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() {