/** * 创建一个员工 * * @param employee * @param jobId * @param organizationId * @return */ @ResponseBody @RequestMapping("/create") public Map<String, Object> createEmployee(Employee employee, Long postId) { Map<String, Object> dataMap = new HashMap<String, Object>(); try { Post post = null; if (postId != null) { post = getBaseApplication().getEntity(Post.class, postId); } employeeApplication.createEmployeeWithPost(employee, post); dataMap.put("result", "success"); } catch (SnIsExistException exception) { dataMap.put("result", "员工编号: " + employee.getSn() + " 已被使用!"); } catch (IdNumberIsExistException exception) { dataMap.put("result", "不能使用与其他人一样的证件号码!"); } catch (Exception e) { dataMap.put("result", "保存失败!"); e.printStackTrace(); } return dataMap; }