Search in sources :

Example 1 with SysJreportVO

use of com.netsteadfast.greenstep.vo.SysJreportVO in project bamboobsc by billchen198318.

the class SysJreportServiceImpl method findForSimpleByReportId.

@Override
public DefaultResult<SysJreportVO> findForSimpleByReportId(String reportId) throws ServiceException, Exception {
    if (StringUtils.isBlank(reportId)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    SysJreportVO searchObj = this.sysJreportDAO.findForSimpleByReportId(reportId);
    DefaultResult<SysJreportVO> result = new DefaultResult<SysJreportVO>();
    if (null != searchObj && !StringUtils.isBlank(searchObj.getOid())) {
        result.setValue(searchObj);
    } else {
        result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_NO_EXIST)));
    }
    return result;
}
Also used : SystemMessage(com.netsteadfast.greenstep.base.model.SystemMessage) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO) DefaultResult(com.netsteadfast.greenstep.base.model.DefaultResult)

Example 2 with SysJreportVO

use of com.netsteadfast.greenstep.vo.SysJreportVO in project bamboobsc by billchen198318.

the class SystemJreportLogicServiceImpl method createParam.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysJreportParamVO> createParam(SysJreportParamVO reportParam, String reportOid) throws ServiceException, Exception {
    if (reportParam == null || super.isBlank(reportOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<SysJreportVO> mResult = this.sysJreportService.findForSimple(reportOid);
    if (mResult.getValue() == null) {
        throw new ServiceException(mResult.getSystemMessage().getValue());
    }
    SysJreportVO report = mResult.getValue();
    reportParam.setReportId(report.getReportId());
    return this.sysJreportParamService.saveObject(reportParam);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with SysJreportVO

use of com.netsteadfast.greenstep.vo.SysJreportVO in project bamboobsc by billchen198318.

the class SystemJreportSaveOrUpdateAction method delete.

private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
    SysJreportVO report = new SysJreportVO();
    this.transformFields2ValueObject(report, new String[] { "oid" });
    DefaultResult<Boolean> result = this.systemJreportLogicService.delete(report);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null && result.getValue()) {
        this.success = IS_YES;
    }
}
Also used : SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO)

Example 4 with SysJreportVO

use of com.netsteadfast.greenstep.vo.SysJreportVO in project bamboobsc by billchen198318.

the class SystemJreportSaveOrUpdateAction method update.

private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    if (!StringUtils.isBlank(this.getFields().get("uploadOid"))) {
        this.selfTestUploadReportData();
    }
    SysJreportVO report = new SysJreportVO();
    this.transformFields2ValueObject(report, new String[] { "oid", "reportId", "description" });
    report.setIsCompile(YesNo.NO);
    if ("true".equals(this.getFields().get("isCompile"))) {
        report.setIsCompile(YesNo.YES);
    }
    if (!StringUtils.isBlank(this.getFields().get("uploadOid"))) {
        this.fillContent(report);
    }
    DefaultResult<SysJreportVO> result = this.systemJreportLogicService.update(report);
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
        this.deployReport(result.getValue());
    }
}
Also used : SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO)

Example 5 with SysJreportVO

use of com.netsteadfast.greenstep.vo.SysJreportVO in project bamboobsc by billchen198318.

the class CommonJasperReportAction method handlerParameter.

private void handlerParameter() throws ControllerException, ServiceException, Exception {
    if (StringUtils.isBlank(this.jreportId)) {
        throw new ControllerException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_INCORRECT));
    }
    DefaultResult<SysJreportVO> mResult = this.sysJreportService.findForSimpleByReportId(this.jreportId);
    if (mResult.getValue() == null) {
        throw new ServiceException(mResult.getSystemMessage().getValue());
    }
    SysJreportVO sysJreport = mResult.getValue();
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("reportId", sysJreport.getReportId());
    //List<TbSysJreportParam> paramList = this.sysJreportParamService.findListByParams(params);
    this.dataSource.add("1");
    this.connection = DataUtils.getConnection();
    String reportFolder = Constants.getDeployJasperReportDir() + File.separator + sysJreport.getReportId() + File.separator;
    /*
		this.reportParams.put("REPORT_FOLDER", reportFolder);
		this.reportParams.put("SUBREPORT_DIR", reportFolder);
		for (int i=0; paramList!=null && i<paramList.size(); i++) {
			TbSysJreportParam sysJreportParam = paramList.get(i);
			Enumeration<String> urlParams = super.getHttpServletRequest().getParameterNames();
			while (urlParams.hasMoreElements()) {
				String p = urlParams.nextElement();
				if (p.equals(sysJreportParam.getUrlParam())) {
					String value = super.getHttpServletRequest().getParameter(p);
					this.reportParams.put(sysJreportParam.getRptParam(), value);
				}
			}
		}
		*/
    this.reportParams = JReportUtils.getParameter(sysJreport.getReportId(), super.getHttpServletRequest());
    this.location = reportFolder + sysJreport.getFile();
}
Also used : ControllerException(com.netsteadfast.greenstep.base.exception.ControllerException) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) HashMap(java.util.HashMap) SysJreportVO(com.netsteadfast.greenstep.vo.SysJreportVO)

Aggregations

SysJreportVO (com.netsteadfast.greenstep.vo.SysJreportVO)7 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)1 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)1 HashMap (java.util.HashMap)1 Transactional (org.springframework.transaction.annotation.Transactional)1