|
|
@ -1,6 +1,7 @@
|
|
|
|
package io.renren.modules.sys.controller;
|
|
|
|
package io.renren.modules.sys.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import io.renren.common.annotation.LogOperation;
|
|
|
|
import io.renren.common.annotation.LogOperation;
|
|
|
|
|
|
|
|
import io.renren.common.config.JdbcTemplateFactory;
|
|
|
|
import io.renren.common.constant.Constant;
|
|
|
|
import io.renren.common.constant.Constant;
|
|
|
|
import io.renren.common.page.PageData;
|
|
|
|
import io.renren.common.page.PageData;
|
|
|
|
import io.renren.common.utils.Result;
|
|
|
|
import io.renren.common.utils.Result;
|
|
|
@ -22,6 +23,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@ -44,6 +46,35 @@ public class SysDeptController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SysUserService sysUserService;
|
|
|
|
private SysUserService sysUserService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("#{new Boolean(${cloud.enable})}")
|
|
|
|
|
|
|
|
private Boolean cloud; // 是否进行云资源统计
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 获取云资源申请
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private static final String getAllsql = "SELECT " +
|
|
|
|
|
|
|
|
" ORG_NAME AS \"deptName\" " +
|
|
|
|
|
|
|
|
"FROM " +
|
|
|
|
|
|
|
|
" VIEW_CLOUD_BUSINESS_INDEX " +
|
|
|
|
|
|
|
|
"WHERE " +
|
|
|
|
|
|
|
|
" 1 = 1 " +
|
|
|
|
|
|
|
|
" AND APPLYTYPE = '01' " +
|
|
|
|
|
|
|
|
" AND STATUS NOT IN ( '00', '07', '99' ) " +
|
|
|
|
|
|
|
|
"GROUP BY " +
|
|
|
|
|
|
|
|
" ORG_NAME UNION ALL " +
|
|
|
|
|
|
|
|
"SELECT " +
|
|
|
|
|
|
|
|
" ORG_NAME AS \"deptName\" " +
|
|
|
|
|
|
|
|
"FROM " +
|
|
|
|
|
|
|
|
" VIEW_VIDEO_BUSINESS_INDEX " +
|
|
|
|
|
|
|
|
"WHERE " +
|
|
|
|
|
|
|
|
" 1 = 1 " +
|
|
|
|
|
|
|
|
" AND STATUS != '00' " +
|
|
|
|
|
|
|
|
"GROUP BY " +
|
|
|
|
|
|
|
|
" ORG_NAME";
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("list")
|
|
|
|
@GetMapping("list")
|
|
|
|
@ApiOperation("查询部门列表")
|
|
|
|
@ApiOperation("查询部门列表")
|
|
|
|
@LogOperation("查询部门列表")
|
|
|
|
@LogOperation("查询部门列表")
|
|
|
@ -110,13 +141,22 @@ public class SysDeptController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<Map<String, Object>> list_metting = jdbcTemplate.queryForList("SELECT DISTINCT dept from t_meetingroom_book WHERE dept IS NOT NULL;");
|
|
|
|
List<Map<String, Object>> list_metting = jdbcTemplate.queryForList("SELECT DISTINCT dept from t_meetingroom_book WHERE dept IS NOT NULL;");
|
|
|
|
List<String> temp = list.stream().map(index -> index.get("name")).filter(index -> index != null).map(index -> index.toString()).collect(Collectors.toList());
|
|
|
|
List<String> temp = list.stream().map(index -> index.get("name")).filter(index -> index != null).map(index -> index.toString()).distinct().collect(Collectors.toList());
|
|
|
|
List<Map<String, Object>> list_ = list_metting.stream().map(index -> index.get("dept")).filter(index -> index != null).collect(Collectors.toList())
|
|
|
|
List<Map<String, Object>> list_ = list_metting.stream().map(index -> index.get("dept")).filter(index -> index != null).collect(Collectors.toList())
|
|
|
|
.stream().filter(index -> !temp.contains(index.toString())).map(index -> new HashMap<String, Object>() {{
|
|
|
|
.stream().filter(index -> !temp.contains(index.toString())).map(index -> new HashMap<String, Object>() {{
|
|
|
|
put("id", null);
|
|
|
|
put("id", null);
|
|
|
|
put("name", index.toString());
|
|
|
|
put("name", index.toString());
|
|
|
|
}}).collect(Collectors.toList());
|
|
|
|
}}).collect(Collectors.toList());
|
|
|
|
list.addAll(list_); // 获取会客厅申请部门
|
|
|
|
list.addAll(list_); // 获取会客厅申请部门
|
|
|
|
|
|
|
|
if (cloud) {
|
|
|
|
|
|
|
|
List<Map<String, Object>> list_zwy = lcJdbcTemplate.queryForList(getAllsql);
|
|
|
|
|
|
|
|
List<Map<String, Object>> list_1 = list_zwy.stream().map(index -> index.get("deptName")).filter(index -> index != null).distinct().collect(Collectors.toList())
|
|
|
|
|
|
|
|
.stream().filter(index -> !temp.contains(index.toString())).map(index -> new HashMap<String, Object>() {{
|
|
|
|
|
|
|
|
put("id", null);
|
|
|
|
|
|
|
|
put("name", index.toString());
|
|
|
|
|
|
|
|
}}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
list.addAll(list_1); // 获取政务云申请部门
|
|
|
|
|
|
|
|
}
|
|
|
|
return new Result<List<Map<String, Object>>>().ok(list);
|
|
|
|
return new Result<List<Map<String, Object>>>().ok(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|