Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
wangliwen | 259ac18110 | |
wangliwen | f67410ddf3 | |
dinggang | b33527cf6c |
|
@ -1,4 +0,0 @@
|
|||
ALTER TABLE `sys_dict_data`
|
||||
ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`;
|
||||
ALTER TABLE `sys_dict_type`
|
||||
ADD COLUMN `status` int NULL DEFAULT 1 COMMENT '启用状态(0未启用 1启用)' AFTER `update_date`;
|
|
@ -1 +0,0 @@
|
|||
ALTER TABLE `sys_user` ADD COLUMN `frequency` int NULL DEFAULT 0 COMMENT '登录失败次数';
|
|
@ -1,11 +0,0 @@
|
|||
INSERT INTO `sys_dict_type`(`id`, `dict_type`, `dict_name`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357067014803457, ' encryptedRoute', '加密路由', '', 0, 1067246875800000001, '2022-11-15 11:21:24', 1067246875800000001, '2022-11-15 11:21:24', 1);
|
||||
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357815098281986, 1592357067014803457, '个人中心', '/personalCenter', '', 0, 1067246875800000001, '2022-11-15 11:24:22', 1067246875800000001, '2022-11-15 11:24:22', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357749759414274, 1592357067014803457, '消息通知', '/mynoticeView', '', 0, 1067246875800000001, '2022-11-15 11:24:07', 1067246875800000001, '2022-11-15 11:24:07', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357668599631874, 1592357067014803457, '融合服务详情', '/integrationServicesDetails', '', 0, 1067246875800000001, '2022-11-15 11:23:47', 1067246875800000001, '2022-11-15 11:23:47', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357561145757698, 1592357067014803457, '融合服务', '/integrationServices', '', 0, 1067246875800000001, '2022-11-15 11:23:22', 1067246875800000001, '2022-11-15 11:23:22', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357495567814658, 1592357067014803457, '能力统计', '/abilityStatistics', '', 0, 1067246875800000001, '2022-11-15 11:23:06', 1067246875800000001, '2022-11-15 11:23:06', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357417113358338, 1592357067014803457, '能力详情', '/details', '', 0, 1067246875800000001, '2022-11-15 11:22:47', 1067246875800000001, '2022-11-15 11:22:47', 1);
|
||||
INSERT INTO `sys_dict_data`(`id`, `dict_type_id`, `dict_label`, `dict_value`, `remark`, `sort`, `creator`, `create_date`, `updater`, `update_date`, `status`) VALUES (1592357337807458305, 1592357067014803457, '能力集市', '/DetailsPageconetent', '', 0, 1067246875800000001, '2022-11-15 11:22:29', 1067246875800000001, '2022-11-15 11:22:29', 1);
|
||||
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for policy_cloud_service
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `policy_cloud_service`;
|
||||
CREATE TABLE `policy_cloud_service` (
|
||||
`service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`service_description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of policy_cloud_service
|
||||
-- ----------------------------
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置1H4G', '1H4G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H4G', '2H4G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H8G', '2H8G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置2H16G', '2H16G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H8G', '4H8G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H16G', '4H16G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置4H32G', '4H32G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H16G', '8H16G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H32G', '8H32G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置8H64G', '8H64G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H32G', '16H32G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置16H64G', '16H64G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H64G', '32H64G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机', '云主机配置32H128G', '32H128G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机系统盘', '云主机系统盘', '40G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '云主机数据盘', '云主机数据盘', '100G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '非结构化数据对象存储服务', '非结构化数据对象存储服务', '100G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据异地容灾服务', '数据异地容灾服务', '100G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '主机服务', '数据本地备份及快速恢复服务', '数据本地备份及快速恢复服务', '100G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('基础服务', '机柜服务', '机柜租赁服务', '机柜租赁服务', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '1200MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '2400MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '6000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MySQL', '云数据库RDS for MySQL', '12000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '1000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '4000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '6000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库RDS for MSSQL Server', '云数据库RDS for MS SQL Server', '12000MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '数据库', '云数据库数据盘', '云数据库数据盘', '100MB内存', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('PaaS服务', '负载均衡', '负载均衡服务', '负载均衡服务', '实例', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '等保三级标准服务', '云主机安全服务-等保三级服务', '云主机', '必选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '数据安全服务', '数据安全服务', '数据库实例', '必选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('安全服务', '主机数据库应用安全服务', '应用安全服务', '应用安全服务', '云主机', '必选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('运营服务', '增值服务', '同城应用容灾服务', '同城应用容灾服务', '云主机', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据离线计算', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据实时计算', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据分析服务', '数据分析服务', '数据分析服务数据同步服务', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据发现', '套', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '数据脱敏服务', '数据脱敏服务', '数据脱敏服务隐私数据漂泊', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '非结构化数据存储', '大数据存储服务非结构化数据存储', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('大数据服务', '大数据存储', '结构化数据存储', '大数据存储服务结构化数据存储', '1', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Windows server 2008 、2012、2016数据中心版等安装、授权激活、维护', '云主机', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'Redhat 6.6以上不同版本系统安装和维护', '云主机', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '商用操作系统套餐', 'CentOS 6.5以上不同版本系统安装和维护', '云主机', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云基础套餐', '双核(1.6Ghz)/3G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云标准套餐', '双核(2.0Ghz)/5G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口或1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云高级套餐', '四核2.4GHz、8G内存/40G系统盘/100G数据盘;6个USB口、1个VGA接口和1个HDMI接口,音频输入输出接口。支持1920*1200桌面分辨率。含瘦终端、分屏器、软件升级费用,不包含鼠标、键盘等外设费用', '个', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '操作系统和其他中间件', '桌面云数据盘', '以100GB为单位', '100G', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统二级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(二级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '信息系统三级等级保护测评服务', '按照国家公安部门等级保护制度要求提供物理安全、网络安全、主机安全、数据安全、应用安全等测评服务(三级)。本服务目录价格为省公安厅最低价。', '信息系统', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '网页防篡改服务', '增强版网页防篡改服务。', '云主机', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '商用密码安全评估', '按照国家《密码安全法》对云平台或云主机做商用密码安全全量评估。最终出具业内标准的商密评估报告。', '系统', '可选', '2022');
|
||||
INSERT INTO `policy_cloud_service` VALUES ('附加增值服务', '云安全保障增值服务', '蜜罐服务', '融合网络欺骗和主动防御威胁检测防御系统,通过暗设陷阱,主动诱导攻击,能够动态感知内网攻击行为,及时精准的定位攻击源,并隐匿真实资产,保障业务系统的安全运行。', '套', '可选', '2022');
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
@ -1,31 +0,0 @@
|
|||
-- ----------------------------
|
||||
-- Table structure for t_will_apply_camera
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_will_apply_camera`;
|
||||
CREATE TABLE `t_will_apply_camera` (
|
||||
`id` bigint(0) NOT NULL COMMENT '主键ID',
|
||||
`user_id` bigint(0) NULL DEFAULT NULL COMMENT '用户',
|
||||
`del_flag` int(0) NULL DEFAULT NULL COMMENT '删除标志:0正常,1删除,',
|
||||
`camera_point_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`channel_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`channel_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`check_status` int(0) NULL DEFAULT NULL,
|
||||
`gpsX` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`gpsY` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`idt_camera_channel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`management_unit_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`node_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`parent_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`status` int(0) NULL DEFAULT NULL,
|
||||
`creator` bigint(0) NULL DEFAULT NULL,
|
||||
`create_date` datetime(0) NULL DEFAULT NULL,
|
||||
`updater` bigint(0) NULL DEFAULT NULL,
|
||||
`update_date` datetime(0) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
ALTER TABLE tb_data_resource ADD COLUMN `undercarriage_instance_id` bigint NULL COMMENT '下架流程实例ID';
|
|
@ -1,11 +0,0 @@
|
|||
-- 2022-11-22 资源增加价格字段,申请表增加申请价格
|
||||
|
||||
ALTER TABLE t_ability_application ADD COLUMN `apply_price` BIGINT NOT NULL DEFAULT 0 COMMENT '申请价格';
|
||||
|
||||
ALTER TABLE tb_data_resource ADD COLUMN `price` BIGINT NOT NULL DEFAULT 0 COMMENT '价格';
|
||||
|
||||
ALTER TABLE t_meetingroom ADD COLUMN `price` BIGINT NOT NULL DEFAULT 0 COMMENT '价格';
|
||||
|
||||
ALTER TABLE t_meetingroom_book ADD COLUMN `apply_price` BIGINT NOT NULL DEFAULT 0 COMMENT '申请价格';
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
ALTER TABLE sys_role_user
|
||||
ADD COLUMN `del_flag` INT NOT NULL DEFAULT 0 COMMENT '删除标志:0正常,1删除',
|
||||
ADD COLUMN `updater` BIGINT NULL COMMENT '修改人',
|
||||
ADD COLUMN `update_date` datetime(0) NULL COMMENT '修改时间';
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
ALTER TABLE `sys_user`
|
||||
ADD INDEX `idx_dept_id`(`dept_id`);
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 192.168.124.46
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 80030
|
||||
Source Host : 192.168.124.46:3306
|
||||
Source Schema : share_platform
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 80030
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 01/12/2022 18:12:20
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_notice_management
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_notice_management`;
|
||||
CREATE TABLE `sys_notice_management` (
|
||||
`id` bigint(0) NOT NULL,
|
||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
|
||||
`publish_time` datetime(0) NULL DEFAULT NULL,
|
||||
`del_flag` int(0) NULL DEFAULT NULL,
|
||||
`create_date` datetime(0) NULL DEFAULT NULL,
|
||||
`creator` bigint(0) NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
@ -1,17 +0,0 @@
|
|||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
-- ----------------------------
|
||||
-- Table structure for t_ucs_lc_dept_rel
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_ucs_lc_dept_rel`;
|
||||
CREATE TABLE `t_ucs_lc_dept_rel` (
|
||||
`ucs_id` bigint(0) NOT NULL COMMENT 'ucs部门ID,sys_dept主键',
|
||||
`ucs_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ucs部门名称',
|
||||
`district` bigint(0) NULL DEFAULT NULL COMMENT '部门所属地区',
|
||||
`district_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地区名称',
|
||||
`type` int(0) NULL DEFAULT NULL COMMENT '部门类型',
|
||||
`lc_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '浪潮部门名称',
|
||||
`lc_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '浪潮部门ID'
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'ucs与浪潮部门名称对应表' ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
@ -1,13 +0,0 @@
|
|||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
drop table IF EXISTS `sys_audit_team`;
|
||||
create TABLE `sys_audit_team` (
|
||||
`id` bigint NOT NULL comment '主键ID',
|
||||
`creator` bigint NOT NULL comment '创建人',
|
||||
`create_date` datetime NOT NULL comment '创建时间',
|
||||
`name` longtext NOT NULL comment '审核组名称',
|
||||
`member` json NOT NULL comment '审核组成员id数组',
|
||||
`index` varchar(255) NULL comment '审核组索引',
|
||||
PRIMARY KEY (`id`)
|
||||
) comment = '流程审核组组员';
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
@ -1,2 +0,0 @@
|
|||
ALTER TABLE tb_fuse ADD COLUMN `district` int(2) DEFAULT 0 COMMENT '赋能场景类型:0市级、1基层场景',
|
||||
ADD COLUMN `area` varchar(128) NULL COMMENT '基层赋能场景所属地区';
|
|
@ -1 +0,0 @@
|
|||
ALTER TABLE `t_demand_data` ADD COLUMN `enclosure_name` longtext NULL COMMENT '附件名称' AFTER `apply_number`;
|
|
@ -1 +0,0 @@
|
|||
alter table `sys_audit_team` ADD COLUMN `description` longtext NULL comment '审核组备注信息';
|
Binary file not shown.
8
pom.xml
8
pom.xml
|
@ -92,14 +92,6 @@
|
|||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>${mysql.version}</version>
|
||||
</dependency>
|
||||
<!--<!– oracle驱动 –>-->
|
||||
<!--<dependency>-->
|
||||
<!-- <groupId>com.oracle</groupId>-->
|
||||
<!-- <artifactId>ojdbc11</artifactId>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/lib/ojdbc11-11.2.0.3.jar</systemPath>-->
|
||||
<!-- <version>${oracle.version}</version>-->
|
||||
<!--</dependency>-->
|
||||
<!-- oracle驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
|
|
Binary file not shown.
|
@ -231,22 +231,6 @@
|
|||
<systemPath>${project.basedir}/lib/yawei-pso-${yawei-pso.version}.jar</systemPath>
|
||||
<version>${yawei-pso.version}</version>
|
||||
</dependency>
|
||||
<!-- oracle驱动 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/ojdbc8-11.2.0.3.jar</systemPath>
|
||||
<version>${oracle.version}</version>
|
||||
</dependency>
|
||||
<!--<!– oracle驱动 –>-->
|
||||
<!--<dependency>-->
|
||||
<!-- <groupId>com.oracle</groupId>-->
|
||||
<!-- <artifactId>ojdbc6</artifactId>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/lib/ojdbc6-11.2.0.3.jar</systemPath>-->
|
||||
<!-- <version>${oracle.version}</version>-->
|
||||
<!--</dependency>-->
|
||||
<!-- en ke video -->
|
||||
<dependency>
|
||||
<groupId>sw.vc3term</groupId>
|
||||
|
@ -342,14 +326,9 @@
|
|||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<!-- 排除生产环境配置 -->
|
||||
<exclude>application-bt.yml</exclude>
|
||||
<!-- <exclude>application-dev.yml</exclude> -->
|
||||
<exclude>application-hwx.yml</exclude>
|
||||
<exclude>application-my.yml</exclude>
|
||||
<exclude>application-prod.yml</exclude>
|
||||
<exclude>application-show.yml</exclude>
|
||||
<exclude>application-test.yml</exclude>
|
||||
<!--<exclude>application-xha.yml</exclude>-->
|
||||
<exclude>application-bt.yml</exclude>
|
||||
<exclude>application-xha.yml</exclude>
|
||||
<!-- 排除flyway管理的sql -->
|
||||
<exclude>db/*.sql</exclude>
|
||||
<exclude>domain/**</exclude>
|
||||
|
@ -384,10 +363,7 @@
|
|||
<classpathPrefix>lib/</classpathPrefix>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<Class-Path>. lib/yawei-pso-${yawei-pso.version}.jar
|
||||
lib/contingencyplan-${contingencyplan.version}.jar
|
||||
lib/ojdbc8-11.2.0.3.jar
|
||||
</Class-Path>
|
||||
<Class-Path>. lib/yawei-pso-${yawei-pso.version}.jar lib/contingencyplan-${contingencyplan.version}.jar</Class-Path>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
|
@ -425,40 +401,36 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>0.2.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>docker</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
|
||||
<!-- 指定本地docker -->
|
||||
<dockerHost>http://192.168.124.46:2375</dockerHost>
|
||||
<!-- Configure the image name -->
|
||||
<imageName>hisense/share-platform</imageName>
|
||||
<imageTags>
|
||||
<imageTag>${project.version}</imageTag>
|
||||
</imageTags>
|
||||
<forceTags>true</forceTags>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/application</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<includes>
|
||||
<include>renren-admin-1.0.tar.gz</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <includeSystemScope>true</includeSystemScope>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-surefire-plugin</artifactId>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <skipTests>true</skipTests>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>com.spotify</groupId>-->
|
||||
<!-- <artifactId>docker-maven-plugin</artifactId>-->
|
||||
<!-- <version>${docker.plugin.version}</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <imageName>renren/${project.artifactId}</imageName>-->
|
||||
<!-- <dockerDirectory>${project.basedir}/</dockerDirectory>-->
|
||||
<!-- <resources>-->
|
||||
<!-- <resource>-->
|
||||
<!-- <targetPath>/</targetPath>-->
|
||||
<!-- <directory>${project.build.directory}</directory>-->
|
||||
<!-- <include>${project.build.finalName}.jar</include>-->
|
||||
<!-- </resource>-->
|
||||
<!-- </resources>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -1,18 +0,0 @@
|
|||
FROM ibm-semeru-runtimes:open-11-jre
|
||||
ENV JAR_FILE renren-admin.jar
|
||||
ENV TAR_FILE renren-admin-1.0.tar.gz
|
||||
ENV ACTIVE "dev"
|
||||
ENV Xmx "1G"
|
||||
|
||||
ENV VERTICLE_HOME /usr/hisense
|
||||
EXPOSE 8888
|
||||
VOLUME ["/usr/hisense"]
|
||||
|
||||
ADD application/$TAR_FILE $VERTICLE_HOME/
|
||||
COPY simsun.ttc /usr/share/fonts/truetype/dejavu/
|
||||
RUN cd /usr/share/fonts/truetype/dejavu && chmod 755 * && fc-cache -fv
|
||||
HEALTHCHECK --interval=3m --timeout=3s --start-period=3m --retries=5 CMD curl --silent --fail 127.0.0.1:8888/ucs-admin/census/center/v2/whole_amount || exit 1
|
||||
|
||||
WORKDIR $VERTICLE_HOME/renren-admin
|
||||
ENTRYPOINT ["sh", "-c"]
|
||||
CMD ["exec java -jar -Dfile.encoding=utf-8 -server -Xshareclasses -Xtune:virtualized -Xms512M -Xmx$Xmx -XX:ReservedCodeCacheSize=240m -XX:InitialCodeCacheSize=240m -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ConcGCThreads=1 -XX:ParallelGCThreads=2 -XX:ZCollectionInterval=120 -XX:ZAllocationSpikeTolerance=5 -Duser.timezone=GMT+08 $VERTICLE_HOME/renren-admin/$JAR_FILE --spring.profiles.active=$ACTIVE"]
|
Binary file not shown.
|
@ -43,7 +43,7 @@ import java.util.concurrent.Executors;
|
|||
public class ActivitiNoticeAspect {
|
||||
|
||||
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService EXECUTOR = Executors.newWorkStealingPool(CPU_NUM * 3);
|
||||
private static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(CPU_NUM * 3);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ActivitiNoticeAspect.class);
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package io.renren.common.config;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import io.renren.commons.dynamic.datasource.properties.DataSourceProperties;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
public class JdbcTemplateFactory {
|
||||
|
||||
public static JdbcTemplate getJdbcTemplate() {
|
||||
DataSourceProperties properties = new DataSourceProperties();
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate();
|
||||
DruidDataSource druidDataSource = new DruidDataSource();
|
||||
|
||||
druidDataSource.setUrl("jdbc:oracle:thin:@15.72.183.89:1521:orcl");
|
||||
druidDataSource.setDriverClassName("oracle.jdbc.OracleDriver");
|
||||
druidDataSource.setUsername("csynuser");
|
||||
druidDataSource.setPassword("csynuser123");
|
||||
|
||||
druidDataSource.setInitialSize(properties.getInitialSize());
|
||||
druidDataSource.setMaxActive(properties.getMaxActive());
|
||||
druidDataSource.setMinIdle(properties.getMinIdle());
|
||||
druidDataSource.setMaxWait(properties.getMaxWait());
|
||||
druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
|
||||
druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
|
||||
druidDataSource.setMaxEvictableIdleTimeMillis(properties.getMaxEvictableIdleTimeMillis());
|
||||
druidDataSource.setValidationQuery("select 1 FROM DUAL");
|
||||
druidDataSource.setValidationQueryTimeout(properties.getValidationQueryTimeout());
|
||||
druidDataSource.setTestOnBorrow(properties.isTestOnBorrow());
|
||||
druidDataSource.setTestOnReturn(properties.isTestOnReturn());
|
||||
druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements());
|
||||
druidDataSource.setMaxOpenPreparedStatements(properties.getMaxOpenPreparedStatements());
|
||||
druidDataSource.setSharePreparedStatements(properties.isSharePreparedStatements());
|
||||
jdbcTemplate.setDataSource(druidDataSource);
|
||||
return jdbcTemplate;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package io.renren.common.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
|
@ -13,11 +12,6 @@ import java.nio.charset.Charset;
|
|||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
|
||||
@Value("${rest_template.read_timeout}")
|
||||
private Integer read_timeout;
|
||||
@Value("${rest_template.connect_timeout}")
|
||||
private Integer connect_timeout;
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
|
||||
RestTemplate restTemplate = new RestTemplate(factory);
|
||||
|
@ -28,8 +22,8 @@ public class RestTemplateConfig {
|
|||
@Bean
|
||||
public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
|
||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
factory.setReadTimeout(read_timeout);//单位为ms
|
||||
factory.setConnectTimeout(connect_timeout);//单位为ms
|
||||
factory.setReadTimeout(30 * 000);//单位为ms
|
||||
factory.setConnectTimeout(5 * 1000);//单位为ms
|
||||
factory.setOutputStreaming(false);
|
||||
|
||||
// InetSocketAddress socketAddress = new InetSocketAddress("192.168.124.31", 8888);
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/ability/center")
|
||||
public class AbilityCenterController {
|
||||
private static final Integer cpuNUm = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(cpuNUm);
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(cpuNUm);
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterController.class);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package io.renren.common.controller;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.dto.AuditingBaseDTO;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.CodeGenerationUtils;
|
||||
|
@ -38,7 +39,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -113,7 +113,7 @@ public class AbilityCenterControllerV2 {
|
|||
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
|
||||
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
/*switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
case TSINGTAO: { // 青岛市局 异步会死锁
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
}
|
||||
|
@ -121,8 +121,7 @@ public class AbilityCenterControllerV2 {
|
|||
default: {
|
||||
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
|
||||
}
|
||||
}*/
|
||||
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
|
||||
}
|
||||
return new Result().ok(LocalDateTime.now().toString());
|
||||
}
|
||||
|
||||
|
@ -143,43 +142,24 @@ public class AbilityCenterControllerV2 {
|
|||
logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO));
|
||||
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
/*switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
case TSINGTAO: { // 青岛市局 异步会死锁
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
//executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
|
||||
return new Result().ok(LocalDateTime.now().toString());
|
||||
}
|
||||
|
||||
private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) {
|
||||
|
||||
List<TAbilityApplicationDTO> tAbilityApplicationDTOList = abilityBatchApplicationDTO.getSystem().stream().map(index -> {
|
||||
|
||||
if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
logger.error("重复发起申请");
|
||||
return null;
|
||||
}
|
||||
|
||||
//2022-11-22 资源重复申请判断更新
|
||||
//if (index.containsKey("channelId")) {
|
||||
// String today = DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN);
|
||||
// if (tAbilityApplicationService.countUserCameraApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId")), today) > 0) {
|
||||
// logger.error("重复发起申请");
|
||||
// return null;
|
||||
// }
|
||||
//} else {
|
||||
// if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
// logger.error("重复发起申请");
|
||||
// return null;
|
||||
// }
|
||||
//}
|
||||
TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO();
|
||||
tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea());
|
||||
tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment());
|
||||
|
@ -196,11 +176,6 @@ public class AbilityCenterControllerV2 {
|
|||
tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId());
|
||||
tAbilityApplicationDTO.setApproveStatus("审核中");
|
||||
tAbilityApplicationDTO.setDelFlag(0);
|
||||
if (StringUtils.isNotBlank(index.get("price"))) {
|
||||
tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price"))));
|
||||
} else {
|
||||
tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO);
|
||||
}
|
||||
// v2 新增字段
|
||||
tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index));
|
||||
tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle());
|
||||
|
@ -211,7 +186,7 @@ public class AbilityCenterControllerV2 {
|
|||
tAbilityApplicationDTO.setEnclosureName(abilityBatchApplicationDTO.getEnclosureName());
|
||||
tAbilityApplicationDTO.setCreateDate(new Date());
|
||||
tAbilityApplicationDTO.setExpireDate(abilityBatchApplicationDTO.getExpireDate());
|
||||
//tAbilityApplicationDTO.setResourceOwnerDept(sysDeptService.getByName(index.get("managementUnitName")));
|
||||
tAbilityApplicationDTO.setResourceOwnerDept(sysDeptService.getByName(index.get("managementUnitName")));
|
||||
|
||||
|
||||
// 归为同一次申请
|
||||
|
@ -231,6 +206,7 @@ public class AbilityCenterControllerV2 {
|
|||
}).filter(ObjectUtil::isNotNull).collect(Collectors.toList()); // 申请入库
|
||||
if (!tAbilityApplicationDTOList.isEmpty()) {
|
||||
codeGenerationUtils.setApplyNumber("NLSY", tAbilityApplicationDTOList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()), jdbcTemplate);
|
||||
|
||||
Map<Long, List<TAbilityApplicationDTO>> temp = tAbilityApplicationDTOList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
|
||||
|
@ -259,7 +235,7 @@ public class AbilityCenterControllerV2 {
|
|||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
String[] sqls = dtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[dtoList.size()]);
|
||||
jdbcTemplate.batchUpdate(sqls);// 批量更新资源所属部门信息
|
||||
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
|
||||
logger.info("批量更新申请的资源的部门信息完成");
|
||||
}, executor);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package io.renren.common.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
|
@ -7,7 +8,6 @@ import io.renren.common.constant.Constant;
|
|||
import io.renren.common.dto.AuditingBaseDTO;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.CodeGenerationUtils;
|
||||
import io.renren.common.utils.DateUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
|
@ -45,7 +45,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
@ -64,8 +63,6 @@ public class AbilityCenterControllerV3 {
|
|||
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
|
||||
|
||||
private static final ExecutorService executorMain = Executors.newCachedThreadPool();
|
||||
|
||||
private static final ObjectMapper oMapper = new ObjectMapper();
|
||||
|
||||
@Value("${project.place}")
|
||||
|
@ -131,10 +128,8 @@ public class AbilityCenterControllerV3 {
|
|||
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
case TSINGTAO: { // 青岛市局 异步会死锁 使用缓存线程池
|
||||
executorMain.execute(() -> {
|
||||
case TSINGTAO: { // 青岛市局 异步会死锁
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
});
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
|
@ -169,9 +164,7 @@ public class AbilityCenterControllerV3 {
|
|||
final UserDetail user = SecurityUser.getUser();
|
||||
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
|
||||
case TSINGTAO: { // 青岛市局 异步会死锁
|
||||
executorMain.execute(() -> {
|
||||
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
|
||||
});
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
|
@ -193,8 +186,7 @@ public class AbilityCenterControllerV3 {
|
|||
// TODO 拆单进行审核 abilityprocess_v3
|
||||
private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) {
|
||||
SysUserDTO sysUserDTO = sysUserService.get(user.getId());
|
||||
List<String> resourceName = abilityBatchApplicationDTO.getSystem().stream()
|
||||
.filter(index -> tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0)
|
||||
List<String> resourceName = abilityBatchApplicationDTO.getSystem().stream().filter(index -> tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0)
|
||||
.map(index -> index.get("resourceName"))
|
||||
.collect(Collectors.toList()); // 获取已申请的资源名称
|
||||
if (!resourceName.isEmpty()) {
|
||||
|
@ -224,28 +216,11 @@ public class AbilityCenterControllerV3 {
|
|||
sysNoticeService.save(dto);
|
||||
}, executor);
|
||||
}
|
||||
logger.info("开始申请流程!");
|
||||
List<TAbilityApplicationDTO> tAbilityApplicationDTOList = abilityBatchApplicationDTO.getSystem().stream().map(index -> {
|
||||
|
||||
//if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
// logger.error("重复发起申请");
|
||||
// return null;
|
||||
//}
|
||||
|
||||
//2022-11-22 资源重复申请判断更新
|
||||
if (index.containsKey("channelId")) {
|
||||
String today = DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN);
|
||||
if (tAbilityApplicationService.countUserCameraApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId")), today) > 0) {
|
||||
logger.error("重复发起申请");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
|
||||
logger.error("重复发起申请");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO();
|
||||
tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea());
|
||||
tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment());
|
||||
|
@ -262,11 +237,7 @@ public class AbilityCenterControllerV3 {
|
|||
tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId());
|
||||
tAbilityApplicationDTO.setApproveStatus("审核中");
|
||||
tAbilityApplicationDTO.setDelFlag(0);
|
||||
if (StringUtils.isNotBlank(index.get("price"))) {
|
||||
tAbilityApplicationDTO.setApplyPrice(BigDecimal.valueOf(Long.valueOf(index.get("price"))));
|
||||
} else {
|
||||
tAbilityApplicationDTO.setApplyPrice(BigDecimal.ZERO);
|
||||
} // v2 新增字段
|
||||
// v2 新增字段
|
||||
tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index));
|
||||
tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle());
|
||||
tAbilityApplicationDTO.setApplicationBackground(abilityBatchApplicationDTO.getApplicationBackground());
|
||||
|
@ -312,24 +283,19 @@ public class AbilityCenterControllerV3 {
|
|||
if (deptId == 0L) { // 部门id不存在时
|
||||
return;
|
||||
}
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
|
||||
final SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
|
||||
if (sysDeptDTO == null) { // 部门不存在
|
||||
logger.info("资源部门不存在时!!!");
|
||||
if (!deptDTO.isPresent()) {
|
||||
return;
|
||||
}
|
||||
sysDeptDTO = deptDTO.isPresent() ? deptDTO.get() : null;
|
||||
}
|
||||
List<TAbilityApplicationDTO> dtoList = temp.get(deptId);
|
||||
SysDeptDTO finalSysDeptDTO = sysDeptDTO;
|
||||
dtoList = dtoList.stream().map(index -> {
|
||||
index.setResourceOwnerDept(finalSysDeptDTO);
|
||||
index.setResourceOwnerDept(sysDeptDTO);
|
||||
return index;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<TAbilityApplicationDTO> finalDtoList = dtoList;
|
||||
CompletableFuture.runAsync(() -> {
|
||||
String[] sqls = finalDtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(finalSysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[finalDtoList.size()]);
|
||||
String[] sqls = finalDtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[finalDtoList.size()]);
|
||||
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
|
||||
logger.info("批量更新申请的资源的部门信息完成");
|
||||
}, executor);
|
||||
|
@ -360,6 +326,7 @@ public class AbilityCenterControllerV3 {
|
|||
Boolean crossRegion = Boolean.FALSE; // 是否跨区
|
||||
Boolean cityApplyCity = Boolean.FALSE; // 是否为市区申请市区
|
||||
|
||||
// TODO
|
||||
if (sysUserDTO.getDeptId() != null) {
|
||||
SysDeptDTO applyUserDeptDTO = sysDeptService.get(sysUserDTO.getDeptId()); // 发起人的部门
|
||||
Integer applyUserDeptType = applyUserDeptDTO.getType(); // 发起人
|
||||
|
@ -395,7 +362,7 @@ public class AbilityCenterControllerV3 {
|
|||
put("city_apply", finalCityApply); // 是否为市级部门发起申请
|
||||
put("cross_region", finalCrossRegion); // 是否跨区
|
||||
put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区
|
||||
put("resource_dept", finalSysDeptDTO); // 同一审核单内部门信息
|
||||
put("resource_dept", sysDeptDTO); // 同一审核单内部门信息
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
package io.renren.common.controller;
|
||||
|
||||
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.utils.UpdateUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "管理员后台")
|
||||
@RestController
|
||||
@RequestMapping("/admin")
|
||||
public class AdminController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AdminController.class);
|
||||
private static final String pwd = System.getProperty("user.dir");
|
||||
@Autowired
|
||||
private UpdateUtil updateUtil;
|
||||
@Value("${spring.profiles.active}")
|
||||
private String active; // 现有生效
|
||||
|
||||
/**
|
||||
* @param params updateFile 更新包下载地址 active 重启完成后的配置环境
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/update")
|
||||
public Result<String> update(@RequestBody Map<String, String> params) {
|
||||
String updateFile = params.containsKey("updateFile") ? params.get("updateFile") : null;
|
||||
String active = params.containsKey("active") ? params.get("active") : null;
|
||||
if (StringUtils.isEmpty(active)) {
|
||||
active = this.active;
|
||||
}
|
||||
if (StringUtils.isEmpty(updateFile)) {
|
||||
return new Result<String>().ok(String.valueOf(false));
|
||||
}
|
||||
boolean success = updateUtil.update(updateFile, active);
|
||||
return new Result<String>().ok(String.valueOf(success));
|
||||
}
|
||||
|
||||
/**
|
||||
* 列出所有日志文件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "logFiles")
|
||||
public Result<List<String>> logFiles() {
|
||||
List<String> result = new ArrayList<>();
|
||||
File file = new File(pwd + File.separator + "logs");
|
||||
File[] tempFile = file.listFiles();
|
||||
result = Arrays.asList(tempFile)
|
||||
.stream()
|
||||
.filter(index -> index.isFile() && index.getName().endsWith(".log"))
|
||||
.sorted(Comparator.comparing(x -> {
|
||||
File index = (File) x;
|
||||
return index.lastModified();
|
||||
}).reversed())
|
||||
.map(index -> index.getName())
|
||||
.collect(Collectors.toList());
|
||||
return new Result<List<String>>().ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载日志文件
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "downloadLog")
|
||||
public ResponseEntity<FileSystemResource> downloadLogFile(String file) {
|
||||
File file_ = new File(pwd + File.separator + "logs" + File.separator + file);
|
||||
if (!file_.exists()) {
|
||||
return null;
|
||||
}
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||
headers.add("Content-Disposition", "attachment; filename=" + file_.getName());
|
||||
headers.add("Pragma", "no-cache");
|
||||
headers.add("Expires", "0");
|
||||
headers.add("Last-Modified", new Date().toString());
|
||||
headers.add("ETag", String.valueOf(System.currentTimeMillis()));
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(headers)
|
||||
.contentLength(file_.length())
|
||||
.contentType(MediaType.parseMediaType("application/octet-stream"))
|
||||
.body(new FileSystemResource(file_));
|
||||
}
|
||||
|
||||
}
|
|
@ -8,9 +8,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.modules.date_snapshot.dto.SysDateSnapshotDTO;
|
||||
import io.renren.modules.date_snapshot.entity.SnapshotType;
|
||||
import io.renren.modules.date_snapshot.service.SysDateSnapshotService;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.renren.modules.resource.dao.ResourceDao;
|
||||
import io.renren.modules.resource.excel.census.SelectApplyDeptDetailTypeCountListExcel;
|
||||
|
@ -22,7 +19,6 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService;
|
|||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.enums.SuperAdminEnum;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -42,7 +38,6 @@ import java.io.IOException;
|
|||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -56,7 +51,7 @@ import java.util.stream.Collectors;
|
|||
public class CensusController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CensusController.class);
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
|
@ -74,17 +69,12 @@ public class CensusController {
|
|||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
private SysDateSnapshotService sysDateSnapshotService;
|
||||
|
||||
@Value("${census.type}")
|
||||
private String[] censusTypes; // 需要进行统计的资源类型
|
||||
|
||||
@Value("${census.applyType}")
|
||||
private String[] censusApplyTypes; // 需要进行申请统计的资源类型
|
||||
|
||||
@Value("${big_date.name}")
|
||||
private String bigDataDeptName;
|
||||
|
||||
/**
|
||||
* 获取各类资源数目
|
||||
|
@ -129,9 +119,7 @@ public class CensusController {
|
|||
CompletableFuture<Void> resourceAmount = CompletableFuture.supplyAsync(() -> { // 获取资源汇聚总量
|
||||
Map map = (Map) resourceService.selectTotal();
|
||||
List<Map<String, Object>> dbAmount = (List<Map<String, Object>>) map.get("total");
|
||||
return dbAmount.stream()
|
||||
.filter(index -> !"知识库".equals(index.get("type").toString())) //2022-11-24 资源总量去除知识库统计
|
||||
.mapToLong(index -> Long.parseLong(index.get("count").toString())).sum();
|
||||
return dbAmount.stream().mapToLong(index -> Long.parseLong(index.get("count").toString())).sum();
|
||||
}, executor).thenAccept(sum -> result.add(new HashMap<String, Object>() {
|
||||
{
|
||||
put("amount", sum);
|
||||
|
@ -387,7 +375,7 @@ public class CensusController {
|
|||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "deptId", value = "申请部门", paramType = "query", dataType = "long"),
|
||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
|
||||
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "region", value = "所属区域id", paramType = "query", dataType = "String"),
|
||||
})
|
||||
|
@ -416,8 +404,6 @@ public class CensusController {
|
|||
Integer.valueOf(index.getOrDefault("ywzy", "0").toString()),
|
||||
Integer.valueOf(index.getOrDefault("yyzy", "0").toString()),
|
||||
Integer.valueOf(index.getOrDefault("hys", "0").toString()),
|
||||
Integer.valueOf(index.getOrDefault("yzy", "0").toString()),
|
||||
Integer.valueOf(index.getOrDefault("ysp", "0").toString()),
|
||||
Integer.valueOf(index.getOrDefault("count", "0").toString()));
|
||||
return temp;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -488,23 +474,23 @@ public class CensusController {
|
|||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
|
||||
@ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
|
||||
})
|
||||
public Result selectCensusResourceTable(@RequestParam Map<String, Object> params) {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
if (user.getDeptId() != null) {
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
|
||||
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
|
||||
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
|
||||
|
||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
||||
}
|
||||
// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员
|
||||
//
|
||||
// }
|
||||
return new Result().ok(resourceService.selectCensusResourceTable(params));
|
||||
}
|
||||
|
||||
@GetMapping("/exportSelectCensusResourceTable")
|
||||
@ApiOperation("导出部门上架资源及审批结果详细信息")
|
||||
@LogOperation("导出部门上架资源及审批结果详细信息")
|
||||
@ApiOperation("查询部门上架资源及审批结果详细信息")
|
||||
@LogOperation("查询部门上架资源及审批结果详细信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
|
@ -514,12 +500,13 @@ public class CensusController {
|
|||
})
|
||||
public void exportSelectCensusResourceTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
if (user.getDeptId() != null) {
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
|
||||
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
|
||||
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
|
||||
|
||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
||||
}
|
||||
// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员
|
||||
//
|
||||
// }
|
||||
ArrayList<Map> resultList = (ArrayList<Map>) resourceDao.selectCensusResourceTable(params);
|
||||
List<List<Object>> date = resultList.stream().map(index -> {
|
||||
List<Object> data = new ArrayList<>();
|
||||
|
@ -570,17 +557,17 @@ public class CensusController {
|
|||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "资源类型", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
|
||||
@ApiImplicitParam(name = "provideDept", value = "提供部门", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
|
||||
})
|
||||
public Result selectCensusApplyTable(@RequestParam Map<String, Object> params) {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
if (user.getDeptId() != null) {
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
|
||||
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
|
||||
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
|
||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
||||
}
|
||||
// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员
|
||||
//
|
||||
// }
|
||||
return new Result().ok(resourceService.selectCensusApplyTable(params));
|
||||
}
|
||||
|
||||
|
@ -596,19 +583,20 @@ public class CensusController {
|
|||
})
|
||||
public void exportSelectCensusApplyTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
if (user.getDeptId() != null) {
|
||||
SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
|
||||
//2022-11-21 修改为只有大数据局部门和admin账号能查看所有
|
||||
if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) {
|
||||
params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
|
||||
}
|
||||
|
||||
ArrayList<Map> resultList = (ArrayList<Map>) resourceService.selectCensusApplyTableNotPaging(params);
|
||||
// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员
|
||||
//
|
||||
// }
|
||||
ArrayList<Map> resultList = (ArrayList<Map>) resourceDao.selectCensusApplyTable(params);
|
||||
List<List<Object>> date = resultList.stream().map(index -> {
|
||||
List<Object> data = new ArrayList<>();
|
||||
data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
|
||||
data.add(index.getOrDefault("resourceDeptName", "") == null ? "" : index.getOrDefault("resourceDeptName", "").toString());
|
||||
data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString());
|
||||
data.add(index.getOrDefault("type", "") == null ? "" : index.getOrDefault("type", "").toString());
|
||||
data.add(index.getOrDefault("resourceDeptName", "") == null ? "" : index.getOrDefault("resourceDeptName", "").toString());
|
||||
data.add(index.getOrDefault("deptName", "") == null ? "" : index.getOrDefault("deptName", "").toString());
|
||||
data.add(index.getOrDefault("createDate", "") == null ? "" : index.getOrDefault("createDate", "").toString());
|
||||
data.add(index.getOrDefault("approveStatus", "") == null ? "" : index.getOrDefault("approveStatus", "").toString());
|
||||
return data;
|
||||
|
@ -626,13 +614,13 @@ public class CensusController {
|
|||
private List<List<String>> exportSelectCensusApplyTableHead() {
|
||||
List<List<String>> list = new ArrayList<>();
|
||||
List<String> head0 = new ArrayList<>();
|
||||
head0.add("申请部门");
|
||||
head0.add("提供部门");
|
||||
List<String> head1 = new ArrayList<>();
|
||||
head1.add("资源名称");
|
||||
List<String> head2 = new ArrayList<>();
|
||||
head2.add("类型");
|
||||
List<String> head3 = new ArrayList<>();
|
||||
head3.add("提供部门");
|
||||
head3.add("申请部门");
|
||||
List<String> head4 = new ArrayList<>();
|
||||
head4.add("日期");
|
||||
List<String> head5 = new ArrayList<>();
|
||||
|
@ -646,211 +634,4 @@ public class CensusController {
|
|||
return list;
|
||||
}
|
||||
|
||||
// TODO 同比环比
|
||||
@GetMapping("/similitude")
|
||||
// @ApiOperation("资源数量环比")
|
||||
// @LogOperation("资源数量环比")
|
||||
@ApiImplicitParams({})
|
||||
public Result similitude() {
|
||||
long countApply = tAbilityApplicationService.countApplyAll(); // 资源申请量
|
||||
HashMap<String, Object> resultMap = (HashMap<String, Object>) resourceService.selectTotal();
|
||||
List<Map<String, Object>> snapshot_now = new ArrayList<Map<String, Object>>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("count", countApply);
|
||||
put("type", "资源申请量");
|
||||
}});
|
||||
try {
|
||||
if (resultMap.containsKey("total")) {
|
||||
addAll((Collection<? extends Map<String, Object>>) resultMap.get("total"));
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("获取资源数量失败", exception);
|
||||
}
|
||||
}}; // 当前数据信息
|
||||
final List<String> needType = new ArrayList<String>() {{
|
||||
add("组件服务");
|
||||
add("应用资源");
|
||||
add("数据资源");
|
||||
add("基础设施");
|
||||
}};
|
||||
SysDateSnapshotDTO data_weekly = sysDateSnapshotService.selectForFlag(SnapshotType.DATA_WEEKLY.getFlag()); // 最近的周快照
|
||||
SysDateSnapshotDTO data_month = sysDateSnapshotService.selectForFlag(SnapshotType.DATA_MONTH.getFlag()); // 最近的周快照
|
||||
List<Map<String, Object>> result = snapshot_now.stream().filter(index -> needType.contains(index.get("type").toString())).map(index -> {
|
||||
String typeTemp = index.get("type").toString();
|
||||
Map<String, Object> temp = new LinkedHashMap<>();
|
||||
temp.put("type", typeTemp);
|
||||
temp.put("count", Integer.valueOf(index.get("count").toString()));
|
||||
if (data_weekly != null) {
|
||||
Optional<Map<String, Object>> t_weekly = data_weekly.getSnapshot().stream().filter(t -> typeTemp.equals(t.get("type"))).findFirst();// 周环比
|
||||
if (t_weekly.isPresent()) {
|
||||
temp.put("weekly_change", Integer.valueOf(index.get("count").toString()) - Integer.valueOf(t_weekly.get().get("count").toString()));
|
||||
} else {
|
||||
temp.put("weekly_change", Integer.valueOf(index.get("count").toString()));
|
||||
}
|
||||
} else {
|
||||
temp.put("weekly_change", Integer.valueOf(index.get("count").toString()));
|
||||
}
|
||||
if (data_month != null) {
|
||||
Optional<Map<String, Object>> t_month = data_month.getSnapshot().stream().filter(t -> typeTemp.equals(t.get("type"))).findFirst(); // 月环比
|
||||
if (t_month.isPresent()) {
|
||||
temp.put("month_change", Integer.valueOf(index.get("count").toString()) - Integer.valueOf(t_month.get().get("count").toString()));
|
||||
} else {
|
||||
temp.put("month_change", Integer.valueOf(index.get("count").toString()));
|
||||
}
|
||||
} else {
|
||||
temp.put("month_change", Integer.valueOf(index.get("count").toString()));
|
||||
}
|
||||
return temp;
|
||||
}).collect(Collectors.toList());
|
||||
Integer sum = result.stream().mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum();
|
||||
Integer weekly_change = result.stream().mapToInt(index -> Integer.valueOf(index.get("weekly_change").toString())).sum();
|
||||
Integer month_change = result.stream().mapToInt(index -> Integer.valueOf(index.get("month_change").toString())).sum();
|
||||
result.add(new LinkedHashMap<String, Object>() {{
|
||||
put("type", "四大类资源");
|
||||
put("count", sum);
|
||||
put("weekly_change", weekly_change);
|
||||
put("month_change", month_change);
|
||||
}});
|
||||
return new Result().ok(result);
|
||||
}
|
||||
|
||||
@GetMapping("/similitude_dept")
|
||||
// @ApiOperation("部门资源数量环比")
|
||||
// @LogOperation("部门资源数量环比")
|
||||
@ApiImplicitParams({})
|
||||
public Result similitudeDept() {
|
||||
List<HashMap<String, Object>> resultList1 = new ArrayList<>();
|
||||
List<HashMap<String, Object>> resultList2 = new ArrayList<>();
|
||||
Long county_dept_count = 0l;
|
||||
Long municipal_dept_count = 0l;
|
||||
try {
|
||||
resultList1 = CompletableFuture.supplyAsync(() -> {
|
||||
return (List<HashMap<String, Object>>) resourceService.selectApplyDeptDetailTypeCountList(new HashMap() {{
|
||||
put("snapshot", true);
|
||||
}}); // 能力申请统计原始数据
|
||||
}, executor).get();
|
||||
resultList2 = CompletableFuture.supplyAsync(() -> {
|
||||
return (List<HashMap<String, Object>>) resourceService.selectDeptDetailTypeCountList(new HashMap() {{
|
||||
put("snapshot", true);
|
||||
}}); // 能力上架统计原始数据
|
||||
}, executor).get();
|
||||
county_dept_count = CompletableFuture.supplyAsync(() -> sysDeptService.countByType(3), executor).get();
|
||||
municipal_dept_count = CompletableFuture.supplyAsync(() -> sysDeptService.countByType(2), executor).get();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("异步获取数据失败", e);
|
||||
} catch (ExecutionException e) {
|
||||
logger.error("异步获取数据失败", e);
|
||||
}
|
||||
|
||||
Integer county_apply_sum = resultList1.stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区申请总量
|
||||
Integer county_resource_sum = resultList2.stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区上架总量
|
||||
|
||||
Integer municipal_apply_sum = resultList1.stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市申请总量
|
||||
Integer municipal_resource_sum = resultList2.stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市上架总量
|
||||
|
||||
Integer county_resource_weekly_change;
|
||||
Integer county_resource_month_change;
|
||||
|
||||
Integer municipal_resource_weekly_change;
|
||||
Integer municipal_resource_month_change;
|
||||
|
||||
SysDateSnapshotDTO resource_weekly = sysDateSnapshotService.selectForFlag(SnapshotType.RESOURCE_WEEKLY.getFlag()); // 最近的上架周快照
|
||||
SysDateSnapshotDTO resource_month = sysDateSnapshotService.selectForFlag(SnapshotType.RESOURCE_MONTH.getFlag()); // 最近的上架月快照
|
||||
if (resource_weekly != null) {
|
||||
int temp = resource_weekly.getSnapshot().stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区上架总量
|
||||
county_resource_weekly_change = county_resource_sum - temp;
|
||||
temp = resource_weekly.getSnapshot().stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市上架总量
|
||||
municipal_resource_weekly_change = municipal_resource_sum - temp;
|
||||
} else {
|
||||
county_resource_weekly_change = county_resource_sum;
|
||||
municipal_resource_weekly_change = municipal_resource_sum;
|
||||
}
|
||||
if (resource_month != null) {
|
||||
int temp = resource_month.getSnapshot().stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区上架总量
|
||||
county_resource_month_change = county_resource_sum - temp;
|
||||
temp = resource_month.getSnapshot().stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市上架总量
|
||||
municipal_resource_month_change = municipal_resource_sum - temp;
|
||||
} else {
|
||||
county_resource_month_change = county_resource_sum;
|
||||
municipal_resource_month_change = municipal_resource_sum;
|
||||
}
|
||||
|
||||
SysDateSnapshotDTO apply_weekly = sysDateSnapshotService.selectForFlag(SnapshotType.APPLY_WEEKLY.getFlag()); // 最近的申请周快照
|
||||
SysDateSnapshotDTO apply_month = sysDateSnapshotService.selectForFlag(SnapshotType.APPLY_MONTH.getFlag()); // 最近的申请月快照
|
||||
|
||||
Integer county_apply_weekly_change;
|
||||
Integer county_apply_month_change;
|
||||
|
||||
Integer municipal_apply_weekly_change;
|
||||
Integer municipal_apply_month_change;
|
||||
|
||||
if (apply_weekly != null) {
|
||||
int temp = apply_weekly.getSnapshot().stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区申请总量
|
||||
county_apply_weekly_change = county_apply_sum - temp;
|
||||
temp = apply_weekly.getSnapshot().stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市申请总量
|
||||
municipal_apply_weekly_change = municipal_apply_sum - temp;
|
||||
} else {
|
||||
county_apply_weekly_change = county_apply_sum;
|
||||
municipal_apply_weekly_change = municipal_apply_sum;
|
||||
}
|
||||
|
||||
if (apply_month != null) {
|
||||
int temp = apply_month.getSnapshot().stream().filter(index -> index.containsKey("level") && "county".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 区申请总量
|
||||
county_apply_month_change = county_apply_sum - temp;
|
||||
temp = apply_month.getSnapshot().stream().filter(index -> index.containsKey("level") && "municipal".equals(index.get("level").toString()))
|
||||
.mapToInt(index -> Integer.valueOf(index.get("count").toString())).sum(); // 市申请总量
|
||||
municipal_apply_month_change = municipal_apply_sum - temp;
|
||||
} else {
|
||||
county_apply_month_change = county_apply_sum;
|
||||
municipal_apply_month_change = municipal_apply_sum;
|
||||
}
|
||||
|
||||
Integer finalCounty_resource_weekly_change = county_resource_weekly_change;
|
||||
Integer finalCounty_resource_month_change = county_resource_month_change;
|
||||
Integer finalMunicipal_resource_weekly_change = municipal_resource_weekly_change;
|
||||
Integer finalMunicipal_resource_month_change = municipal_resource_month_change;
|
||||
Integer finalCounty_apply_weekly_change = county_apply_weekly_change;
|
||||
Integer finalMunicipal_apply_weekly_change = municipal_apply_weekly_change;
|
||||
Integer finalMunicipal_apply_month_change = municipal_apply_month_change;
|
||||
Integer finalCounty_apply_month_change = county_apply_month_change;
|
||||
Long finalCounty_dept_count = county_dept_count;
|
||||
Long finalMunicipal_dept_count = municipal_dept_count;
|
||||
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("tip", "区市部门");
|
||||
put("level", "county");
|
||||
put("dept_count", finalCounty_dept_count);
|
||||
put("apply_sum", county_apply_sum);
|
||||
put("resource_sum", county_resource_sum);
|
||||
put("resource_weekly_change", finalCounty_resource_weekly_change);
|
||||
put("resource_month_change", finalCounty_resource_month_change);
|
||||
put("apply_weekly_change", finalCounty_apply_weekly_change);
|
||||
put("apply_month_change", finalCounty_apply_month_change);
|
||||
}});
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("tip", "市级部门");
|
||||
put("level", "municipal");
|
||||
put("dept_count", finalMunicipal_dept_count);
|
||||
put("apply_sum", municipal_apply_sum);
|
||||
put("resource_sum", municipal_resource_sum);
|
||||
put("resource_weekly_change", finalMunicipal_resource_weekly_change);
|
||||
put("resource_month_change", finalMunicipal_resource_month_change);
|
||||
put("apply_weekly_change", finalMunicipal_apply_weekly_change);
|
||||
put("apply_month_change", finalMunicipal_apply_month_change);
|
||||
}});
|
||||
}};
|
||||
return new Result().ok(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.concurrent.Executors;
|
|||
@RequestMapping("/comment/center")
|
||||
public class CommentController {
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ObjectMapper oMapper = new ObjectMapper();
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package io.renren.common.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -34,8 +36,8 @@ public class FileUploadController {
|
|||
private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd/");
|
||||
|
||||
@PostMapping("/upload")
|
||||
// @ApiOperation("文件上传")
|
||||
// @LogOperation("文件上传")
|
||||
@ApiOperation("文件上传")
|
||||
@LogOperation("文件上传")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "file", value = "文件", paramType = "file", dataType = "file", required = true)
|
||||
})
|
||||
|
|
|
@ -33,11 +33,7 @@ public class RejectController {
|
|||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* @param taskId 驳回到第一节点的当前task
|
||||
* @param params 尝试更新表单
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("relaunch/{taskId}")
|
||||
@ApiOperation("携带更新后的表单重新发起流程")
|
||||
@LogOperation("携带更新后的表单重新发起流程")
|
||||
|
@ -58,7 +54,7 @@ public class RejectController {
|
|||
taskService.removeVariable(task.getId(), "parameterContent");
|
||||
taskService.removeVariable(task.getId(), "resourceDTO");
|
||||
taskService.setVariables(task.getId(), combineResultMap); // 更新
|
||||
logger.info("携带更新后的表单重新发起流程:{}", JSON.toJSONString(combineResultMap));
|
||||
logger.error("-----------{}", JSON.toJSONString(combineResultMap));
|
||||
taskService.setVariable(task.getId(), "backToFirst", Boolean.FALSE); // 标识驳回标签false
|
||||
taskService.setVariable(task.getId(), "completeEntry", Boolean.FALSE); // 标志为非首次录入
|
||||
taskService.setVariable(task.getId(), "reject", Boolean.FALSE); // 标识流程中是否存在拒绝false
|
||||
|
@ -68,7 +64,7 @@ public class RejectController {
|
|||
String name = userDTOOptional.isPresent() ? userDTOOptional.get().getRealName() : "";
|
||||
actTaskService.completeTask(task.getId(), name + "重新发起审核");
|
||||
result.set(new Result().ok(name + "重新发起审核成功"));
|
||||
logger.info("{} 重新发起审核成功", name);
|
||||
logger.error("{}重新发起审核成功", name);
|
||||
});
|
||||
return result.get();
|
||||
}
|
||||
|
|
|
@ -236,11 +236,6 @@ public class ResourceMountController {
|
|||
ProcessInstanceDTO index_ = actRunningService.startOfBusinessKey(processStartDTO);
|
||||
logger.info("-------------------2.启动流程成功--------------------------");
|
||||
logger.info("ProcessInstanceDTO.getBusinessKey:{}", index_.getBusinessKey());
|
||||
|
||||
//11-18 新增下架流程实例id
|
||||
dto.setUndercarriageInstanceId(Long.parseLong(index_.getProcessInstanceId()));
|
||||
resourceService.update(dto);
|
||||
|
||||
dtoList.add(index_);
|
||||
});
|
||||
return dtoList.stream().findAny().orElse(null);
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
package io.renren.common.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.CodeGenerationUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.modules.activiti.dto.ProcessInstanceDTO;
|
||||
import io.renren.modules.activiti.dto.ProcessStartDTO;
|
||||
import io.renren.modules.activiti.service.ActProcessService;
|
||||
import io.renren.modules.activiti.service.ActRunningService;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.resourceMountApply.dto.TResourceBatchMountApplyDTO;
|
||||
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
|
||||
import io.renren.modules.resourceMountApply.service.TResourceMountApplyService;
|
||||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.activiti.engine.task.TaskQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.codehaus.jackson.map.ObjectMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "资源上架")
|
||||
@RestController
|
||||
@RequestMapping("/resource/center")
|
||||
public class ResourceMountShowController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceMountShowController.class);
|
||||
private static final ObjectMapper oMapper = new ObjectMapper();
|
||||
@Autowired
|
||||
private ActProcessService actProcessService;
|
||||
@Autowired
|
||||
private ActRunningService actRunningService;
|
||||
@Autowired
|
||||
private TResourceMountApplyService tResourceMountApplyService;
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
private final CodeGenerationUtils codeGenerationUtils = CodeGenerationUtils.getInstance();
|
||||
|
||||
@Autowired
|
||||
protected TaskService taskService;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@Autowired
|
||||
private SysDeptService sysDeptService;
|
||||
|
||||
@Value("${big_date.name}")
|
||||
private String bigDateDeptName; // 大数据局名称
|
||||
|
||||
private static final String APPLY_KEY = "resourcemountapply_show"; // 资源上架
|
||||
|
||||
private static final String UNDERCARRIAGE_KEY = "resourcundercarriageapply"; // 资源下架
|
||||
|
||||
private static final Map<String, Object> apply_params = new HashMap<String, Object>() {
|
||||
{
|
||||
put("isLatestVersion", true); // 取最新版本
|
||||
put("key", APPLY_KEY); // 限定 能力资源上架
|
||||
}
|
||||
};
|
||||
|
||||
private static final Map<String, Object> undercarriage_params = new HashMap<String, Object>() {
|
||||
{
|
||||
put("isLatestVersion", true); // 取最新版本
|
||||
put("key", UNDERCARRIAGE_KEY); // 限定 资源下架
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@PostMapping(value = "/apply_show")
|
||||
@ApiOperation("批量进行能力上架申请")
|
||||
@LogOperation("批量进行能力上架申请")
|
||||
public Result<List<ProcessInstanceDTO>> apply(@RequestBody TResourceBatchMountApplyDTO tResourceBatchMountApplyDTO) {
|
||||
// 仿照请求接口 /act/process/lastestPage
|
||||
PageData<Map<String, Object>> page = actProcessService.page(apply_params);
|
||||
if (page.getTotal() <= 0) { //
|
||||
return new Result().error("联系管理员添加流程");
|
||||
}
|
||||
logger.info("---------------------------------------------------");
|
||||
logger.info(JSONObject.toJSONString(tResourceBatchMountApplyDTO));
|
||||
logger.info("####################################################");
|
||||
return new Result().ok(tResourceBatchMountApplyDTO.getResourceDTO().stream().map(index -> {
|
||||
TResourceMountApplyDTO tResourceMountApplyDTO = new TResourceMountApplyDTO();
|
||||
tResourceMountApplyDTO.setPhone(tResourceBatchMountApplyDTO.getPhone());
|
||||
tResourceMountApplyDTO.setDeptId(tResourceBatchMountApplyDTO.getDeptId());
|
||||
tResourceMountApplyDTO.setUserId(tResourceBatchMountApplyDTO.getUserId());
|
||||
tResourceMountApplyDTO.setUserName(tResourceBatchMountApplyDTO.getUserName());
|
||||
tResourceMountApplyDTO.setParameterContent(JSON.toJSONString(index));
|
||||
tResourceMountApplyDTO.setParameterContentMd5(SecureUtil.md5(JSON.toJSONString(index)));
|
||||
tResourceMountApplyDTO.setResourceDTO(index);
|
||||
tResourceMountApplyDTO.setEnclosure(index.getEnclosure());
|
||||
tResourceMountApplyDTO.setFlowType("资源上架");
|
||||
try {
|
||||
tResourceMountApplyDTO.setResourceId(tResourceMountApplyDTO.getResourceDTO().getId());
|
||||
} catch (Exception e) {
|
||||
logger.error("资源上架异常", e);
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(tResourceBatchMountApplyDTO.getDeptId())) {
|
||||
Optional<SysUserDTO> userDTO = Optional.ofNullable(sysUserService.get(Long.valueOf(tResourceBatchMountApplyDTO.getUserId())));
|
||||
userDTO.ifPresent(user -> {
|
||||
if (user.getSuperAdmin() == 1) {
|
||||
SysDeptDTO deptDTO = sysDeptService.getByName(bigDateDeptName);
|
||||
tResourceMountApplyDTO.setDeptId(deptDTO.getId().toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ValidatorUtils.validateEntity(tResourceMountApplyDTO, AddGroup.class, DefaultGroup.class);
|
||||
tResourceMountApplyService.save(tResourceMountApplyDTO); // 保存单条资源申请记录
|
||||
if (tResourceMountApplyDTO.getId() == null) {
|
||||
return null;
|
||||
}
|
||||
codeGenerationUtils.setApplyNumber("NLSJ", Arrays.asList(tResourceMountApplyDTO.getId()), jdbcTemplate);
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
Task task = taskQuery.active().processInstanceBusinessKey(tResourceMountApplyDTO.getId().toString()).singleResult();
|
||||
if (task != null) {
|
||||
logger.error("该资源已发起上架");
|
||||
throw new RuntimeException("该资源已发起上架");
|
||||
}
|
||||
|
||||
tResourceMountApplyDTO.setCompleteEntry(Boolean.TRUE);
|
||||
logger.info("-------------------1.保存申请表单成功--------------------------");
|
||||
// 仿照请求接口 /act/running/startOfBusinessKey
|
||||
ProcessStartDTO processStartDTO = new ProcessStartDTO();
|
||||
processStartDTO.setBusinessKey(tResourceMountApplyDTO.getId().toString());
|
||||
processStartDTO.setProcessDefinitionKey(APPLY_KEY); // 限定资源上架
|
||||
|
||||
Map<String, Object> variables = oMapper.convertValue(tResourceMountApplyDTO, Map.class);
|
||||
processStartDTO.setVariables(variables);
|
||||
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
|
||||
logger.info("-------------------2.启动流程成功--------------------------");
|
||||
logger.info("ProcessInstanceDTO.getBusinessKey:{}", dto.getBusinessKey());
|
||||
|
||||
if (Long.valueOf(dto.getBusinessKey()) != null) {
|
||||
// 仿照请求接口 /processForm/tabilityapplication/updateInstanceId
|
||||
tResourceMountApplyService.updateInstanceId(dto.getProcessInstanceId(), Long.valueOf(dto.getBusinessKey()));
|
||||
logger.info("-------------------更新updateInstanceId.成功--------------------------");
|
||||
logger.info("ProcessInstanceDTO.getProcessInstanceId:{}", dto.getProcessInstanceId());
|
||||
}
|
||||
return dto;
|
||||
}).filter(ObjectUtil::isNotNull).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ import java.util.concurrent.Executors;
|
|||
@Component
|
||||
public class InitiatorDataEntryListener implements TaskListener {
|
||||
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService EXECUTOR = Executors.newWorkStealingPool(CPU_NUM * 3);
|
||||
private static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(CPU_NUM * 3);
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InitiatorDataEntryListener.class);
|
||||
|
||||
|
@ -75,35 +75,15 @@ public class InitiatorDataEntryListener implements TaskListener {
|
|||
} else if (kv.containsKey("userId")) {
|
||||
creator = kv.get("userId").toString();
|
||||
}
|
||||
Integer type = 10;
|
||||
String flowType = kv.getOrDefault("flowType", "").toString();
|
||||
switch (flowType) {
|
||||
case "能力申请":
|
||||
type = 0;
|
||||
break;
|
||||
case "能力需求申请":
|
||||
type = 6;
|
||||
break;
|
||||
case "评论审核":
|
||||
type = 8;
|
||||
break;
|
||||
case "资源上架":
|
||||
type = 2;
|
||||
break;
|
||||
case "资源下架":
|
||||
type = 4;
|
||||
break;
|
||||
}
|
||||
try {
|
||||
String result = "被驳回";
|
||||
String finalCreator = creator;
|
||||
String finalResult = result;
|
||||
Integer finalType = type;
|
||||
CompletableFuture.runAsync(() -> { // 发起人
|
||||
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
|
||||
String content = "【通知】" + userDTO.getRealName() + ",您发起的流程 " + kv.getOrDefault("flowType", "") + finalResult;
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(finalType);
|
||||
dto.setType(2);
|
||||
dto.setTitle("流程节点系统通知");
|
||||
dto.setContent(content); // 通知内容
|
||||
dto.setReceiverType(1);
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
package io.renren.common.utils;
|
||||
|
||||
import cn.hutool.core.util.RuntimeUtil;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Component
|
||||
public class UpdateUtil {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UpdateUtil.class);
|
||||
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final String pwd = System.getProperty("user.dir");
|
||||
|
||||
private static final OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(1, TimeUnit.MINUTES).readTimeout(2, TimeUnit.MINUTES).connectionPool(new ConnectionPool(CPUNUM * 2, 2, TimeUnit.MINUTES)).retryOnConnectionFailure(false).build(); // 下载更新包的工具
|
||||
|
||||
/**
|
||||
* 执行更新
|
||||
*
|
||||
* @param updateFile
|
||||
* @param active
|
||||
* @return
|
||||
*/
|
||||
public Boolean update(String updateFile, String active) {
|
||||
String updateFilePath = downloadUpdateFile(updateFile);
|
||||
if (StringUtils.isEmpty(updateFile)) {
|
||||
return false;
|
||||
}
|
||||
execUpdate(updateFilePath, active);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载更新包
|
||||
*
|
||||
* @param updateFile
|
||||
* @return 下载的更新包磁盘路径
|
||||
*/
|
||||
private String downloadUpdateFile(String updateFile) {
|
||||
File folder = new File(pwd + File.separator + "/update"); // 更新包下载保存文件夹
|
||||
File file = new File(folder, updateFile.substring(updateFile.lastIndexOf("/") + 1)); // 保存文件路径与名称
|
||||
if (!folder.isDirectory()) {
|
||||
folder.mkdirs();
|
||||
}
|
||||
Request request = new Request.Builder().url(updateFile).addHeader("Connection", "close").get().build();
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
if (response.isSuccessful()) {
|
||||
try (InputStream is = response.body().byteStream(); FileOutputStream fos = new FileOutputStream(file)) {
|
||||
long total = response.body().contentLength();
|
||||
byte[] buf = new byte[4096];
|
||||
int len;
|
||||
long sum = 0;
|
||||
while ((len = is.read(buf)) != -1) {
|
||||
fos.write(buf, 0, len);
|
||||
sum += len;
|
||||
int progress = (int) (sum * 1.0f / total * 100);
|
||||
logger.info("更新包下载进度 {}% ", progress);
|
||||
}
|
||||
fos.flush();
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
} else {
|
||||
logger.error("下载更新包失败:{},错误码:{}", updateFile, response.code());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error("下载更新包失败:" + updateFile, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateFilePath 下载到本地的更新文件
|
||||
* @param active 启动程序的配置文件
|
||||
*/
|
||||
private void execUpdate(String updateFilePath, String active) {
|
||||
String[] cmd = {"/bin/sh", "-c", String.format("cd %s && sh update.sh %s %s %s %s", pwd, pwd, updateFilePath, "renren-admin", active)};
|
||||
// String cmd = String.format("cd %s && sh update.sh %s %s", pwd, pwd, updateFilePath, "renren-admin", active);
|
||||
logger.info("执行指令:{}", Arrays.asList(cmd).toString());
|
||||
logger.info(RuntimeUtil.execForStr(cmd));
|
||||
}
|
||||
}
|
|
@ -3,20 +3,15 @@ package io.renren.modules.activiti.controller;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.config.JdbcTemplateFactory;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.exception.ErrorCode;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.modules.activiti.dto.BatchCompleteDTO;
|
||||
import io.renren.modules.activiti.dto.TaskDTO;
|
||||
import io.renren.modules.activiti.service.ActTaskService;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.service.SysAuditTeamService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysRoleUserService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -27,20 +22,15 @@ import org.activiti.engine.TaskService;
|
|||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.repository.ProcessDefinitionQuery;
|
||||
import org.activiti.engine.task.TaskQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -52,35 +42,17 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/act/task")
|
||||
@Api(tags = "任务管理")
|
||||
public class ActTaskController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActTaskController.class);
|
||||
|
||||
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPU_NUM * 3);
|
||||
|
||||
@Autowired
|
||||
private ActTaskService actTaskService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Autowired
|
||||
protected RepositoryService repositoryService;
|
||||
@Autowired
|
||||
protected TaskService taskService;
|
||||
@Autowired
|
||||
private SysAuditTeamService sysAuditTeamService;
|
||||
|
||||
@Value("#{new Boolean(${auditteam.enable})}")
|
||||
private Boolean auditteam; // 是否进行审核组
|
||||
|
||||
@Value("${big_date.assignee_meet_role_id}")
|
||||
private String defaultAssigneeRoleId; // 会客厅审核人角色
|
||||
|
||||
@Autowired
|
||||
private SysRoleUserService sysRoleUserService;
|
||||
|
||||
private JdbcTemplate lcJdbcTemplate = JdbcTemplateFactory.getJdbcTemplate();
|
||||
|
||||
/**
|
||||
* 获取用户任务列表
|
||||
|
@ -120,49 +92,33 @@ public class ActTaskController {
|
|||
})
|
||||
// @RequiresPermissions("sys:task:all")
|
||||
public Result<PageData<TaskDTO>> myToDoTaskPage(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
String userId = SecurityUser.getUserId().toString();
|
||||
params.put("userId", userId);
|
||||
logger.info("--------------------------------------------------------{}", userId);
|
||||
params.put("userId", SecurityUser.getUserId().toString());
|
||||
PageData<TaskDTO> page = actTaskService.page(params);
|
||||
for (TaskDTO taskDTO : page.getList()) {
|
||||
if (!StringUtils.isEmpty(taskDTO.getAssignee())) {
|
||||
SysUserDTO userDTO = sysUserService.get(Long.valueOf(taskDTO.getAssignee()));
|
||||
taskDTO.setAssigneeName(userDTO.getRealName());
|
||||
if (userId.equals(taskDTO.getAssignee())) {
|
||||
taskDTO.setSynergism(Boolean.FALSE);
|
||||
} else {
|
||||
taskDTO.setSynergism(Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当未指定流程类型时 补充一下会客厅的待办
|
||||
*/
|
||||
if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) {
|
||||
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
|
||||
if (useIds.contains(Long.parseLong(userId))) { // 拥有会客厅审核权限
|
||||
int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Integer.class);
|
||||
page.setTotal(page.getTotal() + meetingroom_book);
|
||||
Integer limit = 10;
|
||||
if (params.get(Constant.LIMIT) != null) {
|
||||
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
|
||||
}
|
||||
int mettingLimit = limit - page.getList().size();
|
||||
if (page.getList().size() < limit) {
|
||||
List<Map<String, Object>> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " +
|
||||
" t_meetingroom_book.id AS `taskId`, " +
|
||||
" t_meetingroom_book.dept AS `userDeptName`, " +
|
||||
" '会客厅' AS `resourceType`, " +
|
||||
" '青岛市大数据发展管理局' AS `provideDept`, " +
|
||||
" t_meetingroom.`name` AS `userName`, " +
|
||||
" '会客厅审核' AS `taskName `, " +
|
||||
" '会议室审核' AS `taskName `, " +
|
||||
" t_meetingroom.create_date AS `createTime` " +
|
||||
"FROM " +
|
||||
" t_meetingroom_book " +
|
||||
" LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " +
|
||||
"WHERE " +
|
||||
" state = 1 LIMIT " + mettingLimit);
|
||||
" state = 1;");
|
||||
List<TaskDTO> meetingroom_bookTaskDto = meetingroom_bookTask
|
||||
.stream().map(index -> {
|
||||
TaskDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), TaskDTO.class);
|
||||
|
@ -173,7 +129,6 @@ public class ActTaskController {
|
|||
page.setList(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Result<PageData<TaskDTO>>().ok(page);
|
||||
}
|
||||
|
||||
|
@ -185,8 +140,7 @@ public class ActTaskController {
|
|||
})
|
||||
public Result<Map<String, Long>> myToDoTaskNum(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
Map<String, Long> result = new LinkedHashMap<>();
|
||||
String userId = SecurityUser.getUserId().toString();
|
||||
params.put("userId", userId);
|
||||
params.put("userId", SecurityUser.getUserId().toString());
|
||||
ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery()
|
||||
.orderByProcessDefinitionId().desc().orderByProcessDefinitionKey().desc();
|
||||
processDefinitionQuery.latestVersion();
|
||||
|
@ -196,28 +150,7 @@ public class ActTaskController {
|
|||
taskQuery.processDefinitionKey(index.getKey()); // 流程模型key
|
||||
taskQuery.taskAssignee(SecurityUser.getUserId().toString());
|
||||
taskQuery.active();
|
||||
if (auditteam) { // 允许流程审核协作时
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(Long.parseLong(userId));
|
||||
List<String> groupUserId = sysAuditTeamDTOS
|
||||
.stream()
|
||||
.map(index_ -> index_.getMember())
|
||||
.filter(Objects::nonNull)
|
||||
.flatMap(index_ -> index_.stream())
|
||||
.map(index_ -> index_.get("id").toString())
|
||||
.filter(index_ -> !userId.equals(index_)) // 过滤非本人
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
long sum = groupUserId.stream().mapToLong(inedx_ -> {
|
||||
TaskQuery taskQuery_ = taskService.createTaskQuery();
|
||||
taskQuery_.processDefinitionKey(index.getKey()); // 流程模型key
|
||||
taskQuery_.taskAssignee(inedx_); // 协作组审核人
|
||||
taskQuery_.active();
|
||||
return taskQuery_.count();
|
||||
}).sum();
|
||||
result.put(index.getKey(), taskQuery.count() + sum); // 加上协作组任务数
|
||||
} else {
|
||||
result.put(index.getKey(), taskQuery.count());
|
||||
}
|
||||
});
|
||||
result.put("meetingroom_book", jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Long.class));
|
||||
return new Result<Map<String, Long>>().ok(result);
|
||||
|
@ -294,25 +227,7 @@ public class ActTaskController {
|
|||
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
|
||||
}
|
||||
actTaskService.completeTask(taskId, comment);
|
||||
return new Result().ok("审核通过");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量通过
|
||||
*
|
||||
* @param batchCompleteDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("batchComplete")
|
||||
@ApiOperation("批量任务处理(完成任务)")
|
||||
@LogOperation("批量任务处理(完成任务)")
|
||||
public Result completeTaskBatch(@RequestBody BatchCompleteDTO batchCompleteDTO) {
|
||||
batchCompleteDTO.getTaskIds().stream()
|
||||
.filter(index -> org.apache.commons.lang3.StringUtils.isNotEmpty(index))
|
||||
.forEach(taskId -> {
|
||||
actTaskService.completeTask(taskId, batchCompleteDTO.getComment());
|
||||
});
|
||||
return new Result().ok("批量通过成功");
|
||||
return new Result();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -483,190 +398,4 @@ public class ActTaskController {
|
|||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("/getZwyBusinessList")
|
||||
@ApiOperation("个人中心查询政务云资源申请列表")
|
||||
@LogOperation("个人中心查询政务云资源申请列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "业务名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
||||
})
|
||||
public Result getZwyBusinessList(String name, String status, int pageNum, int pageSize) {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", " +
|
||||
"(CASE WHEN STATUS = '04' THEN '不通过' WHEN STATUS IN ('01', '03') THEN '审核中' ELSE '通过' END) AS \"STATUS\"" +
|
||||
"FROM VIEW_CLOUD_BUSINESS_INDEX WHERE 1 = 1 AND APPLYTYPE = '01' AND STATUS NOT IN ('00', '07', '99') AND ACCOUNT = '" + user.getUsername() + "'");
|
||||
if (!StringUtils.isEmpty(name)) {
|
||||
sql.append(" AND BUSINESS_NAME LIKE ('%' || '").append(name).append("' || '%') ");
|
||||
}
|
||||
if (!StringUtils.isEmpty(status)) {
|
||||
sql.append(" AND STATUS = '").append(status).append("'");
|
||||
}
|
||||
sql.append(" ORDER BY CREATE_TIME DESC");
|
||||
try {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
resultMap.put("total", list.isEmpty() ? 0 : list.size());
|
||||
list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
resultMap.put("list", list);
|
||||
return new Result().ok(resultMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||
logger.error("浪潮数据查询异常", e);
|
||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/getZwyVideoList")
|
||||
@ApiOperation("个人中心查询政务云视频申请列表")
|
||||
@LogOperation("个人中心查询政务云视频申请列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "name", value = "业务名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", required = true, dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "分页大小", paramType = "query", required = true, dataType = "Integer")
|
||||
|
||||
})
|
||||
public Result getZwyVideoList(String name, String status, int pageNum, int pageSize) {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, BUSINESS_NAME, to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') AS \"CREATE_TIME\", " +
|
||||
"(CASE WHEN STATUS = '04' THEN '不通过' WHEN STATUS IN ('05', '06') THEN '通过' ELSE '审核中' END) AS \"STATUS\"" +
|
||||
"FROM VIEW_VIDEO_BUSINESS_INDEX WHERE 1 = 1 AND STATUS != '00' AND ACCOUNT = '" + user.getUsername() + "'");
|
||||
if (!StringUtils.isEmpty(name)) {
|
||||
sql.append(" AND BUSINESS_NAME LIKE CONCAT('%', ").append(name).append(", '%') ");
|
||||
}
|
||||
if (!StringUtils.isEmpty(status)) {
|
||||
sql.append(" AND STATUS = '").append(status).append("'");
|
||||
}
|
||||
sql.append(" ORDER BY CREATE_TIME DESC");
|
||||
try {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
resultMap.put("total", list.isEmpty() ? 0 : list.size());
|
||||
list = list.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
||||
resultMap.put("list", list);
|
||||
return new Result().ok(resultMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||
logger.error("浪潮数据查询异常", e);
|
||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getZwyBusinessInfoById")
|
||||
@ApiOperation("根据政务云资源申请业务ID查询详情")
|
||||
@LogOperation("根据政务云资源申请业务ID查询详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
||||
})
|
||||
public Result getZwyBusinessInfoById(String id) {
|
||||
|
||||
|
||||
ArrayList<Map> arrayList = new ArrayList<>();
|
||||
|
||||
//云主机
|
||||
CompletableFuture<Void> yzj = CompletableFuture.runAsync(() -> {
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云主机' AS \"SOURCE_TYPE\", NAME, DISPOSE AS \"INFO\" " +
|
||||
" FROM VIEW_CLOUD_HOST_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||
sql.append(id).append("'");
|
||||
|
||||
List<Map<String, Object>> list = null;
|
||||
try {
|
||||
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
} catch (DataAccessException e) {
|
||||
logger.error("查询浪潮数据库云主机数据异常,SQL语句--->{}", sql);
|
||||
}
|
||||
arrayList.addAll(list);
|
||||
}, executor);
|
||||
|
||||
//云数据库
|
||||
CompletableFuture<Void> ysjk = CompletableFuture.runAsync(() -> {
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '云数据库' AS \"SOURCE_TYPE\", NAME, (TYPE || '/' || STORAGE_SPACE || 'GB') AS \"INFO\" " +
|
||||
" FROM VIEW_CLOUD_DATABASE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||
sql.append(id).append("'");
|
||||
List<Map<String, Object>> list = null;
|
||||
try {
|
||||
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
} catch (DataAccessException e) {
|
||||
logger.error("查询浪潮数据库云数据库数据异常,SQL语句--->{}", sql);
|
||||
}
|
||||
arrayList.addAll(list);
|
||||
}, executor);
|
||||
|
||||
//对象存储
|
||||
CompletableFuture<Void> dxcc = CompletableFuture.runAsync(() -> {
|
||||
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '对象存储' AS \"SOURCE_TYPE\", NAME, (DATA_DISK || 'GB') AS \"INFO\" " +
|
||||
" FROM VIEW_CLOUD_OBJECTSTORAGE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||
sql.append(id).append("'");
|
||||
List<Map<String, Object>> list = null;
|
||||
try {
|
||||
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
} catch (DataAccessException e) {
|
||||
logger.error("查询浪潮数据库对象存储数据异常,SQL语句--->{}", sql);
|
||||
}
|
||||
arrayList.addAll(list);
|
||||
}, executor);
|
||||
|
||||
//托管服务
|
||||
CompletableFuture<Void> tgfw = CompletableFuture.runAsync(() -> {
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, '托管服务' AS \"SOURCE_TYPE\", NAME, (U_NUM || 'U') AS \"INFO\" " +
|
||||
" FROM VIEW_TRUSTEESHIPSERVICE_INFO WHERE 1 = 1 AND BSNUM = '");
|
||||
sql.append(id).append("'");
|
||||
List<Map<String, Object>> list = null;
|
||||
try {
|
||||
list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
} catch (DataAccessException e) {
|
||||
logger.error("查询浪潮数据库托管服务数据异常,SQL语句--->{}", sql);
|
||||
}
|
||||
arrayList.addAll(list);
|
||||
}, executor);
|
||||
|
||||
CompletableFuture all = CompletableFuture.allOf(yzj, ysjk, dxcc, tgfw);
|
||||
all.join();
|
||||
return new Result().ok(arrayList);
|
||||
}
|
||||
|
||||
@GetMapping("/getZwyVideoInfoById")
|
||||
@ApiOperation("根据政务云视频申请业务ID查询详情")
|
||||
@LogOperation("根据政务云视频申请业务ID查询详情")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "业务ID", paramType = "query", required = true, dataType = "String")
|
||||
})
|
||||
public Result getZwyVideoInfoById(String id) {
|
||||
StringBuilder sql = new StringBuilder("SELECT BSNUM, CAMERATYPE, NAME, ORG_NAME " +
|
||||
"FROM VIEW_VIDEO_BUSINESS_RELATION WHERE 1 = 1 AND BSNUM = '");
|
||||
sql.append(id).append("'");
|
||||
try {
|
||||
List<Map<String, Object>> list = lcJdbcTemplate.queryForList(sql.toString());
|
||||
return new Result().ok(list);
|
||||
} catch (Exception e) {
|
||||
logger.error("浪潮数据查询异常", e);
|
||||
logger.error("查询浪潮数据库申SQL语句--->{}", sql);
|
||||
return new Result().error("数据查询异常,请联系云资源数据库管理人员!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("batchBackToFirst")
|
||||
@ApiOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
||||
@LogOperation("驳回,回退至第一个用户任务(重新录入表单)")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "comment", value = "驳回审核意见", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result batchBackToFirst(@RequestBody BatchCompleteDTO batchCompleteDTO) {
|
||||
batchCompleteDTO.getTaskIds().stream()
|
||||
.filter(index -> org.apache.commons.lang3.StringUtils.isNotEmpty(index))
|
||||
.forEach(taskId -> actTaskService.backToFirst(taskId, batchCompleteDTO.getComment()));
|
||||
return new Result().ok("批量驳回成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.renren.modules.activiti.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
|
@ -19,12 +18,10 @@ import io.renren.modules.resource.dto.ResourceDTO;
|
|||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
|
||||
import io.renren.modules.resourceMountApply.service.TResourceMountApplyService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.sys.dao.SysUserDao;
|
||||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.renren.modules.sys.service.SysRoleUserService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
|
@ -38,11 +35,7 @@ import org.activiti.engine.history.HistoricProcessInstance;
|
|||
import org.activiti.engine.history.HistoricProcessInstanceQuery;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
@ -65,7 +58,6 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/act/his")
|
||||
@Api(tags = "流程历史")
|
||||
public class HistoryController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(HistoryController.class);
|
||||
|
||||
@Autowired
|
||||
protected HistoryService historyService_;
|
||||
|
@ -93,17 +85,10 @@ public class HistoryController {
|
|||
protected RuntimeService runtimeService;
|
||||
@Autowired
|
||||
private SysDeptService sysDeptService;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@Autowired
|
||||
private SysRoleUserService sysRoleUserService;
|
||||
|
||||
@Autowired
|
||||
private SysUserDao sysUserDao;
|
||||
|
||||
@Value("${big_date.assignee_meet_role_id}")
|
||||
private String defaultAssigneeRoleId; // 会客厅审核人角色
|
||||
|
||||
@GetMapping("getInstImage")
|
||||
@ApiOperation(value = "获取流程活动图", produces = "application/octet-stream")
|
||||
@LogOperation("获取流程活动图")
|
||||
|
@ -143,42 +128,6 @@ public class HistoryController {
|
|||
params.replace("processDefinitionKey", params.get("processDefinitionKey").toString() + "%");
|
||||
}
|
||||
PageData<ProcessActivityDTO> page = activitiService.getMyProcessInstancePage(params);
|
||||
if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) {
|
||||
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
|
||||
if (useIds.contains(SecurityUser.getUserId())) { // 拥有会客厅审核权限
|
||||
logger.info(SecurityUser.getUserId() + " 拥有会客厅权限");
|
||||
int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state != 1;", Integer.class);
|
||||
page.setTotal(page.getTotal() + meetingroom_book);
|
||||
Integer limit = 10;
|
||||
if (params.get(Constant.LIMIT) != null) {
|
||||
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
|
||||
}
|
||||
int mettingLimit = limit - page.getList().size();
|
||||
if (page.getList().size() < limit) {
|
||||
List<Map<String, Object>> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " +
|
||||
" t_meetingroom_book.id AS `businessKey`, " +
|
||||
" t_meetingroom_book.dept AS `startUserDeptName`, " +
|
||||
" '会客厅' AS `resourceName`, " +
|
||||
" '青岛市大数据发展管理局' AS `provideDept`, " +
|
||||
" t_meetingroom.`name` AS `userName`, " +
|
||||
" '会客厅审核' AS `processDefinitionName `, " +
|
||||
" t_meetingroom.create_date AS `startTime` " +
|
||||
"FROM " +
|
||||
" t_meetingroom_book " +
|
||||
" LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " +
|
||||
"WHERE " +
|
||||
" state != 1 LIMIT " + mettingLimit);
|
||||
List<ProcessActivityDTO> meetingroom_bookTaskDto = meetingroom_bookTask
|
||||
.stream().map(index -> {
|
||||
ProcessActivityDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), ProcessActivityDTO.class);
|
||||
return taskDTO;
|
||||
}).collect(Collectors.toList());
|
||||
List<ProcessActivityDTO> temp = page.getList();
|
||||
temp.addAll(meetingroom_bookTaskDto);
|
||||
page.setList(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
setExtraProcessProperties(Optional.ofNullable(page.getList()).orElse(new ArrayList<>()));
|
||||
return new Result().ok(page);
|
||||
}
|
||||
|
@ -224,7 +173,6 @@ public class HistoryController {
|
|||
detailDTO.setExecutionId(task.getExecutionId());
|
||||
detailDTO.setProcessDefinitionId(task.getProcessDefinitionId());
|
||||
detailDTO.setComment("待审核");
|
||||
detailDTO.setTaskId(task.getId());
|
||||
final List<HistoryDetailDTO> taskHandleDetailInfo_ = new ArrayList<>();
|
||||
taskHandleDetailInfo_.add(detailDTO);
|
||||
taskHandleDetailInfo_.addAll(list);
|
||||
|
@ -262,9 +210,7 @@ public class HistoryController {
|
|||
TResourceMountApplyDTO tResourceMountApplyDTO = null;
|
||||
TDemandDataDTO tDemandDataDTO = null;
|
||||
ResourceDTO resourceDTO = null;
|
||||
if (StringUtils.isNotEmpty(activityDTO.getBusinessKey())
|
||||
&& !activityDTO.getBusinessKey().startsWith("[")
|
||||
&& !activityDTO.getBusinessKey().startsWith("{")) { // json 内容(批量申请)
|
||||
if (!activityDTO.getBusinessKey().startsWith("[") && !activityDTO.getBusinessKey().startsWith("{")) { // json 内容(批量申请)
|
||||
tResourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(activityDTO.getBusinessKey()));
|
||||
tDemandDataDTO = tDemandDataService.get(Long.valueOf(activityDTO.getBusinessKey()));
|
||||
resourceDTO = resourceService.get(Long.valueOf(activityDTO.getBusinessKey()));
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package io.renren.modules.activiti.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Api(tags = "批量审核表单dto")
|
||||
public class BatchCompleteDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "审批意见")
|
||||
private String comment;
|
||||
@ApiModelProperty(value = "任务ID列表")
|
||||
private List<String> taskIds;
|
||||
}
|
|
@ -56,14 +56,4 @@ public class HistoryDetailDTO {
|
|||
|
||||
@ApiModelProperty(value = "受理人部门名称")
|
||||
private String assigneeDeptName;
|
||||
|
||||
/**
|
||||
* 催办功能增加字段
|
||||
*/
|
||||
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
|
||||
private Boolean allowReminders;
|
||||
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
|
||||
private Boolean doneReminders;
|
||||
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
|
||||
private Integer nextRemindersDays;
|
||||
}
|
||||
|
|
|
@ -91,14 +91,4 @@ public class ProcessInstanceDTO {
|
|||
|
||||
@ApiModelProperty(value = "申请单号")
|
||||
private String applyNumber;
|
||||
|
||||
/**
|
||||
* 催办功能增加字段
|
||||
*/
|
||||
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
|
||||
private Boolean allowReminders;
|
||||
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
|
||||
private Boolean doneReminders;
|
||||
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
|
||||
private Integer nextRemindersDays;
|
||||
}
|
||||
|
|
|
@ -92,19 +92,10 @@ public class TaskDTO {
|
|||
@ApiModelProperty(value = "流程中是否存在拒绝?")
|
||||
private Boolean reject = null;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "流程直接被终止?")
|
||||
private Boolean termination = null;
|
||||
|
||||
@ApiModelProperty(value = "资源类型")
|
||||
private String resourceType;
|
||||
|
||||
@ApiModelProperty(value = "提供部门")
|
||||
private String provideDept;
|
||||
@ApiModelProperty(value = "是否为审核组内协助任务")
|
||||
private Boolean synergism;
|
||||
@ApiModelProperty(value = "审核组名称")
|
||||
private String auditTeamName;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
|
|
@ -12,7 +12,6 @@ import io.renren.modules.demandComment.entity.TDemandCommentEntityDelFlag;
|
|||
import io.renren.modules.demandComment.service.TDemandCommentService;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.renren.modules.reminders.service.TRemindersService;
|
||||
import io.renren.modules.resource.dto.ResourceDTO;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
|
||||
|
@ -38,16 +37,12 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -97,11 +92,6 @@ public class ActHistoryService {
|
|||
@Autowired
|
||||
private ProcessEngine processEngine_;
|
||||
|
||||
@Autowired
|
||||
private TRemindersService tRemindersService;
|
||||
@Value("${reminders.interval}") // 流程发起后多少天允许催办
|
||||
private Integer interval;
|
||||
|
||||
|
||||
public void getProcessInstanceDiagram(String processInstanceId, HttpServletResponse response) throws Exception {
|
||||
if (StringUtils.isEmpty(processInstanceId)) {
|
||||
|
@ -385,53 +375,10 @@ public class ActHistoryService {
|
|||
.filter(Objects::nonNull)
|
||||
.filter(index -> null != index.getName() && index.getName().contains(params.get("name").toString()))
|
||||
.collect(Collectors.toList());
|
||||
List<ProcessInstanceDTO> list2 = list1.stream().skip((Integer.parseInt(page) - 1) * Integer.parseInt(limit))
|
||||
.limit(Integer.parseInt(limit)).collect(Collectors.toList());
|
||||
List<ProcessInstanceDTO> list2 = list1.stream().skip((Integer.parseInt(page) - 1) * Integer.parseInt(limit)).limit(Integer.parseInt(limit)).collect(Collectors.toList());
|
||||
pageData.setTotal(list1.size());
|
||||
pageData.setList(list2);
|
||||
}
|
||||
/**
|
||||
* 处理催办相关条件、数据
|
||||
*/
|
||||
pageData.setList(pageData.getList().stream().map(index -> {
|
||||
Optional<Task> nowTask = taskService.createTaskQuery().processInstanceId(index.getProcessInstanceId())
|
||||
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
|
||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||
logger.info("当前任务id:" + nowTask.get().getId());
|
||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||
if (localDate == null) { // 未进行过催办
|
||||
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||
if (between <= interval) {
|
||||
logger.info("该任务未到允许催办的日期");
|
||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||
} else {
|
||||
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
} else { // 进行过催办
|
||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||
if (between <= interval) { // 间隔天数小于限制天数
|
||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||
} else {
|
||||
index.setAllowReminders(Boolean.TRUE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.info("不存在正在进行流程节点:" + index.getProcessInstanceId());
|
||||
index.setAllowReminders(Boolean.FALSE);
|
||||
index.setDoneReminders(Boolean.FALSE);
|
||||
index.setNextRemindersDays(0);
|
||||
}
|
||||
return index;
|
||||
}).collect(Collectors.toList()));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ import io.renren.common.page.PageData;
|
|||
import io.renren.common.service.impl.BaseServiceImpl;
|
||||
import io.renren.common.utils.MessageUtils;
|
||||
import io.renren.modules.activiti.dto.TaskDTO;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.service.SysAuditTeamService;
|
||||
import io.renren.modules.demanData.dto.TDemandDataDTO;
|
||||
import io.renren.modules.demanData.service.TDemandDataService;
|
||||
import io.renren.modules.demandComment.dto.TDemandCommentDTO;
|
||||
|
@ -53,7 +51,6 @@ import org.activiti.engine.impl.pvm.process.TransitionImpl;
|
|||
import org.activiti.engine.impl.task.TaskDefinition;
|
||||
import org.activiti.engine.repository.ProcessDefinition;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.NativeTaskQuery;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.activiti.engine.task.TaskInfo;
|
||||
import org.activiti.engine.task.TaskQuery;
|
||||
|
@ -62,13 +59,15 @@ import org.codehaus.jackson.map.ObjectMapper;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -82,9 +81,7 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
private static final ObjectMapper oMapper = new ObjectMapper();
|
||||
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
|
||||
|
||||
private static final ExecutorService executor_task = Executors.newCachedThreadPool();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
|
||||
public static String Task_HANDLE_STATE = "handleState"; //任务节点处理状态key
|
||||
public static String Task_HANDLE_STATE_AGREE = "agree"; //同意
|
||||
|
@ -128,11 +125,6 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
private SysNoticeService sysNoticeService;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@Autowired
|
||||
private SysAuditTeamService sysAuditTeamService;
|
||||
|
||||
@Value("#{new Boolean(${auditteam.enable})}")
|
||||
private Boolean auditteam; // 是否进行审核组
|
||||
|
||||
/**
|
||||
* 根据参数获取当前运行的任务信息
|
||||
|
@ -142,25 +134,6 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
*/
|
||||
public PageData<TaskDTO> page(Map<String, Object> params) {
|
||||
String userId = (String) params.get("userId");
|
||||
// 同一审核组内成员
|
||||
List<String> groupUserId = new ArrayList<>();
|
||||
List<SysAuditTeamDTO> sysAuditTeamDTOS = new ArrayList<>();
|
||||
logger.info("auditteam:" + auditteam);
|
||||
if (auditteam) {
|
||||
sysAuditTeamDTOS = sysAuditTeamService.selectByMemberOne(Long.parseLong(userId));
|
||||
logger.info("审核组成员:" + sysAuditTeamDTOS.toString());
|
||||
groupUserId = sysAuditTeamDTOS
|
||||
.stream()
|
||||
.map(index -> index.getMember())
|
||||
.filter(Objects::nonNull)
|
||||
.filter(index -> !index.isEmpty())
|
||||
.flatMap(index -> index.stream())
|
||||
.map(index -> index.get("id").toString())
|
||||
.filter(index -> !userId.equals(index)) // 过滤非本人
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
Integer curPage = 1;
|
||||
Integer limit = 10;
|
||||
if (params.get(Constant.PAGE) != null) {
|
||||
|
@ -169,99 +142,32 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
if (params.get(Constant.LIMIT) != null) {
|
||||
limit = Integer.parseInt((String) params.get(Constant.LIMIT));
|
||||
}
|
||||
String taskSql = "SELECT " +
|
||||
" RES.* " +
|
||||
"FROM " +
|
||||
" ACT_RU_TASK RES " +
|
||||
" INNER JOIN ACT_RE_PROCDEF D ON RES.PROC_DEF_ID_ = D.ID_ ";
|
||||
String countSql = "SELECT " +
|
||||
" COUNT(RES.ID_) " +
|
||||
"FROM " +
|
||||
" ACT_RU_TASK RES " +
|
||||
" INNER JOIN ACT_RE_PROCDEF D ON RES.PROC_DEF_ID_ = D.ID_ ";
|
||||
StringBuffer where = new StringBuffer(" WHERE 1 =1 ");
|
||||
TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
if (StringUtils.isNotEmpty(userId)) {
|
||||
where.append("AND ( RES.ASSIGNEE_ = #{userId} ");
|
||||
// 处理同一工作组内
|
||||
if (auditteam) { // 进行审核组协作时
|
||||
groupUserId.stream().forEach(index -> {
|
||||
where.append(String.format(" OR RES.ASSIGNEE_ = '%s' ", index));
|
||||
});
|
||||
taskQuery.taskAssignee(userId);
|
||||
}
|
||||
where.append(")");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty((String) params.get("taskName"))) {
|
||||
where.append(" AND RES.NAME_ = #{taskName}");
|
||||
taskQuery.taskNameLike("%" + params.get("taskName") + "%");
|
||||
}
|
||||
if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key
|
||||
where.append(" AND D.KEY_ = #{processDefinitionKey} ");
|
||||
taskQuery.processDefinitionKey((String) params.get("processDefinitionKey"));
|
||||
}
|
||||
where.append(" AND RES.SUSPENSION_STATE_ = 1 ");
|
||||
|
||||
String order = " ORDER BY " +
|
||||
" RES.CREATE_TIME_ DESC ";
|
||||
NativeTaskQuery nativeTaskQuery = taskService.createNativeTaskQuery().sql(taskSql + where + order);
|
||||
NativeTaskQuery nativeCountTaskQuery = taskService.createNativeTaskQuery().sql(countSql + where + order);
|
||||
if (StringUtils.isNotEmpty(userId)) { // 分配审核员
|
||||
nativeTaskQuery.parameter("userId", userId);
|
||||
nativeCountTaskQuery.parameter("userId", userId);
|
||||
if (StringUtils.isNotEmpty((String) params.get("isRoleGroup")) && "1".equals(params.get("isRoleGroup"))) {
|
||||
List<Long> listRoles = sysRoleUserService.getRoleIdList(SecurityUser.getUserId());
|
||||
List<String> listStr = new ArrayList<>();
|
||||
for (Long role : listRoles) {
|
||||
listStr.add(role.toString());
|
||||
}
|
||||
if (StringUtils.isNotEmpty((String) params.get("taskName"))) { // 任务名称
|
||||
nativeTaskQuery.parameter("taskName", params.get("taskName"));
|
||||
nativeCountTaskQuery.parameter("taskName", params.get("taskName"));
|
||||
listStr.add(SecurityUser.getUserId().toString());
|
||||
if (!listStr.isEmpty()) {
|
||||
taskQuery.taskCandidateGroupIn(listStr);
|
||||
} else {
|
||||
return new PageData<>(new ArrayList<>(), 0);
|
||||
}
|
||||
if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key
|
||||
nativeTaskQuery.parameter("processDefinitionKey", params.get("processDefinitionKey"));
|
||||
nativeCountTaskQuery.parameter("processDefinitionKey", params.get("processDefinitionKey"));
|
||||
}
|
||||
List<Task> tasks = nativeTaskQuery.listPage((curPage - 1) * limit, limit);
|
||||
long count = nativeCountTaskQuery.count();
|
||||
List<CompletableFuture> completableFutures = new ArrayList<CompletableFuture>();
|
||||
final TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
List<Task> list_ = tasks.stream().map(index -> {
|
||||
CompletableFuture tempTask = CompletableFuture.supplyAsync(() -> taskQuery.taskId(index.getId()).includeProcessVariables().singleResult(), executor_task);
|
||||
Task temp = null;
|
||||
try {
|
||||
temp = (Task) tempTask.get();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("异步获取失败", e);
|
||||
} catch (ExecutionException e) {
|
||||
logger.error("异步获取失败", e);
|
||||
}
|
||||
return temp;
|
||||
}).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[completableFutures.size()])).join();
|
||||
String name = sysAuditTeamDTOS.stream().map(index -> index.getName()).findFirst().orElse("");
|
||||
return new PageData<>(tasks2TaskDtos(list_, name), (int) count);
|
||||
// 以下注释为原实现方案
|
||||
// TaskQuery taskQuery = taskService.createTaskQuery();
|
||||
// if (StringUtils.isNotEmpty(userId)) {
|
||||
// taskQuery.taskAssignee(userId);
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty((String) params.get("taskName"))) {
|
||||
// taskQuery.taskNameLike("%" + params.get("taskName") + "%");
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty((String) params.get("processDefinitionKey"))) { // 流程定义key
|
||||
// taskQuery.processDefinitionKey((String) params.get("processDefinitionKey"));
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty((String) params.get("isRoleGroup")) && "1".equals(params.get("isRoleGroup"))) {
|
||||
// List<Long> listRoles = sysRoleUserService.getRoleIdList(SecurityUser.getUserId());
|
||||
// List<String> listStr = new ArrayList<>();
|
||||
// for (Long role : listRoles) {
|
||||
// listStr.add(role.toString());
|
||||
// }
|
||||
// listStr.add(SecurityUser.getUserId().toString());
|
||||
// if (!listStr.isEmpty()) {
|
||||
// taskQuery.taskCandidateGroupIn(listStr);
|
||||
// } else {
|
||||
// return new PageData<>(new ArrayList<>(), 0);
|
||||
// }
|
||||
// }
|
||||
// taskQuery.orderByTaskCreateTime().desc();
|
||||
// List<Task> list = taskQuery.active()
|
||||
// .includeProcessVariables().listPage((curPage - 1) * limit, limit);
|
||||
// return new PageData<>(tasks2TaskDtos(list), (int) taskQuery.count());
|
||||
taskQuery.orderByTaskCreateTime().desc();
|
||||
List<Task> list = taskQuery.active().includeProcessVariables().listPage((curPage - 1) * limit, limit);
|
||||
return new PageData<>(tasks2TaskDtos(list), (int) taskQuery.count());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -294,7 +200,7 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
.listPage((finalCurPage - 1) * finalLimit, finalCurPage * finalLimit);
|
||||
count.add(taskQuery.taskAssignee(index.getId().toString())
|
||||
.orderByTaskCreateTime().desc().count());
|
||||
taskDtoList.addAll(tasks2TaskDtos(list, ""));
|
||||
taskDtoList.addAll(tasks2TaskDtos(list));
|
||||
});
|
||||
return completableFuture;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -315,55 +221,21 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
return page;
|
||||
}
|
||||
|
||||
private List<TaskDTO> tasks2TaskDtos(List<Task> list, String audioTeamName) {
|
||||
private List<TaskDTO> tasks2TaskDtos(List<Task> list) {
|
||||
List<TaskDTO> listDto = new ArrayList<>();
|
||||
for (Task task : list) {
|
||||
TaskDTO dto = new TaskDTO();
|
||||
this.convertTaskInfo(task, dto);
|
||||
// 填入审核协作组名称
|
||||
dto.setAuditTeamName(audioTeamName);
|
||||
Map<String, Object> processVariable = new LinkedHashMap<>();
|
||||
|
||||
|
||||
if (task.getProcessVariables().containsKey("tAbilityApplicationDTOList")) {
|
||||
processVariable.putAll(task.getProcessVariables());
|
||||
dto.setParams(processVariable);
|
||||
|
||||
List<TAbilityApplicationDTO> dtoList = (List<TAbilityApplicationDTO>) task.getProcessVariables().get("tAbilityApplicationDTOList");
|
||||
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(dtoList.get(0)));
|
||||
|
||||
List<String> resourceIds = new ArrayList<>();
|
||||
dtoList.forEach(index -> resourceIds.add(index.getResourceId()));
|
||||
|
||||
|
||||
if (jsonObject != null) {
|
||||
|
||||
//资源类型
|
||||
CompletableFuture sjzy = CompletableFuture.runAsync(() -> {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> resourcesName = resourceDao.selectResourcesTypeByIds(resourceIds);
|
||||
resourcesName.forEach(x -> stringBuilder.append(x).append(","));
|
||||
String string = "";
|
||||
if (stringBuilder.length() > 0) {
|
||||
string = stringBuilder.substring(0, stringBuilder.length() - 1);
|
||||
}
|
||||
dto.setResourceType(string);
|
||||
}, executor);
|
||||
|
||||
//提供部门
|
||||
CompletableFuture jcss = CompletableFuture.runAsync(() -> {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<String> proviDeptsName = resourceDao.selectProvideDeptNameByIds(resourceIds);
|
||||
proviDeptsName.forEach(x -> stringBuilder.append(x).append(","));
|
||||
String string = "";
|
||||
if (stringBuilder.length() > 0) {
|
||||
string = stringBuilder.substring(0, stringBuilder.length() - 1);
|
||||
}
|
||||
dto.setProvideDept(string);
|
||||
}, executor);
|
||||
|
||||
CompletableFuture all = CompletableFuture.allOf(sjzy, jcss);
|
||||
all.join();
|
||||
|
||||
|
||||
dto.setUserName(jsonObject.containsKey("user") ? jsonObject.getString("user") : "");
|
||||
dto.setUserDeptName(sysUserDao.getDeptNameByUserId(jsonObject.containsKey("userId") ? jsonObject.getString("userId") : null));
|
||||
dto.setApplyTitle(jsonObject.containsKey("title") ? jsonObject.getString("title") : "");
|
||||
|
@ -392,16 +264,11 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
dto.setParams(processVariable);
|
||||
dto.setUserName(abilityApplicationDTO.getUser());
|
||||
ResourceEntity resourceEntity = resourceDao.selectById(abilityApplicationDTO.getResourceId());
|
||||
dto.setResourceType(resourceEntity.getType());
|
||||
SysDeptEntity dept = sysDeptDao.getById(resourceEntity.getDeptId());
|
||||
String provideDeptName = dept == null ? "" : dept.getName();
|
||||
dto.setProvideDept(provideDeptName);
|
||||
dto.setApplyTitle(resourceEntity == null ? "" : resourceEntity.getName());
|
||||
dto.setUserDeptName(abilityApplicationDTO.getUnit());
|
||||
listDto.add(dto);
|
||||
continue;
|
||||
}
|
||||
|
||||
TResourceMountApplyDTO resourceMountApplyDTO = tResourceMountApplyService.get(Long.valueOf(dto.getBusinessKey()));
|
||||
if (resourceMountApplyDTO != null) {
|
||||
Map<String, Object> variables = oMapper.convertValue(resourceMountApplyDTO, Map.class);
|
||||
|
@ -415,7 +282,6 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
listDto.add(dto);
|
||||
continue;
|
||||
}
|
||||
|
||||
TDemandDataDTO tDemandDataDTO = tDemandDataService.get(Long.valueOf(dto.getBusinessKey()));
|
||||
if (tDemandDataDTO != null) {
|
||||
Map<String, Object> variables = oMapper.convertValue(tDemandDataDTO, Map.class);
|
||||
|
@ -428,7 +294,6 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
listDto.add(dto);
|
||||
continue;
|
||||
}
|
||||
|
||||
ResourceDTO resourceDTO = resourceService.get(Long.valueOf(dto.getBusinessKey()));
|
||||
if (resourceDTO != null) {
|
||||
Map<String, Object> variables = oMapper.convertValue(resourceDTO, Map.class);
|
||||
|
@ -533,10 +398,8 @@ public class ActTaskService extends BaseServiceImpl {
|
|||
public void completeTask(String taskId, String comment) {
|
||||
String userId = SecurityUser.getUserId().toString();
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (StringUtils.isNotEmpty(task.getAssignee())
|
||||
&& !task.getAssignee().equals(userId)) {
|
||||
taskService.setVariable(taskId, "autoApply", taskId); // 配置不发送审核人分配通知
|
||||
taskService.setAssignee(taskId, userId); //与原任务审核人员不一致时,换成实际通过的人
|
||||
if (StringUtils.isNotEmpty(task.getAssignee())) {
|
||||
taskService.setAssignee(taskId, userId);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(comment)) {
|
||||
taskService.addComment(taskId, task.getProcessInstanceId(), comment);
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
package io.renren.modules.audit_team.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.ExcelUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.AssertUtils;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.excel.SysAuditTeamExcel;
|
||||
import io.renren.modules.audit_team.service.SysAuditTeamService;
|
||||
import io.renren.modules.category.util.CommonUtils;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("audit_team/sysauditteam")
|
||||
@Api(tags = "流程审核组组员")
|
||||
public class SysAuditTeamController {
|
||||
@Autowired
|
||||
private SysAuditTeamService sysAuditTeamService;
|
||||
@Autowired
|
||||
private SysUserService sysUserService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "name", value = "根据审核组名称模糊查", paramType = "query", dataType = "String")
|
||||
})
|
||||
// @RequiresPermissions("audit_team:sysauditteam:page")
|
||||
public Result<PageData<SysAuditTeamDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<SysAuditTeamDTO> page = sysAuditTeamService.page(params);
|
||||
|
||||
return new Result<PageData<SysAuditTeamDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
// @RequiresPermissions("audit_team:sysauditteam:info")
|
||||
public Result<SysAuditTeamDTO> get(@PathVariable("id") Long id) {
|
||||
SysAuditTeamDTO data = sysAuditTeamService.get(id);
|
||||
|
||||
return new Result<SysAuditTeamDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
// @RequiresPermissions("audit_team:sysauditteam:save")
|
||||
public Result save(@RequestBody SysAuditTeamDTO dto) {
|
||||
// 效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
dto.setIndex(CommonUtils.getPinYinHeadChar(dto.getName())); // 索引设置为名称拼音
|
||||
dto.setMember(dto.getMember().stream().map(index -> {
|
||||
Optional<SysUserDTO> sysUserDTO = Optional.ofNullable(sysUserService.get(Long.parseLong(index.get("id").toString())));
|
||||
index.put("id", Long.parseLong(index.get("id").toString()));
|
||||
if (sysUserDTO.isPresent()) {
|
||||
index.put("name", sysUserDTO.get().getRealName());
|
||||
index.put("dept_name", sysUserDTO.get().getDeptName());
|
||||
}
|
||||
return index;
|
||||
}).collect(Collectors.toList()));
|
||||
sysAuditTeamService.save(dto);
|
||||
return new Result().ok("保存成功");
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
// @RequiresPermissions("audit_team:sysauditteam:update")
|
||||
public Result update(@RequestBody SysAuditTeamDTO dto) {
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
dto.setIndex(CommonUtils.getPinYinHeadChar(dto.getName())); // 索引设置为名称拼音
|
||||
dto.setMember(dto.getMember().stream().map(index -> {
|
||||
Optional<SysUserDTO> sysUserDTO = Optional.ofNullable(sysUserService.get(Long.parseLong(index.get("id").toString())));
|
||||
index.put("id", Long.parseLong(index.get("id").toString()));
|
||||
if (sysUserDTO.isPresent()) {
|
||||
index.put("name", sysUserDTO.get().getRealName());
|
||||
index.put("dept_name", sysUserDTO.get().getDeptName());
|
||||
}
|
||||
return index;
|
||||
}).collect(Collectors.toList()));
|
||||
sysAuditTeamService.update(dto);
|
||||
|
||||
return new Result().ok("修改成功");
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
// @RequiresPermissions("audit_team:sysauditteam:delete")
|
||||
public Result delete(@RequestBody Long[] ids) {
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
|
||||
sysAuditTeamService.delete(ids);
|
||||
|
||||
return new Result().ok("删除成功");
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
// @RequiresPermissions("audit_team:sysauditteam:export")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<SysAuditTeamDTO> list = sysAuditTeamService.list(params);
|
||||
|
||||
ExcelUtils.exportExcelToTarget(response, null, "流程审核组组员", list, SysAuditTeamExcel.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package io.renren.modules.audit_team.dao;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.entity.SysAuditTeamEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysAuditTeamDao extends BaseDao<SysAuditTeamEntity> {
|
||||
|
||||
/**
|
||||
* 根据审核组成员用户id,获取审核组列表
|
||||
*
|
||||
* @param member
|
||||
* @return
|
||||
*/
|
||||
List<SysAuditTeamDTO> selectByMemberOne(@Param("member") Long member);
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package io.renren.modules.audit_team.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "流程审核组组员")
|
||||
public class SysAuditTeamDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long creator;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createDate;
|
||||
@ApiModelProperty(value = "审核组名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "审核组成员id数组")
|
||||
private List<Map> member;
|
||||
@ApiModelProperty(value = "审核组索引")
|
||||
private String index;
|
||||
@ApiModelProperty(value = "审核组备注内容")
|
||||
private String description;
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package io.renren.modules.audit_team.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "sys_audit_team", autoResultMap = true)
|
||||
public class SysAuditTeamEntity extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 审核组名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 审核组成员id数组
|
||||
*/
|
||||
@TableField(value = "member", typeHandler = FastjsonTypeHandler.class)
|
||||
private List<Map> member;
|
||||
|
||||
/**
|
||||
* 审核组索引
|
||||
*/
|
||||
@TableField(value = "`index`")
|
||||
private String index;
|
||||
|
||||
/**
|
||||
* 审核组备注内容
|
||||
*/
|
||||
private String description;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package io.renren.modules.audit_team.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@Data
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(25)
|
||||
public class SysAuditTeamExcel {
|
||||
@ExcelProperty(value = "主键ID", index = 0)
|
||||
private Object id;
|
||||
@ExcelProperty(value = "创建人", index = 1)
|
||||
private Object creator;
|
||||
@ExcelProperty(value = "创建时间", index = 2)
|
||||
private Object createDate;
|
||||
@ExcelProperty(value = "审核组名称", index = 3)
|
||||
private Object name;
|
||||
@ExcelProperty(value = "审核组成员id数组", index = 4)
|
||||
private Object member;
|
||||
@ExcelProperty(value = "审核组索引", index = 5)
|
||||
private Object index;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package io.renren.modules.audit_team.service;
|
||||
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.entity.SysAuditTeamEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
public interface SysAuditTeamService extends CrudService<SysAuditTeamEntity, SysAuditTeamDTO> {
|
||||
List<SysAuditTeamDTO> selectByMemberOne(Long member);
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package io.renren.modules.audit_team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.modules.audit_team.dao.SysAuditTeamDao;
|
||||
import io.renren.modules.audit_team.dto.SysAuditTeamDTO;
|
||||
import io.renren.modules.audit_team.entity.SysAuditTeamEntity;
|
||||
import io.renren.modules.audit_team.service.SysAuditTeamService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 流程审核组组员
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2022-12-12
|
||||
*/
|
||||
@Service
|
||||
public class SysAuditTeamServiceImpl extends CrudServiceImpl<SysAuditTeamDao, SysAuditTeamEntity, SysAuditTeamDTO> implements SysAuditTeamService {
|
||||
|
||||
@Override
|
||||
public QueryWrapper<SysAuditTeamEntity> getWrapper(Map<String, Object> params) {
|
||||
QueryWrapper<SysAuditTeamEntity> wrapper = new QueryWrapper<>();
|
||||
params.keySet().stream().filter(index -> null != params.get(index)).forEach(index -> {
|
||||
switch (index) {
|
||||
case "name":
|
||||
wrapper.like(StringUtils.isNotBlank(params.get("name").toString()), "name", params.get("name").toString());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SysAuditTeamDTO> selectByMemberOne(Long member) {
|
||||
return baseDao.selectByMemberOne(member);
|
||||
}
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.ExcelUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.AssertUtils;
|
||||
import io.renren.common.validator.ValidatorUtils;
|
||||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.date_snapshot.dto.SysDateSnapshotDTO;
|
||||
import io.renren.modules.date_snapshot.excel.SysDateSnapshotExcel;
|
||||
import io.renren.modules.date_snapshot.service.SysDateSnapshotService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("date_snapshot/sysdatesnapshot")
|
||||
@Api(tags = "运行数据快照(资源数量、申请数量)")
|
||||
public class SysDateSnapshotController {
|
||||
@Autowired
|
||||
private SysDateSnapshotService sysDateSnapshotService;
|
||||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
|
||||
})
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:page")
|
||||
public Result<PageData<SysDateSnapshotDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<SysDateSnapshotDTO> page = sysDateSnapshotService.page(params);
|
||||
|
||||
return new Result<PageData<SysDateSnapshotDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:info")
|
||||
public Result<SysDateSnapshotDTO> get(@PathVariable("id") Long id) {
|
||||
SysDateSnapshotDTO data = sysDateSnapshotService.get(id);
|
||||
|
||||
return new Result<SysDateSnapshotDTO>().ok(data);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:save")
|
||||
public Result save(@RequestBody SysDateSnapshotDTO dto) {
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
sysDateSnapshotService.save(dto);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:update")
|
||||
public Result update(@RequestBody SysDateSnapshotDTO dto) {
|
||||
//效验数据
|
||||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||
|
||||
sysDateSnapshotService.update(dto);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:delete")
|
||||
public Result delete(@RequestBody Long[] ids) {
|
||||
//效验数据
|
||||
AssertUtils.isArrayEmpty(ids, "id");
|
||||
|
||||
sysDateSnapshotService.delete(ids);
|
||||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
// @RequiresPermissions("date_snapshot:sysdatesnapshot:export")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<SysDateSnapshotDTO> list = sysDateSnapshotService.list(params);
|
||||
|
||||
ExcelUtils.exportExcelToTarget(response, null, "运行数据快照(资源数量、申请数量)", list, SysDateSnapshotExcel.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.dao;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.date_snapshot.dto.SysDateSnapshotDTO;
|
||||
import io.renren.modules.date_snapshot.entity.SysDateSnapshotEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDateSnapshotDao extends BaseDao<SysDateSnapshotEntity> {
|
||||
|
||||
SysDateSnapshotDTO selectForFlag(@Param("type") Integer type);
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "运行数据快照(资源数量、申请数量)")
|
||||
public class SysDateSnapshotDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "数据快照类型(1:每周快照 2:每月快照)")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long creator;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createDate;
|
||||
@ApiModelProperty(value = "数据快照内容")
|
||||
private List<Map<String, Object>> snapshot;
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.entity;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 快照任务 枚举
|
||||
*/
|
||||
public enum SnapshotType {
|
||||
|
||||
/**
|
||||
* 运营数据每周快照
|
||||
*/
|
||||
DATA_WEEKLY(1, "运营数据每周快照"),
|
||||
/**
|
||||
* 运营数据每月快照
|
||||
*/
|
||||
DATA_MONTH(2, "运营数据每月快照"),
|
||||
/**
|
||||
* 能力使用周快照
|
||||
*/
|
||||
APPLY_WEEKLY(3, "能力使用周快照"),
|
||||
/**
|
||||
* 能力使用月快照
|
||||
*/
|
||||
APPLY_MONTH(4, "能力使用月快照"),
|
||||
/**
|
||||
* 能力上架周快照
|
||||
*/
|
||||
RESOURCE_WEEKLY(5, "能力上架周快照"),
|
||||
/**
|
||||
* 能力使用月快照
|
||||
*/
|
||||
RESOURCE_MONTH(6, "能力使用月快照"),
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
UN(99, "未知");
|
||||
|
||||
private int flag;
|
||||
private String tip;
|
||||
|
||||
SnapshotType(int flag, String tip) {
|
||||
this.flag = flag;
|
||||
this.tip = tip;
|
||||
}
|
||||
|
||||
public static SnapshotType getByFlag(int flag) {
|
||||
SnapshotType[] index = SnapshotType.values();
|
||||
return Arrays.asList(index).stream().filter(index_ -> index_.flag == flag).findAny().orElse(SnapshotType.UN);
|
||||
}
|
||||
|
||||
|
||||
public int getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(int flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getTip() {
|
||||
return tip;
|
||||
}
|
||||
|
||||
public void setTip(String tip) {
|
||||
this.tip = tip;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import io.renren.common.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "sys_date_snapshot", autoResultMap = true)
|
||||
public class SysDateSnapshotEntity extends BaseEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 数据快照类型(1:每周快照 2:每月快照 3:能力使用周快照 4:能力使用月快照 5:能力上架周快照 6:能力使用月快照)
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 数据快照内容
|
||||
*/
|
||||
@TableField(value = "`snapshot`", typeHandler = FastjsonTypeHandler.class)
|
||||
private List<Map<String, Object>> snapshot;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.excel;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@Data
|
||||
@ContentRowHeight(20)
|
||||
@HeadRowHeight(20)
|
||||
@ColumnWidth(25)
|
||||
public class SysDateSnapshotExcel {
|
||||
@ExcelProperty(value = "主键", index = 0)
|
||||
private Object id;
|
||||
@ExcelProperty(value = "数据快照类型(1:每周快照 2:每月快照)", index = 1)
|
||||
private Object type;
|
||||
@ExcelProperty(value = "创建人", index = 2)
|
||||
private Object creator;
|
||||
@ExcelProperty(value = "创建时间", index = 3)
|
||||
private Object createDate;
|
||||
@ExcelProperty(value = "数据快照内容", index = 4)
|
||||
private Object snapshot;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.service;
|
||||
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.date_snapshot.dto.SysDateSnapshotDTO;
|
||||
import io.renren.modules.date_snapshot.entity.SysDateSnapshotEntity;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
public interface SysDateSnapshotService extends CrudService<SysDateSnapshotEntity, SysDateSnapshotDTO> {
|
||||
/**
|
||||
* 数据快照行为
|
||||
*/
|
||||
void snapshotAction(Integer type);
|
||||
|
||||
/**
|
||||
* 能力申请快照行为
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
void snapshotApplyAction(Integer type);
|
||||
|
||||
/**
|
||||
* 能力上架统计快照行为
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
void snapshotResourceAction(Integer type);
|
||||
|
||||
SysDateSnapshotDTO selectForFlag(Integer type);
|
||||
}
|
|
@ -1,114 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.service.impl.CrudServiceImpl;
|
||||
import io.renren.modules.date_snapshot.dao.SysDateSnapshotDao;
|
||||
import io.renren.modules.date_snapshot.dto.SysDateSnapshotDTO;
|
||||
import io.renren.modules.date_snapshot.entity.SysDateSnapshotEntity;
|
||||
import io.renren.modules.date_snapshot.service.SysDateSnapshotService;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 运行数据快照(资源数量、申请数量)
|
||||
*
|
||||
* @author wangliwen wangliwen2@hisense.com
|
||||
* @since 1.0 2023-01-03
|
||||
*/
|
||||
@Service
|
||||
public class SysDateSnapshotServiceImpl extends CrudServiceImpl<SysDateSnapshotDao, SysDateSnapshotEntity, SysDateSnapshotDTO> implements SysDateSnapshotService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SysDateSnapshotServiceImpl.class);
|
||||
@Autowired
|
||||
private TAbilityApplicationService tAbilityApplicationService;
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
|
||||
@Override
|
||||
public QueryWrapper<SysDateSnapshotEntity> getWrapper(Map<String, Object> params) {
|
||||
QueryWrapper<SysDateSnapshotEntity> wrapper = new QueryWrapper<>();
|
||||
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据快照行为
|
||||
*/
|
||||
@Override
|
||||
public void snapshotAction(Integer type) {
|
||||
SysDateSnapshotDTO sysDateSnapshotDTO = new SysDateSnapshotDTO();
|
||||
long countApply = tAbilityApplicationService.countApplyAll(); // 资源申请量
|
||||
HashMap<String, Object> resultMap = (HashMap<String, Object>) resourceService.selectTotal();
|
||||
List<Map<String, Object>> snapshot = new ArrayList<Map<String, Object>>() {{
|
||||
add(new LinkedHashMap<String, Object>() {{
|
||||
put("count", countApply);
|
||||
put("type", "资源申请量");
|
||||
}});
|
||||
try {
|
||||
if (resultMap.containsKey("total")) {
|
||||
addAll((Collection<? extends Map<String, Object>>) resultMap.get("total"));
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
logger.error("获取资源数量失败", exception);
|
||||
}
|
||||
}};
|
||||
|
||||
sysDateSnapshotDTO.setCreateDate(new Date());
|
||||
sysDateSnapshotDTO.setType(type);
|
||||
sysDateSnapshotDTO.setSnapshot(snapshot);
|
||||
save(sysDateSnapshotDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 能力申请快照行为
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
@Override
|
||||
public void snapshotApplyAction(Integer type) {
|
||||
SysDateSnapshotDTO sysDateSnapshotDTO = new SysDateSnapshotDTO();
|
||||
List<HashMap<String, Object>> resultList = (List<HashMap<String, Object>>) resourceService.selectApplyDeptDetailTypeCountList(new HashMap() {{
|
||||
put("snapshot", true);
|
||||
}}); // 能力申请统计原始数据
|
||||
List<Map<String, Object>> snapshot = new ArrayList<Map<String, Object>>() {{
|
||||
addAll(resultList);
|
||||
}};
|
||||
sysDateSnapshotDTO.setCreateDate(new Date());
|
||||
sysDateSnapshotDTO.setType(type);
|
||||
sysDateSnapshotDTO.setSnapshot(snapshot);
|
||||
save(sysDateSnapshotDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 能力上架统计快照行为
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
@Override
|
||||
public void snapshotResourceAction(Integer type) {
|
||||
SysDateSnapshotDTO sysDateSnapshotDTO = new SysDateSnapshotDTO();
|
||||
List<HashMap<String, Object>> resultList = (List<HashMap<String, Object>>) resourceService.selectDeptDetailTypeCountList(new HashMap() {{
|
||||
put("snapshot", true);
|
||||
}}); // 能力上架统计原始数据
|
||||
List<Map<String, Object>> snapshot = new ArrayList<Map<String, Object>>() {{
|
||||
addAll(resultList);
|
||||
}};
|
||||
sysDateSnapshotDTO.setCreateDate(new Date());
|
||||
sysDateSnapshotDTO.setType(type);
|
||||
sysDateSnapshotDTO.setSnapshot(snapshot);
|
||||
save(sysDateSnapshotDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDateSnapshotDTO selectForFlag(Integer type) {
|
||||
return baseDao.selectForFlag(type);
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.task;
|
||||
|
||||
import io.renren.modules.date_snapshot.entity.SnapshotType;
|
||||
import io.renren.modules.date_snapshot.service.SysDateSnapshotService;
|
||||
import io.renren.modules.job.task.ITask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
||||
@Component("monthSnapshot")
|
||||
public class MonthSnapshot implements ITask {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MonthSnapshot.class);
|
||||
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
|
||||
@Autowired
|
||||
private SysDateSnapshotService sysDateSnapshotService;
|
||||
|
||||
/**
|
||||
* 执行定时任务接口
|
||||
*
|
||||
* @param params 参数,多参数使用JSON数据
|
||||
*/
|
||||
@Override
|
||||
public void run(String params) {
|
||||
logger.info("月快照计划");
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotAction(SnapshotType.DATA_MONTH.getFlag());
|
||||
});
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotApplyAction(SnapshotType.APPLY_MONTH.getFlag());
|
||||
});
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotResourceAction(SnapshotType.RESOURCE_MONTH.getFlag());
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package io.renren.modules.date_snapshot.task;
|
||||
|
||||
import io.renren.modules.date_snapshot.entity.SnapshotType;
|
||||
import io.renren.modules.date_snapshot.service.SysDateSnapshotService;
|
||||
import io.renren.modules.job.task.ITask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
||||
/**
|
||||
* 周快照计划任务
|
||||
*/
|
||||
@Component("weeklySnapshot")
|
||||
public class WeeklySnapshot implements ITask {
|
||||
private static final Logger logger = LoggerFactory.getLogger(WeeklySnapshot.class);
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
|
||||
@Autowired
|
||||
private SysDateSnapshotService sysDateSnapshotService;
|
||||
|
||||
/**
|
||||
* 执行定时任务接口
|
||||
*
|
||||
* @param params 参数,多参数使用JSON数据
|
||||
*/
|
||||
@Override
|
||||
public void run(String params) {
|
||||
logger.info("周快照计划");
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotAction(SnapshotType.DATA_WEEKLY.getFlag());
|
||||
});
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotApplyAction(SnapshotType.APPLY_WEEKLY.getFlag());
|
||||
});
|
||||
executor.execute(() -> {
|
||||
sysDateSnapshotService.snapshotResourceAction(SnapshotType.RESOURCE_WEEKLY.getFlag());
|
||||
});
|
||||
}
|
||||
}
|
|
@ -95,7 +95,7 @@ public class TDemandDataController {
|
|||
|
||||
tDemandDataService.save(dto);
|
||||
|
||||
return new Result().ok("保存成功");
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
|
@ -108,7 +108,7 @@ public class TDemandDataController {
|
|||
|
||||
tDemandDataService.update(dto);
|
||||
|
||||
return new Result().ok("修改成功");
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
|
|
|
@ -43,10 +43,8 @@ public class TDemandDataDTO extends AuditingBaseDTO implements Serializable {
|
|||
private String detailsField;
|
||||
private Long creator;
|
||||
private Date createDate;
|
||||
@ApiModelProperty(value = "附件名称")
|
||||
private String enclosure;
|
||||
@ApiModelProperty(value = "附件")
|
||||
private String enclosureName;
|
||||
private String enclosure;
|
||||
@ApiModelProperty(value = "业务标志(0:初始化 1:审批中 2:审批拒绝 3:审批通过)")
|
||||
private Integer flag;
|
||||
@ApiModelProperty(value = "业务标志提示(0:初始化 1:审批中 2:审批拒绝 3:审批通过)")
|
||||
|
|
|
@ -57,11 +57,6 @@ public class TDemandDataEntity extends BaseEntity {
|
|||
* 附件
|
||||
*/
|
||||
private String enclosure;
|
||||
|
||||
/**
|
||||
* 附件名称
|
||||
*/
|
||||
private String enclosureName;
|
||||
/**
|
||||
* 业务标志(0:初始化 1:审批中 2:审批拒绝 3:审批通过)
|
||||
*/
|
||||
|
|
|
@ -15,8 +15,6 @@ import io.renren.modules.notice.enums.NoticeStatusEnum;
|
|||
import io.renren.modules.notice.service.SysNoticeService;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -38,10 +36,8 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Service
|
||||
public class TDemandCommentServiceImpl extends CrudServiceImpl<TDemandCommentDao, TDemandCommentEntity, TDemandCommentDTO> implements TDemandCommentService {
|
||||
private static Logger logger = LoggerFactory.getLogger(TDemandCommentServiceImpl.class);
|
||||
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
@Autowired
|
||||
private TDemandDataService tDemandDataService;
|
||||
@Autowired
|
||||
|
|
|
@ -6,6 +6,7 @@ import io.renren.modules.devtools.config.query.AbstractQuery;
|
|||
import io.renren.modules.devtools.entity.TableFieldEntity;
|
||||
import io.renren.modules.devtools.entity.TableInfoEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import oracle.jdbc.OracleConnection;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
|
@ -33,7 +34,7 @@ public class DbUtils {
|
|||
|
||||
Connection connection = DriverManager.getConnection(info.getConnUrl(), info.getUsername(), info.getPassword());
|
||||
if (info.getDbType() == DbType.Oracle) {
|
||||
//((OracleConnection) connection).setRemarksReporting(true);
|
||||
((OracleConnection) connection).setRemarksReporting(true);
|
||||
}
|
||||
|
||||
return connection;
|
||||
|
|
|
@ -11,13 +11,11 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
import sw.vc3term.contingencyplan.ContingencyPlanUtil;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
|
@ -41,27 +39,19 @@ public class EnkeController {
|
|||
private static final String videoConfernceIp = "35.1.190.62";
|
||||
private static final int videoConferncePort = 8756;
|
||||
|
||||
private static ContingencyPlanUtil cp = null;
|
||||
private static final ContingencyPlanUtil cp;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
|
||||
|
||||
@Autowired
|
||||
private EnkeService enkeService;
|
||||
@Value("#{new Boolean(${enke.enable})}")
|
||||
private Boolean enke; // 是否进行恩科会议组会
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (enke) {
|
||||
static {
|
||||
cp = ContingencyPlanUtil.getInstance();
|
||||
// 初始化会议
|
||||
cp.init(videoConfernceIp, videoConferncePort);
|
||||
List<String> ips = getLocalIP();
|
||||
cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT);
|
||||
logger.info("开启组会功能成功!");
|
||||
} else {
|
||||
logger.info("不开启组会功能");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,7 +112,6 @@ public class EnkeController {
|
|||
}
|
||||
}
|
||||
}
|
||||
logger.info("本机ip:" + ips);
|
||||
return ips;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,13 +47,9 @@ public class FuseController {
|
|||
@ApiImplicitParam(name = "description", value = "融合服务描述", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "type", value = "融合服务类型", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "applicationArea", value = "应用领域", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "int"),
|
||||
@ApiImplicitParam(name = "district", value = "赋能场景类型", paramType = "query", dataType = "int")
|
||||
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "int")
|
||||
})
|
||||
public Result<PageData<TbFuseDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
if (params.containsKey("orderType")) {
|
||||
params.put("order", params.get("orderType"));
|
||||
}
|
||||
PageData<TbFuseDTO> page = tbFuseService.page(params);
|
||||
return new Result<PageData<TbFuseDTO>>().ok(page);
|
||||
}
|
||||
|
|
|
@ -58,10 +58,6 @@ public class TbFuseDTO {
|
|||
private Integer dataSourceCount;
|
||||
@ApiModelProperty(value = "组件服务数量")
|
||||
private Integer componentCount;
|
||||
@ApiModelProperty(value = "赋能场景类型:0市级,1基层")
|
||||
private Integer district;
|
||||
@ApiModelProperty(value = "基层赋能场景所属地区")
|
||||
private String area;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -18,20 +18,17 @@ public class TbFuseResourceDTO {
|
|||
private Long id;
|
||||
@ApiModelProperty(value = "融合服务id")
|
||||
private Long fuseId;
|
||||
// @ApiModelProperty(value = "资源id")
|
||||
// private String resourceId;
|
||||
@ApiModelProperty(value = "资源id")
|
||||
private String resourceId;
|
||||
@ApiModelProperty(value = "资源挂载顺序")
|
||||
private String sequence;
|
||||
// @ApiModelProperty(value = "资源")
|
||||
// private Object resource;
|
||||
@ApiModelProperty(value = "资源类型一级分类")
|
||||
@ApiModelProperty(value = "资源")
|
||||
private Object resource;
|
||||
@ApiModelProperty(value = "资源类型")
|
||||
private String type;
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private String deptName;
|
||||
@ApiModelProperty(value = "资源名称")
|
||||
private String resourceName;
|
||||
|
||||
@ApiModelProperty(value = "资源类型次级分类")
|
||||
private String typeSecond;
|
||||
|
||||
}
|
||||
|
|
|
@ -79,6 +79,4 @@ public class TbFuseEntity extends BaseEntity {
|
|||
private Integer infrastructureCount;
|
||||
private Integer dataSourceCount;
|
||||
private Integer componentCount;
|
||||
private Integer district;
|
||||
private String area;
|
||||
}
|
||||
|
|
|
@ -17,16 +17,17 @@ import lombok.EqualsAndHashCode;
|
|||
@TableName("tb_fuse_resource")
|
||||
public class TbFuseResourceEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 融合服务id
|
||||
*/
|
||||
private Long fuseId;
|
||||
// /**
|
||||
// * 资源id
|
||||
// */
|
||||
// private String resourceId;
|
||||
/**
|
||||
* 资源id
|
||||
*/
|
||||
private String resourceId;
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
|
@ -35,10 +36,7 @@ public class TbFuseResourceEntity {
|
|||
* 资源类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 资源类型次级
|
||||
*/
|
||||
private String typeSecond;
|
||||
|
||||
private String deptName;
|
||||
private String resourceName;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package io.renren.modules.fuse.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
|
@ -21,6 +20,7 @@ import io.renren.modules.monitor.mapper.CameraChannelMapper;
|
|||
import io.renren.modules.resource.dataResource.AbstractDataResourceService;
|
||||
import io.renren.modules.resource.dataResource.DataResourceFactory;
|
||||
import io.renren.modules.resource.dto.GetDataResourceListDto;
|
||||
import io.renren.modules.resource.dto.ResourceDTO;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.resource.service.impl.ResourceServiceImpl;
|
||||
import io.renren.modules.resourceCollection.dao.ResourceCollectionDao;
|
||||
|
@ -100,19 +100,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
case "updateDate":
|
||||
wrapper.eq(StringUtils.isNotBlank(params.get("updateDate").toString()), "update_date", params.get("updateDate").toString());
|
||||
break;
|
||||
case "district": // 0 市级 1基层
|
||||
wrapper.eq(params.get("district") != null, "district", params.get("district"));
|
||||
break;
|
||||
case "areas": { // 区域
|
||||
List<String> areas = JSONArray.parseArray(params.get("area").toString()).toJavaList(String.class);
|
||||
wrapper.in(!areas.isEmpty(), "area", areas);
|
||||
}
|
||||
break;
|
||||
case "senses": {
|
||||
List<String> senses = JSONArray.parseArray(params.get("senses").toString()).toJavaList(String.class);
|
||||
wrapper.in(!senses.isEmpty(), "application_area", senses);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -131,12 +118,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
limit = Long.parseLong((String) params.get(Constant.LIMIT));
|
||||
}
|
||||
params.put("userId", SecurityUser.getUserId());
|
||||
if (params.containsKey("senses")) {
|
||||
params.put("senses", JSONArray.parseArray(params.get("senses").toString()).toJavaList(String.class).toArray());
|
||||
}
|
||||
if (params.containsKey("areas")) {
|
||||
params.put("areas", JSONArray.parseArray(params.get("areas").toString()).toJavaList(String.class).toArray());
|
||||
}
|
||||
List<TbFuseDTO> dtoList = baseDao.getFuseDTOList(params);
|
||||
dtoList.forEach(dto -> {
|
||||
dto.setFuseResourceList(getFuseResourceByFuseId(dto.getId()));
|
||||
|
@ -240,47 +221,44 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
QueryWrapper wrapper = new QueryWrapper();
|
||||
wrapper.eq("fuse_id", fuseId);
|
||||
List<TbFuseResourceEntity> list = fuseResourceDao.selectList(wrapper);
|
||||
result = list.stream().map(index -> {
|
||||
Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
||||
//if (resourceMap.containsKey("数据资源")) {
|
||||
// dataResourceMap.putAll(getDataResource());
|
||||
//}
|
||||
resourceMap.forEach((type, value) -> {
|
||||
if ("组件服务".equals(type)) {
|
||||
result.addAll(value.stream().map(attr -> {
|
||||
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
dto.setFuseId(fuseId);
|
||||
BeanUtils.copyProperties(index, dto);
|
||||
BeanUtils.copyProperties(attr, dto);
|
||||
if (org.apache.commons.lang3.StringUtils.isNumeric(dto.getResourceId())) {
|
||||
ResourceDTO resourceDTO = resourceService.get(Long.parseLong(dto.getResourceId()));
|
||||
resourceDTO.setDeptName(sysDeptService.get(resourceDTO.getDeptId()).getName());
|
||||
dto.setResource(resourceDTO);
|
||||
}
|
||||
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
// Map<String, List<TbFuseResourceEntity>> resourceMap = list.stream().filter(index -> index.getType() != null).collect(Collectors.groupingBy(TbFuseResourceEntity::getType));
|
||||
// resourceMap.forEach((type, value) -> {
|
||||
// if ("组件服务".equals(type)) {
|
||||
// result.addAll(value.stream().map(attr -> {
|
||||
// TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
// BeanUtils.copyProperties(attr, dto);
|
||||
// if (org.apache.commons.lang3.StringUtils.isNumeric(dto.getResourceId())) {
|
||||
// ResourceDTO resourceDTO = resourceService.get(Long.parseLong(dto.getResourceId()));
|
||||
// resourceDTO.setDeptName(sysDeptService.get(resourceDTO.getDeptId()).getName());
|
||||
// dto.setResource(resourceDTO);
|
||||
// }
|
||||
//
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList()));
|
||||
// } else if ("数据资源".equals(type)) {
|
||||
// result.addAll(value.stream().map(attr -> {
|
||||
// TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
// BeanUtils.copyProperties(attr, dto);
|
||||
// HashMap<Object, Object> map = new HashMap<>();
|
||||
// map.put("resourceName", attr.getResourceName());
|
||||
// map.put("resourceId", attr.getResourceId());
|
||||
// map.put("deptName", attr.getDeptName());
|
||||
// map.put("type", attr.getType());
|
||||
// dto.setResource(map);
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList()));
|
||||
// } else if ("基础设施".equals(type)) {
|
||||
// result.addAll(value.stream().map(attr -> {
|
||||
// TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
// BeanUtils.copyProperties(attr, dto);
|
||||
// dto.setResource(cameraChannelMapper.selectById(dto.getResourceId().toString()));
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList()));
|
||||
// }
|
||||
// });
|
||||
}).collect(Collectors.toList()));
|
||||
} else if ("数据资源".equals(type)) {
|
||||
result.addAll(value.stream().map(attr -> {
|
||||
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
BeanUtils.copyProperties(attr, dto);
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("resourceName", attr.getResourceName());
|
||||
map.put("resourceId", attr.getResourceId());
|
||||
map.put("deptName", attr.getDeptName());
|
||||
map.put("type", attr.getType());
|
||||
dto.setResource(map);
|
||||
return dto;
|
||||
}).collect(Collectors.toList()));
|
||||
} else if ("基础设施".equals(type)) {
|
||||
result.addAll(value.stream().map(attr -> {
|
||||
TbFuseResourceDTO dto = new TbFuseResourceDTO();
|
||||
BeanUtils.copyProperties(attr, dto);
|
||||
dto.setResource(cameraChannelMapper.selectById(dto.getResourceId().toString()));
|
||||
return dto;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -292,8 +270,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
fuseEntity.setVisits(0L);
|
||||
fuseEntity.setApplyCount(0L);
|
||||
int result = fuseDao.insert(fuseEntity);
|
||||
|
||||
if (dto.getFuseResourceList() != null) {
|
||||
dto.getFuseResourceList().forEach(fuseResourceDTO -> {
|
||||
fuseResourceDTO.setId(IdWorker.getId(fuseResourceDTO));
|
||||
fuseResourceDTO.setFuseId(fuseEntity.getId());
|
||||
|
@ -301,8 +277,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
BeanUtils.copyProperties(fuseResourceDTO, entity);
|
||||
fuseResourceDao.insert(entity);
|
||||
});
|
||||
}
|
||||
if (dto.getFuseAttrList() != null) {
|
||||
dto.getFuseAttrList().forEach(fuseAttrDTO -> {
|
||||
fuseAttrDTO.setId(IdWorker.getId(fuseAttrDTO));
|
||||
fuseAttrDTO.setFuseId(fuseEntity.getId());
|
||||
|
@ -310,7 +284,6 @@ public class TbFuseServiceImpl extends CrudServiceImpl<TbFuseDao, TbFuseEntity,
|
|||
BeanUtils.copyProperties(fuseAttrDTO, entity);
|
||||
fuseAttrDao.insert(entity);
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,8 +15,6 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
|
@ -41,7 +39,6 @@ import java.util.*;
|
|||
@Api(tags = "网关统计")
|
||||
@Log4j2
|
||||
public class MonitorController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(MonitorController.class);
|
||||
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
@ -154,20 +151,9 @@ public class MonitorController {
|
|||
outputStream.write(buffer, 0, len);
|
||||
len = inputStream.read(buffer);
|
||||
}
|
||||
outputStream.close();
|
||||
inputStream.close();
|
||||
} catch (Exception e) {
|
||||
log.error("网关接口异常", e);
|
||||
response.setStatus(500);
|
||||
try {
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
outputStream.write("api error".getBytes());
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
} catch (Exception exception) {
|
||||
|
||||
}
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -301,8 +287,8 @@ public class MonitorController {
|
|||
"&start=" + start +
|
||||
"&end=" + end +
|
||||
"&step=" + step;
|
||||
ResponseEntity<HashMap> entity = restTemplate.getForEntity(url, HashMap.class, query);
|
||||
|
||||
ResponseEntity<HashMap> entity = restTemplate.getForEntity(url, HashMap.class, query);
|
||||
HashMap body = entity.getBody();
|
||||
HashMap data = (HashMap) body.get("data");
|
||||
if (data != null) {
|
||||
|
|
|
@ -1,234 +0,0 @@
|
|||
package io.renren.modules.meeting.Excel;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.modules.meeting.dao.TMeetingroomMapper;
|
||||
import io.renren.modules.meeting.dto.MeetingExcelDTO;
|
||||
import io.renren.modules.meeting.dto.MeetingExcelValidationDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.entity.TMeetingroom;
|
||||
import io.renren.modules.meeting.service.TMeetingroomBookService;
|
||||
import io.renren.modules.sys.dao.SysUserDao;
|
||||
import io.renren.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@Component
|
||||
public class MeetingExcelDataListener extends AnalysisEventListener<MeetingExcelDTO> {
|
||||
|
||||
@Resource
|
||||
private TMeetingroomMapper tMeetingroomMapper;
|
||||
@Resource
|
||||
private SysUserDao sysUserDao;
|
||||
|
||||
@Resource
|
||||
private TMeetingroomBookService tMeetingroomBookService;
|
||||
/**
|
||||
* 定义一个存储的界限,每读取5条数据就存储一次数据库,防止数据过多时发生溢出
|
||||
* 存储完成之后就清空list重新读取新的数据,方便内存回收
|
||||
*/
|
||||
private static final int BATCH_COUNT = 5;
|
||||
|
||||
/**
|
||||
* 定义一个数据存储缓存,用于临时存储读取到的数据
|
||||
*/
|
||||
private List<MeetingExcelDTO> cacheDataList = new ArrayList<>();
|
||||
public List<MeetingExcelValidationDTO> badlist = new ArrayList<>();
|
||||
|
||||
private ReentrantLock badlistlock = new ReentrantLock();
|
||||
|
||||
public void lock (){
|
||||
badlistlock.lock();
|
||||
}
|
||||
|
||||
public void unlock(){
|
||||
badlistlock.unlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(MeetingExcelDTO item, AnalysisContext analysisContext) {
|
||||
|
||||
cacheDataList.add(item);
|
||||
/**
|
||||
* 如果当前缓存列表中的数据等于指定值,就存储
|
||||
*/
|
||||
if (cacheDataList.size() == BATCH_COUNT) {
|
||||
//保存数据到数据库
|
||||
saveData();
|
||||
//清空缓存列表重新读取
|
||||
cacheDataList.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||
saveData();
|
||||
cacheDataList.clear();
|
||||
}
|
||||
|
||||
private void saveData() {
|
||||
System.out.println(Thread.currentThread().getName()+"----------------------------------");
|
||||
for (MeetingExcelDTO item : cacheDataList) {
|
||||
String sportOriginalValue = item.getActivitySpot();
|
||||
if (StringUtils.isBlank(sportOriginalValue)) {
|
||||
continue;
|
||||
}
|
||||
//一条数据里有多个会议室
|
||||
if (sportOriginalValue.contains("、")) {
|
||||
String spots[] = sportOriginalValue.split("、");
|
||||
for (int i = 1; i < spots.length; i++) {
|
||||
MeetingExcelDTO meetingExcelDTO = new MeetingExcelDTO();
|
||||
BeanUtils.copyProperties(item, meetingExcelDTO);
|
||||
meetingExcelDTO.setActivitySpot(spots[i]);
|
||||
MeetingExcelValidationDTO validationDTO = checkAndInsert(meetingExcelDTO);
|
||||
if (!validationDTO.getValidated()) {
|
||||
badlist.add(validationDTO);
|
||||
}
|
||||
}
|
||||
item.setActivitySpot(spots[0]);
|
||||
}
|
||||
|
||||
MeetingExcelValidationDTO validationDTO = checkAndInsert(item);
|
||||
if (!validationDTO.getValidated()) {
|
||||
badlist.add(validationDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MeetingExcelValidationDTO checkAndInsert(MeetingExcelDTO item) {
|
||||
MeetingExcelValidationDTO result = new MeetingExcelValidationDTO();
|
||||
result.setMeetingExcelDTO(item);
|
||||
|
||||
TMeetingroomBookDTO dto = new TMeetingroomBookDTO();
|
||||
//会议室处理
|
||||
QueryWrapper<TMeetingroom> qw = new QueryWrapper();
|
||||
qw.eq("name", item.getActivitySpot().trim());
|
||||
qw.eq("del_flag", 0);
|
||||
TMeetingroom tMeetingroom = tMeetingroomMapper.selectOne(qw);
|
||||
if (tMeetingroom == null) {
|
||||
result.setValidated(false);
|
||||
result.getErrors().add("会议室找不到对应:" + item.getActivitySpot().trim());
|
||||
} else {
|
||||
dto.setRoomId(tMeetingroom.getId());
|
||||
dto.setRoomName(tMeetingroom.getName());
|
||||
}
|
||||
|
||||
//活动时间处理
|
||||
String activityTimeStr = item.getActivityTime();
|
||||
if (StringUtils.isNotBlank(activityTimeStr)) {
|
||||
Date activityTimeDate = null;
|
||||
Date startTime = null;
|
||||
Date endTime = null;
|
||||
Date bookTime = null;
|
||||
SimpleDateFormat format0 = new SimpleDateFormat("yyyy/M/d");
|
||||
try {
|
||||
activityTimeDate = format0.parse(activityTimeStr);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(activityTimeDate);
|
||||
calendar.set(Calendar.HOUR, 9);
|
||||
startTime = calendar.getTime();
|
||||
calendar.add(Calendar.HOUR, 1);
|
||||
endTime = calendar.getTime();
|
||||
bookTime = startTime;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (startTime == null) {
|
||||
SimpleDateFormat format1 = new SimpleDateFormat("yyyy/M/d HH:mm");
|
||||
try {
|
||||
startTime = format0.parse(activityTimeStr);
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(startTime);
|
||||
calendar.add(Calendar.HOUR, 1);
|
||||
endTime = calendar.getTime();
|
||||
bookTime = startTime;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (startTime == null) {
|
||||
result.setValidated(false);
|
||||
result.getErrors().add("活动时间异常:" + item.getActivityTime());
|
||||
} else {
|
||||
//开始时间
|
||||
dto.setStartTime(startTime);
|
||||
//结束时间
|
||||
dto.setEndTime(endTime);
|
||||
//提交预约时间
|
||||
dto.setBookDate(bookTime);
|
||||
}
|
||||
} else {
|
||||
result.setValidated(false);
|
||||
result.getErrors().add("活动时间异常:" + item.getActivityTime());
|
||||
}
|
||||
|
||||
//申请人处理
|
||||
String liaison = item.getLiaison();
|
||||
if (StringUtils.isNotBlank(liaison)) {
|
||||
dto.setName(liaison);//申请人
|
||||
QueryWrapper<SysUserEntity> qw1 = new QueryWrapper();
|
||||
qw1.eq("real_name", liaison);
|
||||
qw1.eq("status", 1);
|
||||
SysUserEntity user = sysUserDao.selectOne(qw1);
|
||||
if (user == null) {
|
||||
result.setValidated(false);
|
||||
result.getErrors().add("联系人在系统中没有:" + liaison);
|
||||
} else {
|
||||
dto.setPhone(user.getMobile());
|
||||
}
|
||||
} else {
|
||||
result.setValidated(false);
|
||||
result.getErrors().add("联系人异常:" + liaison);
|
||||
}
|
||||
if (result.getValidated()) {
|
||||
StringBuffer matterBuff = new StringBuffer();
|
||||
if (StringUtils.isNotBlank(item.getActivityName())) {
|
||||
matterBuff.append("活动名称:");
|
||||
matterBuff.append(item.getActivityName());
|
||||
matterBuff.append(" ");
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getParticipants())) {
|
||||
matterBuff.append("参会人员:");
|
||||
matterBuff.append(item.getParticipants());
|
||||
matterBuff.append(" ");
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getActivityContents())) {
|
||||
matterBuff.append("活动内容:");
|
||||
matterBuff.append(item.getActivityContents());
|
||||
matterBuff.append(" ");
|
||||
}
|
||||
dto.setMatter(matterBuff.toString());
|
||||
|
||||
dto.setState(2);//通过
|
||||
dto.setAuditViem("通过");
|
||||
dto.setDept(item.getDept());//部门
|
||||
|
||||
QueryWrapper<SysUserEntity> qw2 = new QueryWrapper();
|
||||
qw2.eq("real_name", "城市云脑工作专班");
|
||||
qw2.eq("status", 1);
|
||||
SysUserEntity user = sysUserDao.selectOne(qw2);
|
||||
dto.setCreator(user.getId());
|
||||
dto.setCreateDate(dto.getBookDate());
|
||||
dto.setAuditor(user.getId());
|
||||
dto.setAuditTime(dto.getBookDate());
|
||||
|
||||
//插入数据
|
||||
tMeetingroomBookService.save(dto);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package io.renren.modules.meeting.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
|
@ -9,9 +8,6 @@ import io.renren.common.validator.ValidatorUtils;
|
|||
import io.renren.common.validator.group.AddGroup;
|
||||
import io.renren.common.validator.group.DefaultGroup;
|
||||
import io.renren.common.validator.group.UpdateGroup;
|
||||
import io.renren.modules.meeting.Excel.MeetingExcelDataListener;
|
||||
import io.renren.modules.meeting.dto.MeetingExcelDTO;
|
||||
import io.renren.modules.meeting.dto.MeetingExcelValidationDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomBookDTO;
|
||||
import io.renren.modules.meeting.dto.TMeetingroomDTO;
|
||||
import io.renren.modules.meeting.service.TMeetingroomBookService;
|
||||
|
@ -25,18 +21,17 @@ import io.swagger.annotations.Api;
|
|||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "预约会客厅")
|
||||
@Api(tags = "预约会议室")
|
||||
@RestController
|
||||
@RequestMapping("bookMeeting")
|
||||
public class BookMeetingRoomController {
|
||||
|
@ -44,7 +39,7 @@ public class BookMeetingRoomController {
|
|||
@Value("${big_date.name}")
|
||||
private String bigDateDeptName; // 大数据局名称
|
||||
@Value("${big_date.assignee_meet_role_id}")
|
||||
private String defaultAssigneeRoleId; // 改成配置的会客厅审核人
|
||||
private String defaultAssigneeRoleId; // 改成配置的会议室审核人
|
||||
|
||||
@Resource
|
||||
private TMeetingroomBookService tMeetingroomBookService;
|
||||
|
@ -56,16 +51,14 @@ public class BookMeetingRoomController {
|
|||
private SysRoleUserService sysRoleUserService;
|
||||
|
||||
@GetMapping("list")
|
||||
@ApiOperation("搜索可以预约的会客厅")
|
||||
@ApiOperation("搜索可以预约的会议室")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "name", value = "会客厅名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "name", value = "会议室名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "bookDate", value = "预约开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "预约开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "预约结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String")
|
||||
})
|
||||
public Result<PageData<TMeetingroomDTO>> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<TMeetingroomDTO> list = tMeetingroomService.selectFreeRoom(params);
|
||||
|
@ -77,7 +70,7 @@ public class BookMeetingRoomController {
|
|||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "roomName", value = "会客厅名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "roomName", value = "会议室名称", paramType = "query", dataType = "String"),
|
||||
})
|
||||
public Result<PageData<TMeetingroomBookDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<TMeetingroomBookDTO> page = tMeetingroomBookService.queryList(params);
|
||||
|
@ -85,9 +78,9 @@ public class BookMeetingRoomController {
|
|||
}
|
||||
|
||||
@GetMapping("availableDate")
|
||||
@ApiOperation("根据日期获取会客厅当天的可用时段")
|
||||
@ApiOperation("根据日期获取会议室当天的可用时段")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "roomId", value = "会客厅主键", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "roomId", value = "会议室主键", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "date", value = "查询的天数", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
public Result<List<String>> availableDate(@ApiIgnore @RequestParam Map<String, Object> params) throws ParseException {
|
||||
|
@ -108,9 +101,9 @@ public class BookMeetingRoomController {
|
|||
tMeetingroomBookService.save(dto);
|
||||
// 发起预约后推送消息
|
||||
String content = "【通知】请审核" + dto.getName() + "发起的" + dto.getRoomName() +
|
||||
"会客厅申请";
|
||||
"会议室申请";
|
||||
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
|
||||
sysNoticeDTO.setTitle("会客厅申请审核通知");
|
||||
sysNoticeDTO.setTitle("会议室申请审核通知");
|
||||
sysNoticeDTO.setContent(content); // 通知内容
|
||||
sysNoticeDTO.setReceiverType(1);
|
||||
sysNoticeDTO.setType(11);
|
||||
|
@ -134,12 +127,12 @@ public class BookMeetingRoomController {
|
|||
sysNoticeService.save(sysNoticeDTO);
|
||||
// 还要发送自己能看到的的谁给我审核的消息
|
||||
String ownedContent = "【通知】您发起的" + dto.getRoomName() +
|
||||
"会客厅申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会客厅管理员";
|
||||
"会议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员";
|
||||
SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO();
|
||||
ownedSysNoticeDTO.setType(10);
|
||||
ownedSysNoticeDTO.setApplyState(0);
|
||||
ownedSysNoticeDTO.setApplyId(dto.getId().toString());
|
||||
ownedSysNoticeDTO.setTitle("会客厅申请发起通知");
|
||||
ownedSysNoticeDTO.setTitle("会议室申请发起通知");
|
||||
ownedSysNoticeDTO.setContent(ownedContent); // 通知内容
|
||||
ownedSysNoticeDTO.setReceiverType(1);
|
||||
ownedSysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString());
|
||||
|
@ -167,7 +160,7 @@ public class BookMeetingRoomController {
|
|||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "roomName", value = "会客厅名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "roomName", value = "会议室名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "state", value = "预约状态", paramType = "query", dataType = "int"),
|
||||
})
|
||||
public Result<PageData<TMeetingroomBookDTO>> auditPage(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
|
@ -187,12 +180,12 @@ public class BookMeetingRoomController {
|
|||
// 修改之后推送存通知sysNotice
|
||||
String state = dto.getState() == 2 ? "通过" : "不通过";
|
||||
String content = "【通知】" + dto.getName() + ",您发起的" + dto.getRoomName() +
|
||||
"会客厅申请,审核结果为:" + state;
|
||||
"会议室申请,审核结果为:" + state;
|
||||
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
|
||||
sysNoticeDTO.setType(10);
|
||||
sysNoticeDTO.setApplyState(1);
|
||||
sysNoticeDTO.setApplyId(dto.getId().toString());
|
||||
sysNoticeDTO.setTitle("会客厅申请审核结果通知");
|
||||
sysNoticeDTO.setTitle("会议室申请审核结果通知");
|
||||
sysNoticeDTO.setContent(content); // 通知内容
|
||||
sysNoticeDTO.setReceiverType(1);
|
||||
sysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString());
|
||||
|
@ -206,30 +199,4 @@ public class BookMeetingRoomController {
|
|||
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private MeetingExcelDataListener meetingExcelDataListener;
|
||||
|
||||
|
||||
@PostMapping("importExcel")
|
||||
@ApiOperation("导入Excel")
|
||||
public Result importExcel(@RequestParam("excelfile") MultipartFile file) throws Exception {
|
||||
meetingExcelDataListener.lock();
|
||||
//解析并保存到数据库
|
||||
EasyExcel.read(file.getInputStream(), MeetingExcelDTO.class, meetingExcelDataListener).sheet().doRead();
|
||||
Result r = new Result();
|
||||
|
||||
ArrayList<MeetingExcelValidationDTO> clonedList = new ArrayList<>();
|
||||
Iterator<MeetingExcelValidationDTO> it = meetingExcelDataListener.badlist.iterator();
|
||||
while (it.hasNext()) {
|
||||
MeetingExcelValidationDTO s = it.next();
|
||||
MeetingExcelValidationDTO newS = new MeetingExcelValidationDTO();
|
||||
BeanUtils.copyProperties(s, newS);
|
||||
clonedList.add(newS);
|
||||
}
|
||||
r.setData(clonedList);
|
||||
meetingExcelDataListener.badlist.clear();
|
||||
meetingExcelDataListener.unlock();
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import javax.annotation.Resource;
|
|||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "会客厅")
|
||||
@Api(tags = "会议室")
|
||||
@RestController
|
||||
@RequestMapping("meeting")
|
||||
public class MeetingroomController {
|
||||
|
@ -36,7 +36,7 @@ public class MeetingroomController {
|
|||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = "name", value = "会客厅名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "name", value = "会议室名称", paramType = "query", dataType = "String"),
|
||||
})
|
||||
public Result<PageData<TMeetingroomDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
PageData<TMeetingroomDTO> page = meetingroomService.queryList(params);
|
||||
|
@ -58,7 +58,7 @@ public class MeetingroomController {
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||
|
||||
if (meetingroomService.checkMeetingRepeat(dto.getName())) {
|
||||
return new Result().error("已经存在相同名称的会客厅,请勿重复新增");
|
||||
return new Result().error("已经存在相同名称的会议室,请勿重复新增");
|
||||
}
|
||||
meetingroomService.save(dto);
|
||||
return new Result();
|
||||
|
|
|
@ -34,8 +34,4 @@ public interface TMeetingroomBookMapper extends BaseDao<TMeetingroomBook> {
|
|||
@Param("state") Integer state);
|
||||
|
||||
List<TMeetingroomBook> selectInvalid(Date date);
|
||||
|
||||
List<Long> selectBookIdByRoomId(Long id);
|
||||
|
||||
Long countApply(Long id);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package io.renren.modules.meeting.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "excel导入")
|
||||
public class MeetingExcelDTO {
|
||||
|
||||
@ExcelProperty(value = "序号")
|
||||
private int id;
|
||||
@ExcelProperty(value = "活动名称")
|
||||
private String activityName;
|
||||
@ExcelProperty(value = "活动时间")
|
||||
private String activityTime;
|
||||
@ExcelProperty(value = "活动地点")
|
||||
private String activitySpot;
|
||||
@ExcelProperty(value = "参会人员")
|
||||
private String participants;
|
||||
@ExcelProperty(value = "活动内容")
|
||||
private String activityContents;
|
||||
@ExcelProperty(value = "组织单位")
|
||||
private String dept;
|
||||
@ExcelProperty(value = "联系人")
|
||||
private String liaison;
|
||||
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package io.renren.modules.meeting.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "excel数据验证结果")
|
||||
public class MeetingExcelValidationDTO {
|
||||
@ApiModelProperty(value = "数据内容")
|
||||
private MeetingExcelDTO meetingExcelDTO;
|
||||
@ApiModelProperty(value = "验证结果")
|
||||
private Boolean validated = true;
|
||||
@ApiModelProperty(value = "错误内容")
|
||||
private ArrayList<String> errors = new ArrayList<>();
|
||||
}
|
|
@ -6,18 +6,17 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "会客厅预约")
|
||||
@ApiModel(value = "会议室预约")
|
||||
public class TMeetingroomBookDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键,新增时不传")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "会客厅id")
|
||||
@ApiModelProperty(value = "会议室id")
|
||||
private Long roomId;
|
||||
@ApiModelProperty(value = "预约时间,请传时间格式为2000-01-01")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
@ -42,7 +41,7 @@ public class TMeetingroomBookDTO implements Serializable {
|
|||
private Date createDate;
|
||||
@ApiModelProperty(value = "创建者")
|
||||
private Long creator;
|
||||
@ApiModelProperty(value = "审核状态,审核时传,默认0为待审核,2-通过,3-不通过")
|
||||
@ApiModelProperty(value = "审核状态,审核时传,2-通过,3-不通过")
|
||||
private Integer state;
|
||||
@ApiModelProperty(value = "审核意见")
|
||||
private String auditViem;
|
||||
|
@ -52,7 +51,4 @@ public class TMeetingroomBookDTO implements Serializable {
|
|||
private Date auditTime;
|
||||
|
||||
private String roomName;
|
||||
|
||||
@ApiModelProperty(value = "申请价格")
|
||||
private BigDecimal applyPrice;
|
||||
}
|
|
@ -5,14 +5,13 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会客厅
|
||||
* 会议室
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "会客厅表")
|
||||
@ApiModel(value = "会议室表")
|
||||
public class TMeetingroomDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -26,7 +25,7 @@ public class TMeetingroomDTO implements Serializable {
|
|||
private String area;
|
||||
@ApiModelProperty(value = "可容纳人数")
|
||||
private Integer capacity;
|
||||
@ApiModelProperty(value = "会客厅图片")
|
||||
@ApiModelProperty(value = "会议室图片")
|
||||
private String pic;
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String description;
|
||||
|
@ -40,10 +39,5 @@ public class TMeetingroomDTO implements Serializable {
|
|||
private Long modifier;
|
||||
@ApiModelProperty(value = "是否删除,0-未删除,1-删除")
|
||||
private Integer delFlag;
|
||||
@ApiModelProperty(value = "价格")
|
||||
private BigDecimal price;
|
||||
@ApiModelProperty(value = "申请成功次数")
|
||||
private Long applyCount;
|
||||
|
||||
|
||||
}
|
|
@ -5,11 +5,10 @@ import io.renren.common.entity.BaseEntity;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会客厅
|
||||
* 会议室
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
@ -34,7 +33,7 @@ public class TMeetingroom extends BaseEntity {
|
|||
*/
|
||||
private Integer capacity;
|
||||
/**
|
||||
* 会客厅图片
|
||||
* 会议室图片
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
|
@ -48,9 +47,4 @@ public class TMeetingroom extends BaseEntity {
|
|||
|
||||
private Integer delFlag;
|
||||
private Long modifier;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
|
@ -5,11 +5,10 @@ import io.renren.common.entity.BaseEntity;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会客厅预约
|
||||
* 会议室预约
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
@ -18,7 +17,7 @@ public class TMeetingroomBook extends BaseEntity {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 会客厅id
|
||||
* 会议室id
|
||||
*/
|
||||
private Long roomId;
|
||||
private Date bookDate;
|
||||
|
@ -66,10 +65,4 @@ public class TMeetingroomBook extends BaseEntity {
|
|||
* 审核时间
|
||||
*/
|
||||
private Date auditTime;
|
||||
|
||||
/**
|
||||
* 申请价格
|
||||
*/
|
||||
private BigDecimal applyPrice;
|
||||
|
||||
}
|
|
@ -15,11 +15,9 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
public class TMeetingroomServiceImpl extends CrudServiceImpl<TMeetingroomMapper, TMeetingroom, TMeetingroomDTO> implements TMeetingroomService {
|
||||
|
@ -88,39 +86,20 @@ public class TMeetingroomServiceImpl extends CrudServiceImpl<TMeetingroomMapper,
|
|||
String finalBookDate = bookDate + " 00:00:00";
|
||||
String finalStartTime = "1970-01-01 " + startTime;
|
||||
String finalEndTime = "1970-01-01 " + endTime;
|
||||
Stream<TMeetingroomDTO> temp = tMeetingroomDTOS.stream().filter(room -> {
|
||||
tMeetingroomDTOS = tMeetingroomDTOS.stream().filter(room -> {
|
||||
// 如果有时间,根据时间段去预约表搜,如果搜不到,那就芜湖起飞
|
||||
boolean flag = false;
|
||||
if ("null 00:00:00".equals(finalBookDate) || "1970-01-01 ".equals(finalStartTime) || "1970-01-01 ".equals(finalEndTime)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
List<TMeetingroomBookDTO> meetingroomBookDTOS = tMeetingroomBookMapper.selectByRoomAndTime(room.getId(), finalBookDate,
|
||||
finalStartTime, finalEndTime);
|
||||
if (CollectionUtils.isEmpty(meetingroomBookDTOS)) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(index -> {
|
||||
index.setApplyCount(tMeetingroomBookMapper.countApply(index.getId()));
|
||||
return index;
|
||||
});
|
||||
// 增加排序
|
||||
if (params.containsKey("orderField") && params.containsKey("orderType")) {
|
||||
if ("applyCount".equals(params.get("orderField"))) {
|
||||
if ("DESC".equals(params.get("orderType"))) {
|
||||
tMeetingroomDTOS = temp.sorted(Comparator.comparing(x -> {
|
||||
TMeetingroomDTO index = (TMeetingroomDTO) x;
|
||||
return index.getApplyCount();
|
||||
}).reversed()).collect(Collectors.toList());
|
||||
} else {
|
||||
tMeetingroomDTOS = temp.sorted(Comparator.comparing(x -> x.getApplyCount())).collect(Collectors.toList());
|
||||
}
|
||||
} else {
|
||||
tMeetingroomDTOS = temp.collect(Collectors.toList());
|
||||
}
|
||||
} else {
|
||||
tMeetingroomDTOS = temp.collect(Collectors.toList());
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<TMeetingroomDTO> pageSizeDataForRelations = PageUtil.getPageSizeDataForRelations(tMeetingroomDTOS, pageSize, page);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public class SysNoticeDTO implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "id")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "通知类型 0:申请前台 1:申请后台 2:上架前台 3:上架后台 4:下架前台 5:下架后台 6:需求前台 7:需求后台 8:评论前台 9:评论后台 10:会客厅前台 11:会客厅后台 12:其他")
|
||||
@ApiModelProperty(value = "通知类型 0:申请前台 1:申请后台 2:上架前台 3:上架后台 4:下架前台 5:下架后台 6:需求前台 7:需求后台 8:评论前台 9:评论后台 10:会议室前台 11:会议室后台 12:其他")
|
||||
private Integer type;
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
|
|
@ -271,17 +271,12 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
|||
exchangeCodes.append(ywMobile + ";");
|
||||
}
|
||||
}
|
||||
if (userGuids.length() <= 0 || userNames.length() <= 0) {
|
||||
logger.info("未找到亚伟用户guid,用户为{}", userNames);
|
||||
return;
|
||||
if (userNames.charAt(userNames.length() - 1) == ';') {
|
||||
userNames.deleteCharAt(userNames.length() - 1);
|
||||
}
|
||||
if (userGuids.charAt(userGuids.length() - 1) == ';') {
|
||||
userGuids.deleteCharAt(userGuids.length() - 1);
|
||||
}
|
||||
if (userNames.charAt(userNames.length() - 1) == ';') {
|
||||
userNames.deleteCharAt(userNames.length() - 1);
|
||||
}
|
||||
|
||||
if (exchangeCodes.charAt(exchangeCodes.length() - 1) == ';') {
|
||||
exchangeCodes.deleteCharAt(exchangeCodes.length() - 1);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class NoticeUntil {
|
|||
" 0: \"myAgent-CommentModeration\"," +
|
||||
" 1: \"hasToDoTasks-CommentModeration\"," +
|
||||
" }," +
|
||||
" \"会客厅后台\": {" +
|
||||
" \"会议室后台\": {" +
|
||||
" 0: \"activiti-RoomExamineAdmin\"," +
|
||||
" 1: \"activiti-RoomExamineAdmin\"," +
|
||||
" }," +
|
||||
|
@ -55,8 +55,8 @@ public class NoticeUntil {
|
|||
" 7: \"需求后台\"," +
|
||||
" 8: \"评论前台\"," +
|
||||
" 9: \"评论后台\"," +
|
||||
" 10: \"会客厅前台\"," +
|
||||
" 11: \"会客厅后台\"," +
|
||||
" 10: \"会议室前台\"," +
|
||||
" 11: \"会议室后台\"," +
|
||||
" 12: \"其他\"" +
|
||||
"}";
|
||||
typeMap = JSONObject.parseObject(typeString, HashMap.class);
|
||||
|
@ -67,7 +67,7 @@ public class NoticeUntil {
|
|||
" \"下架前台\": \"能力下架\"," +
|
||||
" \"需求前台\": \"能力需求\"," +
|
||||
" \"评论前台\": \"需求评论\"," +
|
||||
" \"会客厅前台\": \"会客厅前台\"" +
|
||||
" \"会议室前台\": \"会议室前台\"" +
|
||||
"}";
|
||||
tabMap = JSONObject.parseObject(tabString, HashMap.class);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class NoticeUntil {
|
|||
if (route != null) {
|
||||
return manageUrl + "/#/" + route;
|
||||
}
|
||||
} else if (typeName.equals("会客厅前台")) {//会客厅单独处理
|
||||
} else if (typeName.equals("会议室前台")) {//会议室单独处理
|
||||
return portalUrl + "/#/DetailsPageconetent?select=基础设施&formPage=noticePage";
|
||||
} else {//前台根据tab区分不同param
|
||||
String tabName = tabMap.get(typeName);
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package io.renren.modules.processForm.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.constant.Constant;
|
||||
import io.renren.common.page.PageData;
|
||||
import io.renren.common.utils.ConvertUtils;
|
||||
import io.renren.common.utils.DateUtils;
|
||||
import io.renren.common.utils.ExcelUtils;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.common.validator.AssertUtils;
|
||||
|
@ -26,15 +22,13 @@ import io.renren.modules.processForm.dto.TAbilityApplicationV2DTO;
|
|||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||
import io.renren.modules.processForm.excel.TAbilityApplicationExcel;
|
||||
import io.renren.modules.processForm.service.TAbilityApplicationService;
|
||||
import io.renren.modules.reminders.service.TRemindersService;
|
||||
import io.renren.modules.resource.dto.ResourceDTO;
|
||||
import io.renren.modules.resource.excel.census.config.CustomCellWriteHeightConfig;
|
||||
import io.renren.modules.resource.excel.census.config.CustomCellWriteWeightConfig;
|
||||
import io.renren.modules.resource.service.ResourceService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import io.renren.modules.sys.dto.SysDeptDTO;
|
||||
import io.renren.modules.sys.dto.SysUserDTO;
|
||||
import io.renren.modules.sys.enums.SuperAdminEnum;
|
||||
import io.renren.modules.sys.service.SysDeptService;
|
||||
import io.renren.modules.sys.service.SysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -56,16 +50,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -105,12 +91,6 @@ public class TAbilityApplicationController {
|
|||
@Value("${infrastructure.dept-can-apply-max}")
|
||||
private Integer infrastructureMax;
|
||||
|
||||
@Value("${reminders.interval}") // 流程发起后多少天允许催办
|
||||
private Integer interval;
|
||||
|
||||
@Autowired
|
||||
private TRemindersService tRemindersService;
|
||||
|
||||
|
||||
/**
|
||||
* 根据能力资源id获取该能力申请使用分页
|
||||
|
@ -146,30 +126,23 @@ public class TAbilityApplicationController {
|
|||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String")
|
||||
}
|
||||
@ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String")}
|
||||
)
|
||||
public Result<PageData<TAbilityApplicationDTO>> myPage(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页
|
||||
params.put("user_id", user == null ? null : user.getId());
|
||||
|
||||
//2022-12-28 西海岸个人中心-我的申请去除已过期申请
|
||||
if (Constant.ProjectPlace.TSINGTAO_XHA.equals(projectPlace)) {
|
||||
params.put("date", "xha");
|
||||
}
|
||||
|
||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||
List<TAbilityApplicationDTO> list =
|
||||
page.getList().stream().map(index -> {
|
||||
String inStanceIdSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag());
|
||||
Integer inStanceId =
|
||||
jdbcTemplate.queryForObject(inStanceIdSql, Integer.class);
|
||||
jdbcTemplate.queryForObject(String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s' LIMIT 1", index.getApplyFlag()), Integer.class);
|
||||
if (inStanceId == null) {
|
||||
return index;
|
||||
}
|
||||
|
||||
List<TAbilityApplicationDTO> dtos = tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
||||
List<TAbilityApplicationDTO> dtos =
|
||||
tAbilityApplicationService.getByInstanceId(inStanceId + "");
|
||||
if (!dtos.isEmpty()) {
|
||||
dtos.stream()
|
||||
.limit(1L)
|
||||
|
@ -181,6 +154,7 @@ public class TAbilityApplicationController {
|
|||
} else {
|
||||
index.setSystem("视频资源申请:" + index.getSystem());
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -191,60 +165,6 @@ public class TAbilityApplicationController {
|
|||
Boolean ended = jdbcTemplate.queryForObject(sql, Boolean.class);
|
||||
index.setEnded(Boolean.TRUE.equals(ended));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断该次申请是否存在驳回的子单
|
||||
*/
|
||||
// 该条申请的实例id列表
|
||||
String inStanceIdsSql = String.format("SELECT DISTINCT instance_id FROM t_ability_application WHERE apply_flag = '%s';", index.getApplyFlag());
|
||||
List<Map<String, Object>> inStanceIds = jdbcTemplate.queryForList(inStanceIdsSql);
|
||||
index.setBackToFirst(inStanceIds.stream().map(inStanceId_ -> {
|
||||
List<Task> listTask = taskService.createTaskQuery().processInstanceId(inStanceId_.get("instance_id").toString())
|
||||
.includeProcessVariables().includeTaskLocalVariables().list();
|
||||
return listTask.stream().anyMatch(task ->
|
||||
task.getProcessVariables().containsKey("backToFirst") ?
|
||||
(task.getProcessVariables().get("backToFirst") != null ? Boolean.valueOf(task.getProcessVariables().get("backToFirst").toString()) : Boolean.FALSE)
|
||||
: Boolean.FALSE
|
||||
);
|
||||
}).filter(i -> i).findAny().isPresent()); // 子单内是否存在驳回流程
|
||||
|
||||
/**
|
||||
* 处理催办条件与催办信息
|
||||
*/
|
||||
Optional<Task> nowTask = taskService.createTaskQuery().processInstanceId(index.getInstanceId())
|
||||
.orderByTaskCreateTime().desc().active().list().stream().findFirst(); // 尝试获取当前task
|
||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||
if (localDate == null) { // 未进行过催办
|
||||
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||
if (between <= interval) {
|
||||
logger.info("该任务未到允许催办的日期");
|
||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||
} else {
|
||||
index.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||
index.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
} else { // 进行过催办
|
||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||
if (between <= interval) { // 间隔天数小于限制天数
|
||||
index.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||
} else {
|
||||
index.setAllowReminders(Boolean.TRUE); // 不允许催办
|
||||
index.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
index.setAllowReminders(Boolean.FALSE);
|
||||
index.setDoneReminders(Boolean.FALSE);
|
||||
index.setNextRemindersDays(0);
|
||||
}
|
||||
return index;
|
||||
}).collect(Collectors.toList());
|
||||
page.setList(list);
|
||||
|
@ -286,20 +206,17 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("getByApplyFlag/{applyFlag}")
|
||||
@ApiOperation("根据申请标识获取能力申请信息")
|
||||
@LogOperation("根据申请标识获取能力申请信息")
|
||||
public Result<TAbilityApplicationV2DTO> getByApplyFlag(@PathVariable("applyFlag") String applyFlag, @RequestParam Map<String, Object> requestParams) {
|
||||
public Result<TAbilityApplicationV2DTO> getByApplyFlag(@PathVariable("applyFlag") String applyFlag) {
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
Map<String, Object> params = new HashMap<String, Object>() {
|
||||
{
|
||||
put("apply_flag", applyFlag); // 限定
|
||||
}
|
||||
};
|
||||
|
||||
/* 2022-11-16 去除对用户角色的判断,在后台能力统计处都可以看到申请详情
|
||||
// 非超级管理员,只出本人
|
||||
if (user.getSuperAdmin() == SuperAdminEnum.NO.value()) {
|
||||
params.put("user_id", user == null ? null : user.getId());
|
||||
}
|
||||
*/
|
||||
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
|
||||
Map<String, List<TAbilityApplicationDTO>> result = applicationDTOS.stream().collect(Collectors.groupingBy(t -> {
|
||||
SysDeptDTO sysDeptDTO = t.getResourceOwnerDept();
|
||||
|
@ -309,14 +226,6 @@ public class TAbilityApplicationController {
|
|||
return sysDeptDTO.getName();
|
||||
}
|
||||
}));
|
||||
|
||||
if (requestParams.containsKey("resourceDeptName") && StringUtils.isNotEmpty(requestParams.get("resourceDeptName").toString())) { // 限制只出该资源所属部门的申请情况
|
||||
Map<String, List<TAbilityApplicationDTO>> finalResult = result;
|
||||
result = new HashMap<String, List<TAbilityApplicationDTO>>() {{
|
||||
put(requestParams.get("resourceDeptName").toString(), finalResult.get(requestParams.get("resourceDeptName").toString()));
|
||||
}};
|
||||
}
|
||||
|
||||
if (applicationDTOS.isEmpty()) {
|
||||
return new Result<TAbilityApplicationV2DTO>().ok(null);
|
||||
}
|
||||
|
@ -330,10 +239,9 @@ public class TAbilityApplicationController {
|
|||
}
|
||||
}
|
||||
});
|
||||
Map<String, List<TAbilityApplicationDTO>> finalResult1 = result;
|
||||
Map<String, List<Map<String, Object>>> re = result.keySet().stream().map(index -> {
|
||||
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = finalResult1.get(index);
|
||||
if (tAbilityApplicationDTOList == null || tAbilityApplicationDTOList.isEmpty()) {
|
||||
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = result.get(index);
|
||||
if (tAbilityApplicationDTOList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
List<ResourceDTO> resourceDTOS = tAbilityApplicationDTOList.stream().filter(tAbilityApplicationDTO -> StringUtils.isEmpty(tAbilityApplicationDTO.getCameraList())) // 过滤非摄像头申请
|
||||
|
@ -386,7 +294,6 @@ public class TAbilityApplicationController {
|
|||
detailDTO.setExecutionId(task.getExecutionId());
|
||||
detailDTO.setProcessDefinitionId(task.getProcessDefinitionId());
|
||||
detailDTO.setComment("待审核");
|
||||
detailDTO.setTaskId(task.getId());
|
||||
final List<HistoryDetailDTO> taskHandleDetailInfo_ = new ArrayList<>();
|
||||
taskHandleDetailInfo_.add(detailDTO);
|
||||
taskHandleDetailInfo_.addAll(taskHandleDetailInfo);
|
||||
|
@ -394,18 +301,6 @@ public class TAbilityApplicationController {
|
|||
taskHandleDetailInfo = taskHandleDetailInfo_;
|
||||
}
|
||||
}
|
||||
AtomicReference<Boolean> allowReminders = new AtomicReference<>(Boolean.FALSE); // 是否允许催办
|
||||
AtomicReference<Boolean> doneReminders = new AtomicReference<>(Boolean.FALSE); // 是否已执行过催办
|
||||
AtomicReference<Integer> nextRemindersDays = new AtomicReference<>(0); // 下次催办多少天后
|
||||
|
||||
final Optional<Task> nowTaskRoot = taskService.createTaskQuery()
|
||||
.processInstanceId(tAbilityApplicationDTOList.get(0).getInstanceId())
|
||||
.orderByTaskCreateTime()
|
||||
.desc()
|
||||
.active()
|
||||
.list()
|
||||
.stream()
|
||||
.findFirst(); // 尝试获取当前task
|
||||
|
||||
taskHandleDetailInfo = taskHandleDetailInfo.stream().map(index_ -> { // 补充审核人部门名称
|
||||
if (StringUtils.isNumeric(index_.getAssignee())) {
|
||||
|
@ -417,81 +312,13 @@ public class TAbilityApplicationController {
|
|||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 处理催办条件与催办信息
|
||||
*/
|
||||
Optional<Task> nowTask = taskService.createTaskQuery()
|
||||
.processInstanceId(index_.getProcessInstanceId())
|
||||
.taskId(index_.getTaskId()) // 每个任务
|
||||
.orderByTaskCreateTime()
|
||||
.desc()
|
||||
.active()
|
||||
.list()
|
||||
.stream()
|
||||
.findFirst(); // 尝试获取当前task
|
||||
if (nowTask.isPresent()) { // 存在正在进行的任务
|
||||
logger.info("该流程最新task:" + nowTask.get().getId());
|
||||
LocalDate localDate = tRemindersService.selectRemindersTime(nowTask.get().getId());
|
||||
if (localDate == null) { // 最新流程未进行过催办
|
||||
LocalDate taskCreateDate = nowTask.get().getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
long between = ChronoUnit.DAYS.between(taskCreateDate, LocalDate.now());
|
||||
if (between <= interval) {
|
||||
logger.info("该任务未到允许催办的日期");
|
||||
if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
|
||||
index_.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数为
|
||||
}
|
||||
allowReminders.set(Boolean.FALSE);
|
||||
doneReminders.set(Boolean.FALSE);
|
||||
nextRemindersDays.set((int) (interval - between));
|
||||
} else {
|
||||
if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
|
||||
allowReminders.set(Boolean.TRUE);
|
||||
doneReminders.set(Boolean.FALSE);
|
||||
nextRemindersDays.set(0);
|
||||
}
|
||||
index_.setAllowReminders(Boolean.TRUE); // 允许催办
|
||||
index_.setDoneReminders(Boolean.FALSE); // 不存在催办记录
|
||||
index_.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
} else { // 进行过催办
|
||||
long between = ChronoUnit.DAYS.between(localDate, LocalDate.now()); // 上次催办距离今天已过天数
|
||||
if (between <= interval) { // 间隔天数小于限制天数
|
||||
if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
|
||||
allowReminders.set(Boolean.FALSE);
|
||||
doneReminders.set(Boolean.TRUE);
|
||||
nextRemindersDays.set((int) (interval - between));
|
||||
}
|
||||
index_.setAllowReminders(Boolean.FALSE); // 不允许催办
|
||||
index_.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index_.setNextRemindersDays((int) (interval - between)); // 距离下次催办天数
|
||||
} else {
|
||||
if (nowTask.get().getId().equals(nowTaskRoot.get().getId())) {
|
||||
allowReminders.set(Boolean.TRUE);
|
||||
doneReminders.set(Boolean.TRUE);
|
||||
nextRemindersDays.set(0);
|
||||
}
|
||||
index_.setAllowReminders(Boolean.TRUE); // 不允许催办
|
||||
index_.setDoneReminders(Boolean.TRUE); // 存在催办记录
|
||||
index_.setNextRemindersDays(0); // 距离下次催办天数为0
|
||||
}
|
||||
}
|
||||
} else {
|
||||
index_.setAllowReminders(Boolean.FALSE);
|
||||
index_.setDoneReminders(Boolean.FALSE);
|
||||
index_.setNextRemindersDays(0);
|
||||
}
|
||||
return index_;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
boolean finalBackToFirst = backToFirst;
|
||||
List<HistoryDetailDTO> finalTaskHandleDetailInfo = taskHandleDetailInfo;
|
||||
return new LinkedHashMap<String, Object>() {
|
||||
return new HashMap<String, Object>() {
|
||||
{
|
||||
put("allowReminders", allowReminders.get());
|
||||
put("doneReminders", doneReminders.get());
|
||||
put("nextRemindersDays", nextRemindersDays.get());
|
||||
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
|
||||
put("resourceOwnerDept", tAbilityApplicationDTOList.get(0).getResourceOwnerDept()); // 资源所属部门信息
|
||||
put("resources", resourceDTOS);//申请的该部门的能力资源
|
||||
|
@ -616,223 +443,4 @@ public class TAbilityApplicationController {
|
|||
return new Result();
|
||||
}
|
||||
|
||||
@GetMapping("getApplyDeptList")
|
||||
@ApiOperation("/获取申请部门列表")
|
||||
@LogOperation("/获取申请部门列表")
|
||||
public Result getApplyDeptList() {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyDeptList());
|
||||
}
|
||||
|
||||
@GetMapping("/getApplyCameraList")
|
||||
@ApiOperation("西海岸-根据用户获取已申请摄像头列表")
|
||||
@LogOperation("西海岸-根据用户获取已申请摄像头列表")
|
||||
public Result getApplyCameraList() {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyCameraList());
|
||||
}
|
||||
|
||||
@PostMapping("/delApplyCamera")
|
||||
@ApiOperation("西海岸-用户删除已申请摄像头")
|
||||
@LogOperation("西海岸-用户删除已申请摄像头")
|
||||
public Result delApplyCamera(@RequestBody List<Long> ids) {
|
||||
tAbilityApplicationService.delApplyCamera(ids);
|
||||
return new Result().ok("删除成功。");
|
||||
}
|
||||
|
||||
@GetMapping("/getFundStatement")
|
||||
@ApiOperation("获取资金报表")
|
||||
@LogOperation("获取资金报表")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "provideDept", value = "提供部门", paramType = "query", dataType = "Long"),
|
||||
@ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "applyResult", value = "审核状态", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query", dataType = "INTEGER"),
|
||||
@ApiImplicitParam(name = "pageSize", value = "页数大小", paramType = "query", dataType = "INTEGER")
|
||||
})
|
||||
public Result getFundStatement(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getFundStatement(params));
|
||||
}
|
||||
|
||||
@GetMapping("/exportFundStatementTable")
|
||||
@ApiOperation("导出资金报表")
|
||||
@LogOperation("导出资金报表")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "provideDept", value = "提供部门", paramType = "query", dataType = "Long"),
|
||||
@ApiImplicitParam(name = "applyDept", value = "申请部门", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "resourceType", value = "资源类型", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "applyResult", value = "审核状态", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "resourceName", value = "资源名称", paramType = "query", dataType = "String")
|
||||
})
|
||||
public void exportFundStatementTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
|
||||
|
||||
List<Map> resultList = (List<Map>) tAbilityApplicationService.exportFundStatementTable(params);
|
||||
BigDecimal decimal = new BigDecimal(tAbilityApplicationDao.getFundStatementSum(params));
|
||||
BigDecimal divide = decimal.divide(new BigDecimal("10000"));
|
||||
divide = divide.setScale(1, RoundingMode.HALF_UP);
|
||||
List<List<Object>> date = resultList.stream().map(index -> {
|
||||
List<Object> data = new ArrayList<>();
|
||||
data.add(index.getOrDefault("resourceName", "") == null ? "" : index.getOrDefault("resourceName", "").toString());
|
||||
data.add(index.getOrDefault("resourceType", "") == null ? "" : index.getOrDefault("resourceType", "").toString());
|
||||
data.add(index.getOrDefault("applyResult", "") == null ? "" : index.getOrDefault("applyResult", "").toString());
|
||||
data.add(index.getOrDefault("provideDept", "") == null ? "" : index.getOrDefault("provideDept", "").toString());
|
||||
data.add(index.getOrDefault("applyDept", "") == null ? "" : index.getOrDefault("applyDept", "").toString());
|
||||
data.add(index.getOrDefault("applyDate", "") == null ? "" : index.getOrDefault("applyDate", "").toString());
|
||||
data.add(index.getOrDefault("applyPrice", "") == null ? "" : index.getOrDefault("applyPrice", "").toString());
|
||||
return data;
|
||||
}).collect(Collectors.toList());
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("UCS节约资金报表" + DateUtils.format(new Date(), "yyyyMMdd"), "UTF-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
EasyExcel.write(response.getOutputStream()).head(exportSelectCensusApplyTableHead(divide))
|
||||
.registerWriteHandler(new CustomCellWriteWeightConfig())
|
||||
.registerWriteHandler(new CustomCellWriteHeightConfig())
|
||||
.sheet("资金报表").doWrite(date);
|
||||
}
|
||||
|
||||
|
||||
private List<List<String>> exportSelectCensusApplyTableHead(BigDecimal priceTotal) {
|
||||
|
||||
String total = "累计节省财政资金约" + priceTotal + "万元";
|
||||
List<List<String>> list = new ArrayList<>();
|
||||
List<String> head0 = new ArrayList<>(Arrays.asList(total, "资源名称"));
|
||||
List<String> head1 = new ArrayList<>(Arrays.asList(total, "资源类型"));
|
||||
List<String> head2 = new ArrayList<>(Arrays.asList(total, "审核状态"));
|
||||
List<String> head3 = new ArrayList<>(Arrays.asList(total, "提供部门"));
|
||||
List<String> head4 = new ArrayList<>(Arrays.asList(total, "申请部门"));
|
||||
List<String> head5 = new ArrayList<>(Arrays.asList(total, "申请时间"));
|
||||
List<String> head6 = new ArrayList<>(Arrays.asList(total, "参考价格(元)"));
|
||||
list.add(head0);
|
||||
list.add(head1);
|
||||
list.add(head2);
|
||||
list.add(head3);
|
||||
list.add(head4);
|
||||
list.add(head5);
|
||||
list.add(head6);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDistrictFundStatement")
|
||||
@ApiOperation("获取区市资金报表")
|
||||
@LogOperation("获取区市资金报表")
|
||||
public Result getDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
@GetMapping("/getComponentFundStatement")
|
||||
@ApiOperation("获取组件节约资金列表")
|
||||
@LogOperation("获取组件节约资金列表")
|
||||
public Result getComponentFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getComponentFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getResourceFundStatement")
|
||||
@ApiOperation("获取应用资源节约资金列表")
|
||||
@LogOperation("获取应用资源节约资金列表")
|
||||
public Result getResourceFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getResourceFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getInfrastructureFundStatement")
|
||||
@ApiOperation("获取基础设施节约资金列表")
|
||||
@LogOperation("获取基础设施节约资金列表")
|
||||
public Result getInfrastructureFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getInfrastructureFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getProvideDeptFundStatement")
|
||||
@ApiOperation("获取提供部门节约资金列表")
|
||||
@LogOperation("获取提供部门节约资金列表")
|
||||
public Result getProvideDeptFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getProvideDeptFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getApplyDeptFundStatement")
|
||||
@ApiOperation("获取申请部门节约资金列表")
|
||||
@LogOperation("获取申请部门节约资金列表")
|
||||
public Result getApplyDeptFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyDeptFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getProvideDistrictFundStatement")
|
||||
@ApiOperation("获取提供区市节约资金列表")
|
||||
@LogOperation("获取提供区市节约资金列表")
|
||||
public Result getProvideDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getProvideDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getApplyDistrictFundStatement")
|
||||
@ApiOperation("获取申请区市节约资金列表")
|
||||
@LogOperation("获取申请区市节约资金列表")
|
||||
public Result getApplyDistrictFundStatement(Map<String, Object> params) {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyDistrictFundStatement(params));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getApplyPriceCount")
|
||||
@ApiOperation("资金报表大屏获取总节约资金")
|
||||
@LogOperation("资金报表大屏获取总节约资金")
|
||||
public Result getApplyPriceCount() {
|
||||
return new Result().ok(tAbilityApplicationService.getApplyPriceCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据能力资源id获取该能力申请使用分页
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("page_for_score")
|
||||
@ApiOperation("用于评分的分页")
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "oneEnded", value = "是否完成(true, false)", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "score", value = "是否已评分(true, false)", paramType = "query", dataType = "String")
|
||||
}
|
||||
)
|
||||
public Result<PageData<Map<String, Object>>> pageForScore(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||
final UserDetail user = SecurityUser.getUser();
|
||||
params.put("user_id", user == null ? null : user.getId());
|
||||
PageData<TAbilityApplicationDTO> page = tAbilityApplicationService.page(params);
|
||||
List<Map<String, Object>> mapList = page.getList().stream().map(index -> {
|
||||
Map<String, Object> temp = new LinkedHashMap<>();
|
||||
temp.put("applyNumber", index.getApplyNumber());
|
||||
temp.put("approveStatus", index.getApproveStatus());
|
||||
temp.put("createDate", index.getCreateDate());
|
||||
temp.put("system", index.getSystem());
|
||||
temp.put("resourceId", index.getResourceId());
|
||||
ResourceDTO resourceDTO = resourceService.get(Long.parseLong(index.getResourceId()));
|
||||
try {
|
||||
temp.put("resourceDept", sysDeptService.get(resourceDTO.getDeptId()).getName());
|
||||
} catch (Exception exception) {
|
||||
temp.put("resourceDept", "-");
|
||||
}
|
||||
temp.put("description", resourceDTO.getDescription());
|
||||
if ("应用资源".equals(resourceDTO.getType())) {
|
||||
temp.put("resourceTYpe", "应用资源");
|
||||
} else if ("组件服务".equals(resourceDTO.getType())) {
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONObject.toJSONString(resourceDTO.getInfoList()));
|
||||
Optional<String> optional = jsonArray.stream().map(index_ -> (JSONObject) index_).filter(index_ -> "组件类型".equals(index_.getString("attrType"))).map(index_ -> index_.getString("attrValue")).findFirst();
|
||||
if (optional.isPresent()) {
|
||||
temp.put("resourceTYpe", optional.get());
|
||||
}
|
||||
}
|
||||
return temp;
|
||||
}).collect(Collectors.toList());
|
||||
PageData<Map<String, Object>> pageData = new PageData<>(mapList, page.getTotal());
|
||||
return new Result<PageData<Map<String, Object>>>().ok(pageData);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package io.renren.modules.processForm.controller;
|
||||
|
||||
import io.renren.common.annotation.LogOperation;
|
||||
import io.renren.common.utils.Result;
|
||||
import io.renren.modules.processForm.dto.WillApplyCameraDTO;
|
||||
import io.renren.modules.processForm.entity.WillApplyCameraEntity;
|
||||
import io.renren.modules.processForm.service.WillApplyCameraService;
|
||||
import io.renren.modules.security.user.SecurityUser;
|
||||
import io.renren.modules.security.user.UserDetail;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/willApplyCamera")
|
||||
@Api(tags = "西海岸待申请摄像头")
|
||||
public class WillApplyCameraController {
|
||||
|
||||
@Autowired
|
||||
private WillApplyCameraService willApplyCameraService;
|
||||
|
||||
@GetMapping("/select")
|
||||
@LogOperation("/查询")
|
||||
@ApiOperation("/查询")
|
||||
public Result select() {
|
||||
UserDetail user = SecurityUser.getUser();
|
||||
return new Result().ok(willApplyCameraService.selectByUserId(user.getId()));
|
||||
}
|
||||
|
||||
@PostMapping("/batchInsert")
|
||||
@ApiOperation("/保存")
|
||||
@LogOperation("/保存")
|
||||
public Result batchInsert(@RequestBody List<WillApplyCameraDTO> willApplyCameraDTOList) {
|
||||
ArrayList<WillApplyCameraEntity> list = new ArrayList<>();
|
||||
willApplyCameraDTOList.forEach(index -> {
|
||||
WillApplyCameraEntity cameraEntity = new WillApplyCameraEntity();
|
||||
BeanUtils.copyProperties(index, cameraEntity);
|
||||
cameraEntity.setUserId(SecurityUser.getUserId());
|
||||
cameraEntity.setDelFlag(0);
|
||||
list.add(cameraEntity);
|
||||
});
|
||||
willApplyCameraService.insertBatch(list);
|
||||
return new Result().ok("数据保存成功。");
|
||||
}
|
||||
|
||||
@PostMapping("/batchDelete")
|
||||
@ApiOperation("/删除")
|
||||
@LogOperation("/删除")
|
||||
public Result batchDelete(@RequestBody List<Long> ids) {
|
||||
willApplyCameraService.deleteBatchIds(ids);
|
||||
return new Result().ok("数据删除成功。");
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,6 @@ package io.renren.modules.processForm.dao;
|
|||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -46,42 +45,4 @@ public interface TAbilityApplicationDao extends BaseDao<TAbilityApplicationEntit
|
|||
Long countUserResourceApply(Long userId, Long resourceId);
|
||||
|
||||
Integer getDeptInfrastructureApply(Long deptId);
|
||||
|
||||
List<Long> getInstanceIdByResId(Long id);
|
||||
|
||||
List<Map> getApplyDeptList();
|
||||
|
||||
List<Map> getApplyCameraList(@Param("userId") Long userId, @Param("date") String date);
|
||||
|
||||
Integer delApplyCamera(@Param("ids") List<Long> ids);
|
||||
|
||||
Integer countUserCameraApply(@Param("userId") Long userId, @Param("resourceId") Long resourceId, @Param("today") String today);
|
||||
|
||||
List<Map> getFundStatement(@Param("params") Map<String, Object> params);
|
||||
|
||||
Long getFundStatementSum(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<Map> exportFundStatementTable(@Param("params") Map<String, Object> params);
|
||||
|
||||
Long getFundStatementCount(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<Map> getDistrictFundStatement();
|
||||
|
||||
List<Map> getComponentFundStatement();
|
||||
|
||||
List<Map> getResourceFundStatement();
|
||||
|
||||
List<Map> getInfrastructureFundStatement();
|
||||
|
||||
List<Map> getProvideDeptFundStatement();
|
||||
|
||||
List<Map> getApplyDeptFundStatement();
|
||||
|
||||
List<Map> getProvideDistrictFundStatement();
|
||||
|
||||
List<Map> getApplyDistrictFundStatement();
|
||||
|
||||
Long getApplyPriceCount();
|
||||
|
||||
Long getResourceFundStatementTotal();
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package io.renren.modules.processForm.dao;
|
||||
|
||||
import io.renren.common.dao.BaseDao;
|
||||
import io.renren.modules.processForm.entity.WillApplyCameraEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface WillApplyCameraDao extends BaseDao<WillApplyCameraEntity> {
|
||||
|
||||
List<Map> select(@Param("userId") Long userId);
|
||||
}
|
|
@ -7,7 +7,6 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -94,18 +93,4 @@ public class TAbilityApplicationDTO extends AuditingBaseDTO implements Serializa
|
|||
|
||||
@ApiModelProperty(value = "过期时间")
|
||||
private Date expireDate;
|
||||
|
||||
@ApiModelProperty(value = "申请价格")
|
||||
private BigDecimal applyPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 催办功能增加字段
|
||||
*/
|
||||
@ApiModelProperty(value = "该流程的节点当前是否允许催办")
|
||||
private Boolean allowReminders;
|
||||
@ApiModelProperty(value = "该流程的节点当前是否已经进行过催办")
|
||||
private Boolean doneReminders;
|
||||
@ApiModelProperty(value = "该流程的节点需几天后进行催办")
|
||||
private Integer nextRemindersDays;
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package io.renren.modules.processForm.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "西海岸待申请摄像头")
|
||||
public class WillApplyCameraDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
private String cameraPointTypeName;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private Integer checkStatus;
|
||||
|
||||
private String gpsX;
|
||||
|
||||
private String gpsY;
|
||||
|
||||
private String idtCameraChannel;
|
||||
|
||||
private String managementUnitName;
|
||||
|
||||
private String nodeName;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long creator;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long updater;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
}
|
|
@ -9,7 +9,6 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -137,10 +136,4 @@ public class TAbilityApplicationEntity extends BaseEntity implements Serializabl
|
|||
* 过期时间
|
||||
*/
|
||||
private Date expireDate;
|
||||
|
||||
/**
|
||||
* 申请价格
|
||||
*/
|
||||
private BigDecimal applyPrice;
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package io.renren.modules.processForm.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName(value = "t_will_apply_camera", autoResultMap = true)
|
||||
public class WillApplyCameraEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Integer delFlag;
|
||||
|
||||
private String cameraPointTypeName;
|
||||
|
||||
private String channelCode;
|
||||
|
||||
private String channelId;
|
||||
|
||||
private String channelName;
|
||||
|
||||
private Integer checkStatus;
|
||||
|
||||
@TableField("gpsX")
|
||||
private String gpsX;
|
||||
|
||||
@TableField("gpsY")
|
||||
private String gpsY;
|
||||
|
||||
private String idtCameraChannel;
|
||||
|
||||
private String managementUnitName;
|
||||
|
||||
private String nodeName;
|
||||
|
||||
private String parentId;
|
||||
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long creator;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createDate;
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Long updater;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateDate;
|
||||
}
|
|
@ -236,15 +236,15 @@ public class CorrectionListenerV3 implements TaskListener, ExecutionListener, Ac
|
|||
|
||||
List<HistoricActivityInstance> historicActivityInstanceList = historyService.createHistoricActivityInstanceQuery().processInstanceId(delegateTask.getProcessInstanceId())
|
||||
.activityType("userTask").unfinished().orderByHistoricActivityInstanceEndTime().desc().list();
|
||||
if (!historicActivityInstanceList.isEmpty() && historicActivityInstanceList.get(0).getAssignee().equals(assignee)) {
|
||||
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人重复,默认通过");
|
||||
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
|
||||
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
|
||||
taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());
|
||||
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
|
||||
sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1);
|
||||
return;
|
||||
}
|
||||
//if (!historicActivityInstanceList.isEmpty() && historicActivityInstanceList.get(0).getAssignee().equals(assignee)) {
|
||||
// taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人重复,默认通过");
|
||||
// taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
|
||||
// taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
|
||||
// taskService.setVariable(delegateTask.getId(), "autoApply", delegateTask.getId());
|
||||
// taskService.complete(delegateTask.getId(), delegateTask.getVariables());
|
||||
// sysNoticeService.updateApplyStateById(delegateTask.getProcessInstanceId(), 1);
|
||||
// return;
|
||||
//}
|
||||
|
||||
List<TAbilityApplicationDTO> dtoList = delegateTask.getVariable("tAbilityApplicationDTOList", List.class);
|
||||
Optional<TAbilityApplicationDTO> tAbilityApplicationDTO = dtoList.stream().filter(index -> {
|
||||
|
|
|
@ -51,39 +51,4 @@ public interface TAbilityApplicationService extends CrudService<TAbilityApplicat
|
|||
* @return
|
||||
*/
|
||||
Integer getDeptInfrastructureApply(Long deptId);
|
||||
|
||||
/**
|
||||
* 获取申请能力部门列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Object getApplyDeptList();
|
||||
|
||||
Object getApplyCameraList();
|
||||
|
||||
void delApplyCamera(List<Long> ids);
|
||||
|
||||
Integer countUserCameraApply(Long userId, Long resourceId, String today);
|
||||
|
||||
Object getFundStatement(Map<String, Object> params);
|
||||
|
||||
Object exportFundStatementTable(Map<String, Object> params);
|
||||
|
||||
Object getDistrictFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getComponentFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getResourceFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getInfrastructureFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getProvideDeptFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getApplyDeptFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getProvideDistrictFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getApplyDistrictFundStatement(Map<String, Object> params);
|
||||
|
||||
Object getApplyPriceCount();
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package io.renren.modules.processForm.service;
|
||||
|
||||
import io.renren.common.service.CrudService;
|
||||
import io.renren.modules.processForm.dto.WillApplyCameraDTO;
|
||||
import io.renren.modules.processForm.entity.WillApplyCameraEntity;
|
||||
|
||||
public interface WillApplyCameraService extends CrudService<WillApplyCameraEntity, WillApplyCameraDTO> {
|
||||
|
||||
Object selectByUserId(Long id);
|
||||
}
|
|
@ -73,7 +73,7 @@ public class JuApiGateway implements ApiGateway {
|
|||
HashSet supportMethod = Sets.newHashSet("POST", "GET");
|
||||
|
||||
if (StringUtils.isBlank(apiUrl) || deptId == null || deptId == 0 || StringUtils.isBlank(methods) || !supportMethod.contains(methods)) {
|
||||
String msg = String.format("注册api参数为空,跳过 apiUrl:%s, deptId:%d methods:%s, resourceId:%s", apiUrl, deptId, methods, resourceId);
|
||||
String msg = String.format("注册api参数为空,跳过 apiUrl:%s, deptId:%ld methods:%s, resourceId:%s", apiUrl, deptId, methods, resourceId);
|
||||
|
||||
//重要参数没有当成不需要注册
|
||||
log.info(msg);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue