职等职级接口 浏览框定义
This commit is contained in:
parent
7bd87d4707
commit
c5a7a1fb07
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.organization.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @description: TODO
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/11
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TopTab {
|
||||
private String color;
|
||||
private String groupId;
|
||||
private Boolean showCount;
|
||||
private String title;
|
||||
private String viewCondition;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TopTab{" +
|
||||
"color='" + color + '\'' +
|
||||
", groupid='" + groupId + '\'' +
|
||||
", showcount='" + showCount + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", viewcondition='" + viewCondition + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -72,4 +72,10 @@ public interface LevelService {
|
|||
*/
|
||||
Map<String, Object> getTableBtn();
|
||||
|
||||
/**
|
||||
* 获取列表tabs
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getTableInfo();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.api.browser.bean.SearchConditionItem;
|
|||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.TopTab;
|
||||
import com.engine.organization.entity.scheme.dto.LevelDTO;
|
||||
import com.engine.organization.entity.scheme.param.LevelSearchParam;
|
||||
import com.engine.organization.entity.scheme.po.LevelPO;
|
||||
|
|
@ -83,10 +84,10 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "等级方案", "161", "schemeId", true, "schemeBrowser");
|
||||
SearchConditionItem levelNameCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "名称", "levelName");
|
||||
SearchConditionItem levelNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "编号", "levelNo");
|
||||
conditionItems.add(browserItem);
|
||||
conditionItems.add(levelNameCondition);
|
||||
conditionItems.add(levelNoCondition);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
|
|
@ -102,10 +103,8 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
levelNameCondition.setRules("required|string");
|
||||
SearchConditionItem levelNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "编号", "levelNo");
|
||||
levelNoCondition.setRules("required|string");
|
||||
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "描述说明", "description");
|
||||
|
||||
// TODO 浏览按钮
|
||||
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, "等级方案", "17", "levelScheme");
|
||||
SearchConditionItem descriptionCondition = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "描述说明", "description");
|
||||
SearchConditionItem browserItem = OrganizationFormItemUtil.browserItem(user, 2, 17, 3, false, "等级方案", "161", "schemeId", true, "schemeBrowser");
|
||||
|
||||
// 编辑状态下赋值操作
|
||||
String id = Util.null2String(params.get("id"));
|
||||
|
|
@ -116,7 +115,7 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
levelNameCondition.setValue(levelPO.getLevelName());
|
||||
levelNoCondition.setValue(levelPO.getLevelNo());
|
||||
descriptionCondition.setValue(levelPO.getDescription());
|
||||
// TODO 浏览按钮赋值
|
||||
browserItem.setValue(levelPO.getSchemeId());
|
||||
// 编辑状态下,编号只读
|
||||
levelNoCondition.setViewAttr(1);
|
||||
}
|
||||
|
|
@ -135,6 +134,19 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTableInfo() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<TopTab> topTabs = new ArrayList<>();
|
||||
topTabs.add(TopTab.builder().color("#000000").groupId("flowAll").showCount(true).title("全部").viewCondition("-1").build());
|
||||
topTabs.add(TopTab.builder().color("#ff3232").groupId("flowNew").showCount(true).title("启用").viewCondition("0").build());
|
||||
topTabs.add(TopTab.builder().color("#fea468").groupId("flowRes").showCount(true).title("禁用").viewCondition("1").build());
|
||||
apiDatas.put("topTabs",topTabs);
|
||||
|
||||
apiDatas.put("topTabCount",topTabs);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
|
|
@ -144,13 +156,18 @@ public class LevelServiceImpl extends Service implements LevelService {
|
|||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where t.delete_type ='0' ";
|
||||
String name = (String) params.get("levelName");
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sqlWhere += " AND t.level_name " + dbType.like(name);
|
||||
String levelName = (String) params.get("levelName");
|
||||
if (StringUtils.isNotBlank(levelName)) {
|
||||
sqlWhere += " AND t.level_name " + dbType.like(levelName);
|
||||
}
|
||||
String no = (String) params.get("levelNo");
|
||||
if (StringUtils.isNotBlank(no)) {
|
||||
sqlWhere += " AND t.level_no " + dbType.like(no);
|
||||
String schemeId = (String) params.get("schemeId");
|
||||
if (StringUtils.isNotBlank(schemeId)) {
|
||||
sqlWhere += " AND t.scheme_id " + dbType.like(schemeId);
|
||||
}
|
||||
String viewCondition = (String) params.get("viewcondition");
|
||||
// -1:全部、0:启用、1:禁用
|
||||
if (StringUtils.isNotBlank(viewCondition) && !"-1".equalsIgnoreCase(viewCondition)) {
|
||||
sqlWhere += " AND t.forbidden_tag = '" + schemeId + "'";
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public class SchemeServiceImpl extends Service implements SchemeService {
|
|||
schemeNameCondition.setRules("required|string");
|
||||
SearchConditionItem schemeNoCondition = OrganizationFormItemUtil.inputItem(user, 2, 17, 3, 50, "方案编号", "schemeNo");
|
||||
schemeNoCondition.setRules("required|string");
|
||||
SearchConditionItem textareaItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "方案说明", "schemeDescription");
|
||||
SearchConditionItem textareaItem = OrganizationFormItemUtil.textareaItem(user, 2, 17, true, 2, 60, "方案说明", "schemeDescription");
|
||||
|
||||
// 编辑状态下赋值操作
|
||||
String id = Util.null2String(params.get("id"));
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
package com.engine.organization.util;
|
||||
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
import com.api.browser.util.ConditionType;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -19,6 +22,7 @@ public class OrganizationFormItemUtil {
|
|||
|
||||
/**
|
||||
* 下拉框
|
||||
*
|
||||
* @param user
|
||||
* @param selectOptions
|
||||
* @param colSpan
|
||||
|
|
@ -29,9 +33,9 @@ public class OrganizationFormItemUtil {
|
|||
* @return
|
||||
*/
|
||||
public static SearchConditionItem selectItem(User user, List<SearchConditionOption> selectOptions, int colSpan, int fieldcol,
|
||||
int labelcol, boolean isQuickSearch, String label,String name) {
|
||||
int labelcol, boolean isQuickSearch, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT,502327,name);
|
||||
SearchConditionItem select = conditionFactory.createCondition(ConditionType.SELECT, 502327, name);
|
||||
select.setOptions(selectOptions);
|
||||
select.setColSpan(colSpan);
|
||||
select.setFieldcol(fieldcol);
|
||||
|
|
@ -44,6 +48,7 @@ public class OrganizationFormItemUtil {
|
|||
|
||||
/**
|
||||
* checkbox
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -54,9 +59,9 @@ public class OrganizationFormItemUtil {
|
|||
* @return
|
||||
*/
|
||||
public static SearchConditionItem checkboxItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, boolean isQuickSearch, String label,String name) {
|
||||
int viewAttr, boolean isQuickSearch, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX,502327,name);
|
||||
SearchConditionItem checkbox = conditionFactory.createCondition(ConditionType.CHECKBOX, 502327, name);
|
||||
checkbox.setColSpan(colSpan);
|
||||
checkbox.setFieldcol(fieldcol);
|
||||
checkbox.setViewAttr(viewAttr);
|
||||
|
|
@ -68,6 +73,7 @@ public class OrganizationFormItemUtil {
|
|||
|
||||
/**
|
||||
* 输入框数字
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -75,10 +81,10 @@ public class OrganizationFormItemUtil {
|
|||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputNumberItem(User user,int colSpan, int fieldcol,
|
||||
int viewAttr, String label,String name) {
|
||||
public static SearchConditionItem inputNumberItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER,502327, name);
|
||||
SearchConditionItem inputnumber = conditionFactory.createCondition(ConditionType.INPUTNUMBER, 502327, name);
|
||||
inputnumber.setColSpan(colSpan);
|
||||
inputnumber.setFieldcol(fieldcol);
|
||||
inputnumber.setViewAttr(viewAttr);
|
||||
|
|
@ -89,6 +95,7 @@ public class OrganizationFormItemUtil {
|
|||
|
||||
/**
|
||||
* 输入框文本
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -97,10 +104,10 @@ public class OrganizationFormItemUtil {
|
|||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem inputItem(User user,int colSpan, int fieldcol,
|
||||
int viewAttr,int length, String label,String name) {
|
||||
public static SearchConditionItem inputItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, int length, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT,25034, name);
|
||||
SearchConditionItem input = conditionFactory.createCondition(ConditionType.INPUT, 25034, name);
|
||||
input.setColSpan(colSpan);
|
||||
input.setFieldcol(fieldcol);
|
||||
input.setViewAttr(viewAttr);
|
||||
|
|
@ -109,8 +116,10 @@ public class OrganizationFormItemUtil {
|
|||
return input;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 浏览按钮
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -118,23 +127,62 @@ public class OrganizationFormItemUtil {
|
|||
* @param isQuickSearch
|
||||
* @param label
|
||||
* @param type
|
||||
* @param name
|
||||
* @param iscustom 是否为自定义浏览按钮
|
||||
* @param fieldDbType 数据展现集成标识
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem browserItem(User user,int colSpan, int fieldcol,
|
||||
int viewAttr,boolean isQuickSearch,String label,String type,String name) {
|
||||
public static SearchConditionItem browserItem(User user, int colSpan, int fieldcol,
|
||||
int viewAttr, boolean isQuickSearch, String label, String type, String name, Boolean iscustom, String fieldDbType) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER,502327,name,type);
|
||||
SearchConditionItem browser = conditionFactory.createCondition(ConditionType.BROWSER, 502327, name, type);
|
||||
browser.setColSpan(colSpan);
|
||||
browser.setFieldcol(fieldcol);
|
||||
browser.setViewAttr(viewAttr);
|
||||
browser.setIsQuickSearch(isQuickSearch);
|
||||
browser.setLabel(label);
|
||||
if (iscustom) {
|
||||
fieldDbType = "browser." + fieldDbType;
|
||||
BrowserBean browserBean = new BrowserBean();
|
||||
// completeParams
|
||||
Map<String, Object> completeMap = new HashMap<>();
|
||||
completeMap.put("f_weaver_belongto_usertype", 0);
|
||||
completeMap.put("type", type);
|
||||
completeMap.put("fielddbtype", fieldDbType);
|
||||
browserBean.setCompleteParams(completeMap);
|
||||
// conditionDataParams
|
||||
Map<java.lang.String, Object> conditionDataMap = new HashMap<>();
|
||||
conditionDataMap.put("f_weaver_belongto_usertype", 0);
|
||||
conditionDataMap.put("type", fieldDbType);
|
||||
conditionDataMap.put("fielddbtype", fieldDbType);
|
||||
browserBean.setConditionDataParams(conditionDataMap);
|
||||
// dataParams
|
||||
Map<java.lang.String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("f_weaver_belongto_usertype", 0);
|
||||
dataMap.put("type", fieldDbType);
|
||||
browserBean.setDataParams(dataMap);
|
||||
// destDataParams
|
||||
Map<java.lang.String, Object> destDataMap = new HashMap<>();
|
||||
destDataMap.put("f_weaver_belongto_usertype", 0);
|
||||
destDataMap.put("type", fieldDbType);
|
||||
browserBean.setDestDataParams(destDataMap);
|
||||
|
||||
browserBean.setLinkUrl("");
|
||||
browserBean.setMobileLinkUrl("");
|
||||
browserBean.setPageSize(10);
|
||||
browserBean.setScrollx(true);
|
||||
browserBean.setTitle(label);
|
||||
browserBean.setType(type);
|
||||
|
||||
browser.setBrowserConditionParam(browserBean);
|
||||
}
|
||||
return browser;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 日期区间
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -142,20 +190,21 @@ public class OrganizationFormItemUtil {
|
|||
* @param label
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem rangeDateItem(User user,int colSpan, int fieldcol,int viewAttr
|
||||
,String label,String name1,String name2) {
|
||||
public static SearchConditionItem rangeDateItem(User user, int colSpan, int fieldcol, int viewAttr
|
||||
, String label, String name1, String name2) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER,502327,new String[]{name1,name2});
|
||||
SearchConditionItem rangeDate = conditionFactory.createCondition(ConditionType.TIMEPICKER, 502327, new String[]{name1, name2});
|
||||
rangeDate.setColSpan(colSpan);
|
||||
rangeDate.setFieldcol(fieldcol);
|
||||
rangeDate.setViewAttr(viewAttr);
|
||||
rangeDate.setLabel(label);
|
||||
return rangeDate;
|
||||
return rangeDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 多行文本框
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -166,10 +215,10 @@ public class OrganizationFormItemUtil {
|
|||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem textareaItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
||||
int viewAttr,int length, String label,String name) {
|
||||
public static SearchConditionItem textareaItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, int length, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA,502227, name);
|
||||
SearchConditionItem textarea = conditionFactory.createCondition(ConditionType.TEXTAREA, 502227, name);
|
||||
textarea.setColSpan(colSpan);
|
||||
textarea.setFieldcol(fieldcol);
|
||||
textarea.setIsQuickSearch(isQuickSearch);
|
||||
|
|
@ -183,6 +232,7 @@ public class OrganizationFormItemUtil {
|
|||
|
||||
/**
|
||||
* 日期
|
||||
*
|
||||
* @param user
|
||||
* @param colSpan
|
||||
* @param fieldcol
|
||||
|
|
@ -192,10 +242,10 @@ public class OrganizationFormItemUtil {
|
|||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static SearchConditionItem datePickerItem(User user,int colSpan, int fieldcol,boolean isQuickSearch,
|
||||
int viewAttr,String label,String name) {
|
||||
public static SearchConditionItem datePickerItem(User user, int colSpan, int fieldcol, boolean isQuickSearch,
|
||||
int viewAttr, String label, String name) {
|
||||
ConditionFactory conditionFactory = new ConditionFactory(user);
|
||||
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER,502227, name);
|
||||
SearchConditionItem datePicker = conditionFactory.createCondition(ConditionType.DATEPICKER, 502227, name);
|
||||
datePicker.setColSpan(colSpan);
|
||||
datePicker.setFieldcol(fieldcol);
|
||||
datePicker.setIsQuickSearch(isQuickSearch);
|
||||
|
|
@ -205,8 +255,4 @@ public class OrganizationFormItemUtil {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue