|
|
|
@ -2,7 +2,6 @@ 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;
|
|
|
|
@ -13,7 +12,6 @@ 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;
|
|
|
|
@ -60,19 +58,20 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
RangeCondition condition = new RangeCondition();
|
|
|
|
|
condition.setLabel(quickSearchCondition.getCustomName());
|
|
|
|
|
condition.setDomkey(Collections.singletonList(formField.getFieldName()));
|
|
|
|
|
//condition.setShowModel(quickSearchCondition.getShowModel());
|
|
|
|
|
// 根据条件字段类型,组装展示样式
|
|
|
|
|
switch (quickSearchCondition.getType()) {
|
|
|
|
|
case 5:
|
|
|
|
|
// 字段本身值、判断有无下拉框选项
|
|
|
|
|
if ("4".equals(formField.getFieldHtmlType()) || "5".equals(formField.getFieldHtmlType())) {
|
|
|
|
|
List<JclSelectItem> selectItemListByFieldId = getQuickSearchMapper().getSelectItemListByFieldId(quickSearchCondition.getFieldId());
|
|
|
|
|
List<JclSelectItem> selectItemListByFieldId = getQuickSearchMapper().getSelectItemListByFieldId(quickSearchCondition.getFieldId());
|
|
|
|
|
if (CollectionUtils.isEmpty(selectItemListByFieldId)) {
|
|
|
|
|
condition.setCom("未设置选项");
|
|
|
|
|
} else {
|
|
|
|
|
// 字段本身值、判断有无下拉框选项
|
|
|
|
|
List<ConditionOption> options = selectItemListByFieldId.stream().map(item -> ConditionOption.builder().key(item.getSelectValue()).showname(item.getSelectName()).build()).collect(Collectors.toList());
|
|
|
|
|
options.add(ConditionOption.builder().key("-1").showname("全部").build());
|
|
|
|
|
condition.setOptions(options);
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
// 日期类型数据
|
|
|
|
@ -91,22 +90,25 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
Map<String, Object> map = new HashMap<>(2);
|
|
|
|
|
map.put("conditionType", "RANGEPICKER");
|
|
|
|
|
map.put("domkey", Arrays.asList("start", "end"));
|
|
|
|
|
selectLinkageDataMap.put("1", map);
|
|
|
|
|
selectLinkageDataMap.put("6", map);
|
|
|
|
|
condition.setSelectLinkageDatas(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()));
|
|
|
|
|
if (CollectionUtils.isEmpty(quickSearchDetailList)) {
|
|
|
|
|
condition.setCom("未设置选项");
|
|
|
|
|
} else {
|
|
|
|
|
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:
|
|
|
|
|
case -3:
|
|
|
|
|
case -4:
|
|
|
|
|
default:
|
|
|
|
|
SearchConditionItem searchConditionItem = OrganizationFormItemUtil.browserItem(user, 2, 18, 2, false, quickSearchCondition.getCustomName(), formField.getType(), formField.getFieldName(), "");
|
|
|
|
|
rangeConditions.add(searchConditionItem);
|
|
|
|
|
rangeConditions.add(condition);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -178,21 +180,12 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
if ("1".equals(fieldHtmlType)) {
|
|
|
|
|
if ("1".equals(type)) {
|
|
|
|
|
//单行文本
|
|
|
|
|
fieldType = "5";
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
//整数或浮点数
|
|
|
|
|
fieldType = "1";
|
|
|
|
|
isShowModel = true;
|
|
|
|
|
}
|
|
|
|
|
} 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";
|
|
|
|
@ -216,20 +209,10 @@ public class QuickSearchServiceImpl extends Service implements QuickSearchServic
|
|
|
|
|
fieldType = "3";
|
|
|
|
|
break;
|
|
|
|
|
case "1":
|
|
|
|
|
//人力资源 1已被占用,重新换一个
|
|
|
|
|
fieldType = "-1";
|
|
|
|
|
break;
|
|
|
|
|
case "3":
|
|
|
|
|
//会议室联系单 3已被占用,重新换一个
|
|
|
|
|
fieldType = "-3";
|
|
|
|
|
break;
|
|
|
|
|
case "5":
|
|
|
|
|
//仓库5已被占用,重新换一个
|
|
|
|
|
fieldType = "-5";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
fieldType = type;
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|