From f7d13453ddec5e58b64f5170d52e204e698c00f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Wed, 28 Jun 2023 09:04:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A5=A8=E6=8D=AE=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=B5=8F=E8=A7=88=E5=8F=8A=E7=AB=99=E7=82=B9=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E5=94=AF=E4=B8=80=E6=95=88=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceimpl/DefectProcessServiceImpl.java | 2 +- .../MachineryTicketProcessServiceImpl.java | 2 +- .../serviceimpl/MaintenanceProcessServiceImpl.java | 2 +- .../serviceimpl/OneTicketProcessServiceImpl.java | 2 +- .../OperationTicketProcessServiceImpl.java | 2 +- .../hzims-middle/src/main/resources/db/1.0.0.sql | 67 ++ .../hzims-middle/src/main/resources/db/newsql.sql | 67 -- .../service/impl/MaintenanceServiceImpl.java | 27 +- .../station/controller/StationController.java | 311 +++---- .../station/service/IStationService.java | 9 + .../station/service/impl/StationServiceImpl.java | 29 +- .../controller/TicketMatterGroupController.java | 20 +- .../library/service/ITicketMatterGroupService.java | 10 + .../service/impl/TicketMatterGroupServiceImpl.java | 973 ++++++++++++++------- .../service/impl/OperationTicketServiceImpl.java | 24 +- .../twoTicket/service/TicketProcessService.java | 10 + .../service/impl/TicketProcessServiceImpl.java | 2 - .../ticket/src/main/resources/db/1.0.0.sql | 180 ++++ .../ticket/src/main/resources/db/newsql.sql | 180 ---- 19 files changed, 1157 insertions(+), 762 deletions(-) create mode 100644 hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql delete mode 100644 hzims-service/hzims-middle/src/main/resources/db/newsql.sql create mode 100644 hzims-service/ticket/src/main/resources/db/1.0.0.sql delete mode 100644 hzims-service/ticket/src/main/resources/db/newsql.sql diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java index 95bab8f..97a1266 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java @@ -47,7 +47,7 @@ public class DefectProcessServiceImpl extends ProcessAbstractService { log.info("已执行消缺工作流程环节操作~~~~"); return true; } - log.error("未是否执行消缺工作流流程环节操作,请联系管理员~~~~"); + log.error("未执行消缺工作流流程环节操作,请联系管理员~~~~"); return false; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java index 42d6ed1..48d0154 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MachineryTicketProcessServiceImpl.java @@ -50,7 +50,7 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService { log.info("已执行水力机械工作票流程环节操作~~~~"); return true; } - log.error("未是否执行水力机械工作票流程环节操作,请联系管理员~~~~"); + log.error("未执行水力机械工作票流程环节操作,请联系管理员~~~~"); return false; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java index 2e99908..972e37b 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/MaintenanceProcessServiceImpl.java @@ -47,7 +47,7 @@ public class MaintenanceProcessServiceImpl extends ProcessAbstractService { log.info("已执行日常维护流程环节操作~~~~"); return true; } - log.error("未是否执行日常维护流程环节操作,请联系管理员~~~~"); + log.error("未执行日常维护流程环节操作,请联系管理员~~~~"); return false; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java index 2b4df40..600e82d 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OneTicketProcessServiceImpl.java @@ -55,7 +55,7 @@ public class OneTicketProcessServiceImpl extends ProcessAbstractService { log.info("已执行工作票流程环节操作~~~~"); return true; } - log.error("未是否执行工作票流程环节操作,请联系管理员~~~~"); + log.error("未执行工作票流程环节操作,请联系管理员~~~~"); return false; } diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java index 1d8d70b..608f866 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/OperationTicketProcessServiceImpl.java @@ -51,7 +51,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService { log.info("已执行操作票流程环节操作~~~~"); return true; } - log.error("未是否执行操作票流程环节操作,请联系管理员~~~~"); + log.error("未执行操作票流程环节操作,请联系管理员~~~~"); return false; } diff --git a/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql b/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql new file mode 100644 index 0000000..ac22bdf --- /dev/null +++ b/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql @@ -0,0 +1,67 @@ +SET FOREIGN_KEY_CHECKS=0; + +CREATE TABLE `hzims-middle`.`hzims_process_type` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `sequence` int(11) NOT NULL COMMENT '序号', + `deployment_id` varchar(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程key', + `deployment_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程名称', + `segment` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一个流程图的名称', + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', + `is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流审批类型' ROW_FORMAT = Dynamic; + +ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `module_name_num` int(11) NULL DEFAULT 0 COMMENT '功能模块统计' AFTER `module_name`; + +ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `date_calculated` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '统计日期' AFTER `module_name_num`; + +ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title`; + +ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title_num`; + +ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path`; + +ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path_num`; + +ALTER TABLE `hzims-middle`.`hzims_sys_log` ENGINE = MyISAM; + +ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_operation_time_index`(`operation_time`) USING BTREE; + +ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_module_name_index`(`module_name`) USING BTREE; + +ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_title_index`(`title`) USING BTREE; + +CREATE TABLE `hzims-middle`.`hzims_workflow_operation_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `take_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务ID', + `take_name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称', + `process_definition_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程ID', + `process_instance_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '实例key', + `next_step_operator` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一环节处理人', + `variables` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '表单', + `user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id', + `handleType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', + `is_deleted` tinyint(4) NULL DEFAULT NULL COMMENT '是否逻辑删除,0 可用,1. 不可用', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流操作日志' ROW_FORMAT = Dynamic; + +CREATE TABLE `hzims-middle`.`process_dict` ( + `dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '票据编码', + `dict_sort` int(4) NULL DEFAULT 0 COMMENT '票据排序', + `dict_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据字典码', + `dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据流程标识', + `dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据标签', + `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据类型', + `is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', + `status` tinyint(1) NULL DEFAULT 0 COMMENT '状态(0正常 1停用)', + `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '所属机构', + `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '票据备注', + PRIMARY KEY (`dict_code`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流字典表' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file diff --git a/hzims-service/hzims-middle/src/main/resources/db/newsql.sql b/hzims-service/hzims-middle/src/main/resources/db/newsql.sql deleted file mode 100644 index ac22bdf..0000000 --- a/hzims-service/hzims-middle/src/main/resources/db/newsql.sql +++ /dev/null @@ -1,67 +0,0 @@ -SET FOREIGN_KEY_CHECKS=0; - -CREATE TABLE `hzims-middle`.`hzims_process_type` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `sequence` int(11) NOT NULL COMMENT '序号', - `deployment_id` varchar(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程key', - `deployment_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前流程名称', - `segment` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一个流程图的名称', - `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - `is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流审批类型' ROW_FORMAT = Dynamic; - -ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `module_name_num` int(11) NULL DEFAULT 0 COMMENT '功能模块统计' AFTER `module_name`; - -ALTER TABLE `hzims-middle`.`hzims_statistics` MODIFY COLUMN `date_calculated` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '统计日期' AFTER `module_name_num`; - -ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title`; - -ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `title_num`; - -ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path`; - -ALTER TABLE `hzims-middle`.`hzims_statistics` DROP COLUMN `path_num`; - -ALTER TABLE `hzims-middle`.`hzims_sys_log` ENGINE = MyISAM; - -ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_operation_time_index`(`operation_time`) USING BTREE; - -ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_module_name_index`(`module_name`) USING BTREE; - -ALTER TABLE `hzims-middle`.`hzims_sys_log` ADD INDEX `hzims_sys_log_title_index`(`title`) USING BTREE; - -CREATE TABLE `hzims-middle`.`hzims_workflow_operation_log` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `take_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务ID', - `take_name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称', - `process_definition_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前环节流程ID', - `process_instance_key` char(160) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '实例key', - `next_step_operator` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一环节处理人', - `variables` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '表单', - `user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id', - `handleType` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - `is_deleted` tinyint(4) NULL DEFAULT NULL COMMENT '是否逻辑删除,0 可用,1. 不可用', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流操作日志' ROW_FORMAT = Dynamic; - -CREATE TABLE `hzims-middle`.`process_dict` ( - `dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '票据编码', - `dict_sort` int(4) NULL DEFAULT 0 COMMENT '票据排序', - `dict_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据字典码', - `dict_value` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据流程标识', - `dict_label` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据标签', - `dict_type` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '票据类型', - `is_default` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否默认(Y是 N否)', - `status` tinyint(1) NULL DEFAULT 0 COMMENT '状态(0正常 1停用)', - `create_dept` bigint(20) NULL DEFAULT NULL COMMENT '所属机构', - `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '票据备注', - PRIMARY KEY (`dict_code`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作流字典表' ROW_FORMAT = Dynamic; - -SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java index 0578a39..ffcd825 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.maintenance.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; @@ -128,7 +129,10 @@ public class MaintenanceServiceImpl implements MaintenanceService { OperMaintenanceTaskEntityVo standardTicketInfoVo = null; try { JSONObject jsonObject = JSONObject.parseObject(formData); - standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class); + standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("operMaintenanceTaskEntityVo"), + new TypeReference(){}); + // standardTicketInfoVo = (OperMaintenanceTaskEntityVo) jsonObject.get("operMaintenanceTaskEntityVo"); + // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, OperMaintenanceTaskEntityVo.class); } catch (Exception e) { log.error("获取表单出现异常了~~~~"); throw new IllegalArgumentException(e.getMessage()); @@ -140,8 +144,8 @@ public class MaintenanceServiceImpl implements MaintenanceService { log.error("获取日常维护数据不存在"); return; } - OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity(); - BeanUtils.copyProperties(standardTicketInfoVo,entity); + OperMaintenanceTaskEntity entity = new OperMaintenanceTaskEntity(); + BeanUtils.copyProperties(standardTicketInfoVo, entity); entity.setId(id); //填充日常维护信息 saveOperMaintenanceTaskEntity(entity, response); @@ -211,7 +215,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { log.info("================================================"); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); if (!booleanR.isSuccess()) { - throw new ServiceException("消息推送失败"); + throw new ServiceException("消息推送失败"); } log.info("推送成功~"); } @@ -220,6 +224,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { /** * 填充日常维护信息 + * * @param entity * @param response */ @@ -228,7 +233,9 @@ public class MaintenanceServiceImpl implements MaintenanceService { //如果response.getHandleType() 是0使用户 entity.setFlowUserId(response.getUserId()); entity.setNextStepOperator(response.getNextStepOperator()); - flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); + if (response.getNextStepOperator() != null) { + flowDescription = "审批中,当前环节是".concat(response.getTaskName()).concat(",待").concat(response.getNextStepOperator()).concat("审批"); + } //如果taskId为空 String taskId = response.getTaskId(); if (StringUtils.isEmpty(taskId)) { @@ -319,7 +326,6 @@ public class MaintenanceServiceImpl implements MaintenanceService { } - /** * 开启一个流程实例 * @@ -327,8 +333,8 @@ public class MaintenanceServiceImpl implements MaintenanceService { **/ private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) { OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo(); - BeanUtils.copyProperties(taskEntity,operMaintenanceTaskEntityVo); - Map params = new HashMap<>(); + BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); + Map params = new HashMap<>(); params.put("taskId", taskEntity.getId()); List userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> { @@ -338,16 +344,15 @@ public class MaintenanceServiceImpl implements MaintenanceService { params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, - String.valueOf(taskEntity.getId()),taskEntity.getTitle(), params) + String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params) .getData() .getProcessInstanceId(); } - - /** * 推送日常维护任务消息 + * * @return void * @Param taskEntity 日常维护任务 **/ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java index 17aa337..b204bbf 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java @@ -1,4 +1,4 @@ - package com.hnac.hzims.operational.station.controller; +package com.hnac.hzims.operational.station.controller; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -13,6 +13,7 @@ import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.service.IStationService; import com.hnac.hzims.operational.station.vo.StationVO; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; @@ -44,47 +45,47 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/station") @AllArgsConstructor -@Api(value = "站点",tags = "站点管理") +@Api(value = "站点", tags = "站点管理") @Slf4j public class StationController extends BladeController { - private final IStationService stationService; - - private final HzimsDataService dataServicel; - - private final IMainSystemMonitoringService mainSystemMonitoringService; - - /** - * 分页 代码自定义代号 - */ - @ApiLog - @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) - @ApiOperationSupport(order = 10) - @ApiOperation(value = "分页", notes = "传入StationEntity") - @OperationAnnotation( - moduleName = "站点管理", - title = "水电站点管理",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE, - action = "分页查询") - public R> list(StationEntity entity, Query query) { - IPage vos = stationService.list(entity,query); - return R.data(vos); - } - - @GetMapping("/detail/{id}") - // @ApiOperationSupport(order = 60) - @ApiOperation(value = "查看详情", notes = "查看详情") - public R detail(@PathVariable @ApiParam("主键ID") Long id) { - return R.data(stationService.getById(id)); - } - - /** - * 新增 - */ - @PostMapping("/save") - @ApiOperationSupport(order = 20) - @ApiOperation(value = "新增") - public R save(@Valid @RequestBody StationEntity req) { - stationService.buildStation(req); - return R.success("保存成功!"); + private final IStationService stationService; + + private final HzimsDataService dataServicel; + + private final IMainSystemMonitoringService mainSystemMonitoringService; + + /** + * 分页 代码自定义代号 + */ + @ApiLog + @RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST}) + @ApiOperationSupport(order = 10) + @ApiOperation(value = "分页", notes = "传入StationEntity") + @OperationAnnotation( + moduleName = "站点管理", + title = "水电站点管理", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, + action = "分页查询") + public R> list(StationEntity entity, Query query) { + IPage vos = stationService.list(entity, query); + return R.data(vos); + } + + @GetMapping("/detail/{id}") + // @ApiOperationSupport(order = 60) + @ApiOperation(value = "查看详情", notes = "查看详情") + public R detail(@PathVariable @ApiParam("主键ID") Long id) { + return R.data(stationService.getById(id)); + } + + /** + * 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 20) + @ApiOperation(value = "新增") + public R save(@Valid @RequestBody StationEntity req) { + stationService.buildStation(req); + return R.success("保存成功!"); // List list = stationService.list(new LambdaQueryWrapper(){{ // eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName()); // }}); @@ -96,124 +97,136 @@ public class StationController extends BladeController { // return "success"; // }); // return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.save(req)); - } - - /** - * 修改 代码自定义代号 - */ - @PostMapping("/update") - @ApiOperationSupport(order = 30) - @ApiOperation(value = "修改", notes = "传入StationEntity") - public R update(@Valid @RequestBody StationEntity req) { - stationService.buildStation(req); - return R.success("修改成功!"); + } + + /** + * 修改 代码自定义代号 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 30) + @ApiOperation(value = "修改", notes = "传入StationEntity") + public R update(@Valid @RequestBody StationEntity req) { + stationService.buildStation(req); + return R.success("修改成功!"); // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); // queryWrapper.ne(StationEntity::getId,req.getId()); // queryWrapper.and(wrapper -> wrapper.eq(StationEntity::getCode,req.getCode()).or().eq(StationEntity::getName,req.getName())); // List list = stationService.list(queryWrapper); // return list.size()>0 ? R.fail(400,"该站点名/编码已有对应记录,请找到相应记录做修改处理") : R.status(stationService.updateById(req)); - } - - @PostMapping("/instanceProject") - @ApiOperationSupport(order = 60) - @ApiOperation(value = "实例化实时画面项目", notes = "站点信息") - public R instanceProject(@RequestBody StationEntity req) { - return R.status(stationService.instanceProject(req)); - } - - @PostMapping("/updateBatch") - @ApiOperationSupport(order = 30) - @ApiOperation(value = "批量修改", notes = "传入站点列表") - public R updateBatch(@RequestBody List req) { - for (StationEntity stationEntity : req) { - if(StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) { - List list = stationService.list(new LambdaQueryWrapper(){{ - eq(StationEntity::getCode,stationEntity.getCode()).or().eq(StationEntity::getName,stationEntity.getName()); - }}); - Assert.isTrue(CollectionUtil.isEmpty(list),()->{ - throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理"); - }); - } - } - return R.status(stationService.updateBatchById(req)); - } - - /** - * 删除 代码自定义代号 - */ - @PostMapping("/remove") - @ApiOperationSupport(order = 40) - @ApiOperation(value = "逻辑删除", notes = "传入id") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(stationService.removeStation(ids)); - } - - @GetMapping("/getStationByCode") - @ApiOperationSupport(order = 50) - @ApiOperation(value = "通过站点编码获取站点", notes = "传入站点code") - public R getStationByCode(@RequestParam("code") String code){ - return R.data(stationService.getStationByCode(code)); - } - - @ApiLog - @GetMapping(value = "/getList") - @ApiOperationSupport(order = 70) - @ApiOperation(value = "获取站点列表(不分页查询)", notes = "传入StationEntity") - public R> getList(StationEntity entity) { - LambdaQueryWrapper lwq = Condition.getQueryWrapper(new StationEntity(),entity); - if(Func.isNotEmpty(entity.getStatus())) { - lwq.eq(StationEntity::getStatus,entity.getStatus()); - } - return R.data(stationService.list(lwq)); - } - - @ApiLog - @GetMapping("/list/all") - @ApiOperationSupport(order = 80) - @ApiOperation(value = "查询所有", notes = "") - public R> listAll(){ - return R.data(stationService.getAll()); - } - - @ApiLog - @GetMapping("/listByServeType") - @ApiOperationSupport(order = 90) - @ApiOperation(value = "根据服务类型查询站点", notes = "") - public R> listByServeType(@RequestParam("serveType") Integer serveType){ - return R.data(stationService.doListByServeType(serveType)); - } - - @ApiLog - @GetMapping("/listByType") - @ApiOperationSupport(order = 90) - @ApiOperation(value = "根据服务类型查询站点", notes = "") - public R> listByType(){ - //获取水电站及泵站 - String type = "0,2"; - List list = stationService.list(new LambdaQueryWrapper() {{ - in(StationEntity::getType, Func.toStrList(type)); - }}); + } + + @PostMapping("/instanceProject") + @ApiOperationSupport(order = 60) + @ApiOperation(value = "实例化实时画面项目", notes = "站点信息") + public R instanceProject(@RequestBody StationEntity req) { + return R.status(stationService.instanceProject(req)); + } + + @PostMapping("/updateBatch") + @ApiOperationSupport(order = 30) + @ApiOperation(value = "批量修改", notes = "传入站点列表") + public R updateBatch(@RequestBody List req) { + for (StationEntity stationEntity : req) { + if (StringUtil.isNotBlank(stationEntity.getCode()) || StringUtil.isNotBlank(stationEntity.getName())) { + List list = stationService.list(new LambdaQueryWrapper() {{ + eq(StationEntity::getCode, stationEntity.getCode()).or().eq(StationEntity::getName, stationEntity.getName()); + }}); + Assert.isTrue(CollectionUtil.isEmpty(list), () -> { + throw new ServiceException(stationEntity.getId() + "下站点名/编码已有对应记录,请找到相应记录做修改处理"); + }); + } + } + return R.status(stationService.updateBatchById(req)); + } + + /** + * 删除 代码自定义代号 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 40) + @ApiOperation(value = "逻辑删除", notes = "传入id") + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { + return R.status(stationService.removeStation(ids)); + } + + @GetMapping("/getStationByCode") + @ApiOperationSupport(order = 50) + @ApiOperation(value = "通过站点编码获取站点", notes = "传入站点code") + public R getStationByCode(@RequestParam("code") String code) { + return R.data(stationService.getStationByCode(code)); + } + + @ApiLog + @GetMapping(value = "/getList") + @ApiOperationSupport(order = 70) + @ApiOperation(value = "获取站点列表(不分页查询)", notes = "传入StationEntity") + public R> getList(StationEntity entity) { + LambdaQueryWrapper lwq = Condition.getQueryWrapper(new StationEntity(), entity); + if (Func.isNotEmpty(entity.getStatus())) { + lwq.eq(StationEntity::getStatus, entity.getStatus()); + } + return R.data(stationService.list(lwq)); + } + + @ApiLog + @GetMapping("/list/all") + @ApiOperationSupport(order = 80) + @ApiOperation(value = "查询所有", notes = "") + public R> listAll() { + return R.data(stationService.getAll()); + } + + @ApiLog + @GetMapping("/listByServeType") + @ApiOperationSupport(order = 90) + @ApiOperation(value = "根据服务类型查询站点", notes = "") + public R> listByServeType(@RequestParam("serveType") Integer serveType) { + return R.data(stationService.doListByServeType(serveType)); + } + + @ApiLog + @GetMapping("/listByType") + @ApiOperationSupport(order = 90) + @ApiOperation(value = "根据服务类型查询站点", notes = "") + public R> listByType() { + //获取水电站及泵站 + String type = "0,2"; + List list = stationService.list(new LambdaQueryWrapper() {{ + in(StationEntity::getType, Func.toStrList(type)); + }}); /*BladeUser user = AuthUtil.getUser(); if(user.getAccount().equals("admin")){ return R.data(stationService.doListByTypes()); } List list = mainSystemMonitoringService.classifyUserDataScopeType(null, null, Func.toStrList(type));*/ - return R.data(list); - } - @ApiLog - @GetMapping("/getHomeStationList") - @ApiOperationSupport(order = 91) - @ApiOperation(value = "获取首页站点列表", notes = "") - public R> getHomeStationList(@RequestParam(value = "deptId",required = false) Long deptId,@RequestParam(value = "types",required = false) List types,@RequestParam(value = "serveType",required = false) Integer serveType){ - return R.data(stationService.getHomeStationList(deptId,types,serveType)); - } - - @ApiLog - @GetMapping("/select") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "下拉站点列表", notes = "") - public R> select(@RequestParam(value = "type",required = false) Integer type,@RequestParam(value = "serveType",required = false) Integer serveType){ - return R.data(stationService.select(type,serveType)); - } + return R.data(list); + } + + @ApiLog + @GetMapping("/getHomeStationList") + @ApiOperationSupport(order = 91) + @ApiOperation(value = "获取首页站点列表", notes = "") + public R> getHomeStationList(@RequestParam(value = "deptId", required = false) Long deptId, @RequestParam(value = "types", required = false) List types, @RequestParam(value = "serveType", required = false) Integer serveType) { + return R.data(stationService.getHomeStationList(deptId, types, serveType)); + } + + @ApiLog + @GetMapping("/select") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "下拉站点列表", notes = "") + public R> select(@RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "serveType", required = false) Integer serveType) { + return R.data(stationService.select(type, serveType)); + } + + + /** + * 两票编号抬头唯一效验 + */ + @ApiModelProperty("两票编号抬头唯一效验") + @GetMapping("/uniqueStationByStation") + public R uniqueStationByStation(@RequestParam(value = "signage") String signage) { + stationService.uniqueStationByStation(signage); + return R.success("两票编号抬头不存在,可以创建"); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java index d4dc67e..2cb45e9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java @@ -125,4 +125,13 @@ public interface IStationService extends BaseService { * @return 站点 */ StationEntity getOne(StationEntity request); + + + /** + * 两票编号抬头唯一效验 + * @param signage 站点编号 + * @return + */ + void uniqueStationByStation(String signage); + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index 17d0b92..931484d 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -1,4 +1,4 @@ - package com.hnac.hzims.operational.station.service.impl; +package com.hnac.hzims.operational.station.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -98,8 +98,8 @@ public class StationServiceImpl extends BaseServiceImplquestionClient.submitStationInfo(req.getCode(), ""),"智能诊断站点推送").start(); - new Thread(()->this.instanceProject(req),"新建项目").start(); + new Thread(() -> questionClient.submitStationInfo(req.getCode(), ""), "智能诊断站点推送").start(); + new Thread(() -> this.instanceProject(req), "新建项目").start(); } } @@ -138,21 +138,21 @@ public class StationServiceImpl extends BaseServiceImpl deptResult = sysClient.getDept(stationEntity.getRefDept()); if (deptResult.isSuccess() && ObjectUtil.isNotEmpty(deptResult.getData())) { R projectResult = deptClient.deleteDeptById(stationEntity.getRefDept()); - if(!projectResult.isSuccess()) { + if (!projectResult.isSuccess()) { logger.info("hzims-operational:station:removeStation", stationEntity.getRefDept() + "所属机构删除失败,报错信息为:" + projectResult.getMsg()); } } // 清空 } - new Thread(()-> { + new Thread(() -> { // 删除站点下集中监控属性配置 stationAttributeService.removeByStationCode(stationEntity.getCode()); // 删除智能诊断站点 questionClient.deleteStationInfo(stationEntity.getCode()); // 删除智能诊断实例图信息 questionClient.deleteStationAnswer(stationEntity.getCode()); - },"删除站点集中监控属性").start(); + }, "删除站点集中监控属性").start(); return saveFlag; } @@ -692,4 +692,21 @@ public class StationServiceImpl extends BaseServiceImpl projectClient.delete()); // } } + + + /** + * 两票编号抬头唯一效验 + * + * @param signage 站点编号 + * @return + */ + @Override + public void uniqueStationByStation(String signage) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StationEntity::getSignage, signage); + Integer count = baseMapper.selectCount(queryWrapper); + if (count > 0){ + throw new ServiceException("两票编号抬头已存在"); + } + } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java index a7882b1..908efaa 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/controller/TicketMatterGroupController.java @@ -13,10 +13,7 @@ import com.hnac.hzims.ticket.library.vo.TicketMatterGroupVO; import com.hnac.hzims.ticket.library.wrapper.TicketMatterGroupWrapper; import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto; import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.boot.ctrl.BladeController; @@ -114,4 +111,19 @@ public class TicketMatterGroupController extends BladeController { public void preview(@RequestParam("id") Long id, @RequestParam("type") String type , HttpServletResponse response) throws Exception { service.preview(id, type, response); } + + + /** + * 票据模板预览 + */ + @GetMapping(value = "/newPreview/{id}/{type}/{status}") + @ApiOperationSupport(order = 70) + @ApiOperation(value = "票据模板预览") + public void newPreview(@ApiParam(name = "id",value = "编号") @PathVariable Long id, + @ApiParam(name = "type",value = "模板类型:2为工作票;1为操作票") @PathVariable Integer type, + @ApiParam(name = "status",value = "具体的模板") @PathVariable Integer status, + HttpServletResponse response){ + service.newPreview(id, type,status, response); + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java index 150f581..95b28f0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/library/service/ITicketMatterGroupService.java @@ -52,4 +52,14 @@ public interface ITicketMatterGroupService extends BaseService implements ITicketMatterGroupService { - /**word模板预览导出保存路径**/ - @Value("${hzims.ticket.path.xlsx.savePath}") - private String xlsSavePath; - - @Value("${hzims.ticket.path.pdf.savePath}") - private String pdfSavePath; - - //private final OssTemplate ossTemplate; - private final ITwoTicketMatterLibraryService twoTicketMatterLibraryService; - - - @Override - public R> queryList(TicketMatterGroupDTO req, Query query){ - LambdaQueryWrapper queryWrapper = this.getQueryWrapper(req); - IPage page = this.page(Condition.getPage(query),queryWrapper); - return R.data(page.setRecords(TicketMatterGroupWrapper.build().listVO(page.getRecords()))); - } - - @Override - public R detail(Long id){ - TicketMatterGroupEntity entity = getById(id); - TicketMatterGroupVO groupVO = TicketMatterGroupWrapper.build().entityVO(entity); - /**获取安措**/ - List libraryEntityList = twoTicketMatterLibraryService.list(new LambdaQueryWrapper(){{ - eq(TwoTicketMatterLibraryEntity::getMatterGroup,id); - orderByAsc(TwoTicketMatterLibraryEntity::getType); - orderByDesc(TwoTicketMatterLibraryEntity::getSort); - }}); - if(CollectionUtil.isNotEmpty(libraryEntityList)){ - Map> libraryMap = libraryEntityList.stream() - .sorted(Comparator.comparing(TwoTicketMatterLibraryEntity::getType).thenComparing(TwoTicketMatterLibraryEntity::getSort)).collect(Collectors.groupingBy(TwoTicketMatterLibraryEntity::getType)); - libraryMap.forEach((type,list)->{ - if(ONE_TYPE.equals(type)){ - groupVO.setMatterLibraryListOne(TwoTicketMatterLibraryWrapper.build().listVO(list)); - } - else if(TWO_TYPE.equals(type)){ - groupVO.setMatterLibraryListTwo(TwoTicketMatterLibraryWrapper.build().listVO(list)); - } - else if(THREE_TYPE.equals(type)){ - groupVO.setMatterLibraryListThree(TwoTicketMatterLibraryWrapper.build().listVO(list)); - } - }); - } - return R.data(groupVO); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public R updateById(TicketMatterGroupDTO req) { - TicketMatterGroupEntity groupEntity = BeanUtil.copy(req,TicketMatterGroupEntity.class); - updateById(groupEntity); - List libraryEntityList = new ArrayList<>(); - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListOne())){ - libraryEntityList.addAll(req.getMatterLibraryListOne().stream().map(libraryDto->BeanUtil.copy(libraryDto,TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListTwo())){ - libraryEntityList.addAll(req.getMatterLibraryListTwo().stream().map(libraryDto->BeanUtil.copy(libraryDto,TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListThree())){ - libraryEntityList.addAll(req.getMatterLibraryListThree().stream().map(libraryDto->BeanUtil.copy(libraryDto,TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); - } - List list = twoTicketMatterLibraryService.list(new LambdaQueryWrapper(){{ - eq(TwoTicketMatterLibraryEntity::getMatterGroup,req.getId()); - }}); - if(CollectionUtil.isNotEmpty(list)){ - //取出移除数据 - List subtractList = (List)CollectionUtils.subtract( - list.stream().map(TwoTicketMatterLibraryEntity::getId).collect(Collectors.toList()), - libraryEntityList.stream().map(TwoTicketMatterLibraryEntity::getId).collect(Collectors.toList()) - ); - if(CollectionUtil.isNotEmpty(subtractList)){ - twoTicketMatterLibraryService.deleteLogic(subtractList); - } - } - libraryEntityList.forEach(library->{ - if(Func.isEmpty(library.getId())){ - library.setMatterGroup(groupEntity.getId()); - } - }); - twoTicketMatterLibraryService.saveOrUpdateBatch(libraryEntityList); - return R.success("保存成功!"); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public R doSave(TicketMatterGroupDTO req) { - TicketMatterGroupEntity groupEntity = BeanUtil.copy(req,TicketMatterGroupEntity.class); - boolean flag = save(groupEntity); - if(!flag){ - throw new ServiceException("保存对象失败"); - } - /**组合安措、操作事项库列表**/ - List list = new ArrayList<>(); - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListOne())){ - list.addAll(req.getMatterLibraryListOne().stream().map(matterLibrary->{ - TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary,TwoTicketMatterLibraryEntity.class); - libraryEntity.setMatterGroup(groupEntity.getId()); - return libraryEntity; - }).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListTwo())){ - list.addAll(req.getMatterLibraryListTwo().stream().map(matterLibrary->{ - TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary,TwoTicketMatterLibraryEntity.class); - libraryEntity.setMatterGroup(groupEntity.getId()); - return libraryEntity; - }).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(req.getMatterLibraryListThree())){ - list.addAll(req.getMatterLibraryListThree().stream().map(matterLibrary->{ - TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary,TwoTicketMatterLibraryEntity.class); - libraryEntity.setMatterGroup(groupEntity.getId()); - return libraryEntity; - }).collect(Collectors.toList())); - } - twoTicketMatterLibraryService.saveBatch(list); - return R.success("保存成功!"); - } - - @Override - public void preview(Long id, String type, HttpServletResponse response) throws Exception { - Map params = new HashMap<>(); - R groupVOR = detail(id); - if(!groupVOR.isSuccess()){ - throw new ServiceException(groupVOR.getMsg()); - } - if(TicketConstants.WordFileNameEnum.WORK.getType().equals(type)){ - //若为工作票 - try{ - params = this.completeWorkTicketData(new WorkTicketInfoVO()); - } - catch(Exception e){ - throw new ServiceException("对象转换失败"); - } - TicketMatterGroupVO groupVO = groupVOR.getData(); - - //完善模板数据 - /**获取安措**/ - List libraryEntityList = twoTicketMatterLibraryService.list(new LambdaQueryWrapper(){{ - eq(TwoTicketMatterLibraryEntity::getMatterGroup,id); - orderByAsc(TwoTicketMatterLibraryEntity::getType); - orderByDesc(TwoTicketMatterLibraryEntity::getSort); - }}); - if(TicketConstants.WordFileNameEnum.SECOND_WORK.getType().equals(groupVO.getTicketType())) { - //第二种工作票 - params.put("measures", libraryEntityList.stream().map(TwoTicketMatterLibraryEntity::getSafetyMeasure).collect(Collectors.joining(","))); - params.put("workTicketContentDtoList", Lists.newArrayList()); - } - else if(TicketConstants.WordFileNameEnum.MECHANICAL_WORK.getType().equals(groupVO.getTicketType())) { - //机械工作票 - List> mapList = libraryEntityList.stream().map(measure -> { - Map result = PdfUtils.objectToMap(measure); - result.put("status", ""); - result.put("measure",measure.getSafetyMeasure()); - return result; - }).collect(Collectors.toList()); - log.info("机械工作票安措:{}", JSON.toJSONString(mapList)); - params.put("initMeasures",mapList); - } - - params.put("matterLibraryListOne",new ArrayList()); - params.put("matterLibraryListTwo",new ArrayList()); - params.put("matterLibraryListThree",new ArrayList()); - if(CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListOne())){ - params.put("matterLibraryListOne",groupVO.getMatterLibraryListOne().stream().map(library-> { - try { - Map map = PdfUtils.objectToMap(library); - map.put("status", " "); - return map; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - }).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListTwo())){ - params.put("matterLibraryListTwo",groupVO.getMatterLibraryListTwo().stream().map(library-> { - try { - Map map = PdfUtils.objectToMap(library); - map.put("status", " "); - return map; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - }).collect(Collectors.toList())); - } - if(CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListThree())){ - params.put("matterLibraryListThree",groupVO.getMatterLibraryListThree().stream().map(library-> { - try { - Map map = PdfUtils.objectToMap(library); - map.put("status", " "); - return map; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - }).collect(Collectors.toList())); - } - } - else if(TicketConstants.WordFileNameEnum.OPERATE.getType().equals(type)){ - //若为操作票 - try{ - params = PdfUtils.objectToMap(new StandardTicketInfoVO()); - AtomicInteger index = new AtomicInteger(1); - params.put("measureMapList",groupVOR.getData().getMatterLibraryListOne().stream().map(library-> { - Map map = new HashMap<>(); - map.put("index", index.get()); - map.put("measure", library.getSafetyMeasure()); - map.put("status", " "); - index.getAndIncrement(); - return map; - }).collect(Collectors.toList())); - } - catch (Exception e) { - throw new ServiceException("对象转换失败"); - } - } - //获取导出word路径 - String fileName = TicketConstants.WordFileNameEnum.getFileNameByType(groupVOR.getData().getTicketType()) + PdfUtils.XLSX_SUFFIX; - TemplateExportParams templateExportParams = new TemplateExportParams("template/" + fileName, true); - Workbook workbook = ExcelUtil.getWorkbook(templateExportParams,params); - //上传xlsx至服务器 - ExcelUtil.upload(workbook,xlsSavePath,fileName); - //将xlsx文件转换为pdf并保存 - String pdfFileName = TicketConstants.WordFileNameEnum.getFileNameByType(groupVOR.getData().getTicketType()) + PdfUtils.PDF_SUFFIX; - PdfUtils.convertPdf(xlsSavePath, fileName, pdfSavePath, pdfFileName); - String savePath = pdfSavePath + pdfFileName; - // 设置response参数,可以打开下载页面 - PdfUtils.readPdf(response,savePath); - //上传minio并获取相应路径 + /** word模板预览导出保存路径 **/ + @Value("${hzims.ticket.path.xlsx.savePath}") + private String xlsSavePath; + + @Value("${hzims.ticket.path.pdf.savePath}") + private String pdfSavePath; + + //private final OssTemplate ossTemplate; + private final ITwoTicketMatterLibraryService twoTicketMatterLibraryService; + + + private final OperationTicketService operationTicketService; + + + private final TicketProcessService ticketProcessService; + + + @Override + public R> queryList(TicketMatterGroupDTO req, Query query) { + LambdaQueryWrapper queryWrapper = this.getQueryWrapper(req); + IPage page = this.page(Condition.getPage(query), queryWrapper); + return R.data(page.setRecords(TicketMatterGroupWrapper.build().listVO(page.getRecords()))); + } + + @Override + public R detail(Long id) { + TicketMatterGroupEntity entity = getById(id); + TicketMatterGroupVO groupVO = TicketMatterGroupWrapper.build().entityVO(entity); + /**获取安措**/ + List libraryEntityList = twoTicketMatterLibraryService.list(new LambdaQueryWrapper() {{ + eq(TwoTicketMatterLibraryEntity::getMatterGroup, id); + orderByAsc(TwoTicketMatterLibraryEntity::getType); + orderByDesc(TwoTicketMatterLibraryEntity::getSort); + }}); + if (CollectionUtil.isNotEmpty(libraryEntityList)) { + Map> libraryMap = libraryEntityList.stream() + .sorted(Comparator.comparing(TwoTicketMatterLibraryEntity::getType).thenComparing(TwoTicketMatterLibraryEntity::getSort)).collect(Collectors.groupingBy(TwoTicketMatterLibraryEntity::getType)); + libraryMap.forEach((type, list) -> { + if (ONE_TYPE.equals(type)) { + groupVO.setMatterLibraryListOne(TwoTicketMatterLibraryWrapper.build().listVO(list)); + } else if (TWO_TYPE.equals(type)) { + groupVO.setMatterLibraryListTwo(TwoTicketMatterLibraryWrapper.build().listVO(list)); + } else if (THREE_TYPE.equals(type)) { + groupVO.setMatterLibraryListThree(TwoTicketMatterLibraryWrapper.build().listVO(list)); + } + }); + } + return R.data(groupVO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R updateById(TicketMatterGroupDTO req) { + TicketMatterGroupEntity groupEntity = BeanUtil.copy(req, TicketMatterGroupEntity.class); + updateById(groupEntity); + List libraryEntityList = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListOne())) { + libraryEntityList.addAll(req.getMatterLibraryListOne().stream().map(libraryDto -> BeanUtil.copy(libraryDto, TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListTwo())) { + libraryEntityList.addAll(req.getMatterLibraryListTwo().stream().map(libraryDto -> BeanUtil.copy(libraryDto, TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListThree())) { + libraryEntityList.addAll(req.getMatterLibraryListThree().stream().map(libraryDto -> BeanUtil.copy(libraryDto, TwoTicketMatterLibraryEntity.class)).collect(Collectors.toList())); + } + List list = twoTicketMatterLibraryService.list(new LambdaQueryWrapper() {{ + eq(TwoTicketMatterLibraryEntity::getMatterGroup, req.getId()); + }}); + if (CollectionUtil.isNotEmpty(list)) { + //取出移除数据 + List subtractList = (List) CollectionUtils.subtract( + list.stream().map(TwoTicketMatterLibraryEntity::getId).collect(Collectors.toList()), + libraryEntityList.stream().map(TwoTicketMatterLibraryEntity::getId).collect(Collectors.toList()) + ); + if (CollectionUtil.isNotEmpty(subtractList)) { + twoTicketMatterLibraryService.deleteLogic(subtractList); + } + } + libraryEntityList.forEach(library -> { + if (Func.isEmpty(library.getId())) { + library.setMatterGroup(groupEntity.getId()); + } + }); + twoTicketMatterLibraryService.saveOrUpdateBatch(libraryEntityList); + return R.success("保存成功!"); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public R doSave(TicketMatterGroupDTO req) { + TicketMatterGroupEntity groupEntity = BeanUtil.copy(req, TicketMatterGroupEntity.class); + boolean flag = save(groupEntity); + if (!flag) { + throw new ServiceException("保存对象失败"); + } + /**组合安措、操作事项库列表**/ + List list = new ArrayList<>(); + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListOne())) { + list.addAll(req.getMatterLibraryListOne().stream().map(matterLibrary -> { + TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary, TwoTicketMatterLibraryEntity.class); + libraryEntity.setMatterGroup(groupEntity.getId()); + return libraryEntity; + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListTwo())) { + list.addAll(req.getMatterLibraryListTwo().stream().map(matterLibrary -> { + TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary, TwoTicketMatterLibraryEntity.class); + libraryEntity.setMatterGroup(groupEntity.getId()); + return libraryEntity; + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(req.getMatterLibraryListThree())) { + list.addAll(req.getMatterLibraryListThree().stream().map(matterLibrary -> { + TwoTicketMatterLibraryEntity libraryEntity = BeanUtil.copy(matterLibrary, TwoTicketMatterLibraryEntity.class); + libraryEntity.setMatterGroup(groupEntity.getId()); + return libraryEntity; + }).collect(Collectors.toList())); + } + twoTicketMatterLibraryService.saveBatch(list); + return R.success("保存成功!"); + } + + @Override + public void preview(Long id, String type, HttpServletResponse response) throws Exception { + Map params = new HashMap<>(); + R groupVOR = detail(id); + if (!groupVOR.isSuccess()) { + throw new ServiceException(groupVOR.getMsg()); + } + if (TicketConstants.WordFileNameEnum.WORK.getType().equals(type)) { + //若为工作票 + try { + params = this.completeWorkTicketData(new WorkTicketInfoVO()); + } catch (Exception e) { + throw new ServiceException("对象转换失败"); + } + TicketMatterGroupVO groupVO = groupVOR.getData(); + + //完善模板数据 + /**获取安措**/ + List libraryEntityList = twoTicketMatterLibraryService.list(new LambdaQueryWrapper() {{ + eq(TwoTicketMatterLibraryEntity::getMatterGroup, id); + orderByAsc(TwoTicketMatterLibraryEntity::getType); + orderByDesc(TwoTicketMatterLibraryEntity::getSort); + }}); + if (TicketConstants.WordFileNameEnum.SECOND_WORK.getType().equals(groupVO.getTicketType())) { + //第二种工作票 + params.put("measures", libraryEntityList.stream().map(TwoTicketMatterLibraryEntity::getSafetyMeasure).collect(Collectors.joining(","))); + params.put("workTicketContentDtoList", Lists.newArrayList()); + } else if (TicketConstants.WordFileNameEnum.MECHANICAL_WORK.getType().equals(groupVO.getTicketType())) { + //机械工作票 + List> mapList = libraryEntityList.stream().map(measure -> { + Map result = PdfUtils.objectToMap(measure); + result.put("status", ""); + result.put("measure", measure.getSafetyMeasure()); + return result; + }).collect(Collectors.toList()); + log.info("机械工作票安措:{}", JSON.toJSONString(mapList)); + params.put("initMeasures", mapList); + } + + params.put("matterLibraryListOne", new ArrayList()); + params.put("matterLibraryListTwo", new ArrayList()); + params.put("matterLibraryListThree", new ArrayList()); + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListOne())) { + params.put("matterLibraryListOne", groupVO.getMatterLibraryListOne().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListTwo())) { + params.put("matterLibraryListTwo", groupVO.getMatterLibraryListTwo().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListThree())) { + params.put("matterLibraryListThree", groupVO.getMatterLibraryListThree().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + } else if (TicketConstants.WordFileNameEnum.OPERATE.getType().equals(type)) { + //若为操作票 + try { + params = PdfUtils.objectToMap(new StandardTicketInfoVO()); + AtomicInteger index = new AtomicInteger(1); + params.put("measureMapList", groupVOR.getData().getMatterLibraryListOne().stream().map(library -> { + Map map = new HashMap<>(); + map.put("index", index.get()); + map.put("measure", library.getSafetyMeasure()); + map.put("status", " "); + index.getAndIncrement(); + return map; + }).collect(Collectors.toList())); + } catch (Exception e) { + throw new ServiceException("对象转换失败"); + } + } + //获取导出word路径 + String fileName = TicketConstants.WordFileNameEnum.getFileNameByType(groupVOR.getData().getTicketType()) + PdfUtils.XLSX_SUFFIX; + TemplateExportParams templateExportParams = new TemplateExportParams("template/" + fileName, true); + Workbook workbook = ExcelUtil.getWorkbook(templateExportParams, params); + //上传xlsx至服务器 + ExcelUtil.upload(workbook, xlsSavePath, fileName); + //将xlsx文件转换为pdf并保存 + String pdfFileName = TicketConstants.WordFileNameEnum.getFileNameByType(groupVOR.getData().getTicketType()) + PdfUtils.PDF_SUFFIX; + PdfUtils.convertPdf(xlsSavePath, fileName, pdfSavePath, pdfFileName); + String savePath = pdfSavePath + pdfFileName; + // 设置response参数,可以打开下载页面 + PdfUtils.readPdf(response, savePath); + //上传minio并获取相应路径 // String savePath = pdfSavePath + pdfFileName; // File saveFile = new File(savePath); // FileInputStream inputStream = new FileInputStream(saveFile); // MultipartFile multipartFile = new MockMultipartFile("file", saveFile.getName(), ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream); // return ossTemplate.putFile(multipartFile); - } - - private LambdaQueryWrapper getQueryWrapper(TicketMatterGroupDTO groupDTO){ - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - if(Func.isNotEmpty(groupDTO.getTicketType())){ - queryWrapper.in(TicketMatterGroupEntity::getTicketType, Arrays.asList(groupDTO.getTicketType().split(","))); - } - if(Func.isNotEmpty(groupDTO.getName())){ - queryWrapper.like(TicketMatterGroupEntity::getTicketType, groupDTO.getName()); - } - queryWrapper.orderByDesc(TicketMatterGroupEntity::getCreateTime).orderByDesc(TicketMatterGroupEntity::getUpdateTime); - return queryWrapper; - } - - private Map completeWorkTicketData(WorkTicketInfoVO workTicketInfoVO){ - /**将workTicketInfoVO封装进Map,以便pdf导出**/ - Map workTicketInfoMap = new HashMap<>(); - try { - workTicketInfoMap = PdfUtils.objectToMap(workTicketInfoVO); - } - catch (Exception e) { - log.info("转换对象失败!"); - } - /**签发**/ - workTicketInfoMap.put("signer", " "); - workTicketInfoMap.put("signTime", " "); - /**许可人许可**/ - workTicketInfoMap.put("licensorConfirm", " "); - workTicketInfoMap.put("licenseTime", " "); - - /**负责人收到工作票**/ - workTicketInfoMap.put("receivePrincipal"," "); - workTicketInfoMap.put("receiveTime", " "); - workTicketInfoMap.put("principalConfirm"," "); - - /**负责人确认安全事项**/ - workTicketInfoMap.put("confirmPrincipal"," "); - workTicketInfoMap.put("confirmTime", " "); - - /**工作结束**/ - workTicketInfoMap.put("finisher"," "); - workTicketInfoMap.put("finishTime", " "); - workTicketInfoMap.put("principalFinish"," "); - - /**工作终结**/ - workTicketInfoMap.put("endLicensor", " "); - workTicketInfoMap.put("endTime", " "); - workTicketInfoMap.put("groundSwitchCount", " "); - workTicketInfoMap.put("groundWireCode", " "); - workTicketInfoMap.put("groundWireCount", " "); - - /**负责人变更**/ - workTicketInfoMap.put("initPrincipal", " "); - workTicketInfoMap.put("changePrincipal", " "); - workTicketInfoMap.put("principalChangeSigner", " "); - workTicketInfoMap.put("principalChangeTime", " "); - - /**工作成员变更**/ - workTicketInfoMap.put("membersChangeSituation", " "); - workTicketInfoMap.put("memberChangePrincipal", " "); - - /**工作票延期**/ - workTicketInfoMap.put("delayTime", " "); - workTicketInfoMap.put("delayPrincipal", " "); - workTicketInfoMap.put("delayPrincipalTime", " "); - workTicketInfoMap.put("delayLicensor", " "); - workTicketInfoMap.put("delayLicenseTime", " "); - - /**跨日工作时间**/ - List> operateMapList = new ArrayList<>(); - Map map = new HashMap<>(4); - map.put("startTime", " "); - map.put("endTime", " "); - map.put("principal", " "); - map.put("licensor", " "); - operateMapList.add(map); - workTicketInfoMap.put("operateMapList", operateMapList); - - /**运行值班人员暂为空**/ - workTicketInfoMap.put("dutyPersonName"," "); - workTicketInfoMap.put("membersConfirm"," "); - return workTicketInfoMap; - } + } + + private LambdaQueryWrapper getQueryWrapper(TicketMatterGroupDTO groupDTO) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (Func.isNotEmpty(groupDTO.getTicketType())) { + queryWrapper.in(TicketMatterGroupEntity::getTicketType, Arrays.asList(groupDTO.getTicketType().split(","))); + } + if (Func.isNotEmpty(groupDTO.getName())) { + queryWrapper.like(TicketMatterGroupEntity::getTicketType, groupDTO.getName()); + } + queryWrapper.orderByDesc(TicketMatterGroupEntity::getCreateTime).orderByDesc(TicketMatterGroupEntity::getUpdateTime); + return queryWrapper; + } + + private Map completeWorkTicketData(WorkTicketInfoVO workTicketInfoVO) { + /**将workTicketInfoVO封装进Map,以便pdf导出**/ + Map workTicketInfoMap = new HashMap<>(); + try { + workTicketInfoMap = PdfUtils.objectToMap(workTicketInfoVO); + } catch (Exception e) { + log.info("转换对象失败!"); + } + /**签发**/ + workTicketInfoMap.put("signer", " "); + workTicketInfoMap.put("signTime", " "); + /**许可人许可**/ + workTicketInfoMap.put("licensorConfirm", " "); + workTicketInfoMap.put("licenseTime", " "); + + /**负责人收到工作票**/ + workTicketInfoMap.put("receivePrincipal", " "); + workTicketInfoMap.put("receiveTime", " "); + workTicketInfoMap.put("principalConfirm", " "); + + /**负责人确认安全事项**/ + workTicketInfoMap.put("confirmPrincipal", " "); + workTicketInfoMap.put("confirmTime", " "); + + /**工作结束**/ + workTicketInfoMap.put("finisher", " "); + workTicketInfoMap.put("finishTime", " "); + workTicketInfoMap.put("principalFinish", " "); + + /**工作终结**/ + workTicketInfoMap.put("endLicensor", " "); + workTicketInfoMap.put("endTime", " "); + workTicketInfoMap.put("groundSwitchCount", " "); + workTicketInfoMap.put("groundWireCode", " "); + workTicketInfoMap.put("groundWireCount", " "); + + /**负责人变更**/ + workTicketInfoMap.put("initPrincipal", " "); + workTicketInfoMap.put("changePrincipal", " "); + workTicketInfoMap.put("principalChangeSigner", " "); + workTicketInfoMap.put("principalChangeTime", " "); + + /**工作成员变更**/ + workTicketInfoMap.put("membersChangeSituation", " "); + workTicketInfoMap.put("memberChangePrincipal", " "); + + /**工作票延期**/ + workTicketInfoMap.put("delayTime", " "); + workTicketInfoMap.put("delayPrincipal", " "); + workTicketInfoMap.put("delayPrincipalTime", " "); + workTicketInfoMap.put("delayLicensor", " "); + workTicketInfoMap.put("delayLicenseTime", " "); + + /**跨日工作时间**/ + List> operateMapList = new ArrayList<>(); + Map map = new HashMap<>(4); + map.put("startTime", " "); + map.put("endTime", " "); + map.put("principal", " "); + map.put("licensor", " "); + operateMapList.add(map); + workTicketInfoMap.put("operateMapList", operateMapList); + + /**运行值班人员暂为空**/ + workTicketInfoMap.put("dutyPersonName", " "); + workTicketInfoMap.put("membersConfirm", " "); + return workTicketInfoMap; + } + + + /** + * 票据模板预览 + * + * @param id 编号 + * @param type 模板类型:2为工作票;1为操作票 + * @param status 模板状态 + * @param response + */ + @Override + public void newPreview(Long id, Integer type, Integer status, HttpServletResponse response) { + String fileName = IdWorker.get32UUID() + ".docx"; + // response.setContentType("application/octet-stream;charset=ISO8859-1"); + response.setHeader("Content-Disposition", "attachment; filename=" + fileName); + response.setContentType("application/vnd.ms-excel;charset=utf-8"); + R detail = this.detail(id); + if (!detail.isSuccess()) { + throw new ServiceException(detail.getMsg()); + } + TicketMatterGroupVO groupVO = detail.getData(); + if (groupVO == null) { + throw new ServiceException("查询数据不存在"); + } + //判断票据类型是操操作票还是工作票 + this.getTypeByStatus(type, status, groupVO, response, id); + } + + + /** + * 判断票据类型是操操作票还是工作票 + * + * @param type 模板类型:2为工作票;1为操作票 + * @param status 模板状态 + * @param groupVO + * @param response + * @param id + */ + private void getTypeByStatus(Integer type, Integer status, TicketMatterGroupVO groupVO, HttpServletResponse response, Long id) { + Map result = new HashMap<>(); + switch (type) { + //操作票 + case 1: + getStandardTicket(result, status, groupVO, response); + break; + //工作票 + case 2: + getWordTicket(result, status, groupVO, response, id); + break; + default: + throw new ServiceException("输入的模板类型不存在"); + } + } + + /** + * 工作票 + * + * @param params + * @param groupVO + * @param response + * @param id + */ + @SneakyThrows + private void getWordTicket(Map params, Integer status, TicketMatterGroupVO groupVO, + HttpServletResponse response, Long id) { + + + WorkTicketInfoEntity workTicket = new WorkTicketInfoEntity(); + //1. 工作对象 + Map workTicketInfoMap = PdfUtils.objectToMapResult(workTicket, params); + ticketProcessService.getDataConversion(workTicketInfoMap, "isSafety", false); + //危险点分析与预控措施票 (true,展示附件,false,不展示附件) + ticketProcessService.getDataConversion(workTicketInfoMap, "isHazard", false); + //危险点分析与预控措施票 (true,展示附件,false,不展示附件) + ticketProcessService.getDataConversion(workTicketInfoMap, "isRailway", false); + //有限空间监测记录单(true,展示附件,false,不展示附件) + ticketProcessService.getDataConversion(workTicketInfoMap, "isLimited", false); + params.putAll(workTicketInfoMap); + //3. 工作票工作任务组 + params.put("workTicketContentDtoList", new ArrayList<>()); + //4. 工作票延期 + params.putAll(PdfUtils.objectToMapResult(new WorkTicketDelayEntity(), params)); + //5. 工作结束 + params.putAll(PdfUtils.objectToMapResult(new WorkTicketFinish(), params)); + //5. 工作票负责人变更; + params.putAll(PdfUtils.objectToMapResult(new WorkTicketPrincipalChangeEntity(), params)); + + + + params.put("matterLibraryListOne", new ArrayList<>()); + params.put("matterLibraryListTwo", new ArrayList<>()); + params.put("matterLibraryListThree", new ArrayList<>()); + params.put("matterLibraryListFour", new ArrayList<>()); + params.put("matterLibraryListFive", new ArrayList<>()); + params.put("matterLibraryListFlow", new ArrayList<>()); + params.put("matterLibraryListSeven", new ArrayList<>()); + params.put("matterLibraryListEight", new ArrayList<>()); + params.put("matterLibraryListNine", new ArrayList<>()); + params.put("matterLibraryListTen", new ArrayList<>()); + params.put("matterLibraryList", new ArrayList<>()); + + + /** 获取安措 **/ + List libraryEntityList = twoTicketMatterLibraryService.list(new LambdaQueryWrapper() {{ + eq(TwoTicketMatterLibraryEntity::getMatterGroup, id); + orderByAsc(TwoTicketMatterLibraryEntity::getType); + orderByDesc(TwoTicketMatterLibraryEntity::getSort); + }}); + if (TicketConstants.WordFileNameEnum.SECOND_WORK.getType().equals(groupVO.getTicketType())) { + //第二种工作票 + params.put("measures", libraryEntityList.stream().map(TwoTicketMatterLibraryEntity::getSafetyMeasure).collect(Collectors.joining(","))); + params.put("workTicketContentDtoList", Lists.newArrayList()); + } else if (TicketConstants.WordFileNameEnum.MECHANICAL_WORK.getType().equals(groupVO.getTicketType())) { + //机械工作票 + List> mapList = libraryEntityList.stream().map(measure -> { + Map result = PdfUtils.objectToMap(measure); + result.put("status", ""); + result.put("measure", measure.getSafetyMeasure()); + return result; + }).collect(Collectors.toList()); + log.info("机械工作票安措:{}", JSON.toJSONString(mapList)); + params.put("initMeasures", mapList); + } + + + //许可人确认安全措施,负责人确认安全措施 + WordHelper.putMap(params, "principalName1", 10); + //负责人变更 + WordHelper.putMap(params, "signerName2", 10); + WordHelper.putMap(params, "licensorName1", 10); + //延期 + WordHelper.putMap(params, "principalName2", 10); + //许可人确认工作票终结 + WordHelper.putMap(params, "principalName3", 10); + WordHelper.putMap(params, "licensorName2", 10); + + WordMapUtils.newMapWithList("matterLibraryList", params, true, 4, null); + + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListOne())) { + params.put("matterLibraryListOne", groupVO.getMatterLibraryListOne().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListTwo())) { + params.put("matterLibraryListTwo", groupVO.getMatterLibraryListTwo().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + if (CollectionUtil.isNotEmpty(groupVO.getMatterLibraryListThree())) { + params.put("matterLibraryListThree", groupVO.getMatterLibraryListThree().stream().map(library -> { + try { + Map map = PdfUtils.objectToMap(library); + map.put("status", " "); + return map; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + }).collect(Collectors.toList())); + } + this.isMatterLibraryList(params); + Map resultMap = WordHelper.resultMap(params); + String workTicketStatus = WordMapUtils.getWorkTicketStatus(status); + String os = TicketConstant.OS_NAME; + //Windows操作系统 + if (os != null && os.toLowerCase().startsWith("windows")) { + String url = "template/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + log.info("当前系统版本是:{}", os); + doc.write(response.getOutputStream()); + } else { + String url = TicketConstant.TICKET_LIUNX_PATH + "/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + //其它操作系统 + log.info("当前系统版本是:{}", os); + ServletOutputStream outputStream = response.getOutputStream(); + doc.write(outputStream); + } + } + + /** + * 操作票 + * + * @param workTicketInfoMap 返回的数据 + * @param groupVO + * @param response + */ + @SneakyThrows + private void getStandardTicket(Map workTicketInfoMap, Integer status, TicketMatterGroupVO groupVO, + HttpServletResponse response) { + workTicketInfoMap.putAll(this.convertMap(new StandardTicketInfoVo())); + AtomicInteger index = new AtomicInteger(1); + List> collect = groupVO.getMatterLibraryListOne().stream().map(library -> { + Map map = new HashMap<>(); + map.put("index", index.get()); + map.put("measure", library.getSafetyMeasure()); + map.put("status", " "); + map.put("hello", ""); + map.put("hello1", ""); + map.put("operationTime", ""); + index.getAndIncrement(); + return map; + }).collect(Collectors.toList()); + workTicketInfoMap.put("measureMapList", collect); + Map resultMap = OperationWordHelper.resultMap(workTicketInfoMap); + String workTicketStatus = this.getWorkTicketStatus(status); + String os = TicketConstant.OS_NAME; + //Windows操作系统 + if (os != null && os.toLowerCase().startsWith("windows")) { + String url = "template/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + log.info("当前系统版本是:{}", os); + doc.write(response.getOutputStream()); + } else { + String url = TicketConstant.TICKET_LIUNX_PATH + "/" + workTicketStatus; + XWPFDocument doc = WordExportUtil.exportWord07(url, resultMap); + //其它操作系统 + log.info("当前系统版本是:{}", os); + ServletOutputStream outputStream = response.getOutputStream(); + doc.write(outputStream); + } + } + + + /** + * 将查询的数据转换为map + * + * @param standardTicketInfoVo + * @return + */ + private Map convertMap(StandardTicketInfoVo standardTicketInfoVo) { + //1. 操作票装换map + Map result = new HashMap<>(); + Map stringObjectMap = PdfUtils.objectToMapResult(standardTicketInfoVo, result); + result.putAll(stringObjectMap); + WordMapUtils.newMapWithList("measureMapList", result, false, 17, null); + return result; + } + + + /** + * 根据状态获取模板 + * + * @param status + * @return + */ + public static String getWorkTicketStatus(Integer status) { + String pathName = null; + switch (status) { + case 1: + pathName = "电气第一种工作票模版.docx"; + break; + case 2: + pathName = "电气第二种工作票模版.docx"; + break; + case 3: + pathName = "水力机械工作票模版.docx"; + break; + case 4: + pathName = "电气操作票.docx"; + default: + pathName = "电气第一种工作票模版.docx"; + } + return pathName; + } + + + /** + * 验证是否有数据 + * + * @param workTicketInfoMap + */ + private void isMatterLibraryList(Map workTicketInfoMap) { + //1. 第一种工作票 + //1.1 应断开断路器和隔离开关,包括填写前已断开断路器和隔离开关(注明编号)、应取熔断器(保险) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.ONE.getConvertAttributes(), workTicketInfoMap, true, 6, "safetyMeasure", "status"); + //1.2 应装设接地线、隔板、隔罩(注明确切地点),应合上接地刀闸(注明双重名称) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.TWO.getConvertAttributes(), workTicketInfoMap, true, 3, "safetyMeasure", "status"); + //1.3 应装设遮拦、应挂标识牌及防止二次回路误碰等措施(注明确实地点、名称) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.THREE.getConvertAttributes(), workTicketInfoMap, true, 6, "safetyMeasure", "status"); + + //2. 第二种工作票 + //2.1 应断开断路器和隔离开关,包括填写前已断开断路器和隔离开关(注明编号)、应取熔断器(保险) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.SEVEN.getConvertAttributes(), workTicketInfoMap, true, 6, "safetyMeasure", "status"); + + + //3. 水利机器工作票 + //3.1 必须采取的安全措施 + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.EIGHT.getConvertAttributes(), workTicketInfoMap, true, 8, "safetyMeasure", "status"); + //3.2 检修工作要求检修人员自行执行的安全措施(由工作负责人填写) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.NINE.getConvertAttributes(), workTicketInfoMap, true, 5, "safetyMeasure", "status"); + //3.3 检修工作要求检修人员自行执行的安全措施(由工作负责人填写) + WordMapUtils.newMapWithList(WorkTicketConstants.WorkTicketMeasureTypeEnum.TEN.getConvertAttributes(), workTicketInfoMap, true, 5, "safetyMeasure", "status"); + + + } + } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java index 0ab4599..2e253a9 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java @@ -3,12 +3,12 @@ package com.hnac.hzims.ticket.standardTicket.service.impl; import cn.afterturn.easypoi.word.WordExportUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.message.MessageConstants; import com.hnac.hzims.message.dto.BusinessMessageDTO; -import com.hnac.hzims.message.dto.MessagePushRecordDto; import com.hnac.hzims.message.fegin.IMessageClient; import com.hnac.hzims.middle.process.feign.ProcessDictFeignService; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; @@ -39,8 +39,6 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.system.feign.ISysClient; -import org.springblade.system.user.cache.UserCache; -import org.springblade.system.user.entity.User; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -50,7 +48,10 @@ import javax.servlet.http.HttpServletResponse; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -166,7 +167,9 @@ public class OperationTicketServiceImpl implements OperationTicketService { StandardTicketInfoVo standardTicketInfoVo = null; try { JSONObject jsonObject = JSONObject.parseObject(formData); - standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); + // standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class); + standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"), + new TypeReference(){}); } catch (Exception e) { log.error("获取表单出现异常了~~~~"); e.printStackTrace(); @@ -182,7 +185,8 @@ public class OperationTicketServiceImpl implements OperationTicketService { //设置id StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity(); - BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity); + // BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity); + BeanUtil.copy(standardTicketInfoVo, newStandardTicketInfoEntity); newStandardTicketInfoEntity.setId(id); newStandardTicketInfoEntity.setCreateUser(standardTicketInfoEntity.getCreateUser()); //填充操作票信息 @@ -258,12 +262,12 @@ public class OperationTicketServiceImpl implements OperationTicketService { businessMessageDTO.setUserIds(userIds); businessMessageDTO.setCreateUser(newStandardTicketInfoEntity.getCreateUser()); - System.out.println("================================================"); - System.out.println("businessMessageDTO = " + businessMessageDTO); - System.out.println("================================================"); + log.info("================================================"); + log.info("businessMessageDTO = " + businessMessageDTO); + log.info("================================================"); R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO); if (!booleanR.isSuccess()) { - throw new ServiceException("消息推送失败"); + throw new ServiceException("消息推送失败"); } log.info("推送成功~"); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java index 906c85d..9c67a63 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java @@ -4,6 +4,7 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo; import javax.servlet.http.HttpServletResponse; +import java.util.Map; /** * 开票处理流程接口 @@ -36,4 +37,13 @@ public interface TicketProcessService { * @return */ void newPreview(Long ticketId, Integer status, HttpServletResponse response); + + + /** + * * value true转 ☑ 或 false转 □ + * @param dataConversion + * @param key + * @param value + */ + public void getDataConversion(Map dataConversion, String key, Object value); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java index 844cc6f..a7909aa 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -1284,8 +1284,6 @@ public class TicketProcessServiceImpl implements TicketProcessService { if (StringUtils.isNoneBlank(newValue)) { dataConversion.put(key, BooleanUtils.toBoolean(newValue) ? "☑" : "□"); } - - } /** diff --git a/hzims-service/ticket/src/main/resources/db/1.0.0.sql b/hzims-service/ticket/src/main/resources/db/1.0.0.sql new file mode 100644 index 0000000..5bb14f5 --- /dev/null +++ b/hzims-service/ticket/src/main/resources/db/1.0.0.sql @@ -0,0 +1,180 @@ +SET FOREIGN_KEY_CHECKS=0; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点标识-两票编码' AFTER `ticket_type`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号(原站点ID)' AFTER `signage`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_user_id` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `signage_code`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务Id' AFTER `flow_user_id`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称' AFTER `flow_task_id`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_task_name`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `next_step_operator`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_description`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `class_group_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组' AFTER `project_name`; + +ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_measure` ADD COLUMN `operation_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间' AFTER `matter_group`; + +CREATE TABLE `hzims-ticket`.`hzims_ticket_info_danger` ( + `id` bigint(20) NULL DEFAULT NULL COMMENT '编号', + `ticket_id` bigint(20) NULL DEFAULT NULL, + `dangerous_point` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '危险点', + `maintenance` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '安全措施', + `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', + `is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除' +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + +CREATE TABLE `hzims-ticket`.`hzims_work_ticket_finish` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', + `ticket_id` bigint(20) NULL DEFAULT NULL COMMENT '工作票编号', + `temp_ground_num` int(11) NULL DEFAULT NULL COMMENT '临时接地线', + `temp_dismantle_num` int(11) NULL DEFAULT NULL COMMENT '临时拆除几组', + `ground_num` int(11) NULL DEFAULT NULL COMMENT '接地线几组', + `dismantle_num` int(11) NULL DEFAULT NULL COMMENT '拆除几组', + `retain_num` int(11) NULL DEFAULT NULL COMMENT '保留几组', + `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人名称', + `licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人', + `licensor_end_time` datetime(0) NULL DEFAULT NULL COMMENT '工作票终结时间', + `principal_end_time` datetime(0) NULL DEFAULT NULL COMMENT '负责人工作结束时间', + `content` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', + `tell_content` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交底内容', + `work_end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间', + `brake_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '刀闸编号', + `guardian` bigint(20) NULL DEFAULT NULL COMMENT '监护人', + `guardian_place` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '监护人地址', + `other_items` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他事项', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作结束' ROW_FORMAT = Dynamic; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `power` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 工作条件( 停电或不停电)' AFTER `watch_principal_end_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `flow_user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `step_operator`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_task_name`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作接收人' AFTER `project_name`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver_time` datetime(0) NULL DEFAULT NULL COMMENT '工作接收人时间' AFTER `job_receiver`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_safety` tinyint(1) NULL DEFAULT 0 COMMENT '安全隔离措施附页 (true,展示附件,false,不展示附件)' AFTER `job_receiver_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_hazard` tinyint(1) NULL DEFAULT 0 COMMENT '危险点分析与预控措施票 (true,展示附件,false,不展示附件)' AFTER `is_safety`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_railway` tinyint(1) NULL DEFAULT 0 COMMENT '动火工作票 (true,展示附件,false,不展示附件)' AFTER `is_hazard`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_limited` tinyint(1) NULL DEFAULT 0 COMMENT ' 有限空间监测记录单(true,展示附件,false,不展示附件)' AFTER `is_railway`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_start` tinyint(1) NULL DEFAULT 0 COMMENT '每日开工和收工时间附页' AFTER `is_limited`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `follower_num` int(11) NULL DEFAULT 1 COMMENT '附页第几张' AFTER `flow_description`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `input`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `step_operator` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前审批人' AFTER `next_step_operator`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `is_power`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `start_date_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `end_date_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `content`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `work_ticket_end_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `tell_content`; + +CREATE TABLE `hzims-ticket`.`hzims_work_ticket_info_copy1` ( + `id` bigint(20) NOT NULL COMMENT '主键', + `em_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `em_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流ID', + `type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工作票类型', + `company` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位', + `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', + `task_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务类型', + `task_id` bigint(20) NULL DEFAULT NULL COMMENT '关联业务ID', + `task_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务名称', + `class_group` bigint(20) NULL DEFAULT NULL COMMENT '班组', + `class_group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组名称', + `class_group_members` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员', + `class_group_members_manual` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员手填', + `address_equ_name` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作地点及设备名称', + `work_content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作任务及内容', + `plan_start_time` datetime(0) NULL DEFAULT NULL COMMENT '计划开始时间', + `plan_end_time` datetime(0) NULL DEFAULT NULL COMMENT '计划结束时间', + `signer` bigint(20) NULL DEFAULT NULL COMMENT '签发人', + `principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人', + `principal_manual` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人手填', + `licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人', + `license_time` datetime(0) NULL DEFAULT NULL COMMENT '许可时间', + `flow_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程进行code', + `license_end_time` datetime(0) NULL DEFAULT NULL COMMENT '许可人确认工作结束时间', + `is_evaluate` tinyint(4) NULL DEFAULT 0 COMMENT '是否评价', + `status` tinyint(4) NULL DEFAULT NULL COMMENT '1:未完成 2:执行中 3:已完成', + `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + `create_user` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `update_user` bigint(20) NULL DEFAULT NULL, + `update_time` datetime(0) NULL DEFAULT NULL, + `is_deleted` tinyint(4) NULL DEFAULT NULL, + `create_dept` bigint(20) NOT NULL COMMENT '创建部门', + `confirm_img_urls` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片地址', + `confirm_img_filenames` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片名称', + `sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序', + `confirm_work_time` datetime(0) NULL DEFAULT NULL COMMENT '工作负责人确认工作完成时间', + `pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:许可人添加)', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票' ROW_FORMAT = Dynamic; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)' AFTER `measure`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `execute_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url' AFTER `execute_remark`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人' AFTER `status`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `complete_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址' AFTER `complete_time`; + +ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '类型(1:值班人员添加2:许可人添加)' AFTER `sort`; + +CREATE TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure_copy1` ( + `id` bigint(20) NOT NULL COMMENT '主键ID', + `ticket_id` bigint(20) NOT NULL COMMENT '工作票ID', + `measure_id` bigint(20) NULL DEFAULT NULL COMMENT '安全措施ID', + `matter_group` bigint(20) NULL DEFAULT NULL COMMENT '分组', + `measure` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '安全措施', + `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)', + `executor` bigint(20) NULL DEFAULT NULL COMMENT '执行人', + `execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间', + `execute_remark` tinytext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行情况', + `execute_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url', + `status` tinyint(20) NULL DEFAULT NULL, + `completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人', + `complete_time` datetime(0) NULL DEFAULT NULL COMMENT '内容完成时间', + `complete_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址', + `create_user` bigint(20) NOT NULL COMMENT '创建人', + `create_time` datetime(0) NOT NULL COMMENT '创建时间', + `update_user` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `is_deleted` tinyint(4) NULL DEFAULT NULL, + `create_dept` bigint(20) NOT NULL COMMENT '创建机构', + `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户id', + `sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票安全措施列表' ROW_FORMAT = Dynamic; + +DROP TABLE `hzims-ticket`.`hzims_workflow_operation_log`; + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file diff --git a/hzims-service/ticket/src/main/resources/db/newsql.sql b/hzims-service/ticket/src/main/resources/db/newsql.sql deleted file mode 100644 index 5bb14f5..0000000 --- a/hzims-service/ticket/src/main/resources/db/newsql.sql +++ /dev/null @@ -1,180 +0,0 @@ -SET FOREIGN_KEY_CHECKS=0; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点标识-两票编码' AFTER `ticket_type`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号(原站点ID)' AFTER `signage`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_user_id` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `signage_code`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务Id' AFTER `flow_user_id`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称' AFTER `flow_task_id`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_task_name`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `next_step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_description`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `class_group_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组' AFTER `project_name`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_measure` ADD COLUMN `operation_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间' AFTER `matter_group`; - -CREATE TABLE `hzims-ticket`.`hzims_ticket_info_danger` ( - `id` bigint(20) NULL DEFAULT NULL COMMENT '编号', - `ticket_id` bigint(20) NULL DEFAULT NULL, - `dangerous_point` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '危险点', - `maintenance` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '安全措施', - `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - `is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除' -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `hzims-ticket`.`hzims_work_ticket_finish` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', - `ticket_id` bigint(20) NULL DEFAULT NULL COMMENT '工作票编号', - `temp_ground_num` int(11) NULL DEFAULT NULL COMMENT '临时接地线', - `temp_dismantle_num` int(11) NULL DEFAULT NULL COMMENT '临时拆除几组', - `ground_num` int(11) NULL DEFAULT NULL COMMENT '接地线几组', - `dismantle_num` int(11) NULL DEFAULT NULL COMMENT '拆除几组', - `retain_num` int(11) NULL DEFAULT NULL COMMENT '保留几组', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人名称', - `licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人', - `licensor_end_time` datetime(0) NULL DEFAULT NULL COMMENT '工作票终结时间', - `principal_end_time` datetime(0) NULL DEFAULT NULL COMMENT '负责人工作结束时间', - `content` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `tell_content` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交底内容', - `work_end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间', - `brake_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '刀闸编号', - `guardian` bigint(20) NULL DEFAULT NULL COMMENT '监护人', - `guardian_place` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '监护人地址', - `other_items` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他事项', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作结束' ROW_FORMAT = Dynamic; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `power` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 工作条件( 停电或不停电)' AFTER `watch_principal_end_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `flow_user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_task_name`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作接收人' AFTER `project_name`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver_time` datetime(0) NULL DEFAULT NULL COMMENT '工作接收人时间' AFTER `job_receiver`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_safety` tinyint(1) NULL DEFAULT 0 COMMENT '安全隔离措施附页 (true,展示附件,false,不展示附件)' AFTER `job_receiver_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_hazard` tinyint(1) NULL DEFAULT 0 COMMENT '危险点分析与预控措施票 (true,展示附件,false,不展示附件)' AFTER `is_safety`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_railway` tinyint(1) NULL DEFAULT 0 COMMENT '动火工作票 (true,展示附件,false,不展示附件)' AFTER `is_hazard`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_limited` tinyint(1) NULL DEFAULT 0 COMMENT ' 有限空间监测记录单(true,展示附件,false,不展示附件)' AFTER `is_railway`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_start` tinyint(1) NULL DEFAULT 0 COMMENT '每日开工和收工时间附页' AFTER `is_limited`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `follower_num` int(11) NULL DEFAULT 1 COMMENT '附页第几张' AFTER `flow_description`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `input`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `step_operator` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前审批人' AFTER `next_step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `is_power`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `start_date_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `end_date_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `content`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `work_ticket_end_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `tell_content`; - -CREATE TABLE `hzims-ticket`.`hzims_work_ticket_info_copy1` ( - `id` bigint(20) NOT NULL COMMENT '主键', - `em_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', - `em_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备名称', - `process_instance_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流ID', - `type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工作票类型', - `company` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '单位', - `code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编号', - `task_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务类型', - `task_id` bigint(20) NULL DEFAULT NULL COMMENT '关联业务ID', - `task_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '关联业务名称', - `class_group` bigint(20) NULL DEFAULT NULL COMMENT '班组', - `class_group_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组名称', - `class_group_members` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员', - `class_group_members_manual` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组成员手填', - `address_equ_name` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作地点及设备名称', - `work_content` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作任务及内容', - `plan_start_time` datetime(0) NULL DEFAULT NULL COMMENT '计划开始时间', - `plan_end_time` datetime(0) NULL DEFAULT NULL COMMENT '计划结束时间', - `signer` bigint(20) NULL DEFAULT NULL COMMENT '签发人', - `principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人', - `principal_manual` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '负责人手填', - `licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人', - `license_time` datetime(0) NULL DEFAULT NULL COMMENT '许可时间', - `flow_code` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程进行code', - `license_end_time` datetime(0) NULL DEFAULT NULL COMMENT '许可人确认工作结束时间', - `is_evaluate` tinyint(4) NULL DEFAULT 0 COMMENT '是否评价', - `status` tinyint(4) NULL DEFAULT NULL COMMENT '1:未完成 2:执行中 3:已完成', - `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', - `create_user` bigint(20) NOT NULL COMMENT '创建人', - `create_time` datetime(0) NOT NULL COMMENT '创建时间', - `update_user` bigint(20) NULL DEFAULT NULL, - `update_time` datetime(0) NULL DEFAULT NULL, - `is_deleted` tinyint(4) NULL DEFAULT NULL, - `create_dept` bigint(20) NOT NULL COMMENT '创建部门', - `confirm_img_urls` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片地址', - `confirm_img_filenames` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作负责人确认工作完成上传图片名称', - `sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序', - `confirm_work_time` datetime(0) NULL DEFAULT NULL COMMENT '工作负责人确认工作完成时间', - `pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:许可人添加)', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票' ROW_FORMAT = Dynamic; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)' AFTER `measure`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `execute_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url' AFTER `execute_remark`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人' AFTER `status`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `complete_img_url` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址' AFTER `complete_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure` MODIFY COLUMN `pattern` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '1' COMMENT '类型(1:值班人员添加2:许可人添加)' AFTER `sort`; - -CREATE TABLE `hzims-ticket`.`hzims_work_ticket_safety_measure_copy1` ( - `id` bigint(20) NOT NULL COMMENT '主键ID', - `ticket_id` bigint(20) NOT NULL COMMENT '工作票ID', - `measure_id` bigint(20) NULL DEFAULT NULL COMMENT '安全措施ID', - `matter_group` bigint(20) NULL DEFAULT NULL COMMENT '分组', - `measure` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '安全措施', - `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型(1:值班人员添加2:签发人添加3:许可人添加)', - `executor` bigint(20) NULL DEFAULT NULL COMMENT '执行人', - `execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间', - `execute_remark` tinytext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '执行情况', - `execute_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拍照上传图片url', - `status` tinyint(20) NULL DEFAULT NULL, - `completer` bigint(20) NULL DEFAULT NULL COMMENT '内容执行人', - `complete_time` datetime(0) NULL DEFAULT NULL COMMENT '内容完成时间', - `complete_img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '完成内容上传图片地址', - `create_user` bigint(20) NOT NULL COMMENT '创建人', - `create_time` datetime(0) NOT NULL COMMENT '创建时间', - `update_user` bigint(20) NULL DEFAULT NULL COMMENT '更新人', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `is_deleted` tinyint(4) NULL DEFAULT NULL, - `create_dept` bigint(20) NOT NULL COMMENT '创建机构', - `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户id', - `sort` tinyint(4) NULL DEFAULT NULL COMMENT '排序', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作票安全措施列表' ROW_FORMAT = Dynamic; - -DROP TABLE `hzims-ticket`.`hzims_workflow_operation_log`; - -SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file