| | |
| | | |
| | | public void pageData(Page<OAStaff> page, Map<String, Object> param) |
| | | throws Exception { |
| | | String hql = " from " + OAStaff.class.getName() + " where companyId=:companyId"; |
| | | String hql = " from " + OAStaff.class.getName() + " where companyId =:companyId and deptId =:deptId"; |
| | | |
| | | Map<String, Object> args = new HashMap<>(); |
| | | args.put("companyId", ContextUtil.getCompanyId()); |
| | | args.put("deptId", ContextUtil.subDeptId(null)); |
| | | |
| | | if (null != param) { |
| | | |
| | |
| | | } |
| | | |
| | | public String saveOrUpdate(OAStaff data) { |
| | | |
| | | //判断组织编码 |
| | | if (StringUtils.isEmpty(data.getCompanyId())) { |
| | | data.setCompanyId(data.getCompanyId()); |
| | | } |
| | | Session session = this.getSessionFactory().openSession(); |
| | | try { |
| | | data.setCompanyId(ContextUtil.getCompanyId()); |
| | | if (null == data.getId()) { |
| | | data.setId(ContextUtil.getUUID()); |
| | | } |
| | | session.saveOrUpdate(data); |
| | | } finally { |
| | | session.flush(); |