use of com.netsteadfast.greenstep.vo.SysExprJobVO 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.SysExprJobVO in project bamboobsc by billchen198318.
the class SystemExpressionJobUtils method initRunStatusFlag.
public static void initRunStatusFlag(String system) throws ServiceException, Exception {
@SuppressWarnings("unchecked") ISysExprJobService<SysExprJobVO, TbSysExprJob, String> sysExprJobService = (ISysExprJobService<SysExprJobVO, TbSysExprJob, String>) AppContext.getBean("core.service.SysExprJobService");
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("system", system);
paramMap.put("runStatus", ExpressionJobConstants.RUNSTATUS_PROCESS_NOW);
List<TbSysExprJob> exprJobList = sysExprJobService.findListByParams(paramMap);
if (exprJobList == null || exprJobList.size() < 1) {
return;
}
Date udate = new Date();
String uuserid = "system";
for (TbSysExprJob exprJob : exprJobList) {
log.warn("ExpressionJob current RUN_STATUS is 'R' update to 'Y' , Id: " + exprJob.getId() + " , Name: " + exprJob.getName());
exprJob.setRunStatus(ExpressionJobConstants.RUNSTATUS_SUCCESS);
exprJob.setUdate(udate);
exprJob.setUuserid(uuserid);
sysExprJobService.update(exprJob);
}
}
use of com.netsteadfast.greenstep.vo.SysExprJobVO 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());
}
use of com.netsteadfast.greenstep.vo.SysExprJobVO in project bamboobsc by billchen198318.
the class SystemExpressionJobSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
SysExprJobVO sysExprJob = new SysExprJobVO();
this.transformFields2ValueObject(sysExprJob, new String[] { "oid", "id", "name", "description", "runDayOfWeek", "runHour", "runMinute", "contactMode", "contact" });
sysExprJob.setActive(YesNo.NO);
if ("true".equals(this.getFields().get("active"))) {
sysExprJob.setActive(YesNo.YES);
}
sysExprJob.setCheckFault(YesNo.NO);
if ("true".equals(this.getFields().get("checkFault"))) {
sysExprJob.setCheckFault(YesNo.YES);
}
DefaultResult<SysExprJobVO> result = this.systemExpressionLogicService.updateJob(sysExprJob, this.getFields().get("systemOid"), this.getFields().get("expressionOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.SysExprJobVO in project bamboobsc by billchen198318.
the class SystemExpressionJobSaveOrUpdateAction method save.
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
SysExprJobVO sysExprJob = new SysExprJobVO();
this.transformFields2ValueObject(sysExprJob, new String[] { "id", "name", "description", "runDayOfWeek", "runHour", "runMinute", "contactMode", "contact" });
sysExprJob.setActive(YesNo.NO);
if ("true".equals(this.getFields().get("active"))) {
sysExprJob.setActive(YesNo.YES);
}
sysExprJob.setCheckFault(YesNo.NO);
if ("true".equals(this.getFields().get("checkFault"))) {
sysExprJob.setCheckFault(YesNo.YES);
}
DefaultResult<SysExprJobVO> result = this.systemExpressionLogicService.createJob(sysExprJob, this.getFields().get("systemOid"), this.getFields().get("expressionOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
Aggregations