use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemExpressionSaveOrUpdateAction method delete.
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
SysExpressionVO expression = new SysExpressionVO();
this.transformFields2ValueObject(expression, new String[] { "oid" });
DefaultResult<Boolean> result = this.systemExpressionLogicService.delete(expression);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null && result.getValue()) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemExpressionSaveOrUpdateAction method updateContent.
private void updateContent() throws ControllerException, AuthorityException, ServiceException, Exception {
String content = this.getFields().get("content");
if (StringUtils.isBlank(content)) {
super.throwMessage(this.getText("CORE_PROG003D0002A_exprId_msg2"));
}
if (content.length() > 8000) {
super.throwMessage(this.getText("CORE_PROG003D0002A_exprId_msg3"));
}
SysExpressionVO expression = new SysExpressionVO();
this.transformFields2ValueObject(expression, new String[] { "oid" });
DefaultResult<SysExpressionVO> oldResult = this.sysExpressionService.findObjectByOid(expression);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
expression = oldResult.getValue();
expression.setContent(content);
DefaultResult<SysExpressionVO> result = this.sysExpressionService.updateObject(expression);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class BscReportSupportUtils method loadExpression.
public static void loadExpression(ThreadLocal<SysExpressionVO> exprThreadLocal, String exprId) throws ServiceException, Exception {
if (exprThreadLocal.get() == null) {
SysExpressionVO sysExpression = new SysExpressionVO();
sysExpression.setExprId(exprId);
DefaultResult<SysExpressionVO> result = sysExpressionService.findByUkCacheable(sysExpression);
if (result.getValue() != null) {
sysExpression = result.getValue();
exprThreadLocal.set(sysExpression);
}
}
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class BscReportSupportUtils method getByteIconBase.
public static byte[] getByteIconBase(String mode, float target, float min, float score, String kpiCompareType, String kpiManagement, float kpiQuasiRange) throws Exception {
byte[] datas = null;
SysExpressionVO sysExpression = exprThreadLocal04.get();
if (null == sysExpression) {
return datas;
}
Map<String, Object> parameters = new HashMap<String, Object>();
Map<String, Object> results = new HashMap<String, Object>();
parameters.put("mode", mode);
parameters.put("target", target);
parameters.put("min", min);
parameters.put("score", score);
parameters.put("compareType", kpiCompareType);
parameters.put("management", kpiManagement);
parameters.put("quasiRange", kpiQuasiRange);
results.put("icon", " ");
ScriptExpressionUtils.execute(sysExpression.getType(), sysExpression.getContent(), results, parameters);
String iconResource = (String) results.get("icon");
ClassLoader classLoader = BscReportSupportUtils.class.getClassLoader();
datas = IOUtils.toByteArray(classLoader.getResource(iconResource).openStream());
return datas;
}
Aggregations