|
|
|
@ -26,6 +26,8 @@ import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -70,6 +72,45 @@ public class JobBrowserService extends BrowserService {
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> browserAutoComplete(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>();
|
|
|
|
|
String q = Util.null2String(httpServletRequest.getParameter("q"));
|
|
|
|
|
List<String> sqlParams = new ArrayList<>();
|
|
|
|
|
String keyword = "";
|
|
|
|
|
if (q.length() > 0) keyword = "%" + q + "%";
|
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
|
String sqlwhere = " where t.delete_type = 0 ";
|
|
|
|
|
String backfields = "t.id, t.job_no, h.jobtitlename as name, t.sequence_id, t.scheme_id , t.grade_id , t.level_id ";
|
|
|
|
|
String fromSql = "FROM jcl_org_job t left join hrmjobtitles h on t.ec_jobTitle = h.id ";
|
|
|
|
|
String orderby = " order by t.id ";
|
|
|
|
|
sqlwhere += " ";
|
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user);
|
|
|
|
|
if (detachUtil.isDETACH()) {
|
|
|
|
|
sqlwhere += " AND t.ec_company in (" + detachUtil.getJclRoleLevels() + ")";
|
|
|
|
|
}
|
|
|
|
|
if (!"".equals(keyword)) {
|
|
|
|
|
sqlwhere += " and (h.jobtitlemark like ? or h.jobtitlename like ? or h.ecology_pinyin_search like ? )";
|
|
|
|
|
sqlParams.add(keyword);
|
|
|
|
|
sqlParams.add(keyword);
|
|
|
|
|
sqlParams.add(keyword);
|
|
|
|
|
}
|
|
|
|
|
String sql = "select " + backfields + fromSql + sqlwhere + orderby;
|
|
|
|
|
rs.executeQuery(sql, sqlParams);
|
|
|
|
|
List<Map<String, String>> datas = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
Map<String, String> item = new HashMap<>();
|
|
|
|
|
item.put("id", Util.null2String(rs.getString("id")));
|
|
|
|
|
String name = Util.null2String(rs.getString("name"));
|
|
|
|
|
item.put("name", name);
|
|
|
|
|
item.put("title", name);
|
|
|
|
|
datas.add(item);
|
|
|
|
|
}
|
|
|
|
|
apidatas.put("datas", datas);
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map getBrowserConditionInfo(Map<String, Object> map) {
|
|
|
|
|
Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>();
|
|
|
|
|