use of com.netsteadfast.greenstep.base.chain.SimpleChain in project bamboobsc by billchen198318.
the class PdcaReportContentQueryAction method getExcel.
@SuppressWarnings("unchecked")
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
List<String> bscExcelFileUploadOids = new ArrayList<String>();
List<ChainResultObj> bscReportResults = null;
if ("true".equals(this.getFields().get("showBscReport"))) {
bscReportResults = this.getBscReportContent("kpiReportExcelContentChain");
}
for (int i = 0; bscReportResults != null && i < bscReportResults.size(); i++) {
ChainResultObj resultObj = bscReportResults.get(i);
if (resultObj.getValue() instanceof String) {
bscExcelFileUploadOids.add((String) resultObj.getValue());
}
}
Context pdcaContext = new ContextBase();
pdcaContext.put("pdcaOid", this.getFields().get("pdcaOid"));
pdcaContext.put("bscExcelFileUploadOids", bscExcelFileUploadOids);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("pdcaReportExcelContentChain", pdcaContext);
this.message = resultObj.getMessage();
if (resultObj.getValue() instanceof String) {
this.uploadOid = (String) resultObj.getValue();
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.base.chain.SimpleChain in project bamboobsc by billchen198318.
the class PdcaReportContentQueryAction method getBscReportContent.
private List<ChainResultObj> getBscReportContent(String chainId) throws ControllerException, AuthorityException, ServiceException, Exception {
List<ChainResultObj> results = new ArrayList<ChainResultObj>();
String pdcaOid = this.getFields().get("pdcaOid");
// 先找出 bb_pdca_kpis 的最上層 vision
List<String> visionOids = this.visionService.findForOidByPdcaOid(pdcaOid);
for (String visionOid : visionOids) {
PdcaMeasureFreqVO measureFreq = new PdcaMeasureFreqVO();
measureFreq.setPdcaOid(pdcaOid);
DefaultResult<PdcaMeasureFreqVO> mfResult = this.pdcaMeasureFreqService.findByUK(measureFreq);
if (mfResult.getValue() == null) {
throw new ServiceException(mfResult.getSystemMessage().getValue());
}
measureFreq = mfResult.getValue();
Context context = this.getBscReportChainContext(pdcaOid, visionOid, measureFreq);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource(chainId, context);
results.add(resultObj);
}
return results;
}
use of com.netsteadfast.greenstep.base.chain.SimpleChain in project bamboobsc by billchen198318.
the class PersonalReportContentQueryAction method getContent.
private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("personalReportHtmlContentChain", context);
this.body = String.valueOf(resultObj.getValue());
this.message = resultObj.getMessage();
if (!StringUtils.isBlank(this.body) && this.body.startsWith("<!-- BSC_PROG003D0002Q -->")) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.base.chain.SimpleChain in project bamboobsc by billchen198318.
the class WeightContentQueryAction method renderBody.
@SuppressWarnings("unchecked")
private void renderBody() throws ControllerException, ServiceException, Exception {
this.getCheckFieldHandler().single("visionOid", (super.isNoSelectId(this.getFields().get("visionOid"))), this.getText("MESSAGE.BSC_PROG002D0006Q_visionOid")).throwMessage();
SimpleChain simpleChanin = new SimpleChain();
Context context = new ContextBase();
context.put("visionOid", this.getFields().get("visionOid"));
if (YesNo.YES.equals(this.getFields().get("autoAllocation"))) {
context.put("autoAllocation", this.getFields().get("autoAllocation"));
}
context.put("weightName", this.getText("TPL.BSC_PROG002D0006Q_weightName"));
ChainResultObj resultObj = simpleChanin.getResultFromResource("weightItemsChain", context);
this.body = String.valueOf(resultObj.getValue());
this.message = resultObj.getMessage();
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.base.chain.SimpleChain in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method getCoffeeChartJsonData.
private void getCoffeeChartJsonData() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.setDateValue();
this.checkDateRange();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("kpiReportCoffeeChartJsonDataContentChain", context);
this.message = resultObj.getMessage();
if (resultObj.getValue() instanceof String) {
this.body = String.valueOf(resultObj.getValue());
this.inputStream = new ByteArrayInputStream(this.body.getBytes(Constants.BASE_ENCODING));
this.success = IS_YES;
}
}
Aggregations