feature/hs
dxfeng 2 years ago
commit 613cadfcd0

@ -26,6 +26,8 @@ import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet; import weaver.conn.RecordSet;
import weaver.general.Util; import weaver.general.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -70,6 +72,45 @@ public class JobBrowserService extends BrowserService {
return resultMap; 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 @Override
public Map getBrowserConditionInfo(Map<String, Object> map) { public Map getBrowserConditionInfo(Map<String, Object> map) {
Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>(); Map<String, List<SearchConditionItem>> apiDatas = new HashMap<>();
@ -130,7 +171,7 @@ public class JobBrowserService extends BrowserService {
// 分权 // 分权
DetachUtil detachUtil = new DetachUtil(user); DetachUtil detachUtil = new DetachUtil(user);
if (detachUtil.isDETACH()) { if (detachUtil.isDETACH()) {
sqlWhere += " AND t.parent_comp in (" + detachUtil.getJclRoleLevels() + ")"; sqlWhere += " AND t.ec_company in (" + detachUtil.getJclRoleLevels() + ")";
} }
return sqlWhere; return sqlWhere;
} }

@ -159,7 +159,7 @@ public class DepartmentBO {
return ""; return "";
} }
String departmentPrincipal = MapperProxyFactory.getProxy(DepartmentMapper.class).getDepartmentPrincipal(id); String departmentPrincipal = MapperProxyFactory.getProxy(DepartmentMapper.class).getDepartmentPrincipal(id);
if (StringUtils.isBlank(departmentPrincipal)) { if (StringUtils.isBlank(departmentPrincipal) || "$NULL$".equalsIgnoreCase(departmentPrincipal)) {
return ""; return "";
} }
List<Long> collect = Arrays.stream(departmentPrincipal.split(",")).map(Long::parseLong).collect(Collectors.toList()); List<Long> collect = Arrays.stream(departmentPrincipal.split(",")).map(Long::parseLong).collect(Collectors.toList());

@ -137,7 +137,8 @@
<select id="hasSubs" resultType="java.lang.String"> <select id="hasSubs" resultType="java.lang.String">
select distinct supDepId select distinct supDepId
from hrmdepartment from hrmdepartment
where canceled = 0 where 1=1
<include refid="com.engine.organization.mapper.comp.CompMapper.subsWhere"/>
</select> </select>
<select id="countUsedInJob" resultType="java.lang.Integer"> <select id="countUsedInJob" resultType="java.lang.Integer">
select count(1) select count(1)

@ -152,7 +152,7 @@
where time_start &lt;= convert(varchar(100),getDate(),23) and time_end &gt; convert(varchar(100),getDate(),23)) and delete_type=0 where time_start &lt;= convert(varchar(100),getDate(),23) and time_end &gt; convert(varchar(100),getDate(),23)) and delete_type=0
group by job_id) e on a.id=e.job_id group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f group by c.id) f
on f.id=a.id on f.id=a.id
@ -174,7 +174,7 @@
where time_start&lt;=NOW() and time_end &gt; NOW() and delete_type=0) where time_start&lt;=NOW() and time_end &gt; NOW() and delete_type=0)
group by job_id) e on a.id=e.job_id group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f group by c.id) f
on f.id=a.id on f.id=a.id
@ -196,7 +196,7 @@
where time_start&lt;=TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd') and time_end&gt;TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd')) and delete_type=0 where time_start&lt;=TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd') and time_end&gt;TO_DATE(to_char(SYSDATE,'yyyy-MM-dd'),'yyyy-MM-dd')) and delete_type=0
group by job_id) e on a.id=e.job_id group by job_id) e on a.id=e.job_id
left join ( select c.id,count(1) fcnt from hrmresource a left join ( select c.id,count(1) fcnt from hrmresource a
left join Hrmjobtitles b on a.jobtitle=b.id left join Hrmjobtitles b on a.jobtitle=b.id and a.status&lt;4
left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department left join jcl_org_job c on b.id=c.ec_jobtitle and a.subcompanyid1=c.ec_company and a.departmentid=c.ec_department
group by c.id) f group by c.id) f
on f.id=a.id on f.id=a.id

@ -518,9 +518,15 @@
<if test="resourcePO.subcompanyid1 != null"> <if test="resourcePO.subcompanyid1 != null">
and t.ec_company = #{resourcePO.subcompanyid1} and t.ec_company = #{resourcePO.subcompanyid1}
</if> </if>
<if test="resourcePO.subcompanyid1 == null">
and t.ec_company is null
</if>
<if test="resourcePO.departmentid != null"> <if test="resourcePO.departmentid != null">
and t.ec_department = #{resourcePO.departmentid} and t.ec_department = #{resourcePO.departmentid}
</if> </if>
<if test="resourcePO.departmentid == null">
and t.ec_department is null
</if>
<if test="resourcePO.jobtitle != null"> <if test="resourcePO.jobtitle != null">
and t.ec_jobTitle = #{resourcePO.jobtitle} and t.ec_jobTitle = #{resourcePO.jobtitle}
</if> </if>

@ -111,12 +111,9 @@
from jcl_org_hrmresource t where delete_type = 0 and work_code = #{workCode} from jcl_org_hrmresource t where delete_type = 0 and work_code = #{workCode}
</select> </select>
<select id="listDetachAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO"> <select id="listDetachAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
SELECT t.last_name as lastName,d.departmentname as departmentName, select t.lastname as lastname, d.departmentname as departmentname, c.subcompanyname as companyname, t.mobile,
c.subcompanyname as companyName,t.mobile,t.telephone,t1.last_name as managerName t.telephone, t1.lastname as managername from hrmresource t left join hrmdepartment d on t.departmentid = d.id
from jcl_org_hrmresource t left join hrmsubcompany c on t.subcompanyid1 = c.id left join hrmresource t1 on t.managerid = t1.id
left join hrmdepartment d on t.ec_department = d.id
left join hrmsubcompany c on t.ec_company = c.id
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
where 1 = 1 where 1 = 1
<if test="ids != null and ids.size > 0"> <if test="ids != null and ids.size > 0">
AND t.id IN AND t.id IN
@ -128,7 +125,7 @@
<foreach collection="companyIds" open="(" item="companyId" separator="," close=")"> <foreach collection="companyIds" open="(" item="companyId" separator="," close=")">
#{companyId} #{companyId}
</foreach> </foreach>
order by t.show_order asc; order by t.dsporder asc
</select> </select>
<select id="getMaxShowOrder" resultType="java.lang.Long"> <select id="getMaxShowOrder" resultType="java.lang.Long">

@ -137,7 +137,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
table.setSqlwhere(sqlWhere); table.setSqlwhere(sqlWhere);
List<WeaTableColumn> weaTableColumnList = new ArrayList<>(); List<WeaTableColumn> weaTableColumnList = new ArrayList<>();
JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID())); JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID()));
String columns = null; String columns = "";
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
List<SearchConditionGroup> allConditions = getAllConditions(); List<SearchConditionGroup> allConditions = getAllConditions();
@ -637,20 +637,35 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
DBType dbType = DBType.get(new RecordSet().getDBType()); DBType dbType = DBType.get(new RecordSet().getDBType());
StringBuilder sb = new StringBuilder(" where 1=1 "); StringBuilder sb = new StringBuilder(" where 1=1 ");
if (params.containsKey("lastName")) {
// sb.append(" and t.status = 1");
sb.append(" and t.status < 4");
}
for (Map.Entry<String, Object> entry : params.entrySet()) { for (Map.Entry<String, Object> entry : params.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
String value = Util.null2String(entry.getValue()); String value = Util.null2String(entry.getValue());
if (StringUtils.isBlank(value)) {
continue;
}
if ("lastName".equals(key)) { if ("lastName".equals(key)) {
if (StringUtils.isNotBlank(value)) { sb.append(" and t.lastname ").append(dbType.like(value));
sb.append(" and t.lastname ").append(dbType.like(value)); }
if ("companyId".equals(key)) {
sb.append(" and t.subcompanyid1 ='").append(value).append("'");
}
if ("departmentId".equals(key)) {
sb.append(" and t.departmentId ='").append(value).append("'");
}
if ("jobTitle".equals(key)) {
JobPO jobById = getJobMapper().getJobById(Long.parseLong(value));
if (null != jobById) {
sb.append(" and t.jobtitle ='").append(Util.null2String(jobById.getEcJobTitle())).append("' and t.subcompanyid1 = '").append(Util.null2String(jobById.getEcCompany())).append("' and t.departmentId ='").append(Util.null2String(jobById.getEcDepartment())).append("'");
} else {
sb = new StringBuilder(" where 1 = 2 ");
break;
} }
sb.append(" and t.status = 1");
continue;
} }
if (StringUtils.isBlank(value)) {
continue;
}
SearchConditionItem searchConditionItem = allFieldsMap.get(key); SearchConditionItem searchConditionItem = allFieldsMap.get(key);
// 根据不同的类型,不同的查询方式 // 根据不同的类型,不同的查询方式
buildDynamicSql(searchConditionItem, key, value, sb, dbType); buildDynamicSql(searchConditionItem, key, value, sb, dbType);
@ -1086,7 +1101,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
break; break;
case SELECT://选择框 case SELECT://选择框
if (!"-1".equals(value)) { if (!"-1".equals(value)) {
sb.append(" and ").append(tableSql).append(" = '").append(value).append("' "); if ("t.status".equalsIgnoreCase(tableSql) && "10".equals(value)) {
sb.append(" and ").append(tableSql).append(" < 4 ");
} else {
sb.append(" and ").append(tableSql).append(" = '").append(value).append("' ");
}
} }
break; break;
case DATE: case DATE:
@ -1157,15 +1176,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
private void addEmptyForSelect(SearchConditionItem searchConditionItem) { private void addEmptyForSelect(SearchConditionItem searchConditionItem) {
searchConditionItem.setValue("-1"); searchConditionItem.setValue("-1");
if ("-1_hrm_status".equals(searchConditionItem.getDomkey()[0])) { if ("-1_hrm_status".equals(searchConditionItem.getDomkey()[0])) {
searchConditionItem.setValue("1"); // 默认赋值 在职状态
searchConditionItem.setValue("10");
} }
List<SearchConditionOption> options = searchConditionItem.getOptions(); List<SearchConditionOption> options = searchConditionItem.getOptions();
SearchConditionOption searchConditionOption = new SearchConditionOption(); SearchConditionOption searchConditionOption = new SearchConditionOption();
searchConditionOption.setKey("-1"); searchConditionOption.setKey("-1");
searchConditionOption.setShowname("全部");
options.add(0, searchConditionOption); options.add(0, searchConditionOption);
options.forEach(item -> { options.forEach(item -> item.setSelected(false));
item.setSelected(false);
});
} }
/** /**

@ -195,8 +195,10 @@ public class CompanyImport {
try { try {
if ("subcompanyname".equalsIgnoreCase(infoPO.getFieldName())) { if ("subcompanyname".equalsIgnoreCase(infoPO.getFieldName())) {
reallyValue = cellValue; reallyValue = cellValue;
} else if (StringUtils.isBlank(cellValue)) {
reallyValue = "";
} else { } else {
reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), true); reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), null != infoPO.getIsSystem() && 1 == infoPO.getIsSystem());
} }
} catch (Exception e) { } catch (Exception e) {
historyDetailPO.setOperateDetail(cellValue + "转换失败"); historyDetailPO.setOperateDetail(cellValue + "转换失败");

@ -125,8 +125,8 @@ public class DepartmentImport {
value += SystemEnv.getHtmlLabelName(28576, user.getLanguage()); value += SystemEnv.getHtmlLabelName(28576, user.getLanguage());
item.put("link", templatePath); item.put("link", templatePath);
} }
if(3==i){ if (3 == i) {
value = value.replace("及显示顺序",""); value = value.replace("及显示顺序", "");
} }
item.put("value", value); item.put("value", value);
itemList.add(item); itemList.add(item);
@ -207,8 +207,10 @@ public class DepartmentImport {
try { try {
if ("departmentmark".equalsIgnoreCase(infoPO.getFieldName()) || "subcompanyid1".equalsIgnoreCase(infoPO.getFieldName())) { if ("departmentmark".equalsIgnoreCase(infoPO.getFieldName()) || "subcompanyid1".equalsIgnoreCase(infoPO.getFieldName())) {
reallyValue = cellValue; reallyValue = cellValue;
} else if (StringUtils.isBlank(cellValue)) {
reallyValue = "";
} else { } else {
reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), true); reallyValue = HrmFieldManagerForService.getReallyFieldvalue(infoPO.getJsonObject(cellValue), null != infoPO.getIsSystem() && 1 == infoPO.getIsSystem());
} }
} catch (Exception e) { } catch (Exception e) {
historyDetailPO.setOperateDetail(cellValue + "转换失败"); historyDetailPO.setOperateDetail(cellValue + "转换失败");

@ -232,7 +232,7 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
if ("accounttype".equalsIgnoreCase(voFields[i])) { if ("accounttype".equalsIgnoreCase(voFields[i])) {
accounttypeIndex = i; accounttypeIndex = i;
} }
if (keyFieldIndex != 2 && certificateNumIndex != 29) break; //if (keyFieldIndex != 2 && certificateNumIndex != 29) break;
} }
try { try {
Workbook workbook; Workbook workbook;
@ -292,10 +292,12 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
fieldList.add(cellValue); fieldList.add(cellValue);
if (keyFieldIndex == k) //如果重复性验证标准数据库字段下标与标准excel模板下标相等则找到对应的excel验证列 if (keyFieldIndex == k) //如果重复性验证标准数据库字段下标与标准excel模板下标相等则找到对应的excel验证列
keyColumn = i; keyColumn = i;
if (certificateNumIndex == k) { // if (certificateNumIndex == k) {
if ("身份证号码".equals(cellValue)) {
certificateNumColumn = i; certificateNumColumn = i;
} }
if (accounttypeIndex == k) { // if (accounttypeIndex == k) {
if ("账号类型".equals(cellValue)) {
accounttypeColumn = i; accounttypeColumn = i;
} }
flag = true; flag = true;
@ -550,7 +552,12 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
if (certificateNumColumn == -1) if (certificateNumColumn == -1)
return false; return false;
String certificateNum = getCellValue(row.getCell((short) certificateNumColumn)).trim(); String certificateNum = getCellValue(row.getCell((short) certificateNumColumn)).trim();
String accounttype = getCellValue(row.getCell((short) accounttypeColumn)).trim(); String accounttype;
if (accounttypeColumn == -1) {
accounttype = "";
} else {
accounttype = getCellValue(row.getCell((short) accounttypeColumn)).trim();
}
String key = getCellValue(row.getCell((short) keyColumn)).trim(); String key = getCellValue(row.getCell((short) keyColumn)).trim();
if (voFields[fieldsMap.get(keyColumn)].equals("")) if (voFields[fieldsMap.get(keyColumn)].equals(""))
key = getCellValue(row.getCell((short) 0)).trim() + ">" + getCellValue(row.getCell((short) 1)).trim() + "_" + key; key = getCellValue(row.getCell((short) 0)).trim() + ">" + getCellValue(row.getCell((short) 1)).trim() + "_" + key;

Loading…
Cancel
Save