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;
}
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);
}
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;
}
}
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());
}
}
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();
}
Aggregations