|
|
|
@ -2,6 +2,7 @@ package com.engine.organization.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.cloudstore.dev.api.util.TextUtil;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.organization.entity.jclimport.po.HrmFormFieldPO;
|
|
|
|
@ -12,6 +13,7 @@ import com.engine.organization.entity.search.condition.RangeCondition;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.mapper.condition.QuickSearchMapper;
|
|
|
|
|
import com.engine.organization.service.QuickSearchService;
|
|
|
|
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
@ -40,7 +42,7 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getQuickSearchCondition(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>(16);
|
|
|
|
|
List<RangeCondition> rangeConditions = new ArrayList<>();
|
|
|
|
|
List<Object> rangeConditions = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
List<QuickSearchCondition> quickSearchConditionList = getQuickSearchMapper().getQuickSearchConditionList(user.getUID(), LogModuleNameEnum.RESOURCE.getValue());
|
|
|
|
|
for (QuickSearchCondition quickSearchCondition : quickSearchConditionList) {
|
|
|
|
@ -57,6 +59,7 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
if ("4".equals(formField.getFieldHtmlType()) || "5".equals(formField.getFieldHtmlType())) {
|
|
|
|
|
List<JclSelectItem> selectItemListByFieldId = getQuickSearchMapper().getSelectItemListByFieldId(quickSearchCondition.getFieldId());
|
|
|
|
|
condition.setOptions(selectItemListByFieldId.stream().map(item -> ConditionOption.builder().key(item.getSelectValue()).showname(item.getSelectName()).build()).collect(Collectors.toList()));
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -80,16 +83,20 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
map.put("domkey", Arrays.asList("start", "end"));
|
|
|
|
|
selectLinkageDataMap.put("1", map);
|
|
|
|
|
condition.setSelectLinkageDatas(Collections.singletonList(selectLinkageDataMap));
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
// 整数-浮点数
|
|
|
|
|
List<QuickSearchDetail> quickSearchDetailList = getQuickSearchMapper().getQuickSearchDetailByCid(quickSearchCondition.getId().toString());
|
|
|
|
|
condition.setOptions(quickSearchDetailList.stream().map(item -> ConditionOption.builder().key(item.getId().toString()).showname(item.getCustomName()).build()).collect(Collectors.toList()));
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
break;
|
|
|
|
|
case -1:
|
|
|
|
|
break;
|
|
|
|
|
case -3:
|
|
|
|
|
break;
|
|
|
|
|
case -4:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
SearchConditionItem searchConditionItem = OrganizationFormItemUtil.browserItem(user, 2, 18, 2, false, quickSearchCondition.getCustomName(), formField.getType(), formField.getFieldName(), "");
|
|
|
|
|
rangeConditions.add(searchConditionItem);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -162,6 +169,7 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
if ("1".equals(type)) {
|
|
|
|
|
//单行文本
|
|
|
|
|
fieldType = "5";
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
//整数或浮点数
|
|
|
|
|
fieldType = "1";
|
|
|
|
@ -170,9 +178,11 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
} else if ("2".equals(fieldHtmlType) && "1".equals(type)) {
|
|
|
|
|
//多行文本
|
|
|
|
|
fieldType = "5";
|
|
|
|
|
continue;
|
|
|
|
|
} else if ("2".equals(fieldHtmlType) && "2".equals(type)) {
|
|
|
|
|
//多行文本html
|
|
|
|
|
fieldType = "5";
|
|
|
|
|
continue;
|
|
|
|
|
} else if ("5".equals(fieldHtmlType) && "3".equals(type)) {
|
|
|
|
|
//选择框单选框
|
|
|
|
|
fieldType = "5";
|
|
|
|
|