private void generateDemoAudit() throws Exception { EnterpriseAudit auditModel = audit; EnterpriseBaseModel baseModel = audit.getBaseModel(); String declareYear = (String) application.get(Constants.OPTION_SFDECLARE_YEAR); declareYear = Integer.parseInt(declareYear) + 1 + ""; auditModel.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue()); auditModel.setAuditSecondStatus(EnterpriseAudit.ESecondStatus.Pass.getValue()); /* * modified 2.21 */ // int count = auditService.getCount(baseModel, auditModel); if (baseModel.getEnterpriseStyle() == EnterpriseBaseModel.EStyle.Example.getValue() && Integer.parseInt((String) application.get(Constants.OPTION_SFDECLARE_YEAR)) - Integer.parseInt(baseModel.getEnterpriseExpeYear()) > 2) { EnterpriseAudit newDemAudit = new EnterpriseAudit(); newDemAudit.setAuditEnterprise(baseModel.getEnterpriseName()); newDemAudit.setAuditSecondStatus(EnterpriseAudit.EStatus.NotAudite.getValue()); newDemAudit.setAuditStatus(EnterpriseAudit.EStatus.NotAudite.getValue()); newDemAudit.setAuditType(2); java.util.Date date = new java.util.Date(); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); newDemAudit.setDeclareDate(Date.valueOf(dateFormat.format(date))); newDemAudit.setEditable(true); newDemAudit.setBaseModel(baseModel); newDemAudit.setDeclareYear(declareYear); auditService.saveOrUpdate(newDemAudit); } }
public String projectSave() throws Exception { String id = (String) session.get(BaseAction.BASEIDINSESSION); EnterpriseBaseModel baseModel = eBaseService.get(id); String year; if (baseModel.getEnterpriseStyle() == EnterpriseBaseModel.EStyle.NONE.getValue()) { year = (String) application.get(Constants.OPTION_SDDECLARE_YEAR); year = Integer.parseInt(year) - 1 + ""; } else year = (String) application.get(Constants.OPTION_NDDECLARE_YEAR); project.setDeclareYear(year); project.setBaseModel(baseModel); try { projectService.saveOrUpdate(project); } catch (ServiceException e) { LOGGER.error(e.getMessage()); } return SUCCESS; }
public String get() throws Exception { // UserModel userModel = (UserModel)session.get("USER"); // 查找审批情况 audit.setAuditType(1); audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue()); if (baseModel.getEnterpriseCity() != null && baseModel.getEnterpriseCity() != 0) { // 找到count audit.setAuditSecondStatus(EnterpriseAudit.EStatus.NotPass.getValue()); notPass = auditService.getCount(baseModel, audit); audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Reject.getValue()); notAudit = auditService.getCount(baseModel, audit); audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Pass.getValue()); pass = auditService.getCount(baseModel, audit); servletRequest.setAttribute("enterpriseCity", baseModel.getEnterpriseCity()); } int startIndex = (page - 1) * Constants.DefaultPageSize; try { audit.setAuditStatus(EnterpriseAudit.EStatus.Pass.getValue()); audit.setAuditSecondStatus(EnterpriseAudit.EStatus.Reject.getValue()); audit.setAuditType(1); PaginationSupport<EnterpriseAudit> audits = auditService.getPageByYear( baseModel, audit, "", null, null, Constants.DefaultPageSize, startIndex, "priority", true); servletRequest.setAttribute("auditPage", audits); } catch (ServiceException e) { LOGGER.debug(e.getMessage()); } return "datagrid"; }