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.
weaver-hrm-organization/src/com/engine/organization/service/impl/FieldDefinedServiceImpl.java

72 lines
2.4 KiB
Java

package com.engine.organization.service.impl;
import com.engine.core.impl.Service;
import com.engine.organization.entity.extend.po.ExtendTitlePO;
import com.engine.organization.entity.fieldset.TypeTreeDTO;
import com.engine.organization.mapper.extend.ExtendInfoMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.FieldDefinedService;
import com.engine.organization.util.OrganizationAssert;
import com.engine.organization.util.db.MapperProxyFactory;
3 years ago
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author weaver_cl
3 years ago
* @Description:
* @Date 2022/6/13
* @Version V1.0
**/
public class FieldDefinedServiceImpl extends Service implements FieldDefinedService {
private ExtendTitleMapper getExtendTitleMapper() {
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
}
private ExtendInfoMapper getExtendInfoMapper() {
return MapperProxyFactory.getProxy(ExtendInfoMapper.class);
}
@Override
public List<TypeTreeDTO> getTree(String moduleName) {
3 years ago
List<TypeTreeDTO> typeTreeDTOS = new ArrayList<>();
//int extendType =
return typeTreeDTOS;
}
@Override
public Map<String, Object> getTabInfo(String groupType) {
OrganizationAssert.notBlank(groupType, "分组信息有误,请确认");
Map<String, Object> datas = new HashMap<>();
Long groupId = Long.parseLong(groupType);
List<ExtendTitlePO> extendTitleList = getExtendTitleMapper().getTitlesByGroupID(groupId);
List<Map<String, Object>> tabs = new ArrayList<>();
int idx = 1;
for (ExtendTitlePO extendTitle : extendTitleList) {
Map<String, Object> tab = new HashMap<>();
tab.put("tabkey", idx++);
tab.put("title", extendTitle.getTitle());
tab.put("isShow", extendTitle.getIsShow());
tab.put("groupid", extendTitle.getGroupId());
tab.put("viewAttr", extendTitle.getGroupId() < 0 ? 1 : 2);
tab.put("editable", editTable(extendTitle.getId()));
tabs.add(tab);
}
datas.put("status", "1");
datas.put("tabs", tabs);
return datas;
}
/**
*
*
* @param id
* @return
*/
private boolean editTable(Long id) {
return getExtendInfoMapper().countFieldsByGroupId(id) > 0;
}
}