use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemExpressionLogicServiceImpl method updateJob.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysExprJobVO> updateJob(SysExprJobVO exprJob, String systemOid, String expressionOid) throws ServiceException, Exception {
if (null == exprJob || StringUtils.isBlank(exprJob.getOid()) || StringUtils.isBlank(systemOid) || StringUtils.isBlank(expressionOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysVO sys = new SysVO();
sys.setOid(systemOid);
DefaultResult<SysVO> sysResult = this.sysService.findObjectByOid(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
SysExpressionVO expression = new SysExpressionVO();
expression.setOid(expressionOid);
DefaultResult<SysExpressionVO> expressionResult = this.sysExpressionService.findObjectByOid(expression);
if (expressionResult.getValue() == null) {
throw new ServiceException(expressionResult.getSystemMessage().getValue());
}
expression = expressionResult.getValue();
DefaultResult<SysExprJobVO> oldResult = this.sysExprJobService.findObjectByOid(exprJob);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
exprJob.setId(oldResult.getValue().getId());
exprJob.setSystem(sys.getSysId());
exprJob.setExprId(expression.getExprId());
exprJob.setRunStatus(oldResult.getValue().getRunStatus());
if (super.isBlank(oldResult.getValue().getRunStatus())) {
exprJob.setRunStatus(ExpressionJobConstants.RUNSTATUS_FAULT);
logger.warn("Before runStatus flag is blank. Expression Job ID: " + oldResult.getValue().getId());
}
this.setStringValueMaxLength(exprJob, "description", MAX_DESCRIPTION_LENGTH);
return this.sysExprJobService.updateObject(exprJob);
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemBeanHelpLogicServiceImpl method createExpr.
@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<SysBeanHelpExprVO> createExpr(SysBeanHelpExprVO beanHelpExpr, String helpOid, String expressionOid) throws ServiceException, Exception {
if (beanHelpExpr == null || super.isBlank(helpOid) || super.isBlank(expressionOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBeanHelpVO sysBeanHelp = new SysBeanHelpVO();
sysBeanHelp.setOid(helpOid);
DefaultResult<SysBeanHelpVO> mResult = this.sysBeanHelpService.findObjectByOid(sysBeanHelp);
if (mResult.getValue() == null) {
throw new ServiceException(mResult.getSystemMessage().getValue());
}
// 查看有沒有資料
sysBeanHelp = mResult.getValue();
SysExpressionVO sysExpression = new SysExpressionVO();
sysExpression.setOid(expressionOid);
DefaultResult<SysExpressionVO> exprResult = this.sysExpressionService.findObjectByOid(sysExpression);
if (exprResult.getValue() == null) {
throw new ServiceException(exprResult.getSystemMessage().getValue());
}
sysExpression = exprResult.getValue();
beanHelpExpr.setHelpOid(sysBeanHelp.getOid());
beanHelpExpr.setExprId(sysExpression.getExprId());
return this.sysBeanHelpExprService.saveObject(beanHelpExpr);
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SysExpressionServiceImpl method findExpressionMap.
@Override
public Map<String, String> findExpressionMap(boolean pleaseSelect) throws ServiceException, Exception {
Map<String, String> dataMap = new LinkedHashMap<String, String>();
if (pleaseSelect) {
dataMap.put(Constants.HTML_SELECT_NO_SELECT_ID, Constants.HTML_SELECT_NO_SELECT_NAME);
}
List<SysExpressionVO> searchList = this.sysExpressionDAO.findListForSimple();
for (int i = 0; searchList != null && i < searchList.size(); i++) {
SysExpressionVO expression = searchList.get(i);
dataMap.put(expression.getOid(), expression.getExprId() + " - " + expression.getName());
}
return dataMap;
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemExpressionJobUtils method getExpressionJobForManualMode.
public static ExpressionJobObj getExpressionJobForManualMode(String expressionJobOid) throws ServiceException, Exception {
if (StringUtils.isBlank(expressionJobOid)) {
throw new Exception("error, expressionJobId is blank!");
}
@SuppressWarnings("unchecked") ISysExprJobService<SysExprJobVO, TbSysExprJob, String> sysExprJobService = (ISysExprJobService<SysExprJobVO, TbSysExprJob, String>) AppContext.getBean("core.service.SysExprJobService");
@SuppressWarnings("unchecked") ISysExpressionService<SysExpressionVO, TbSysExpression, String> sysExpressionService = (ISysExpressionService<SysExpressionVO, TbSysExpression, String>) AppContext.getBean("core.service.SysExpressionService");
SysExprJobVO exprJob = new SysExprJobVO();
exprJob.setOid(expressionJobOid);
DefaultResult<SysExprJobVO> exprJobResult = sysExprJobService.findObjectByOid(exprJob);
if (exprJobResult.getValue() == null) {
throw new ServiceException(exprJobResult.getSystemMessage().getValue());
}
exprJob = exprJobResult.getValue();
SysExpressionVO expr = new SysExpressionVO();
expr.setExprId(exprJob.getExprId());
DefaultResult<SysExpressionVO> exprResult = sysExpressionService.findByUK(expr);
if (exprResult.getValue() == null) {
throw new ServiceException(exprResult.getSystemMessage().getValue());
}
expr = exprResult.getValue();
ExpressionJobObj jobObj = new ExpressionJobObj();
jobObj.setSysExprJob(exprJob);
jobObj.setSysExprJobLog(new SysExprJobLogVO());
jobObj.setSysExpression(expr);
return jobObj;
}
use of com.netsteadfast.greenstep.vo.SysExpressionVO in project bamboobsc by billchen198318.
the class SystemExpressionJobManagementAction method loadSysExprJobData.
private void loadSysExprJobData() throws ServiceException, Exception {
this.transformFields2ValueObject(this.sysExprJob, new String[] { "oid" });
DefaultResult<SysExprJobVO> result = this.sysExprJobService.findObjectByOid(this.sysExprJob);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.sysExprJob = result.getValue();
SysVO sys = new SysVO();
sys.setSysId(this.sysExprJob.getSystem());
DefaultResult<SysVO> sysResult = this.sysService.findByUK(sys);
if (sysResult.getValue() == null) {
throw new ServiceException(sysResult.getSystemMessage().getValue());
}
sys = sysResult.getValue();
this.getFields().put("systemOid", sys.getOid());
SysExpressionVO expression = new SysExpressionVO();
expression.setExprId(this.sysExprJob.getExprId());
DefaultResult<SysExpressionVO> expressionResult = this.sysExpressionService.findByUK(expression);
if (expressionResult.getValue() == null) {
throw new ServiceException(expressionResult.getSystemMessage().getValue());
}
expression = expressionResult.getValue();
this.getFields().put("expressionOid", expression.getOid());
}
Aggregations