use of com.netsteadfast.greenstep.base.model.SystemForm in project bamboobsc by billchen198318.
the class CommonLoadFormAction method execute.
@JSON(serialize = false)
@SystemForm
public String execute() throws Exception {
String resultName = RESULT_SEARCH_NO_DATA;
if (StringUtils.isBlank(form_id) || StringUtils.isBlank(form_method)) {
this.message = "no settings data to init form!";
this.setErrorMessage(this.message);
return resultName;
}
try {
SysFormMethodVO formMethod = SystemFormUtils.findFormMethod(this.form_id, this.form_method);
resultName = formMethod.getResultType();
this.processExpression(formMethod);
} catch (ControllerException ce) {
this.message = ce.getMessage().toString();
this.setErrorMessage(this.message);
} catch (AuthorityException ae) {
this.message = ae.getMessage().toString();
this.setErrorMessage(this.message);
if (FormResultType.DEFAULT.equals(resultName)) {
resultName = RESULT_NO_AUTHORITH;
}
} catch (ServiceException se) {
this.message = se.getMessage().toString();
this.setErrorMessage(this.message);
} catch (Exception e) {
// 因為是 JSON 所以不用拋出 throw e 了
e.printStackTrace();
if (e.getMessage() == null) {
this.message = e.toString();
this.logger.error(e.toString());
} else {
this.message = e.getMessage().toString();
this.logger.error(e.getMessage());
}
this.setErrorMessage(this.message);
this.success = IS_EXCEPTION;
if (FormResultType.DEFAULT.equals(resultName)) {
resultName = ERROR;
}
}
return resultName;
}
Aggregations