use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class EmployeeServiceImpl method findForInKpiEmpl.
@Override
public DefaultResult<List<BbEmployee>> findForInKpiEmpl(String kpiId) throws ServiceException, Exception {
if (StringUtils.isBlank(kpiId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<List<BbEmployee>> result = new DefaultResult<List<BbEmployee>>();
List<BbEmployee> searchList = this.employeeDAO.findForInKpiEmpl(kpiId);
if (searchList != null && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class FormulaMode method loadReturnModeMapData.
private static void loadReturnModeMapData() {
returnModeMap.clear();
Map<String, Object> params = new HashMap<String, Object>();
params.put("type", CODE_TYPE);
Map<String, String> orderParams = new HashMap<String, String>();
orderParams.put("code", "ASC");
try {
List<TbSysCode> codes = sysCodeService.findListByParams(params, null, orderParams);
for (TbSysCode code : codes) {
if (MODE_DEFAULT_CODE.equals(code.getCode())) {
returnModeMap.put(MODE_DEFAULT, code.getName());
}
if (MODE_CUSTOM_CODE.equals(code.getCode())) {
returnModeMap.put(MODE_CUSTOM, code.getName());
}
}
} catch (ServiceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
if (returnModeMap.size() != 2) {
returnModeMap.clear();
returnModeMap.put(MODE_DEFAULT, MODE_DEFAULT);
returnModeMap.put(MODE_CUSTOM, MODE_CUSTOM);
}
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class TimeSeriesAnalysisUtils method getMeasureFreq.
public static TsaMeasureFreqVO getMeasureFreq(TsaVO tsa) throws ServiceException, Exception {
TsaMeasureFreqVO measureFreq = new TsaMeasureFreqVO();
measureFreq.setTsaOid(tsa.getOid());
DefaultResult<TsaMeasureFreqVO> result = tsaMeasureFreqService.findByUK(measureFreq);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
measureFreq = result.getValue();
return measureFreq;
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class KpiManagementAction method handlerSelectValueForEdit.
private void handlerSelectValueForEdit() throws ServiceException, Exception {
ObjectiveVO objective = new ObjectiveVO();
objective.setObjId(this.kpi.getObjId());
DefaultResult<ObjectiveVO> objResult = this.objectiveService.findByUK(objective);
if (objResult.getValue() == null) {
throw new ServiceException(objResult.getSystemMessage().getValue());
}
objective = objResult.getValue();
PerspectiveVO perspective = new PerspectiveVO();
perspective.setPerId(objective.getPerId());
DefaultResult<PerspectiveVO> perResult = this.perspectiveService.findByUK(perspective);
if (perResult.getValue() == null) {
throw new ServiceException(perResult.getSystemMessage().getValue());
}
perspective = perResult.getValue();
VisionVO vision = new VisionVO();
vision.setVisId(perspective.getVisId());
DefaultResult<VisionVO> visResult = this.visionService.findForSimpleByVisId(vision.getVisId());
if (visResult.getValue() == null) {
throw new ServiceException(visResult.getSystemMessage().getValue());
}
vision = visResult.getValue();
// FormulaVO formula = new FormulaVO();
// formula.setForId( this.kpi.getForId() );
// DefaultResult<FormulaVO> forResult = this.formulaService.findByUK(formula);
// if (forResult.getValue()==null) {
// throw new ServiceException( forResult.getSystemMessage().getValue() );
// }
// formula = forResult.getValue();
//
// FormulaVO trendsFormula = new FormulaVO();
// trendsFormula.setForId( this.kpi.getTrendsForId() );
// DefaultResult<FormulaVO> trendsForResult = this.formulaService.findByUK(trendsFormula);
// if (trendsForResult.getValue()==null) {
// throw new ServiceException( trendsForResult.getSystemMessage().getValue() );
// }
// trendsFormula = trendsForResult.getValue();
this.getFields().put("visionOid", vision.getOid());
this.getFields().put("perspectiveOid", perspective.getOid());
this.getFields().put("objectiveOid", objective.getOid());
this.getFields().put("formulaOid", BscFormulaUtils.getFormulaById(this.kpi.getForId()).getOid());
this.getFields().put("trendsFormulaOid", BscFormulaUtils.getFormulaById(this.kpi.getTrendsForId()).getOid());
this.getFields().put("aggrMethodOid", AggregationMethodUtils.findSimpleById(this.kpi.getCal()).getOid());
this.perspectiveMap = this.perspectiveService.findForMapByVisionOid(vision.getOid(), true);
this.objectiveMap = this.objectiveService.findForMapByPerspectiveOid(perspective.getOid(), true);
}
use of com.netsteadfast.greenstep.base.exception.ServiceException in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method loadContentFromUpload.
// public static void main(String args[]) throws Exception {
// //CONTENT.txt
// String jsonStr = FSUtils.readStr("/tmp/CONTENT.txt");
// Map<String, Object> dataMap = new ObjectMapper().readValue(jsonStr, Map.class);
// BscStructTreeObj treeObj = new ObjectMapper().readValue( SimpleUtils.deB64((String)dataMap.get("treeObjJsonStr")), BscStructTreeObj.class);
// ChainResultObj resultObj = new ObjectMapper().readValue( SimpleUtils.deB64((String)dataMap.get("resultObjJsonStr")), ChainResultObj.class);
//
// }
/**
* 2016-11-01
* 主要給 workspace 圖表元件載入用的
*
* @throws ControllerException
* @throws AuthorityException
* @throws ServiceException
* @throws Exception
*/
private void loadContentFromUpload() throws ControllerException, AuthorityException, ServiceException, Exception {
String uploadOid = this.getFields().get("uploadOid");
byte[] content = UploadSupportUtils.getDataBytes(uploadOid);
String jsonStr = new String(content, Constants.BASE_ENCODING);
if (StringUtils.isBlank(jsonStr)) {
throw new Exception("Report json data error.");
}
@SuppressWarnings("unchecked") Map<String, Object> dataMap = new ObjectMapper().readValue(jsonStr, Map.class);
BscStructTreeObj treeObj = new ObjectMapper().readValue(SimpleUtils.deB64((String) dataMap.get("treeObjJsonStr")), BscStructTreeObj.class);
ChainResultObj resultObj = new ObjectMapper().readValue(SimpleUtils.deB64((String) dataMap.get("resultObjJsonStr")), ChainResultObj.class);
this.body = String.valueOf(resultObj.getValue());
this.message = resultObj.getMessage();
if (!StringUtils.isBlank(this.body) && this.body.startsWith("<!-- BSC_PROG003D0001Q -->")) {
this.success = IS_YES;
}
this.fillPerspectivesPieChartData(treeObj);
this.fillPerspectivesBarChartData(treeObj);
this.fillLineChartData(treeObj);
}
Aggregations