You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.9 KiB
Java
98 lines
3.9 KiB
Java
3 years ago
|
package com.engine.organization.service.impl;
|
||
|
|
||
|
import com.api.browser.bean.SearchConditionGroup;
|
||
|
import com.api.browser.bean.SearchConditionItem;
|
||
|
import com.engine.core.impl.Service;
|
||
|
import com.engine.organization.entity.TopTab;
|
||
3 years ago
|
import com.engine.organization.service.GroupService;
|
||
3 years ago
|
import com.engine.organization.util.MenuBtn;
|
||
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
||
|
import weaver.conn.RecordSet;
|
||
|
import weaver.general.StringUtil;
|
||
|
import weaver.general.Util;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.HashMap;
|
||
|
import java.util.List;
|
||
|
import java.util.Map;
|
||
|
|
||
|
/**
|
||
|
* @description: TODO
|
||
|
* @author:dxfeng
|
||
|
* @createTime: 2022/05/16
|
||
|
* @version: 1.0
|
||
|
*/
|
||
3 years ago
|
public class GroupServiceImpl extends Service implements GroupService {
|
||
3 years ago
|
@Override
|
||
3 years ago
|
public Map<String, Object> getGroupFormField(Map<String, Object> params) {
|
||
3 years ago
|
Map<String, Object> apiDatas = new HashMap<>();
|
||
|
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||
|
SearchConditionItem companyNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "总部名称", "companyname");
|
||
|
SearchConditionItem companyDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 1, 50, "总部全称", "companydesc");
|
||
|
companyDescItem.setRules("required|string");
|
||
|
SearchConditionItem companyWebItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 1, 60, "公司网站", "companyweb");
|
||
|
|
||
|
// 赋值
|
||
|
String id = Util.null2String(params.get("id"));
|
||
|
if (!StringUtil.isEmpty(id)) {
|
||
|
RecordSet rs = new RecordSet();
|
||
|
|
||
|
String sql = "select * from HrmCompany where id in(" + id + ")";
|
||
|
rs.executeQuery(sql);
|
||
|
rs.executeQuery(sql);
|
||
|
int colcount = rs.getColCounts();
|
||
|
while (rs.next()) {
|
||
|
Map<String, Object> row = new HashMap<String, Object>();
|
||
|
for (int i = 1; i <= colcount; i++) {
|
||
|
row.put(rs.getColumnName(i).toLowerCase(), Util.null2String(rs.getString(i)));
|
||
|
}
|
||
|
// 赋值
|
||
|
companyNameItem.setValue(row.get("companyname"));
|
||
|
companyDescItem.setValue(row.get("companydesc"));
|
||
|
companyWebItem.setValue(row.get("companyweb"));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// 设置编辑属性
|
||
|
if (!StringUtil.isEmpty(Util.null2String(params.get("viewattr")))) {
|
||
|
int viewAttr = Integer.parseInt(params.get("viewattr").toString());
|
||
|
companyNameItem.setViewAttr(viewAttr);
|
||
|
companyDescItem.setViewAttr(viewAttr);
|
||
|
companyWebItem.setViewAttr(viewAttr);
|
||
|
}
|
||
|
|
||
|
selectItems.add(companyNameItem);
|
||
|
selectItems.add(companyDescItem);
|
||
|
selectItems.add(companyWebItem);
|
||
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||
|
apiDatas.put("condition", addGroups);
|
||
|
return apiDatas;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Map<String, Object> getHasRight() {
|
||
|
Map<String, Object> btnDatas = new HashMap<>();
|
||
|
ArrayList<MenuBtn> topMenuList = new ArrayList<>();
|
||
|
ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
|
||
|
// 编辑
|
||
|
topMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName("编辑").type("BTN_EDIT").build());
|
||
|
btnDatas.put("topMenu", topMenuList);
|
||
|
// 编辑
|
||
|
rightMenuList.add(MenuBtn.builder().isTop("1").menuFun("doEdit").menuIcon("icon-coms-edit").menuName("编辑").type("BTN_EDIT").build());
|
||
|
btnDatas.put("rightMenu", rightMenuList);
|
||
|
return btnDatas;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Map<String, Object> getTabInfo() {
|
||
|
Map<String, Object> apiDatas = new HashMap<>();
|
||
|
List<TopTab> topTabs = new ArrayList<>();
|
||
|
topTabs.add(TopTab.builder().title("总部信息").viewCondition("1").build());
|
||
|
apiDatas.put("topTabs", topTabs);
|
||
|
|
||
|
return apiDatas;
|
||
|
}
|
||
|
}
|