/** * 功能:更新资产地点表(EAM)表“ETS_OBJECT”数据。 * * @param workorderObjectNo String * @param objAttibute EtsObjectAttributeDTO * @return boolean */ public boolean updateData(String workorderObjectNo, EtsObjectAttributeDTO objAttibute) throws DataHandleException { boolean operateResult = false; boolean autoCommit = false; boolean hasError = true; try { autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); super.updateData(); // 表修改操作 // EtsObjectAttributeDTO objDTO2 = new EtsObjectAttributeDTO(); objAttibute.setObjectNo(workorderObjectNo); EtsObjectAttributeDAO dao = new EtsObjectAttributeDAO(sfUser, objAttibute, conn); dao.deleteData(); // EtsObjectAttributeDAO dao2 = new EtsObjectAttributeDAO(sfUser,objAttibute,conn); dao.createData(); // 插入操作 operateResult = true; conn.commit(); hasError = false; getMessage().addParameterValue("资产地点表"); } catch (SQLException ex) { Logger.logError(ex); prodMessage(MsgKeyConstant.SQL_ERROR); } finally { try { if (hasError) { conn.rollback(); } conn.setAutoCommit(autoCommit); } catch (SQLException ex) { Logger.logError(ex); prodMessage(MsgKeyConstant.SQL_ERROR); } } return operateResult; }
/** * 功能:插入资产地点表(EAM)表“ETS_OBJECT”数据。 * * @param objAttibute EtsObjectAttributeDTO * @return boolean */ public boolean createData(EtsObjectAttributeDTO objAttibute) throws DataHandleException { // do _save 的 操作 boolean operateResult = false; boolean autoCommit = false; boolean hasError = true; try { autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); EtsObjectDTO objDTO = (EtsObjectDTO) dtoParameter; objDTO.setWorkorderObjectNo(getNextWorkorderObjectNo()); setDTOParameter(objDTO); super.createData(); // 插入数据 inAOAData(); // EtsObjectAttributeDTO objDTO2 = new EtsObjectAttributeDTO(); // objDTO2.setObjectNo(objDTO.getWorkorderObjectNo()); // //获取 WORKORDER_OBJECT_NO // // objAttibute.setObjectNo(objDTO.getWorkorderObjectNo()); EtsObjectAttributeDAO dao = new EtsObjectAttributeDAO(sfUser, objAttibute, conn); dao.createData(); // 根据WORKORDER_OBJECT_NO进行插入操作 operateResult = true; conn.commit(); hasError = false; getMessage().addParameterValue("资产地点表"); } catch (SQLException ex) { Logger.logError(ex); prodMessage(MsgKeyConstant.SQL_ERROR); } finally { try { if (hasError) { conn.rollback(); // 回滚 } conn.setAutoCommit(autoCommit); // 恢复以前状态 } catch (SQLException ex) { Logger.logError(ex); prodMessage(MsgKeyConstant.ROLL_BACK_ERROR); } } return operateResult; }
/** * 功能:更新项目维护表(EAM)表“ETS_PA_PROJECTS_ALL”数据。 * * @return boolean */ public void updateData() throws DataHandleException { boolean operateResult = false; try { String tableName = "ETS_PA_PROJECTS_ALL"; DataUniqueChecker datChecker = new DataUniqueChecker(tableName, dtoParameter, conn); datChecker.setDBAction(DBActionConstant.UPDATE); datChecker.setServletConfig(servletConfig); // boolean isValid = datChecker.isDataValid(); // if (!isValid) { // prodMessage(MsgKeyConstant.UNIQUE_ERROR); // getMessage().addParameterValue(datChecker.getInValidData()); // } else { super.updateData(); operateResult = true; getMessage().addParameterValue("项目"); // } } catch (ValidateException ex) { ex.printLog(); prodMessage(MsgKeyConstant.COMMON_ERROR); } }
/** 功能:删除代维公司相关文件表“AMS_MAINTAIN_FILES”数据。 */ public void deleteData() throws DataHandleException { super.deleteData(); getMessage().addParameterValue("代维公司相关文件"); }
/** * 功能:修改资产地点表(EAM)表“ETS_OBJECT”数据,执行详细页面的单一失效操作。 * * @return boolean */ public void deleteData() throws DataHandleException { // 进行失效操作 // boolean operateResult = super.deleteData(); super.deleteData(); getMessage().addParameterValue("资产地点"); // return operateResult; }