保存的时候oldProjectInfo就能取得 但是为什么提交的时候就为null呢。。。
/**
* 保存建设情况
* @param projectInfo 项目总表
* @param designRequire 规划要求
* @param session
* @return
*/
@At("/saveCS")
@Ok("jsp:jsp.work.designRequire.constructionSituation")
public View saveConstructionSituation(@Param("::projectInfo.")QfgProjectInfo projectInfo,@Param("::designRequire.")QfgDesignRequire designRequire,HttpSession session){
NutMap map = new NutMap();
QfgProjectInfo oldProjectInfo = dao.fetch(QfgProjectInfo.class,projectInfo.getNmSqbId());
QfgDesignRequire oldDesignRequire = dao.fetch(QfgDesignRequire.class,designRequire.getNmSqbId());
try {
if(oldProjectInfo==null){
//土地类型
projectInfo.setStLandType("3");
//默认未生成xml
projectInfo.setStIfGenXml("0");
//业务类型
projectInfo.setStBusCode("WD_TJ_XB");
wondersDao.fastInsert(projectInfo, session);//此处使用fastInsert方法,避免报件主键被自动生成的序列覆盖
}else{
projectInfo.setDtUpdateDate(new Date());
projectInfo.setNmUpdateUser(UserUtils.getUserIdFromSession(session));
Daos.ext(dao, FieldFilter.locked(QfgProjectInfo.class,
"^stIfGenXml|stApproveNode|stIfFinish|stReservationNum|stBusCode|stLandType|stProjectId|dtInsertDate|nmInsertUser$")).update(projectInfo);
//wondersDao.update(projectInfo, session);
}
} catch (Exception e) {
e.printStackTrace();
}
try {
if(oldDesignRequire==null){
wondersDao.insert(designRequire, session);
}else{
wondersDao.update(designRequire, session);
}
} catch (Exception e) {
e.printStackTrace();
}
return new ServerRedirectView("/designRequire/constructionSituation?nmSqbId=" + projectInfo.getNmSqbId());
}
/**
* 提交建设情况
* @param projectInfo 项目总表
* @param designRequire 规划要求
* @param session
* @return
*/
@At("/subCS")
@Ok("jsp:jsp.work.designRequire.applyComplete")
public View subConstructionSituation(@Param("::projectInfo.")QfgProjectInfo projectInfo,@Param("::designRequire.")QfgDesignRequire designRequire,HttpSession session){
NutMap map = new NutMap();
QfgProjectInfo oldProjectInfo = dao.fetch(QfgProjectInfo.class,projectInfo.getNmSqbId());
QfgDesignRequire oldDesignRequire = dao.fetch(QfgDesignRequire.class,designRequire.getNmSqbId());
try {
if(oldProjectInfo==null){
projectInfo.setStLandType("3");
projectInfo.setStIfGenXml("0");
projectInfo.setStBusCode("WD_TJ_XB");
projectInfo.setDtSubmitDate(new Date());
wondersDao.fastInsert(projectInfo, session);
}else{
projectInfo.setDtUpdateDate(new Date());
projectInfo.setNmUpdateUser(UserUtils.getUserIdFromSession(session));
projectInfo.setDtSubmitDate(new Date());
Daos.ext(dao, FieldFilter.locked(QfgProjectInfo.class,
"^stIfGenXml|stApproveNode|stIfFinish|stReservationNum|stBusCode|stLandType|stProjectId|dtInsertDate|nmInsertUser$")).update(projectInfo);
//wondersDao.update(projectInfo, session);
}
} catch (Exception e) {
e.printStackTrace();
return map.setv("ok", false);
}
try {
if(oldDesignRequire==null){
wondersDao.insert(designRequire, session);
}else{
wondersDao.update(designRequire, session);
}
} catch (Exception e) {
e.printStackTrace();
return map.setv("ok", false);
}
List<DicBusMaterial> busMaterialList = dao.query(DicBusMaterial.class, Cnd.where("stBusCode", "=", oldProjectInfo.getStBusCode()));
return new ServerRedirectView("/designRequire/constructionSituation?nmSqbId=" + projectInfo.getNmSqbId());
}