|
|
@ -6,7 +6,6 @@ import com.api.browser.bean.SearchConditionOption;
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
import com.api.hrm.bean.HrmFieldBean;
|
|
|
|
import com.api.hrm.bean.HrmFieldBean;
|
|
|
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
|
|
|
import com.api.hrm.util.HrmFieldSearchConditionComInfo;
|
|
|
|
import com.api.hrm.util.HrmTransMethod;
|
|
|
|
|
|
|
|
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
|
|
|
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
@ -307,7 +306,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
List<String> selectKeys;
|
|
|
|
List<String> selectKeys;
|
|
|
|
if ("custom".equals(type)) {
|
|
|
|
if ("custom".equals(type)) {
|
|
|
|
if ("-1".equals(templateId)) {
|
|
|
|
if ("-1".equals(templateId)) {
|
|
|
|
selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid".split(","));
|
|
|
|
//selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid".split(","));
|
|
|
|
|
|
|
|
selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder".split(","));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId);
|
|
|
|
searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId);
|
|
|
|
selectKeys = getSelectKeys(searchTemplateById);
|
|
|
|
selectKeys = getSelectKeys(searchTemplateById);
|
|
|
@ -603,7 +603,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionGroup> allConditions = getAllConditions();
|
|
|
|
List<SearchConditionGroup> allConditions = getAllConditions(true);
|
|
|
|
// 穿梭框ID,展示所选字段信息
|
|
|
|
// 穿梭框ID,展示所选字段信息
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
if ("-1".equals(templateId)) {
|
|
|
|
if ("-1".equals(templateId)) {
|
|
|
@ -792,6 +792,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
// sb.append(" and t.status = 1");
|
|
|
|
// sb.append(" and t.status = 1");
|
|
|
|
sb.append(" and t.status < 4");
|
|
|
|
sb.append(" and t.status < 4");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (params.containsKey("-1_hrm_subcompanyid1")) {
|
|
|
|
|
|
|
|
String value = Util.null2String(params.get("-1_hrm_subcompanyid1"));
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(value)) {
|
|
|
|
|
|
|
|
sb.append(" and t.subcompanyid1 in(").append(value).append(")");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
params.remove("-1_hrm_subcompanyid1");
|
|
|
|
|
|
|
|
}
|
|
|
|
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());
|
|
|
@ -994,12 +1001,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<SearchConditionGroup> getAllConditions() {
|
|
|
|
|
|
|
|
return getAllConditions(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取所有搜索字段信息构建的高级搜索表单
|
|
|
|
* 获取所有搜索字段信息构建的高级搜索表单
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public List<SearchConditionGroup> getAllConditions() {
|
|
|
|
public List<SearchConditionGroup> getAllConditions(boolean isSearch) {
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
|
|
|
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
|
|
@ -1010,6 +1020,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString());
|
|
|
|
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString());
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
|
|
|
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
|
|
|
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
|
|
|
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
|
|
|
|
|
|
|
SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo,isSearch);
|
|
|
|
|
|
|
|
basicConditionItems.add(0,searchConditionItem);
|
|
|
|
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, basicConditionItems));
|
|
|
|
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, basicConditionItems));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1029,6 +1041,34 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
return addGroups;
|
|
|
|
return addGroups;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 花名册构建
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param hrmFieldSearchConditionComInfo
|
|
|
|
|
|
|
|
* @param isSearch
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private SearchConditionItem buildSubCompanyCondition(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, boolean isSearch) {
|
|
|
|
|
|
|
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldid("");
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldname("-1_hrm_subcompanyid1");
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldlabel("-2458");
|
|
|
|
|
|
|
|
hrmFieldBean.setFieldhtmltype("3");
|
|
|
|
|
|
|
|
if (isSearch) {
|
|
|
|
|
|
|
|
hrmFieldBean.setType("170");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
hrmFieldBean.setType("164");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
hrmFieldBean.setIsQuickSearch(false);
|
|
|
|
|
|
|
|
hrmFieldBean.setIsScope(false);
|
|
|
|
|
|
|
|
hrmFieldBean.setDmlurl("");
|
|
|
|
|
|
|
|
hrmFieldBean.setIssystem("1");
|
|
|
|
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
|
|
|
return searchConditionItem;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 构建查询条件Item
|
|
|
|
* 构建查询条件Item
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -1081,32 +1121,37 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", scopeid);
|
|
|
|
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", scopeid);
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
for (String field : fieldNames) {
|
|
|
|
for (String field : fieldNames) {
|
|
|
|
String fieldName = field.substring(field.lastIndexOf("_") + 1);
|
|
|
|
if ("-1_hrm_subcompanyid1".equals(field)) {
|
|
|
|
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
|
|
|
SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo,true);
|
|
|
|
if (null == hrmFieldConf) {
|
|
|
|
conditionItems.add(searchConditionItem);
|
|
|
|
continue;
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
String fieldName = field.substring(field.lastIndexOf("_") + 1);
|
|
|
|
boolean baseField = hfm.isBaseField(fieldName);
|
|
|
|
JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName);
|
|
|
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
|
|
|
if (null == hrmFieldConf) {
|
|
|
|
hrmFieldBean.setFieldid(Util.null2String(hrmFieldConf.getString("id")));
|
|
|
|
continue;
|
|
|
|
hrmFieldBean.setFieldname(scopeid + "_" + (baseField ? "hrm" : "cus") + "_" + fieldName);
|
|
|
|
}
|
|
|
|
hrmFieldBean.setFieldlabel(hrmFieldConf.getString("fieldlabel"));
|
|
|
|
boolean baseField = hfm.isBaseField(fieldName);
|
|
|
|
hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype"));
|
|
|
|
HrmFieldBean hrmFieldBean = new HrmFieldBean();
|
|
|
|
hrmFieldBean.setType(hrmFieldConf.getString("type"));
|
|
|
|
hrmFieldBean.setFieldid(Util.null2String(hrmFieldConf.getString("id")));
|
|
|
|
hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl"));
|
|
|
|
hrmFieldBean.setFieldname(scopeid + "_" + (baseField ? "hrm" : "cus") + "_" + fieldName);
|
|
|
|
hrmFieldBean.setIssystem(baseField ? "1" : "0");
|
|
|
|
hrmFieldBean.setFieldlabel(hrmFieldConf.getString("fieldlabel"));
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype"));
|
|
|
|
hrmFieldBean.setIsQuickSearch(false);
|
|
|
|
hrmFieldBean.setType(hrmFieldConf.getString("type"));
|
|
|
|
hrmFieldBean.setIsScope(false);
|
|
|
|
hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl"));
|
|
|
|
if ("jobactivity".equals(fieldName)) {
|
|
|
|
hrmFieldBean.setIssystem(baseField ? "1" : "0");
|
|
|
|
// 职务:282
|
|
|
|
hrmFieldBean.setIsFormField(true);
|
|
|
|
hrmFieldBean.setType("282");
|
|
|
|
hrmFieldBean.setIsQuickSearch(false);
|
|
|
|
}
|
|
|
|
hrmFieldBean.setIsScope(false);
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
if ("jobactivity".equals(fieldName)) {
|
|
|
|
conditionItems.add(searchConditionItem);
|
|
|
|
// 职务:282
|
|
|
|
// 如果为下拉框,添加一条空选项
|
|
|
|
hrmFieldBean.setType("282");
|
|
|
|
if (searchConditionItem.getConditionType().equals(ConditionType.SELECT)) {
|
|
|
|
}
|
|
|
|
addEmptyForSelect(searchConditionItem);
|
|
|
|
SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user);
|
|
|
|
|
|
|
|
conditionItems.add(searchConditionItem);
|
|
|
|
|
|
|
|
// 如果为下拉框,添加一条空选项
|
|
|
|
|
|
|
|
if (searchConditionItem.getConditionType().equals(ConditionType.SELECT)) {
|
|
|
|
|
|
|
|
addEmptyForSelect(searchConditionItem);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (CollectionUtils.isNotEmpty(conditionItems)) {
|
|
|
|
if (CollectionUtils.isNotEmpty(conditionItems)) {
|
|
|
|