设备档案导出功能
This commit is contained in:
@@ -353,6 +353,13 @@ public class FrameWorkAdapter implements IlideeYunjiAdapter {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
//获取所有设备类型名称列表
|
||||
@TenantIgnore
|
||||
@Override
|
||||
public List<Map<String, Object>> getAllSblxNameList() {
|
||||
return adapterMapper.getAllSblxNameList();
|
||||
}
|
||||
|
||||
//获取用户分页列表
|
||||
@Override
|
||||
public Object getUserPage(Integer pageNo, Integer pageSize, lideeYunJiUserParam param) {
|
||||
|
||||
@@ -37,6 +37,7 @@ public class FormatCriteriaList implements CriteriaList{
|
||||
List<String> userKeyList = fieldWebMapper.getUserControlTypeFieldCodeList(dbformId);//那些字段是用户控件
|
||||
List<String> deptKeyList = fieldWebMapper.getDeptControlTypeFieldCodeList(dbformId);//那些字段是部门控件
|
||||
List<String> areaKeyList = fieldWebMapper.getAreaControlTypeFieldCodeList(dbformId);//那些字段是区域控件
|
||||
List<String> sblxKeyList = fieldWebMapper.getSblxControlTypeFieldCodeList(dbformId);//那些字段是设备类型控件
|
||||
|
||||
//用户
|
||||
Map<Long, String> nickNameMap = new HashMap<>();
|
||||
@@ -58,6 +59,16 @@ public class FormatCriteriaList implements CriteriaList{
|
||||
map -> Func.getMap2Str(map, "name"),
|
||||
(existing, replacement) -> existing)); // 处理重复key的情况,保留第一个值
|
||||
}
|
||||
//设备类型
|
||||
Map<Long, String> sblxNameMap = new HashMap<>();
|
||||
if (FuncBase.isNotEmpty(sblxKeyList)) {
|
||||
List<Map<String, Object>> sblxNameMapList = adapterMapper.getAllSblxNameList();
|
||||
sblxNameMap = sblxNameMapList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
map -> Func.getMap2Long(map, "id"),
|
||||
map -> Func.getMap2Str(map, "industry_name"),
|
||||
(existing, replacement) -> existing)); // 处理重复key的情况,保留第一个值
|
||||
}
|
||||
|
||||
|
||||
//字典集合
|
||||
@@ -75,6 +86,7 @@ public class FormatCriteriaList implements CriteriaList{
|
||||
//数据里面会存在id,或者字典等,如:1=男,需要转为文字
|
||||
Map<Long, String> finalNickNameMap = nickNameMap;
|
||||
Map<Long, String> finalDeptNameMap = deptNameMap;
|
||||
Map<Long, String> finalSblxNameMap = sblxNameMap;
|
||||
dataMapList.forEach(dataMap -> {
|
||||
//处理字典
|
||||
for (String key : dictKeyList) {
|
||||
@@ -161,6 +173,34 @@ public class FormatCriteriaList implements CriteriaList{
|
||||
}
|
||||
dataMap.put(key, deptnames);
|
||||
}
|
||||
//处理设备类型
|
||||
for(String key : sblxKeyList){
|
||||
String valStr = lideeYunJiUtils.getMap2Str(dataMap, key);
|
||||
if (FuncBase.isEmpty(valStr)) {
|
||||
continue;
|
||||
}
|
||||
String sblxnames="";
|
||||
//有可能是多选
|
||||
List<String> sblxIdList = Func.toStrList(valStr);
|
||||
for (String sblxId : sblxIdList) {//有可能是多选的情况下111,222,333
|
||||
//获取名称
|
||||
String sblxName = finalSblxNameMap.get(Func.toLong(sblxId));
|
||||
|
||||
if (Func.isEmpty(sblxName)) {
|
||||
continue;
|
||||
}
|
||||
if (Func.isEmpty(sblxnames)) {
|
||||
sblxnames = sblxName;
|
||||
} else {
|
||||
sblxnames += "、" + sblxName;
|
||||
}
|
||||
}
|
||||
|
||||
if (FuncBase.isEmpty(sblxnames)) {
|
||||
continue;
|
||||
}
|
||||
dataMap.put(key, sblxnames);
|
||||
}
|
||||
//处理区域
|
||||
for(String key : areaKeyList){
|
||||
String valStr = lideeYunJiUtils.getMap2Str(dataMap, key);
|
||||
|
||||
@@ -36,6 +36,10 @@ public interface AdapterMapper {
|
||||
//获取所有部门名称
|
||||
List<Map<String,Object>> getAllDeptNameList();
|
||||
|
||||
//获取所有设备类型名称列表
|
||||
@TenantIgnore
|
||||
List<Map<String, Object>> getAllSblxNameList();
|
||||
|
||||
@TenantIgnore
|
||||
@lideeYunjiCache(cacheNames = "'"+ lideeRedisConstants.REDIS_ADAPTER+":getUserIdByNikeName:' + #tenantId+'_' + #nikeName", reflexClass = Long.class)
|
||||
List<Long> getUserIdByNikeName(Long tenantId,String nikeName);
|
||||
@@ -70,8 +74,8 @@ public interface AdapterMapper {
|
||||
IPage<lideeYunJiUser> getUserPageByRoleId(Long tenantId, IPage page, Long roleId, List<Long> deptIdList, @Param("params") Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 根据表单id获取表单的字段对应的字典
|
||||
* @param dbFormId
|
||||
* 根据字典编码获取字典数据
|
||||
* @param dictCode 字典编码
|
||||
* @return
|
||||
*/
|
||||
@lideeYunjiCache(cacheNames = "'"+ lideeRedisConstants.REDIS_ADAPTER+":getDictMap:' + #dictCode", reflexClass = Map.class,nullIsSave = true)
|
||||
|
||||
@@ -96,4 +96,18 @@ public interface FormFieldWebMapper extends BaseMapper<FormFieldWebEntity> {
|
||||
return this.selectList(webWrapper);
|
||||
}
|
||||
|
||||
//获取设备类型控件字段
|
||||
default List<String> getSblxControlTypeFieldCodeList(Long dbFormId){
|
||||
LambdaQueryWrapper<FormFieldWebEntity> webWrapper=new LambdaQueryWrapper<>();
|
||||
webWrapper.eq(FormFieldWebEntity::getDbformId,dbFormId);
|
||||
webWrapper.eq(FormFieldWebEntity::getControlType,"sblxSelect");
|
||||
webWrapper.select(FormFieldWebEntity::getFieldCode);
|
||||
List<FormFieldWebEntity> webEntityList = this.selectList(webWrapper);
|
||||
//遍历返回list<String>
|
||||
List<String> fieldCodeList = webEntityList.stream()
|
||||
.map(FormFieldWebEntity::getFieldCode)
|
||||
.collect(Collectors.toList());
|
||||
return fieldCodeList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
select id,name from system_dept
|
||||
</select>
|
||||
|
||||
<select id="getAllSblxNameList" resultType="map">
|
||||
select id,industry_name from dev_sblx where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getUserIdByNikeName" resultType="long">
|
||||
@@ -180,4 +184,15 @@
|
||||
where sup.is_deleted=0 and sp.is_deleted=0
|
||||
and sp.tenant_id =#{tenantId}
|
||||
</select>
|
||||
|
||||
<!--获取所有设备类型名称列表-->
|
||||
<select id="getAllSblxNameList" resultType="java.util.Map">
|
||||
SELECT
|
||||
id,
|
||||
industry_name
|
||||
FROM
|
||||
dev_sblx
|
||||
WHERE
|
||||
is_deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user