/** * 保存头 * * @throws DataHandleException * @throws SQLException */ public void saveHeader() throws DataHandleException, SQLException { if (headerDTO.getTransNo().equals(AssetsWebAttributes.ORDER_AUTO_PROD)) { if (StrUtil.isEmpty(headerDTO.getTransId())) { SeqProducer seqProducer = new SeqProducer(conn); String transId = seqProducer.getGUID(); headerDTO.setTransId(transId); } String companyCode = userAccount.getCompanyCode(); // 还是采用该方法,以下考虑周子君认为没必要 String transType = headerDTO.getTransType(); OrderNumGenerator numberProducer = new OrderNumGenerator(conn, companyCode, transType); headerDTO.setTransNo(numberProducer.getOrderNum()); headerDAO.createHeader(headerDTO); } else { headerDAO.updateHeader(headerDTO); } }
/** * 取头信息 * * @throws QueryException */ protected void prodHeader() throws QueryException { headerDAO.setDTOClassName(UrgentHeaderDTO.class.getName()); headerDAO.setCalPattern(CalendarConstant.LINE_PATTERN); UrgentHeaderDTO tmpDTO = (UrgentHeaderDTO) headerDTO.clone(); headerDTO = (UrgentHeaderDTO) headerDAO.getDataByPrimaryKey(); // 当新建时候 if (null == headerDTO || StrUtil.isEmpty(headerDTO.getTransId())) { headerDTO = new UrgentHeaderDTO(); headerDTO = initHeaderData(headerDTO); } headerDTO.setSf_task_attribute3(tmpDTO.getSf_task_attribute3()); leaseDTO.setHeaderDTO(headerDTO); }
/** * 将流程中保存的单据ID设置进DTO * * @param dtoParameter * @return */ protected UrgentHeaderDTO setFlowIdToDTO(UrgentHeaderDTO dtoParameter) { if (StrUtil.isEmpty(dtoParameter.getTransId())) { dtoParameter.setTransId(StrUtil.nullToString(dtoParameter.getApp_dataID())); } return dtoParameter; }
/** 功能:准备流程数据,由应用实现 */ protected void prepareProcedureData() { flowDTO.setApp_dataID(headerDTO.getTransId()); flowDTO.setPrimaryKey(headerDTO.getTransId()); flowDTO.setOrderNo(headerDTO.getTransNo()); flowDTO.setOrderName(ORDER_TITLE); }
/** * 取行信息 * * @throws QueryException */ protected void prodLines() throws QueryException { lines = headerDAO.getLinesData(headerDTO.getTransId()); leaseDTO.setLines(lines); }