if (!codeGenerator.isValidCode(code)) {
code = codeGenerator.gen(new CodeFixture(baseCode));
if (codeGenerator.isValidCode(code)) {
baseCode.setCode(code);
} else {
return forward(new Action("edit"), "system.codeGen.failure");
}
}
if (entityDao.duplicate(codeClass, codeId, "code", baseCode.getCode())) { return forward(new Action(
"", "edit"), "error.code.existed"); }
baseCodeService.saveOrUpdate(baseCode);
return redirect("search", "info.save.success");
}