|
|
@@ -1,5 +1,7 @@
|
|
|
package com.lc.ibps.business.service.impl;
|
|
|
|
|
|
+import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.lc.ibps.api.base.constants.StateEnum;
|
|
|
import com.lc.ibps.api.form.sql.util.BeanUtils;
|
|
|
import com.lc.ibps.base.core.util.Collections;
|
|
|
@@ -28,7 +30,19 @@ public class HomeServiceImpl implements HomeService {
|
|
|
result.setState(StateEnum.ERROR_EMPLOYEE.getCode());
|
|
|
return result;
|
|
|
}
|
|
|
- String sql = " select id_,name_ from ibps_cat_type where category_key_ = 'FILE_TYPE' and DEPTH_ = '1' and AUTHORITY_NAME like '%" + diDian + "%' ";
|
|
|
+ String str = "";
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ try {
|
|
|
+ resultMap = objectMapper.readValue(diDian, new TypeReference<Map<String, String>>() { });
|
|
|
+ str = resultMap.get("diDian").toString();
|
|
|
+ }catch (Exception e){
|
|
|
+ log.warn("参数错误");
|
|
|
+ result.setState(StateEnum.BAD_REQUEST.getCode());
|
|
|
+ result.setMessage("请求参数错误");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ String sql = " select id_,name_ from ibps_cat_type where category_key_ = 'FILE_TYPE' and DEPTH_ = '1' and AUTHORITY_NAME like '%" + str + "%' ";
|
|
|
List<Map<String,Object>> list = (List<Map<String,Object>>) commonDao.query(sql);
|
|
|
if(Collections.isEmpty(list)){
|
|
|
result.setState(StateEnum.ERROR_CAT_CATEGORY.getCode());
|
|
|
@@ -36,7 +50,7 @@ public class HomeServiceImpl implements HomeService {
|
|
|
}
|
|
|
//依据1级的结构去找所有的下级结构,并且分类放在一起
|
|
|
for (Map<String,Object> item : list) {
|
|
|
- List<Map<String, Object>> fileList = find(item,diDian);
|
|
|
+ List<Map<String, Object>> fileList = find(item,str);
|
|
|
map.put(item.get("name_").toString(),fileList);
|
|
|
}
|
|
|
result.setVariables(map);
|
|
|
@@ -45,7 +59,10 @@ public class HomeServiceImpl implements HomeService {
|
|
|
|
|
|
public List<Map<String,Object>> find(Map<String,Object> map,String diDian){
|
|
|
String typeId = map.get("id_").toString();
|
|
|
- String sql = " SELECT t.name_, COUNT(w.xi_lei_id_) as sum " +
|
|
|
+ String sql = " SELECT t.id_ id,t.category_key_ categoryKey,t.name_, t.name_ name,t.type_key_ typeKey,t.parent_id_ parentId,t.depth_ depth," +
|
|
|
+ " t.stru_type_ struType, t.path_ path, t.is_leaf_ isLeaf, t.is_show_ isShow, t.owner_id_ ownerId, t.sn_ sn, " +
|
|
|
+ " t.create_by_ createBy, t.create_time_ createTime, t.create_org_id_ createOrgId, t.update_by_ updateBy," +
|
|
|
+ " t.update_time_ updateTime, t.tenant_id_ tenantId, t.authority_name authorityName, COUNT(w.xi_lei_id_) as sum " +
|
|
|
" FROM t_wjxxb w JOIN ibps_cat_type t ON w.xi_lei_id_ = t.id_ " +
|
|
|
" WHERE t.category_key_ = 'FILE_TYPE' " +
|
|
|
" AND t.DEPTH_ = '2' " +
|