*/
public IResult save(IRequest request) {
AjaxFormResult result = new AjaxFormResult();
String oid = request.get("oid");
String brNo = request.get("code");
Department branch = null;
if (CapString.isEmpty(oid)) {
branch = departmentService.findByBrno(brNo);
if (branch != null) {
result.set("exist", Boolean.TRUE);
return result;
}
} else {
branch = commonSrv.findById(Department.class, oid);
}
if (branch == null) {
branch = new Department();
branch.setOid(null);
}
CapBeanUtil.map2Bean(request, branch, Department.class);
branch.setUpdater(CapSecurityContext.getUserId());
branch.setUpdateTime(CapDate.getCurrentTimestamp());
departmentService.save(branch);
return result;
}