diff --git a/src/com/api/organization/web/QuickSearchController.java b/src/com/api/organization/web/QuickSearchController.java
new file mode 100644
index 00000000..299e81aa
--- /dev/null
+++ b/src/com/api/organization/web/QuickSearchController.java
@@ -0,0 +1,12 @@
+package com.api.organization.web;
+
+import javax.ws.rs.Path;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/08
+ * @version: 1.0
+ */
+@Path("/bs/hrmorganization/quicksearch")
+public class QuickSearchController extends com.engine.organization.web.QuickSearchController {
+}
diff --git a/src/com/engine/organization/entity/search/QuickSearchCondition.java b/src/com/engine/organization/entity/search/QuickSearchCondition.java
new file mode 100644
index 00000000..fe2c681d
--- /dev/null
+++ b/src/com/engine/organization/entity/search/QuickSearchCondition.java
@@ -0,0 +1,50 @@
+package com.engine.organization.entity.search;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/08
+ * @version: 1.0
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class QuickSearchCondition {
+ /**
+ * ID
+ */
+ private Integer id;
+ /**
+ * 查询id
+ */
+ private String fieldId;
+ /**
+ * 查询名称
+ */
+ private String customName;
+ /**
+ * 类型
+ */
+ private Integer type;
+ /**
+ * 排序id
+ */
+ private Integer orderId;
+ /**
+ * 所属人员
+ */
+ private Integer belongTo;
+ /**
+ * 显示模式
+ */
+ private Integer showModel;
+ /**
+ * 模块id
+ */
+ private Integer modelId;
+}
diff --git a/src/com/engine/organization/entity/search/QuickSearchDetail.java b/src/com/engine/organization/entity/search/QuickSearchDetail.java
new file mode 100644
index 00000000..76a429fc
--- /dev/null
+++ b/src/com/engine/organization/entity/search/QuickSearchDetail.java
@@ -0,0 +1,58 @@
+package com.engine.organization.entity.search;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/08
+ * @version: 1.0
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class QuickSearchDetail {
+ /**
+ * ID
+ */
+ private Integer id;
+ /**
+ * 查询id
+ */
+ private String fieldId;
+ /**
+ * 所属人员
+ */
+ private Integer belongTo;
+ /**
+ * cid
+ */
+ private Integer cId;
+ /**
+ * 查询名称
+ */
+ private String customName;
+ /**
+ * 最小值
+ */
+ private Integer minNum;
+ /**
+ * 最大值
+ */
+ private Integer maxNum;
+ /**
+ * 类型
+ */
+ private Integer type;
+ /**
+ * 排序id
+ */
+ private Integer orderId;
+ /**
+ * 模块id
+ */
+ private Integer modelId;
+}
diff --git a/src/com/engine/organization/entity/search/QuickSearchSetting.java b/src/com/engine/organization/entity/search/QuickSearchSetting.java
new file mode 100644
index 00000000..521c43ff
--- /dev/null
+++ b/src/com/engine/organization/entity/search/QuickSearchSetting.java
@@ -0,0 +1,23 @@
+package com.engine.organization.entity.search;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/09
+ * @version: 1.0
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class QuickSearchSetting {
+ private Integer id;
+ private Integer belongTo;
+ private Integer isQuickSearch;
+ private Integer isShowType;
+ private Integer isHideName;
+}
diff --git a/src/com/engine/organization/mapper/condition/QuickSearchMapper.java b/src/com/engine/organization/mapper/condition/QuickSearchMapper.java
new file mode 100644
index 00000000..0e3aad30
--- /dev/null
+++ b/src/com/engine/organization/mapper/condition/QuickSearchMapper.java
@@ -0,0 +1,20 @@
+package com.engine.organization.mapper.condition;
+
+import com.engine.organization.entity.search.QuickSearchSetting;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/09
+ * @version: 1.0
+ */
+public interface QuickSearchMapper {
+
+ /**
+ * 查询快速搜索设置
+ *
+ * @param belongTo 人员ID
+ * @return 速搜索设置实体
+ */
+ QuickSearchSetting getQuickSearchSetting(@Param("belongTo") Integer belongTo);
+}
diff --git a/src/com/engine/organization/mapper/condition/QuickSearchMapper.xml b/src/com/engine/organization/mapper/condition/QuickSearchMapper.xml
new file mode 100644
index 00000000..1d058e85
--- /dev/null
+++ b/src/com/engine/organization/mapper/condition/QuickSearchMapper.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/com/engine/organization/service/QuickSearchService.java b/src/com/engine/organization/service/QuickSearchService.java
new file mode 100644
index 00000000..4f6d252a
--- /dev/null
+++ b/src/com/engine/organization/service/QuickSearchService.java
@@ -0,0 +1,50 @@
+package com.engine.organization.service;
+
+import java.util.Map;
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/08
+ * @version: 1.0
+ */
+public interface QuickSearchService {
+ /**
+ * 保存快速搜索条件
+ *
+ * @param params 前端参数
+ * @return return
+ */
+ Map saveQuickSearchCondition(Map params);
+
+ /**
+ * 获取快速搜索信息
+ *
+ * @param params params
+ * @return return
+ */
+ Map getQuickSearchInfo(Map params);
+
+ /**
+ * 保存快速搜索信息
+ *
+ * @param params params
+ * @return return
+ */
+ Map saveQuickSearchInfo(Map params);
+
+ /**
+ * 获取快速搜索详细信息
+ *
+ * @param params params
+ * @return return
+ */
+ Map getQuickSearchDetailInfo(Map params);
+
+ /**
+ * 保存快速搜索详细信息
+ *
+ * @param params params
+ * @return return
+ */
+ Map saveQuickSearchDetailInfo(Map params);
+}
diff --git a/src/com/engine/organization/service/impl/QuickSearchServiceImpl.java b/src/com/engine/organization/service/impl/QuickSearchServiceImpl.java
new file mode 100644
index 00000000..9d6f7216
--- /dev/null
+++ b/src/com/engine/organization/service/impl/QuickSearchServiceImpl.java
@@ -0,0 +1,1165 @@
+package com.engine.organization.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.cloudstore.dev.api.util.TextUtil;
+import com.engine.core.impl.Service;
+import com.engine.organization.entity.search.QuickSearchSetting;
+import com.engine.organization.mapper.condition.QuickSearchMapper;
+import com.engine.organization.mapper.post.PostMapper;
+import com.engine.organization.service.QuickSearchService;
+import com.engine.organization.util.db.MapperProxyFactory;
+import org.apache.commons.lang.StringUtils;
+import weaver.conn.RecordSet;
+import weaver.conn.RecordSetTrans;
+import weaver.formmode.exttools.impexp.common.DateUtils;
+import weaver.general.BaseBean;
+import weaver.general.Util;
+import weaver.hrm.User;
+import weaver.hrm.resource.ResourceComInfo;
+import weaver.systeminfo.SystemEnv;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @author:dxfeng
+ * @createTime: 2023/08/08
+ * @version: 1.0
+ */
+public class QuickSearchServiceImpl extends Service implements QuickSearchService {
+ private QuickSearchMapper getQuickSearchMapper() {
+ return MapperProxyFactory.getProxy(QuickSearchMapper.class);
+ }
+
+
+ @Override
+ public Map saveQuickSearchCondition(Map params) {
+ return null;
+ }
+
+ @Override
+ public Map getQuickSearchInfo(Map params) {
+ Map apiDatas = new HashMap<>(16);
+ RecordSet rs = new RecordSet();
+ //开关查询
+ String sql = "select id,isquicksearch,isshowtype,ishidename from jcl_quicksearch_setting where belongto=?";
+ rs.executeQuery(sql, user.getUID());
+ JSONObject json = new JSONObject();
+ if (rs.next()) {
+ json.put("isquicksearch", Util.null2String(rs.getString("isquicksearch")));
+ json.put("isshowtype", Util.null2s(rs.getString("isshowtype"), "1"));
+ json.put("ishidename", Util.null2o(rs.getString("ishidename")));
+ json.put("id", Util.null2String(rs.getString("id")));
+ } else {
+ json.put("isquicksearch", "0");
+ json.put("isshowtype", "0");
+ json.put("ishidename", "0");
+ json.put("id", "0");
+ }
+ apiDatas.put("setting", json);
+
+ //条件字段查询
+ sql = " select c.id, fieldid, c.customname, c.type typeTemp, c.orderid, c.showmodel from jcl_quicksearch_condition c where belongto = ? order by c.orderid asc, c.id asc";
+ rs.executeQuery(sql, user.getUID());
+ JSONArray datas = new JSONArray();
+ while (rs.next()) {
+ JSONObject obj = new JSONObject();
+ String id = Util.null2String(rs.getString("id"));
+ String fieldid = Util.null2String(rs.getString("fieldid"));
+ String customname = Util.null2String(rs.getString("customname"));
+ String type = Util.null2String(rs.getString("typeTemp"));
+ String orderid = Util.null2String(rs.getString("orderid"));
+ String showmodel = Util.null2o(rs.getString("showmodel"));
+ obj.put("cid", id);
+ obj.put("key", id);
+ obj.put("fieldid", fieldid);
+ obj.put("orifieldid", fieldid);
+ obj.put("customname", TextUtil.toBase64ForMultilang(customname));
+ obj.put("type", type);
+ obj.put("orderid", orderid);
+ obj.put("groupid", "");
+ obj.put("showmodel", showmodel);
+ datas.add(obj);
+ }
+ apiDatas.put("datas", datas);
+
+ //字段下拉框查询
+ sql = "select b.fieldid,b.fieldlabel,b.fieldname,fieldhtmltype,b.type typeTemp from hrm_formfield b inner join hrm_fieldgroup c on c.id=b.GROUPID and c.GROUPTYPE in(-1,1,3)";
+ rs.executeQuery(sql);
+ JSONArray options = new JSONArray();
+ while (rs.next()) {
+ JSONObject obj = new JSONObject();
+ String fieldhtmltype = Util.null2String(rs.getString("fieldhtmltype"));
+ String fieldid = Util.null2String(rs.getString("fieldid"));
+ String fieldname = Util.null2String(rs.getString("fieldname"));
+
+
+ String type = Util.null2String(rs.getString("typeTemp"));
+ int fieldlabel = Util.getIntValue(rs.getString("fieldlabel"), 0);
+ String labelname = SystemEnv.getHtmlLabelName(Util.getIntValue(rs.getString("fieldlabel")), user.getLanguage());
+ String fieldtype = "2";
+ boolean isShowModel = false;
+ if ("1".equals(fieldhtmltype)) {
+ if ("1".equals(type)) {
+ //单行文本
+ fieldtype = "5";
+ } else {
+ //整数或浮点数
+ fieldtype = "1";
+ isShowModel = true;
+ }
+ } else if ("2".equals(fieldhtmltype) && "1".equals(type)) {
+ //多行文本
+ fieldtype = "5";
+ } else if ("2".equals(fieldhtmltype) && "2".equals(type)) {
+ //多行文本html
+ fieldtype = "5";
+ } else if ("5".equals(fieldhtmltype) && "3".equals(type)) {
+ //选择框单选框
+ fieldtype = "5";
+ isShowModel = true;
+ } else if ("5".equals(fieldhtmltype) && "2".equals(type)) {
+ //选择框多选框
+ fieldtype = "5";
+ isShowModel = true;
+ } else if ("5".equals(fieldhtmltype) && "1".equals(type)) {
+ //选择框
+ fieldtype = "5";
+ isShowModel = true;
+ } else if ("4".equals(fieldhtmltype) && "1".equals(type)) {
+ //check框
+ fieldtype = "5";
+ isShowModel = true;
+ } else if ("3".equals(fieldhtmltype)) {
+ if ("2".equals(type)) {
+ //日期
+ fieldtype = "3";
+ } else if ("1".equals(type)) {
+ //人力资源 1已被占用,重新换一个
+ fieldtype = "-1";
+ } else if ("3".equals(type)) {
+ //会议室联系单 3已被占用,重新换一个
+ fieldtype = "-3";
+ } else if ("5".equals(type)) {
+ //仓库5已被占用,重新换一个
+ fieldtype = "-5";
+ } else {
+ fieldtype = type;
+ }
+ } else {
+ continue;
+ }
+
+ if ("".equals(labelname)) {
+ labelname = SystemEnv.getHtmlLabelName(fieldlabel, user.getLanguage());
+ }
+
+ obj.put("key", fieldid);
+ obj.put("fieldid", fieldid);
+ obj.put("showname", labelname);
+ obj.put("isdetailtable", "0");
+ obj.put("type", fieldtype);
+ obj.put("isShowModel", isShowModel);
+ options.add(obj);
+ }
+ apiDatas.put("options", options);
+ JSONArray groupidOptions = new JSONArray();
+ apiDatas.put("groupidOptions", groupidOptions);
+ return apiDatas;
+ }
+
+ @Override
+ public Map saveQuickSearchInfo(Map params) {
+ Map apidatas = new HashMap<>();
+ RecordSet rs = new RecordSet();
+ String isquicksearch = Util.null2String(params.get("isquicksearch"));
+ String isshowtype = Util.null2String(params.get("isshowtype"));
+ String ishidename = Util.null2String(params.get("ishidename"));
+ String _id = Util.null2String(params.get("id"));
+ String _data = Util.null2String(params.get("data"));
+ JSONArray datas = JSONArray.parseArray(_data);
+ String sql = "";
+ //配置信息更新
+ if ("0".equals(_id) || "".equals(_id)) {
+ //第一次修改配置
+ sql = "insert into jcl_quicksearch_setting(belongto,isquicksearch,isshowtype,ishidename,updatetor,updatedate,updatetime) values(?,?,?,?,?,?,?)";
+ rs.executeUpdate(sql, user.getUID(), isquicksearch, isshowtype, ishidename, user.getUID(), DateUtils.getCurrentDate(), DateUtils.getCurrentTime());
+ } else {
+ sql = "update jcl_quicksearch_setting set isquicksearch=?,isshowtype=?,ishidename=? where id=?";
+ rs.executeUpdate(sql, isquicksearch, isshowtype, ishidename, _id);
+ }
+
+
+ sql = "select id from jcl_quicksearch_condition where belongto=? ";
+ rs.executeQuery(sql, user.getUID());
+ List list = new ArrayList<>();
+ while (rs.next()) {
+ list.add(rs.getString("id"));
+ }
+
+ for (int i = 0; i < datas.size(); i++) {
+ JSONObject obj = (JSONObject) datas.get(i);
+ String fieldid = obj.getString("fieldid");
+ String orifieldid = obj.getString("orifieldid");
+ int cid = Util.getIntValue(obj.getString("cid"));
+ String customname = obj.getString("customname");
+ String type = obj.getString("type");
+ String orderid = obj.getString("orderid");
+ String showmodel = obj.getString("showmodel");
+ String id = "";
+ if (cid > 0) {
+ list.remove(cid + "");
+ sql = "update jcl_quicksearch_condition set belongto=?,fieldid=?,customname=?,type=?,orderid=?,showmodel=? where id=" + cid;
+ rs.executeUpdate(sql, user.getUID(), fieldid, customname, type, orderid, showmodel);
+ id = cid + "";
+ if (!fieldid.equals(orifieldid)) {
+ //改变了字段,将原先字段的明细删除
+ sql = "delete from jcl_quicksearch_detail where cid=?";
+ rs.executeUpdate(sql, id);
+ }
+ } else {
+ sql = "insert into jcl_quicksearch_condition(belongto,fieldid,customname,type,orderid,showmodel) values(?,?,?,?,?,?)";
+ rs.executeUpdate(sql, user.getUID(), fieldid, customname, type, orderid, showmodel);
+ sql = "select max(id) id from jcl_quicksearch_condition where belongto=?";
+ rs.executeQuery(sql, user.getUID());
+ if (rs.next()) {
+ id = Util.null2String(rs.getString("id"));
+ }
+ }
+
+ }
+
+ if (list.size() > 0) {
+ String ids = StringUtils.join(list.toArray(), ",");
+ rs.executeUpdate("delete from jcl_quicksearch_condition where id in (" + ids + ")");
+ sql = "delete from jcl_quicksearch_detail where cid in (" + ids + ")";
+ rs.executeUpdate(sql);
+ }
+
+
+ return apidatas;
+ }
+
+ @Override
+ public Map getQuickSearchDetailInfo(Map params) {
+ Map apidatas = new HashMap<>(16);
+ String cid = weaver.formmode.exttools.impexp.common.StringUtils.null2String(params.get("cid"));
+ RecordSet rs = new RecordSet();
+ //开关查询
+ String sql = "select id,customname,minnum,maxnum,type typeTemp,orderid,fieldid,belongto from jcl_quicksearch_detail where cid=? order by orderid asc,id asc";
+ rs.executeQuery(sql, cid);
+ JSONArray datas = new JSONArray();
+ while (rs.next()) {
+ JSONObject obj = new JSONObject();
+ String id = Util.null2String(rs.getString("id"));
+ String customname = Util.null2String(rs.getString("customname"));
+ String minnum = Util.null2String(rs.getString("minnum"));
+ minnum = minnum.startsWith("0E") ? "0" : minnum;
+ String maxnum = Util.null2String(rs.getString("maxnum"));
+ maxnum = maxnum.startsWith("0E") ? "0" : maxnum;
+ String type = Util.null2String(rs.getString("typeTemp"));
+ String orderid = Util.null2String(rs.getString("orderid"));
+ String fieldid = Util.null2String(rs.getString("fieldid"));
+ String belongto = Util.null2String(rs.getString("belongto"));
+ obj.put("id", id);
+ obj.put("cid", cid);
+ obj.put("key", id);
+ obj.put("customname", customname);
+ obj.put("minnum", minnum);
+ obj.put("maxnum", maxnum);
+ obj.put("type", type);
+ obj.put("fieldid", fieldid);
+ obj.put("belongto", belongto);
+ obj.put("orderid", orderid);
+ datas.add(obj);
+ }
+ sql = "select b.fieldhtmltype,b.type typeTemp,b.fielddbtype from jcl_quicksearch_condition c left join hrm_formfield b on b.fieldid =c.fieldid where c.id= ? ";
+ rs.executeQuery(sql, cid);
+ int precision = 0;
+ while (rs.next()) {
+ String fieldhtmltype = rs.getString("fieldhtmltype");
+ String type = rs.getString("typeTemp");
+ String dbtype = rs.getString("fielddbtype");
+ if ("1".equals(fieldhtmltype) && !"1".equals(type)) {
+ int digitsIndex = dbtype.indexOf(",");
+ precision = Util.getIntValue(dbtype.substring(digitsIndex + 1, dbtype.length() - 1), 0);
+ }
+ if ("1".equals(fieldhtmltype) && "5".equals(type)) {
+ //precision = Util.getIntValue(rs.getString("qfws"),2);
+ }
+ }
+ apidatas.put("datas", datas);
+ apidatas.put("precision", precision);
+ return apidatas;
+ }
+
+ @Override
+ public Map saveQuickSearchDetailInfo(Map params) {
+ Map apidatas = new HashMap<>(16);
+ RecordSet rs = new RecordSet();
+ String cid = Util.null2String(params.get("cid"));
+ String _data = Util.null2String(params.get("data"));
+ JSONArray datas = JSONArray.parseArray(_data);
+ String sql = "";
+ //条件字段更新
+ RecordSetTrans rst = new RecordSetTrans();
+ sql = "select id from jcl_quicksearch_detail where cid=? ";
+ rs.executeQuery(sql, cid);
+ List list = new ArrayList<>();
+ while (rs.next()) {
+ list.add(rs.getString("id"));
+ }
+ try {
+ for (Object object : datas) {
+ JSONObject obj = (JSONObject) object;
+ String customname = obj.getString("customname");
+ String fieldid = obj.getString("fieldid");
+ String minnum = obj.getString("minnum");
+ minnum = "".equals(minnum) ? null : minnum;
+ String maxnum = obj.getString("maxnum");
+ maxnum = "".equals(maxnum) ? null : maxnum;
+ String type = obj.getString("type");
+ String orderid = obj.getString("orderid");
+ int id = Util.getIntValue(obj.getString("id"));
+ if (id > 0) {
+ list.remove(id + "");
+ sql = "update jcl_quicksearch_detail set cid=?,customname=?,minnum=?,maxnum=?,type=?,orderid=?,fieldid=?,belongto=? where id=?";
+ rst.executeUpdate(sql, cid, customname, minnum, maxnum, type, orderid, fieldid, user.getUID(), id);
+ } else {
+ sql = "insert into jcl_quicksearch_detail(cid,customname,minnum,maxnum,type,orderid,fieldid,belongto) values(?,?,?,?,?,?,?,?)";
+ rst.executeUpdate(sql, cid, customname, minnum, maxnum, type, orderid, fieldid, user.getUID());
+ }
+ }
+ rst.commit();
+ if (list.size() > 0) {
+ String ids = StringUtils.join(list.toArray(), ",");
+ rs.executeUpdate("delete from jcl_quicksearch_detail where id in (" + ids + ")");
+ }
+ } catch (Exception e) {
+ rst.rollback();
+ new BaseBean().writeLog(e);
+ e.printStackTrace();
+ }
+
+ return apidatas;
+ }
+
+
+// public JSONArray GetQuickSearchInfo(String customid, User user, HttpServletRequest request) {
+// JSONArray datas = new JSONArray();
+// RecordSet rs = new RecordSet();
+// RecordSet rs1 = new RecordSet();
+// String ss = request.getQueryString();
+// CustomSearchComInfo customSearchComInfo = new CustomSearchComInfo();
+// String defSql = Util.toScreenToEdit(customSearchComInfo.getDefaultSql(customid), user.getLanguage()) ;
+//
+// Map> groupMap=new HashMap>();
+//
+// // 表单字段
+// String sql = "SELECT ID,fieldid,customname,fieldhtmltype,typeTemp,fielddbtype,fieldname,orderid,groupid,showmodel FROM (";
+// sql += "select quick.ID,bill.id fieldid,quick.customname,bill.fieldhtmltype,bill.type typeTemp,bill.fielddbtype,fieldname,orderid,groupid,showmodel from mode_quicksearch_condition quick left join workflow_billfield bill on bill.id=quick.fieldid where customid=? AND quick.fieldid NOT IN(-1,-2) ";
+//
+// List args = new ArrayList();
+// args.add(customid);
+// ModeFormComInfo modeFormComInfo = new ModeFormComInfo();
+// String formId = customSearchComInfo.getFormId(customid);
+// boolean isVirtualForm = "1".equals(modeFormComInfo.getIsVirtualForm(formId));
+// if(!isVirtualForm) {
+// // 加入创建日期
+// sql += "UNION ALL ";
+// sql += "SELECT id,1 fieldid,customname,'3' fieldhtmltype,2 typeTemp, 'char(10)' fielddbtype,'modedatacreatedate' fieldname,orderid,groupid,showmodel ";
+// sql += "FROM mode_quicksearch_condition WHERE customid=? AND fieldid =-1 ";
+//
+// // 加入创建人
+// sql += "UNION ALL ";
+// //sql += "SELECT id,2 fieldid,customname,'3' fieldhtmltype,1 TYPE, 'int' fielddbtype,'modedatacreater' fieldname,orderid ";
+// sql += "SELECT id,2 fieldid,customname,'3' fieldhtmltype,1 typeTemp, 'int' fielddbtype,'modedatacreater' fieldname,orderid,groupid,showmodel ";
+// sql += "FROM mode_quicksearch_condition WHERE customid=? AND fieldid =-2 ";
+//
+// //添加最后修改人
+// sql += "UNION ALL ";
+// sql += "SELECT id,7 fieldid,customname,'3' fieldhtmltype,1 typeTemp, 'int' fielddbtype,'modedatacreater' fieldname,orderid,groupid,showmodel ";
+// sql += "FROM mode_quicksearch_condition WHERE customid=? AND fieldid =-7 ";
+//
+// //添加最后修改日期时间
+// sql += "UNION ALL ";
+// sql += "SELECT id,8 fieldid,customname,'3' fieldhtmltype,290 typeTemp, 'char(10)' fielddbtype,'modedatacreatedate' fieldname,orderid,groupid,showmodel ";
+// sql += "FROM mode_quicksearch_condition WHERE customid=? AND fieldid =-8 ";
+//
+// //添加密级字段int
+// sql += "UNION ALL ";
+// sql += "SELECT id,9 fieldid,customname,'5' fieldhtmltype,2 typeTemp, 'int' fielddbtype,'seclevel' fieldname,orderid,groupid,showmodel ";
+// sql += "FROM mode_quicksearch_condition WHERE customid=? AND fieldid =-9 ";
+//
+// args.add(customid);
+// args.add(customid);
+// args.add(customid);
+// args.add(customid);
+// args.add(customid);
+// }
+//
+// // 按照字段排序
+// sql += ") a order by groupid asc,orderid asc,id asc";
+//
+// rs.executeQuery(sql, args);
+// while (rs.next()) {
+// int viewAttr = 2;
+// JSONObject json = new JSONObject();
+// String fieldhtmltype = Util.null2String(rs.getString("fieldhtmltype"));
+// String fieldtype = Util.null2String(rs.getString("typeTemp"));
+// String id = Util.null2String(rs.getString("id"));
+// String fieldnames = Util.null2String(rs.getString("fieldname"));
+// String fieldid = Util.null2String(rs.getString("fieldid"));
+// String groupid = Util.null2String(rs.getString("groupid"));
+// float orderid = Util.getFloatValue(Util.null2String(rs.getString("orderid")),0);
+// String showmodel = Util.null2String(rs.getString("showmodel"));
+// String querysql = "select t.* from mode_CustomDspField t where t.customid=? and t.fieldid=?";
+// String conditiontransition = "";
+// String searchparavalue = "";
+// String searchparavalue1 = "";
+// String conditionValue = "";
+// String conditionValue1 = "";
+// String conditionValue2 = "";
+// String fieldname_seclevel = Util.null2String(rs.getString("fieldname"));//用于验证是否是密级字段;
+// String showtype = Util.null2o(rs.getString("showtype"));//显示模式主要 针对浏览框 0:浏览框模式 1:下拉拉框模式
+// rs1.executeQuery(querysql, customid, "1".equals(fieldid)?"-1":"2".equals(fieldid)?"-2":"7".equals(fieldid)?"-7":"8".equals(fieldid)?"-8":fieldid);
+// int count = 0;
+// String requiredCon = "";
+// if(rs1.next()){
+// count ++;
+// conditiontransition = Util.null2String(rs1.getString("conditiontransition"));
+// requiredCon = Util.null2String(rs1.getString("requiredCon"));
+// if("1".equals(requiredCon)){
+// viewAttr = 3;
+// }
+// conditionValue = Util.null2String(rs1.getString("conditionValue"));
+// conditionValue1 = Util.null2String(rs1.getString("conditionValue1"));
+// conditionValue2 = Util.null2String(rs1.getString("conditionValue2"));
+// String searchparaname = Util.null2String(rs1.getString("searchparaname"));
+// String searchparaname1 = Util.null2String(rs1.getString("searchparaname1"));
+// if(!StringHelper.isEmpty(searchparaname)) {
+// searchparavalue = replaceParams(Util.null2String(request.getParameter(searchparaname)), user);
+// }
+//
+// if(!StringHelper.isEmpty(searchparaname1)) {
+// searchparavalue1 = replaceParams(Util.null2String(request.getParameter(searchparaname1)), user);
+// }
+// if("".equals(searchparavalue)){
+// if("3".equals(fieldhtmltype)&&"1".equals(fieldtype)){ //人力资源
+// if(!"".equals(conditionValue1)&&!"null".equals(conditionValue1)){
+// searchparavalue = conditionValue1;
+// }else if(conditiontransition.equalsIgnoreCase("1") && "".equals(conditionValue1)&&!"-5".equals(conditionValue)){
+// searchparavalue = conditionValue;
+// }else{
+// searchparavalue = conditionValue;
+// }
+// }else if ("3".equals(fieldhtmltype)&&("2".equals(fieldtype)||"19".equals(fieldtype)||"290".equals(fieldtype))){
+// if("3".equals(fieldhtmltype)&&"19".equals(fieldtype)){ //时间
+// if("".equals(conditionValue)&&"".equals(conditionValue1)){
+// searchparavalue = searchparavalue;
+// }else{
+// searchparavalue = conditionValue+","+conditionValue1;
+// }
+// }else if("3".equals(fieldhtmltype)&&"2".equals(fieldtype)){ //日期
+// if("".equals(conditionValue)&&"".equals(conditionValue1)){
+// searchparavalue = searchparavalue;
+// }else{
+// searchparavalue = conditionValue+","+conditionValue1;
+// }
+// }else if(!"".equals(conditionValue1)&&!"null".equals(conditionValue1)){
+// if(!"".equals(conditionValue1)&&!"null".equals(conditionValue1)){
+// searchparavalue = conditionValue1+","+conditionValue2; //处理时间,日期回显
+//// searchparavalue1 = conditionValue1;
+// }else{
+// searchparavalue = conditionValue;
+// }
+// }
+// }else{
+// String acValue = conditionValue;
+// if(!"".equals(conditionValue1)&&!"null".equals(conditionValue1)){
+// if(!"".equals(conditionValue2)&&!"null".equals(conditionValue2)){
+// conditionValue = conditionValue+","+conditionValue1+","+conditionValue2;
+// }else{
+// conditionValue = conditionValue+","+conditionValue1;
+// }
+// }
+// if(!"".equals(conditionValue)){
+// searchparavalue = conditionValue;
+// }
+// if("1".equals(fieldhtmltype)&&!"1".equals(fieldtype)){
+// searchparavalue = acValue;
+// }
+// }
+// }
+// }
+// if(conditiontransition.equalsIgnoreCase("1") && fieldhtmltype.equals("3")){
+// fieldtype = convertSingleBrowserTypeToMulti_All(fieldtype);
+// }
+// String fielddbtype = Util.null2String(rs.getString("fielddbtype"));
+// if ("".equals(fieldid)) {
+// continue;
+// }
+//
+// String fieldname = "con_"+ (Util.getIntValue(fieldid) > 0 ? fieldid : "_"+(-Util.getIntValue(fieldid)));
+// if(StringHelper.isEmpty(searchparavalue)&&StringHelper.isEmpty(searchparavalue1)){//con_fielid格式作为查询条件,解析到查询条件上
+// searchparavalue=Util.null2String(request.getParameter(fieldname));
+// }
+//
+//
+// String customname = Util.null2String(rs.getString("customname"));
+// customname=Util.formatMultiLang(customname, user.getLanguage()+"");
+// if ("1".equals(fieldhtmltype)) {
+// if ("1".equals(fieldtype)) {//单行文本
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// }else {//整数或浮点数
+// sql ="select id,customname,minnum,maxnum from mode_quicksearch_detail where cid=? order by orderid asc,id asc";
+// rs1.executeQuery(sql, id);
+// JSONArray arr = new JSONArray();
+// JSONObject obj1 = new JSONObject();
+// if("1".equals(requiredCon)){
+// obj1.put("key", "");
+// }else{
+// obj1.put("key", "-1");
+// }
+// obj1.put("showname", "");
+// arr.add(obj1);
+// boolean flg = false;
+// Map map = new HashMap();
+// while (rs1.next()) {
+// String minnum = Util.null2String(rs1.getString("minnum"));
+// String maxnum = Util.null2String(rs1.getString("maxnum"));
+// String fieldValue = minnum+","+maxnum;
+// map.put(rs1.getString("id"),fieldValue);
+// boolean flgs = false;
+// if (!"".equals(minnum) && !searchparavalue.isEmpty()) {
+// float num = Util.getFloatValue(minnum);
+// float num2 = Util.getFloatValue(maxnum);
+// if(Util.getFloatValue(searchparavalue)==Util.getFloatValue("0")){
+// if(num<=Util.getFloatValue(searchparavalue) && num2>=Util.getFloatValue(searchparavalue) && !flg){
+// flg = true;
+// flgs = true;
+// //json.put("value", rs1.getString("id"));
+// }
+// }else{
+// if(num<=Util.getFloatValue(searchparavalue) && num2>=Util.getFloatValue(searchparavalue) && !flg){
+// flg = true;
+// flgs = true;
+// //json.put("value", rs1.getString("id"));
+// }
+// }
+// }
+// JSONObject obj2 = new JSONObject();
+// obj2.put("key",rs1.getString("id"));
+// obj2.put("selected",flgs);
+// obj2.put("showname", Util.formatMultiLang(rs1.getString("customname"), user.getLanguage()+""));
+// arr.add(obj2);
+// }
+// json.put("floatValue",map);
+// json.put("options", arr);
+// }
+// } else if ("2".equals(fieldhtmltype)) {//多文本
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// }else if ("5".equals(fieldhtmltype) && "1".equals(fieldtype)) {//选择框
+// RecordSet record = new RecordSet();
+// StringBuffer sql1 = new StringBuffer();
+// Integer fieldlabel = 0;
+// String parentDomkey = "";
+// Integer pubchilchoiceId = 0;
+//
+// sql1.append(" select a.id, b.fieldlabel, b.pubchilchoiceId ");
+// sql1.append(" from mode_customdspfield a, workflow_billfield b ");
+// sql1.append(" where a.fieldid = b.id and b.id=? ");
+// sql1.append(" and a.customId = ? ");
+// record.executeQuery(sql1.toString(),fieldid,customId);
+// while(record.next()){
+// fieldlabel = record.getInt("fieldlabel");
+// pubchilchoiceId = record.getInt("pubchilchoiceId");
+// }
+// if(pubchilchoiceId > 0){
+// parentDomkey = "con_"+pubchilchoiceId;
+// }else{//#866910
+// String dlxzksql = "select t.id from workflow_billfield t where t.childfieldid=?";
+// rs1.executeQuery(dlxzksql,fieldid);
+// if(rs1.next()){
+// String parentfieldid = Util.null2String(rs1.getString(1));
+// if(!parentfieldid.isEmpty()){
+// parentDomkey = "con_"+parentfieldid;
+// }
+// }
+// }
+// ConditionFactory conditionFactory = new ConditionFactory(user);
+// CubeFieldService cfs = new CubeFieldService();
+// List options = new ArrayList();
+// SearchConditionItem conditionJson = new SearchConditionItem();
+// if(!"seclevel".equals(fieldname_seclevel)){
+// conditionJson = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname+","+parentDomkey, cfs.getWorkflowSelectItems(""+fieldid, user.getLanguage(),true));
+// //options = cfs.getWorkflowSelectItems(""+fieldid, user.getLanguage(),true);
+// options = conditionJson.getOptions();
+// if("1".equals(conditiontransition) && options.size()>0&&"".equals(options.get(0).getKey())){//选择框多选时去除空选项
+// options.remove(0);
+// }
+// }else{
+// //密级修改为从人力资源那么获取
+// Map otherParam = new HashMap<>();
+// AddSeclevelUtil addSeclevelUtil = new AddSeclevelUtil();
+// otherParam.put("fieldlabel",fieldlabel);
+// otherParam.put("fieldname",fieldname);
+// otherParam.put("parentDomkey",parentDomkey);
+// conditionJson = addSeclevelUtil.getSecLevelOptions(conditionFactory,user,otherParam);
+//
+//// HrmClassifiedProtectionBiz hrmClassifiedProtectionBiz = new HrmClassifiedProtectionBiz();
+//// SearchConditionOption searchConditionOption = new SearchConditionOption();
+//// searchConditionOption.setKey("");
+//// searchConditionOption.setShowname("");
+//// searchConditionOption.setChilditemid(Util.splitString("", ","));
+//// options.add(searchConditionOption);
+//// //密级调用人力资源的 资源密级下拉选项
+//// List comOptions = hrmClassifiedProtectionBiz.getResourceOptionListByUser(user);
+//// if (null != comOptions && comOptions.size() > 0) {
+//// for (SearchConditionOption searchConditionOptioninner : comOptions) {
+//// SearchConditionOption searchConditionOption_inner = new SearchConditionOption();
+//// String selectvalue = searchConditionOptioninner.getKey();
+//// String selectname = searchConditionOptioninner.getShowname();
+//// searchConditionOption_inner.setKey(selectvalue);
+//// searchConditionOption_inner.setShowname(selectname);
+//// searchConditionOption_inner.setChilditemid(Util.splitString("", ","));
+//// options.add(searchConditionOption_inner);
+////
+//// }
+//// conditionJson = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname + "," + parentDomkey, options);
+//// }
+// options = conditionJson.getOptions();
+// if("1".equals(conditiontransition) && options.size()>0&&"".equals(options.get(0).getKey())){//选择框多选时去除空选项
+// options.remove(0);
+// }
+// }
+//
+//
+//
+// json.put("options", options);
+// json.put("parentDomkey",conditionJson.getParentDomkey());
+// json.put("domkey",conditionJson.getDomkey());
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// if(conditiontransition.equalsIgnoreCase("1")){
+// json.put("detailtype","2");
+// json.put("multiple",true);
+// }else{
+// json.put("detailtype","");
+// }
+// json.put("fieldid", fieldid);
+// json.put("customname", customname);
+// }else if ("5".equals(fieldhtmltype) && "2".equals(fieldtype)) {//多选
+// RecordSet record = new RecordSet();
+// StringBuffer sql1 = new StringBuffer();
+// Integer fieldlabel = 0;
+// String parentDomkey = "";
+// Integer pubchilchoiceId = 0;
+//
+// sql1.append(" select a.id, b.fieldlabel,b.pubchilchoiceId ");
+// sql1.append(" from mode_customdspfield a, workflow_billfield b ");
+// sql1.append(" where a.fieldid = b.id and b.id=? ");
+// sql1.append(" and a.customId = ? ");
+// record.executeQuery(sql1.toString(),fieldid,customId);
+// while(record.next()){
+// fieldlabel = record.getInt("fieldlabel");
+// pubchilchoiceId = record.getInt("pubchilchoiceId");
+// }
+// if(pubchilchoiceId > 0){
+// parentDomkey = "con_"+pubchilchoiceId;
+// }else{//#866910
+// String dlxzksql = "select t.id from workflow_billfield t where t.childfieldid=?";
+// rs1.executeQuery(dlxzksql,fieldid);
+// if(rs1.next()){
+// String parentfieldid = Util.null2String(rs1.getString(1));
+// if(!parentfieldid.isEmpty()){
+// parentDomkey = "con_"+parentfieldid;
+// }
+// }
+// }
+// ConditionFactory conditionFactory = new ConditionFactory(user);
+// CubeFieldService cfs = new CubeFieldService();
+// SearchConditionItem conditionJson = new SearchConditionItem();
+// if(!"seclevel".equals(fieldname_seclevel)){
+// conditionJson = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname+","+parentDomkey,cfs.getWorkflowSelectItems(""+fieldid, user.getLanguage(),true));
+// }else{
+// //密级修改为从人力资源那么获取
+// Map otherParam = new HashMap<>();
+// AddSeclevelUtil addSeclevelUtil = new AddSeclevelUtil();
+// otherParam.put("fieldlabel",fieldlabel);
+// otherParam.put("fieldname",fieldname);
+// otherParam.put("parentDomkey",parentDomkey);
+// conditionJson = addSeclevelUtil.getSecLevelOptions(conditionFactory,user,otherParam);
+//
+// }
+// List options = new ArrayList();
+// options = conditionJson.getOptions();
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// json.put("options", options);
+// json.put("parentDomkey",conditionJson.getParentDomkey());
+// json.put("domkey",conditionJson.getDomkey());
+// json.put("viewAttr", viewAttr);
+// json.put("detailtype","2");
+// json.put("customname", customname);
+// }else if ("5".equals(fieldhtmltype) && "3".equals(fieldtype)) {//单选
+// RecordSet record = new RecordSet();
+// StringBuffer sql1 = new StringBuffer();
+// Integer fieldlabel = 0;
+// String parentDomkey = "";
+// Integer pubchilchoiceId = 0;
+//
+// sql1.append(" select a.id, b.fieldlabel, b.pubchilchoiceId ");
+// sql1.append(" from mode_customdspfield a, workflow_billfield b ");
+// sql1.append(" where a.fieldid = b.id and b.id=? ");
+// sql1.append(" and a.customId = ? ");
+// record.executeQuery(sql1.toString(),fieldid,customId);
+// while(record.next()){
+// fieldlabel = record.getInt("fieldlabel");
+// pubchilchoiceId = record.getInt("pubchilchoiceId");
+// }
+// if(pubchilchoiceId > 0){
+// parentDomkey = "con_"+pubchilchoiceId;
+// }else{//#866910
+// String dlxzksql = "select t.id from workflow_billfield t where t.childfieldid=?";
+// rs1.executeQuery(dlxzksql,fieldid);
+// if(rs1.next()){
+// String parentfieldid = Util.null2String(rs1.getString(1));
+// if(!parentfieldid.isEmpty()){
+// parentDomkey = "con_"+parentfieldid;
+// }
+// }
+// }
+// ConditionFactory conditionFactory = new ConditionFactory(user);
+// CubeFieldService cfs = new CubeFieldService();
+// SearchConditionItem conditionJson = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname+","+parentDomkey,cfs.getWorkflowSelectItems(""+fieldid, user.getLanguage(),true));
+// List options = new ArrayList();
+// options = conditionJson.getOptions();
+// if("1".equals(conditiontransition) && options.size()>0&&"".equals(options.get(0).getKey())){//选择框多选时去除空选项
+// options.remove(0);
+// }
+// json.put("options", options);
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// json.put("detailtype","3");
+// json.put("parentDomkey",conditionJson.getParentDomkey());
+// json.put("domkey",conditionJson.getDomkey());
+// json.put("supportCancel", true);
+// json.put("fieldid", fieldid);
+// json.put("customname", customname);
+// }else if ("4".equals(fieldhtmltype) && "1".equals(fieldtype)) {//勾选框
+// RecordSet record = new RecordSet();
+// StringBuffer sql1 = new StringBuffer();
+// Integer fieldlabel = 0;
+//
+// sql1.append(" select a.id, b.fieldlabel ");
+// sql1.append(" from mode_customdspfield a, workflow_billfield b ");
+// sql1.append(" where a.fieldid = b.id and b.id=? ");
+// sql1.append(" and a.customId = ? ");
+// record.executeQuery(sql1.toString(),fieldid,customId);
+// while(record.next()){
+// fieldlabel = record.getInt("fieldlabel");
+// }
+// ConditionFactory conditionFactory = new ConditionFactory(user);
+// CubeFieldService cfs = new CubeFieldService();
+// SearchConditionItem conditionJson = conditionFactory.createCondition(ConditionType.SELECT, fieldlabel, fieldname,this.getCheckOptions(user.getLanguage()));
+// List options = new ArrayList();
+// options = conditionJson.getOptions();
+//
+// json.put("options", options);
+// json.put("domkey",conditionJson.getDomkey());
+// json.put("viewAttr", viewAttr);
+// json.put("detailtype","3");
+// json.put("customname", customname);
+// }else if ("3".equals(fieldhtmltype)) {//日期
+// BrowserBean browserProps = null;
+// if ("2".equals(fieldtype)||"19".equals(fieldtype)||"290".equals(fieldtype)) {//日期 时间 日期时间
+// if(searchparavalue.indexOf(",")>-1){
+// String[] vals = searchparavalue.split(",");
+// if(vals.length>0){
+// searchparavalue = vals[0];
+// if(vals.length>1){
+// searchparavalue1 = vals[1];
+// if(vals.length>2){
+// searchparavalue1 = vals[1]+vals[2];
+// }
+// }
+// }
+// }
+// if("2".equals(fieldtype) && searchparavalue.isEmpty()){
+// searchparavalue = "0"; // 全部
+// }
+// if("2".equals(fieldtype) && !searchparavalue.isEmpty()) {
+// if(-1!=Util.getIntValue(searchparavalue)){
+// json.put("value", new String[]{searchparavalue,"",""});
+// }else{
+// json.put("value", new String[]{"6",searchparavalue,searchparavalue1});
+// }
+// }else{
+// ArrayList dataValue = new ArrayList();
+// if("".equals(searchparavalue)&&"".equals(searchparavalue1)){
+// json.put("value", dataValue);
+// }else{
+// dataValue.add(searchparavalue);
+// dataValue.add(searchparavalue1);
+// json.put("value", dataValue);
+// }
+//// json.put("value", searchparavalue);
+// }
+// }else if("402".equals(fieldtype) || "403".equals(fieldtype)){//年、年月
+// if(!searchparavalue.isEmpty()) {
+// json.put("value", searchparavalue);
+// }
+// }else if("161".equals(fieldtype) || "162".equals(fieldtype)) {
+// browserProps = new BrowserBean(fieldtype);
+// BrowserValueInfoService browserValueInfoService = new BrowserValueInfoService();
+// List