From 4d34aa08ea21bb225dad422e990eb7cc96f8216b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Fri, 16 Jun 2023 11:37:49 +0800
Subject: [PATCH 01/13] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20middle-api?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../logs/constant/TicketProcessConstant.java | 32 -----------
.../common/logs/fegin/ProcessDictFeignService.java | 43 ---------------
.../fallback/ProcessDictFeignServiceFallback.java | 43 ---------------
.../common/to/process/ProcessWorkFlowResponse.java | 63 ----------------------
hzims-service-api/hzims-operational-api/pom.xml | 9 ++++
.../maintenance/feign/MaintenanceFeignClient.java | 2 +-
.../fallback/MaintenanceFeignClientFallback.java | 2 +-
hzims-service-api/middle-api/pom.xml | 42 +++++++++++++++
.../process/constant/TicketProcessConstant.java | 32 +++++++++++
.../fallback/ProcessDictFeignServiceFallback.java | 43 +++++++++++++++
.../process/feign/ProcessDictFeignService.java | 43 +++++++++++++++
.../middle/process/to/ProcessWorkFlowResponse.java | 63 ++++++++++++++++++++++
hzims-service-api/pom.xml | 1 +
hzims-service-api/ticket-api/pom.xml | 6 +++
.../OperationTicketFeignClientFallback.java | 2 +-
.../fallback/TicketProcessFeignClientFallback.java | 2 +-
.../feign/OperationTicketFeignClient.java | 2 +-
.../feign/TicketProcessFeignClient.java | 2 +-
hzims-service/hzims-middle/pom.xml | 5 ++
.../consumer/StandardWorkTicketConsumer.java | 2 +-
.../controller/ProcessTypeController.java | 2 +-
.../strategy/service/ProcessService.java | 2 +-
.../MachineryTicketProcessServiceImpl.java | 4 +-
.../serviceimpl/MaintenanceProcessServiceImpl.java | 4 +-
.../serviceimpl/OneTicketProcessServiceImpl.java | 4 +-
.../OperationTicketProcessServiceImpl.java | 4 +-
.../service/operation/impl/DataServiceImpl.java | 1 -
.../controller/MaintenanceController.java | 2 +-
.../maintenance/service/MaintenanceService.java | 2 +-
.../service/impl/MaintenanceServiceImpl.java | 2 +-
hzims-service/pom.xml | 8 +++
hzims-service/ticket/pom.xml | 5 ++
.../ticket/redisConsume/WorkTicketMsgConsume.java | 2 +-
.../controller/OperationTicketController.java | 2 +-
.../service/OperationTicketService.java | 2 +-
.../service/impl/OperationTicketServiceImpl.java | 6 +--
.../controller/TicketProcessController.java | 2 +-
.../twoTicket/service/TicketProcessService.java | 2 +-
.../service/impl/TicketProcessServiceImpl.java | 8 +--
39 files changed, 289 insertions(+), 214 deletions(-)
delete mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java
delete mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java
delete mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java
delete mode 100644 hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java
create mode 100644 hzims-service-api/middle-api/pom.xml
create mode 100644 hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
create mode 100644 hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java
create mode 100644 hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java
create mode 100644 hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java
diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java
deleted file mode 100644
index 466e9e4..0000000
--- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/constant/TicketProcessConstant.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.hnac.hzims.common.logs.constant;
-
-/**
- * 开票常量类
- *
- * @Author WL
- * @Version v1.0
- * @Serial 1.0
- * @Date 2023/4/8 10:53
- */
-public class TicketProcessConstant {
-
- /**
- * 第一种工作票的key
- */
- public static final String FIRST_TICKET_KEY = "networking";
-
-
- /**
- * 操作票
- */
- public static final String OPERATION_TICKET_KEY = "moreActionBankDirect";
-
- /**
- * 水力机械工作票
- */
- public static final String MACHINERY_TICKET_KEY = "machinery";
- /**
- * 日常维护
- */
- public static final String MAINTENANCE_KEY = "maintenance";
-}
diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java
deleted file mode 100644
index fc794a7..0000000
--- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/ProcessDictFeignService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.hnac.hzims.common.logs.fegin;
-
-import com.hnac.hzims.common.logs.fegin.fallback.ProcessDictFeignServiceFallback;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.stereotype.Repository;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.time.LocalDateTime;
-
-/**
- * @Author WL
- * @Version v1.0
- * @Serial 1.0
- * @Date 2023/6/15 15:16
- */
-@Repository
-@FeignClient(value = "hzims-middle", fallback = ProcessDictFeignServiceFallback.class)
-public interface ProcessDictFeignService {
-
- /**
- * 获取工作票工作票唯一ID
- *
- * @param staff
- * @param typeInstrument
- * @param createTime
- * @return
- */
- @GetMapping("/process-dict/getTicketByCode")
- public String getTicketByCode(@RequestParam("staff") String staff,
- @RequestParam("typeInstrument") String typeInstrument,
- @RequestParam("createTime") LocalDateTime createTime);
-
-
- /**
- * 根据工作流key获取工作流value
- *
- * @param dictKey
- * @return
- */
- @GetMapping("/process-dict/selectDictValueByKey")
- public String selectDictValueByKey(@RequestParam("dictKey") String dictKey);
-}
diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java
deleted file mode 100644
index 1f70c8d..0000000
--- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/fegin/fallback/ProcessDictFeignServiceFallback.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.hnac.hzims.common.logs.fegin.fallback;
-
-import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.time.LocalDateTime;
-
-/**
- * @Author WL
- * @Version v1.0
- * @Serial 1.0
- * @Date 2023/6/15 15:17
- */
-@Slf4j
-@Service
-public class ProcessDictFeignServiceFallback implements ProcessDictFeignService {
- /**
- * 获取工作票工作票唯一ID
- *
- * @param staff
- * @param typeInstrument
- * @param createTime
- * @return
- */
- @Override
- public String getTicketByCode(String staff, String typeInstrument, LocalDateTime createTime) {
- log.error("获取工作票工作票唯一ID 熔断措施");
- return null;
- }
-
- /**
- * 根据工作流key获取工作流value
- *
- * @param dictKey
- * @return
- */
- @Override
- public String selectDictValueByKey(String dictKey) {
- log.error("根据工作流key获取工作流value 熔断措施");
- return null;
- }
-}
diff --git a/hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java b/hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java
deleted file mode 100644
index 0b13613..0000000
--- a/hzims-biz-common/src/main/java/com/hnac/hzims/common/to/process/ProcessWorkFlowResponse.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package com.hnac.hzims.common.to.process;
-
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import javax.validation.constraints.NotNull;
-import java.io.Serializable;
-
-/**
- *
- * @author hx
- * @version 1.0
- * @date 2023/3/14 19:13
- */
-@Data
-@EqualsAndHashCode
-public class ProcessWorkFlowResponse implements Serializable {
-
- /**当前任务ID**/
-
- private String taskId;
-
- /**当前任务名称**/
- private String taskName;
-
- /**当前环节流程ID**/
- @NotNull
- private String processDefinitionKey;
-
-
- /**
- * 业务Id
- */
- private String businessKey;
-
-
- /**
- * 流程实例key
- */
- private String processInstanceId;
-
-
- /**
- * 下一环节处理人
- */
- private String nextStepOperator;
-
-
-
- /**票据表单**/
- private Object variables;
-
- /**
- * 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色
- */
- private String handleType;
-
-
- /**
- * 用户Id
- */
- private String userId;
-}
diff --git a/hzims-service-api/hzims-operational-api/pom.xml b/hzims-service-api/hzims-operational-api/pom.xml
index 3bbc8d9..10b24a0 100644
--- a/hzims-service-api/hzims-operational-api/pom.xml
+++ b/hzims-service-api/hzims-operational-api/pom.xml
@@ -57,10 +57,19 @@
org.springblade
blade-system-api
+
+
com.hnac.hzims
hzims-biz-common
+
+
+ com.hnac.hzims
+ middle-api
+ 4.0.0-SNAPSHOT
+ provided
+
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java
index 725bec4..712a3fd 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/MaintenanceFeignClient.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.operational.maintenance.feign;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.maintenance.feign.fallback.MaintenanceFeignClientFallback;
import io.swagger.annotations.ApiOperation;
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java
index a252c47..86ec9f8 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/feign/fallback/MaintenanceFeignClientFallback.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.operational.maintenance.feign.fallback;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient;
import org.springframework.stereotype.Component;
diff --git a/hzims-service-api/middle-api/pom.xml b/hzims-service-api/middle-api/pom.xml
new file mode 100644
index 0000000..198b15e
--- /dev/null
+++ b/hzims-service-api/middle-api/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+ com.hnac.hzims
+ hzims-service-api
+ 4.0.0-SNAPSHOT
+
+
+ middle-api
+
+
+ 8
+ 8
+ UTF-8
+
+
+
+
+ ${project.name}-${project.version}
+
+
+ com.spotify
+ dockerfile-maven-plugin
+
+ ${docker.username}
+ ${docker.password}
+ ${docker.registry.url}/${docker.namespace}/${project.artifactId}
+ ${project.version}
+ true
+
+ target/${project.build.finalName}.jar
+
+ false
+
+
+
+
+
+
\ No newline at end of file
diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
new file mode 100644
index 0000000..23c173e
--- /dev/null
+++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
@@ -0,0 +1,32 @@
+package com.hnac.hzims.middle.process.constant;
+
+/**
+ * 开票常量类
+ *
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/4/8 10:53
+ */
+public class TicketProcessConstant {
+
+ /**
+ * 第一种工作票的key
+ */
+ public static final String FIRST_TICKET_KEY = "networking";
+
+
+ /**
+ * 操作票
+ */
+ public static final String OPERATION_TICKET_KEY = "moreActionBankDirect";
+
+ /**
+ * 水力机械工作票
+ */
+ public static final String MACHINERY_TICKET_KEY = "machinery";
+ /**
+ * 日常维护
+ */
+ public static final String MAINTENANCE_KEY = "maintenance";
+}
diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java
new file mode 100644
index 0000000..d29fdfd
--- /dev/null
+++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/fallback/ProcessDictFeignServiceFallback.java
@@ -0,0 +1,43 @@
+package com.hnac.hzims.middle.process.fallback;
+
+import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/6/15 15:17
+ */
+@Slf4j
+@Service
+public class ProcessDictFeignServiceFallback implements ProcessDictFeignService {
+ /**
+ * 获取工作票工作票唯一ID
+ *
+ * @param staff
+ * @param typeInstrument
+ * @param createTime
+ * @return
+ */
+ @Override
+ public String getTicketByCode(String staff, String typeInstrument, LocalDateTime createTime) {
+ log.error("获取工作票工作票唯一ID 熔断措施");
+ return null;
+ }
+
+ /**
+ * 根据工作流key获取工作流value
+ *
+ * @param dictKey
+ * @return
+ */
+ @Override
+ public String selectDictValueByKey(String dictKey) {
+ log.error("根据工作流key获取工作流value 熔断措施");
+ return null;
+ }
+}
diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java
new file mode 100644
index 0000000..4e213e4
--- /dev/null
+++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/feign/ProcessDictFeignService.java
@@ -0,0 +1,43 @@
+package com.hnac.hzims.middle.process.feign;
+
+import com.hnac.hzims.middle.process.fallback.ProcessDictFeignServiceFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Repository;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.time.LocalDateTime;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/6/15 15:16
+ */
+@Repository
+@FeignClient(value = "hzims-middle", fallback = ProcessDictFeignServiceFallback.class)
+public interface ProcessDictFeignService {
+
+ /**
+ * 获取工作票工作票唯一ID
+ *
+ * @param staff
+ * @param typeInstrument
+ * @param createTime
+ * @return
+ */
+ @GetMapping("/process-dict/getTicketByCode")
+ public String getTicketByCode(@RequestParam("staff") String staff,
+ @RequestParam("typeInstrument") String typeInstrument,
+ @RequestParam("createTime") LocalDateTime createTime);
+
+
+ /**
+ * 根据工作流key获取工作流value
+ *
+ * @param dictKey
+ * @return
+ */
+ @GetMapping("/process-dict/selectDictValueByKey")
+ public String selectDictValueByKey(@RequestParam("dictKey") String dictKey);
+}
diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java
new file mode 100644
index 0000000..7dafb53
--- /dev/null
+++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/to/ProcessWorkFlowResponse.java
@@ -0,0 +1,63 @@
+package com.hnac.hzims.middle.process.to;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ *
+ * @author hx
+ * @version 1.0
+ * @date 2023/3/14 19:13
+ */
+@Data
+@EqualsAndHashCode
+public class ProcessWorkFlowResponse implements Serializable {
+
+ /**当前任务ID**/
+
+ private String taskId;
+
+ /**当前任务名称**/
+ private String taskName;
+
+ /**当前环节流程ID**/
+ @NotNull
+ private String processDefinitionKey;
+
+
+ /**
+ * 业务Id
+ */
+ private String businessKey;
+
+
+ /**
+ * 流程实例key
+ */
+ private String processInstanceId;
+
+
+ /**
+ * 下一环节处理人
+ */
+ private String nextStepOperator;
+
+
+
+ /**票据表单**/
+ private Object variables;
+
+ /**
+ * 根据handleType区分是用户还是候选组角色 标识 0是用户 1是角色
+ */
+ private String handleType;
+
+
+ /**
+ * 用户Id
+ */
+ private String userId;
+}
diff --git a/hzims-service-api/pom.xml b/hzims-service-api/pom.xml
index 46e8f12..397a172 100644
--- a/hzims-service-api/pom.xml
+++ b/hzims-service-api/pom.xml
@@ -26,6 +26,7 @@
ticket-api
weather-api
common-api
+ middle-api
diff --git a/hzims-service-api/ticket-api/pom.xml b/hzims-service-api/ticket-api/pom.xml
index 89ced25..3b3be45 100644
--- a/hzims-service-api/ticket-api/pom.xml
+++ b/hzims-service-api/ticket-api/pom.xml
@@ -21,5 +21,11 @@
com.hnac.hzims
hzims-operational-api
+
+ com.hnac.hzims
+ middle-api
+ 4.0.0-SNAPSHOT
+ provided
+
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java
index 8d424ac..7f8e409 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/OperationTicketFeignClientFallback.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.fallback;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java
index 03c672b..0e2bc75 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/fallback/TicketProcessFeignClientFallback.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.fallback;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java
index b07f0b0..8070650 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/OperationTicketFeignClient.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.feign;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.ticketprocess.fallback.OperationTicketFeignClientFallback;
import io.swagger.annotations.ApiOperation;
diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java
index 94ec0c0..f117e90 100644
--- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java
+++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/ticketprocess/feign/TicketProcessFeignClient.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.ticket.ticketprocess.feign;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.ticketprocess.fallback.TicketProcessFeignClientFallback;
import io.swagger.annotations.ApiOperation;
diff --git a/hzims-service/hzims-middle/pom.xml b/hzims-service/hzims-middle/pom.xml
index 09d8a4d..f8c28c7 100644
--- a/hzims-service/hzims-middle/pom.xml
+++ b/hzims-service/hzims-middle/pom.xml
@@ -113,6 +113,11 @@
ticket-api
+
+ com.hnac.hzims
+ middle-api
+ 4.0.0-SNAPSHOT
+
diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java
index 822e0ea..2cddc09 100644
--- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java
+++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/consumer/StandardWorkTicketConsumer.java
@@ -2,11 +2,11 @@ package com.hnac.hzims.middle.processflow.consumer;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.entity.WorkflowOperationLog;
import com.hnac.hzims.middle.processflow.service.WorkflowOperationLogService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.extern.slf4j.Slf4j;
import org.springblade.queue.annotation.RedisQueue;
import org.springblade.queue.consume.IQueueConsume;
diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java
index 0ca7ccb..3579ff7 100644
--- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java
+++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java
@@ -5,13 +5,13 @@ import com.alibaba.fastjson.JSON;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.entity.ProcessType;
import com.hnac.hzims.middle.processflow.properties.TicketProperties;
import com.hnac.hzims.middle.processflow.properties.WorkTicketProperties;
import com.hnac.hzims.middle.processflow.service.ProcessTypeService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil;
diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java
index 432ee87..cf5f4ea 100644
--- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java
+++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/service/ProcessService.java
@@ -1,7 +1,7 @@
package com.hnac.hzims.middle.processflow.strategy.service;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
/**
* @Author dfy
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 d332bb0..ac68fc7 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
@@ -1,16 +1,16 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/**
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 acf85bd..2e99908 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
@@ -1,16 +1,16 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.operational.maintenance.feign.MaintenanceFeignClient;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MAINTENANCE_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MAINTENANCE_KEY;
/**
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 da0ebae..2b4df40 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
@@ -1,17 +1,17 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.FIRST_TICKET_KEY;
/**
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 5d36191..f3ab75d 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
@@ -1,16 +1,16 @@
package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springframework.stereotype.Service;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/**
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java
index c9b3847..6d42bb3 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/DataServiceImpl.java
@@ -11,7 +11,6 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
-import com.sun.org.apache.regexp.internal.RE;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
index 9e0e69b..d4868a4 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
@@ -1,8 +1,8 @@
package com.hnac.hzims.operational.maintenance.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.maintenance.service.MaintenanceService;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
index 1fb0176..164901e 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/MaintenanceService.java
@@ -2,7 +2,7 @@ package com.hnac.hzims.operational.maintenance.service;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import java.util.List;
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 bf80bbc..dc17a53 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
@@ -11,6 +11,7 @@ import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.maintenance.entity.OperMaintenancePlanEntity;
@@ -21,7 +22,6 @@ import com.hnac.hzims.operational.maintenance.service.MaintenanceService;
import com.hnac.hzims.operational.maintenance.template.service.TemplateService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenanceTaskEntityVo;
import com.hnac.hzims.operational.util.StringObjUtils;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
diff --git a/hzims-service/pom.xml b/hzims-service/pom.xml
index b690007..5db9e32 100644
--- a/hzims-service/pom.xml
+++ b/hzims-service/pom.xml
@@ -55,6 +55,14 @@
org.springblade
blade-starter-datascope
+
+
+
+
+ com.hnac.hzims
+ middle-api
+ 4.0.0-SNAPSHOT
+
diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml
index 9325e7a..181070e 100644
--- a/hzims-service/ticket/pom.xml
+++ b/hzims-service/ticket/pom.xml
@@ -280,6 +280,11 @@
+
+ com.hnac.hzims
+ middle-api
+ 4.0.0-SNAPSHOT
+
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java
index 8860871..f2b745f 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java
@@ -2,10 +2,10 @@ package com.hnac.hzims.ticket.redisConsume;
import com.alibaba.fastjson.JSONObject;
import com.hnac.hzims.common.config.RedisMessageListener;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.constants.TicketConstants;
import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
index b48ff66..2ef7a12 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
@@ -1,9 +1,9 @@
package com.hnac.hzims.ticket.standardTicket.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
index da8d606..4d5df20 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/OperationTicketService.java
@@ -1,8 +1,8 @@
package com.hnac.hzims.ticket.standardTicket.service;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import javax.servlet.http.HttpServletResponse;
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 c42e186..722c0d9 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
@@ -5,12 +5,12 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService;
+import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
import com.hnac.hzims.common.logs.utils.StringUtils;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.dto.MessagePushRecordDto;
import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.ticket.constants.TicketConstants;
@@ -52,7 +52,7 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.OPERATION_TICKET_KEY;
/**
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
index 9ed5c45..c435161 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
@@ -1,9 +1,9 @@
package com.hnac.hzims.ticket.twoTicket.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 9117268..ac72f7c 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
@@ -1,7 +1,7 @@
package com.hnac.hzims.ticket.twoTicket.service;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.twoTicket.vo.process.WorkTicketVo;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import javax.servlet.http.HttpServletResponse;
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 e671ae2..c68b92f 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
@@ -7,11 +7,12 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.hnac.hzims.common.logs.fegin.ProcessDictFeignService;
import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.message.MessageConstants;
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;
import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.operational.access.feign.IOperAccessTaskClient;
import com.hnac.hzims.operational.feign.IAccessTaskClient;
@@ -38,7 +39,6 @@ import com.hnac.hzims.ticket.workTicket.entity.*;
import com.hnac.hzims.ticket.workTicket.service.*;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketDelayServiceImpl;
import com.hnac.hzims.ticket.workTicket.service.impl.WorkTicketOperateTimeServiceImpl;
-import com.hnac.hzims.common.to.process.ProcessWorkFlowResponse;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
@@ -71,8 +71,8 @@ import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.FIRST_TICKET_KEY;
-import static com.hnac.hzims.common.logs.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.FIRST_TICKET_KEY;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.MACHINERY_TICKET_KEY;
/**
From 3fa2626a4abf901a20c64fdb1b5a46e30e4f66d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Fri, 16 Jun 2023 16:13:02 +0800
Subject: [PATCH 02/13] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=A5=A8=E5=90=AF?=
=?UTF-8?q?=E5=8A=A8=E6=B5=81=E7=A8=8B=E8=BF=94=E5=9B=9EtiketId=E7=BB=99?=
=?UTF-8?q?=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4=E6=B5=81=E7=A8=8B=E7=BB=91?=
=?UTF-8?q?=E5=AE=9A=E5=B7=A5=E4=BD=9C=E7=A5=A8Id?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ticket/twoTicket/controller/TicketProcessController.java | 9 ++++-----
.../hzims/ticket/twoTicket/service/TicketProcessService.java | 2 +-
.../ticket/twoTicket/service/impl/TicketProcessServiceImpl.java | 3 ++-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
index c435161..2a18960 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
@@ -41,18 +41,19 @@ public class TicketProcessController {
@ApiOperation("启动流程")
@PostMapping("/startUp")
public R start(@RequestBody WorkTicketVo workTicketVo) {
- ticketProcessService.startUp(workTicketVo);
- return R.success("申请开票成功");
+ Long ticketId = ticketProcessService.startUp(workTicketVo);
+ return R.data(ticketId);
}
/**
* 工作票待处理
+ *
* @param response
*/
@PostMapping("/findPending")
@ApiOperation(value = "工作票待处理")
- public Boolean findPending(@RequestBody ProcessWorkFlowResponse response){
+ public Boolean findPending(@RequestBody ProcessWorkFlowResponse response) {
try {
ticketProcessService.findPending(response);
return true;
@@ -62,8 +63,6 @@ public class TicketProcessController {
}
-
-
/**
* 预览
*/
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 ac72f7c..906c85d 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
@@ -17,7 +17,7 @@ public interface TicketProcessService {
/**
* 启动开票流程
*/
- void startUp(WorkTicketVo workTicketVo);
+ Long startUp(WorkTicketVo workTicketVo);
/**
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 c68b92f..2b71d51 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
@@ -159,7 +159,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
@SneakyThrows
@Override
@Transactional
- public void startUp(WorkTicketVo workTicketVo) {
+ public Long startUp(WorkTicketVo workTicketVo) {
log.info("执行 com.hnac.hzims.ticket.twoTicket.service.impl【startUp】 。。。方法");
if (workTicketVo.getWorkTicket().getSignage() == null) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置");
@@ -214,6 +214,7 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//8. 处理任务
this.returnTicket(workTicketVo);
+ return workTicketVo.getWorkTicket().getId();
}
/**
From 2dbbefd330c20d50dd955cce7e248c3514ebeb82 Mon Sep 17 00:00:00 2001
From: tyty
Date: Fri, 16 Jun 2023 16:38:32 +0800
Subject: [PATCH 03/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B6=88=E7=BC=BA?=
=?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../defect/constants/TreatMethodConstant.java | 1 +
.../defect/entity/OperAppearanceEntity.java | 169 +++
.../defect/entity/OperDefectEntity.java | 73 +-
.../defect/entity/OperDefectStatisticsEntity.java | 65 +-
.../defect/entity/OperPhenomenonEntity.java | 114 +-
.../feign/Fallback/IOperDefectClientFallback.java | 6 +
.../defect/feign/IOperDefectClient.java | 10 +-
.../com/hnac/hzims/message/MessageConstants.java | 2 +-
.../defect/controller/DefectCheckController.java | 9 +-
.../operational/defect/feign/OperDefectClient.java | 10 +-
.../defect/mapper/OperAppearanceMapper.java | 14 +
.../defect/mapper/OperAppearanceMapper.xml | 6 +
.../defect/service/IDefectCheckService.java | 3 +
.../defect/service/IOperAppearanceService.java | 13 +
.../service/impl/DefectCheckServiceImpl.java | 1324 ++++++++++++--------
.../service/impl/OperAppearanceServiceImpl.java | 16 +
16 files changed, 1259 insertions(+), 576 deletions(-)
create mode 100644 hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java
create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml
create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java
create mode 100644 hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java
index faa3a8c..0760506 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/constants/TreatMethodConstant.java
@@ -10,6 +10,7 @@ public interface TreatMethodConstant {
* 流程主键
*/
String DEFECT_CHECK_PRIMARY_KEY = "defect_check";
+ String DEFECT_CHECK_PRIMARY_KEY_TY = "defectDealty";
/**
* 1-应急抢修处理 、2 - 检修任务处理 、 3- 检修计划处理
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
new file mode 100644
index 0000000..38bb8e1
--- /dev/null
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java
@@ -0,0 +1,169 @@
+package com.hnac.hzims.operational.defect.entity;
+
+import com.baomidou.mybatisplus.annotation.SqlCondition;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.tenant.mp.TenantEntity;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+
+/**
+ * 实体类
+ *
+ * @author Chill
+ */
+@Data
+@TableName("hzims_oper_appearance")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "现象表", description = "现象表")
+public class OperAppearanceEntity extends TenantEntity {
+
+ private static final long serialVersionUID = 8353403086998937117L;
+
+ /**
+ * 缺陷编码
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "缺陷编码")
+ private String defectCode;
+ /**
+ * 问题来源:ZB:值班管理,RCWH:日常维护,XJ:巡检管理,JX:检修管理,ZNZD:智能诊断
+ */
+ @QueryField(condition = SqlCondition.EQUAL)
+ @ApiModelProperty(value = "问题来源: 数据字典:defectSource")
+ private String sourceCode;
+
+ /**
+ * 问题发现人
+ */
+ @QueryField(condition = SqlCondition.EQUAL)
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "问题发现人")
+ private Long finder;
+ /**
+ * 问题类型:
+ *
+ */
+ @QueryField(condition = SqlCondition.EQUAL)
+ @ApiModelProperty(value = "问题类型:字典key : defectType")
+ private String typeCode;
+ /**
+ * 发现时间
+ */
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @ApiModelProperty(value = "发现时间")
+ private Date findTime;
+
+ /**
+ * 名称
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "名称,如果是设备则是设备名称。")
+ private String name;
+ /**
+ * 设备编号
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "设备编号")
+ private String emCode;
+ /**
+ * 故障编码
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "故障缺陷编码")
+ private String faultCode;
+ /**
+ * 故障名称
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "故障缺陷名称")
+ private String faultName;
+ /**
+ * 现象描述
+ */
+ @ApiModelProperty(value = "现象描述")
+ private String descripiton;
+ /**
+ * 故障文件附件,多个文件url通过,隔开
+ */
+ @ApiModelProperty(value = "现象文件附件,多个文件url通过,隔开")
+ private String fileUrls;
+ /**
+ * 初步分析结果
+ */
+ @ApiModelProperty(value = "初步分析结果")
+ private String initResult;
+
+
+ /**
+ * 甄别人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "甄别人")
+ private Long discriminator;
+ /**
+ * 甄别时间
+ */
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @ApiModelProperty(value = "甄别时间")
+ private Date discriminateTime;
+
+
+
+ /**
+ * 甄别状态:已甄别 1 和未甄别 0 ,默认0
+ */
+ @QueryField(condition = SqlCondition.EQUAL)
+ @ApiModelProperty(value = "甄别状态:已甄别 1 和未甄别 0 ,默认0")
+ private String discriminateStatus;
+
+ /**
+ * 是否为缺陷
+ */
+ @QueryField(condition = SqlCondition.EQUAL)
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否为缺陷,0 否,1是")
+ private Integer isDefect;
+ /**
+ * 甄别描述
+ */
+ @ApiModelProperty(value = "甄别描述")
+ private String discriminateDesc;
+ /**
+ * 备注(冗余)
+ */
+ @ApiModelProperty(value = "备注(冗余)")
+ private String remark;
+
+ /**
+ * 是否使用智能诊断
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否使用智能诊断")
+ private Integer isDiagnosis;
+ /**
+ * 智能诊断任务ID
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "智能诊断任务ID")
+ private Long diagnosisId;
+}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
index c4b174c..ac995bc 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java
@@ -4,17 +4,18 @@ import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springblade.core.mp.support.QueryField;
-import org.springblade.core.tenant.mp.TenantEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.YearMonth;
import java.util.Date;
-import java.util.List;
/**
@@ -89,16 +90,17 @@ public class OperDefectEntity extends TenantEntity {
private String disposeDesc;
@TableField(exist = false)
- @ApiModelProperty(value = "开始时间")
+ @ApiModelProperty(value = "缺陷创建时间-开始时间")
private String startTime;
@TableField(exist = false)
- @ApiModelProperty(value = "结束时间")
+ @ApiModelProperty(value = "缺陷创建时间-结束时间")
private String endTime;
- @TableField(exist = false)
- @ApiModelProperty(value = "机构编号集合")
- private List deptIds;
+// 20230612弃用该字段,无地方引用
+// @TableField(exist = false)
+// @ApiModelProperty(value = "机构编号集合")
+// private List deptIds;
/**
@@ -113,4 +115,55 @@ public class OperDefectEntity extends TenantEntity {
@ApiModelProperty(value = "年月")
@TableField(exist = false)
private YearMonth yearMonth;
+ /**
+ * 计划处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "计划处理人")
+ private String planHandler;
+ /**
+ * 处理结论
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "处理结论")
+ private String handlerConclusion;
+
+ /**
+ * 缺陷等级
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "缺陷等级")
+ private String defectGrading;
+ /**
+ * 定论词条
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "定论词条")
+ private String conclusionLabel;
+
+ /**
+ * 备注(冗余)
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "备注(冗余)")
+ private String remark;
+ /**
+ * 是否使用智能诊断
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否使用智能诊断")
+ private Integer isDiagnosis;
+ /**
+ * 智能诊断任务ID
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "智能诊断任务ID")
+ private Long diagnosisId;
+ /**
+ * 已有缺陷编码
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "已有缺陷编码")
+ private String existDefectId;
+
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
index d241884..68779a2 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java
@@ -5,16 +5,15 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
-import org.springblade.core.mp.support.QueryField;
-import org.springblade.core.tenant.mp.TenantEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
-import java.time.LocalDateTime;
/**
@@ -227,4 +226,60 @@ public class OperDefectStatisticsEntity extends TenantEntity {
@ApiModelProperty(value = "定论时间")
private Date conclusionTime;
+ /**
+ * 计划处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "计划处理人")
+ private String planHandler;
+
+ /**
+ * 处理结论
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "处理结论")
+ private String handlerConclusion;
+ /**
+ * 是否入库
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否入库")
+ private Boolean isWarehousing;
+ /**
+ * 当前处理环节
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前处理环节")
+ private String currentOperator;
+ /**
+ * 当前环节处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前环节处理人")
+ private String currentLinkHandler;
+ /**
+ * 备注(冗余)
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "备注(冗余)")
+ private String remark;
+ /**
+ * 是否使用智能诊断
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否使用智能诊断")
+ private Integer isDiagnosis;
+ /**
+ * 智能诊断任务ID
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "智能诊断任务ID")
+ private Long diagnosisId;
+ /**
+ * 已有缺陷编码
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "已有缺陷编码")
+ private String existDefectId;
+
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
index bbcd030..e4ced33 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java
@@ -1,23 +1,19 @@
package com.hnac.hzims.operational.defect.entity;
import com.baomidou.mybatisplus.annotation.SqlCondition;
-import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import org.springblade.core.mp.support.QueryField;
-import org.springblade.core.tenant.mp.TenantEntity;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;
-import java.time.YearMonth;
import java.util.Date;
-import java.time.LocalDateTime;
/**
@@ -28,7 +24,7 @@ import java.time.LocalDateTime;
@Data
@TableName("hzims_oper_phenomenon")
@EqualsAndHashCode(callSuper = true)
-@ApiModel(value = "问题现象表", description = "问题现象表")
+@ApiModel(value = "问题现象全表", description = "问题现象全表")
public class OperPhenomenonEntity extends TenantEntity {
private static final long serialVersionUID = 8353403086998937117L;
@@ -54,7 +50,7 @@ public class OperPhenomenonEntity extends TenantEntity {
/**
* 甄别流程实例
*/
- @ApiModelProperty(value = "甄别流程实例")
+ @ApiModelProperty(value = "流程实例")
private String checkProcessInstanceId;
/**
* 问题发现人
@@ -64,7 +60,7 @@ public class OperPhenomenonEntity extends TenantEntity {
@ApiModelProperty(value = "问题发现人")
private Long finder;
/**
- * 问题类型:
+ * 问题类型:0-设备和1-非设备。
*
*/
@QueryField(condition = SqlCondition.EQUAL)
@@ -287,4 +283,100 @@ public class OperPhenomenonEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class)
@ApiModelProperty(value = "核算工时")
private Integer checkHours;
+ /**
+ * 计划处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "计划处理人")
+ private String planHandler;
+ /**
+ * 实际开始时间
+ */
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @ApiModelProperty(value = "实际开始时间")
+ private Date actStartTime;
+
+ /**
+ * 实际结束时间
+ */
+ @DateTimeFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss"
+ )
+ @ApiModelProperty(value = "实际结束时间")
+ private Date actEndTime;
+ /**
+ * 处理结论
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "处理结论")
+ private String handlerConclusion;
+ /**
+ * 是否入库
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否入库")
+ private Boolean isWarehousing;
+ /**
+ * 缺陷等级
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "缺陷等级")
+ private String defectGrading;
+ /**
+ * 定论词条
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "定论词条")
+ private String conclusionLabel;
+ /**
+ * 当前处理环节
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前处理环节")
+ private String currentOperator;
+ /**
+ * 当前环节处理人
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前环节处理人")
+ private String currentLinkHandler;
+ /**
+ * 备注(冗余)
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "备注(冗余)")
+ private String remark;
+ /**
+ * 是否使用智能诊断
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "是否使用智能诊断")
+ private Integer isDiagnosis;
+ /**
+ * 智能诊断任务ID
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "智能诊断任务ID")
+ private Long diagnosisId;
+ /**
+ * 已有缺陷编码
+ */
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "已有缺陷编码")
+ private String existDefectId;
+ /**
+ * 现象名称
+ */
+ @QueryField(condition = SqlCondition.LIKE)
+ @ApiModelProperty(value = "现象名称")
+ private String defectName;
+
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java
index 5419761..421f3a9 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/Fallback/IOperDefectClientFallback.java
@@ -1,5 +1,6 @@
package com.hnac.hzims.operational.defect.feign.Fallback;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.feign.IOperDefectClient;
@@ -34,4 +35,9 @@ public class IOperDefectClientFallback implements IOperDefectClient {
log.error("远程调用失败,接口:" + CREATE_DEFECT);
return null;
}
+ @Override
+ public R saveDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
+ log.error("远程调用失败,接口:" + SAVE_DEFECT);
+ return null;
+ }
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java
index f8fc74c..b3ff803 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/feign/IOperDefectClient.java
@@ -1,6 +1,6 @@
package com.hnac.hzims.operational.defect.feign;
-
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.OperationalConstants;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
@@ -26,6 +26,8 @@ public interface IOperDefectClient {
String UPDATE_DEFECT_HANDLER_STATE = API_PREFIX + "/updateDefectHandlerState";
String CREATE_DEFECT = API_PREFIX + "/createDefect";
+ String SAVE_DEFECT = API_PREFIX + "/saveDefect";
+
/**
* 修改缺陷信息
* @param entity
@@ -39,4 +41,10 @@ public interface IOperDefectClient {
@PostMapping(CREATE_DEFECT)
R createDefect(@RequestBody OperPhenomenonEntity phenomenon);
+
+ @PostMapping(SAVE_DEFECT)
+ R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse);
+
+
+
}
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
index 6741a3f..4d55a16 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
@@ -1,7 +1,6 @@
package com.hnac.hzims.message;
import lombok.AllArgsConstructor;
-import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -55,6 +54,7 @@ public class MessageConstants {
ACCESS("access","检修消息"),
TICKETMESSAGE("ticket-message","工作票消息"),
OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"),
+ OPERATIONDEFECTMESSAGE("operation-defect-message","消缺消息"),
;
@Getter
private String key;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java
index 660d34e..4f93ac5 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/DefectCheckController.java
@@ -5,17 +5,16 @@ import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IDefectCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
/**
* @author ysj
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java
index 2841984..33366bf 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/feign/OperDefectClient.java
@@ -1,12 +1,13 @@
package com.hnac.hzims.operational.defect.feign;
+
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.service.IDefectCheckService;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@@ -32,8 +33,15 @@ public class OperDefectClient implements IOperDefectClient {
return R.data(service.updateDefectHanderState(entity));
}
+ @PostMapping(CREATE_DEFECT)
@Override
public R createDefect(@RequestBody OperPhenomenonEntity entity) {
return R.data(defectCheckService.startCheck(entity));
}
+
+ @PostMapping(SAVE_DEFECT)
+ @Override
+ public R saveDefect(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse) {
+ return defectCheckService.listenAndUpdateDefect(processWorkFlowResponse);
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java
new file mode 100644
index 0000000..5e6b381
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.java
@@ -0,0 +1,14 @@
+package com.hnac.hzims.operational.defect.mapper;
+
+import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
+import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
+
+/**
+ * Mapper 接口
+ *
+ * @author Chill
+ */
+public interface OperAppearanceMapper extends UserDataScopeBaseMapper {
+
+
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml
new file mode 100644
index 0000000..4fbcacd
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/mapper/OperAppearanceMapper.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java
index 54479d2..8869659 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IDefectCheckService.java
@@ -1,7 +1,9 @@
package com.hnac.hzims.operational.defect.service;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.tool.api.R;
import org.springblade.flow.core.vo.ComleteTask;
@@ -42,6 +44,7 @@ public interface IDefectCheckService extends BaseService {
* @param task
*/
void conclusion(ComleteTask task);
+ R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse);
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java
new file mode 100644
index 0000000..0b28cbb
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperAppearanceService.java
@@ -0,0 +1,13 @@
+package com.hnac.hzims.operational.defect.service;
+
+import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
+import org.springblade.core.mp.base.BaseService;
+
+/**
+ * 服务类
+ *
+ * @author Chill
+ */
+public interface IOperAppearanceService extends BaseService {
+
+}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
index 0311a6d..54d09c8 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
@@ -4,25 +4,34 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.hnac.hzims.common.logs.utils.StringUtils;
import com.hnac.hzims.fdp.feign.IFdpTaskClient;
+import com.hnac.hzims.message.MessageConstants;
+import com.hnac.hzims.message.dto.MessagePushRecordDto;
+import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.operational.access.dto.OperAccessPlanDTO;
import com.hnac.hzims.operational.access.dto.OperAccessTaskDTO;
import com.hnac.hzims.operational.access.service.IOperAccessPlanService;
import com.hnac.hzims.operational.access.service.IOperAccessTaskService;
-import com.hnac.hzims.operational.defect.config.DefectConfiguration;
import com.hnac.hzims.operational.defect.constants.RepairConstant;
import com.hnac.hzims.operational.defect.constants.TreatMethodConstant;
+import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
import com.hnac.hzims.operational.defect.entity.OperDefectEntity;
import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper;
import com.hnac.hzims.operational.defect.service.IDefectCheckService;
+import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
import com.hnac.hzims.operational.defect.service.IOperDefectService;
import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService;
import com.hnac.hzims.ticket.repair.entity.RepairEntity;
import com.hnac.hzims.ticket.repair.fegin.IRepairClient;
import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.math.NumberUtils;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
@@ -34,6 +43,7 @@ import org.springblade.flow.core.feign.IFlowClient;
import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.vo.ComleteTask;
import org.springblade.system.cache.DictCache;
+import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
@@ -41,6 +51,11 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -53,549 +68,774 @@ import java.util.stream.Collectors;
* @author ysj
*/
@Service
+@Slf4j
@RequiredArgsConstructor
public class DefectCheckServiceImpl extends BaseServiceImpl implements IDefectCheckService {
- private final IOperAccessTaskService operAccessTaskService;
-
- private final IOperAccessPlanService operAccessPlanService;
-
- private final IOperDefectStatisticsService statisticsService;
- private final IOperDefectService defectService;
-
- private final IOperAccessPlanService accessPlanService;
-
- private final OperPhenomenonMapper phenomenonMapper;
-
- private final IFlowClient processClient;
-
- private final IUserClient userClient;
-
- private final IFdpTaskClient fdpTaskClient;
-
-
- private final IRepairClient repairClient;
-
- /**
- * 保存现象、开启缺陷处理流程
- * @param entity
- * @return
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public OperPhenomenonEntity startCheck(OperPhenomenonEntity entity) {
- // 步骤1.保存现象
- if(!this.savePhenomenon(entity)){
- throw new ServiceException("保存现象失败!");
- }
- // 步骤2.开启缺陷流程
- this.startDefectCheck(entity);
- return entity;
- }
-
- /**
- * 保存现象
- * @param entity
- * @return
- */
- private boolean savePhenomenon(OperPhenomenonEntity entity) {
- DateTimeFormatter format = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME_MINI);
- // 缺陷编码 : 缺陷来源 + 时间格式化 + 三位长度随机值
- if(Func.isEmpty(entity.getDefectCode())){
- entity.setDefectCode(entity.getSourceCode() + format.format(LocalDateTime.now()) + Func.random(3));
- }
- // 现象发起人 : 当前用户Id
- if(Func.isEmpty(entity.getFinder())){
- entity.setFinder(AuthUtil.getUserId());
- }
- // 现象发起时间
- entity.setFindTime(new Date());
- // 现象更新时间
- entity.setUpdateTime(new Date());
- // 现在最后甄别时间
- Date discriminateDeadline = DateUtil.plusHours(entity.getUpdateTime(), DefectConfiguration.discriminateDeadline);
- entity.setDiscriminateDeadline(discriminateDeadline);
- return this.save(entity);
- }
-
- /**
- * 启动缺陷处理流程
- * @param entity
- */
- private void startDefectCheck(OperPhenomenonEntity entity) {
- // 获取机构下执行定论缺陷角色用户
- List list = this.getAliasUser(entity.getTenantId(),entity.getCreateDept(),TreatMethodConstant.PHENOMENON_SCREEN_ALIAS);
- if(CollectionUtil.isEmpty(list)){
- throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
- }
- List userList = list.stream().map(o -> "taskUser_" + o.getId().toString()).collect(Collectors.toList());
- // 现象发起人名字
- String userName = Optional.ofNullable(UserCache.getUser(entity.getFinder()).getName()).orElse("");
- // 现象发起来源
- String sourceName = DictCache.getValue(TreatMethodConstant.SOURCE_CODE_PREFIX,entity.getSourceCode());
- // 流程名称
- String processName = "[" + userName + "] 发起 " + "【" + sourceName + "】缺陷处理流程" +"——>" + entity.getDefectCode();
- // 设置下一步执行流程用户
- Kv variables = Kv.create()
- .set(TreatMethodConstant.PHENOMENON_SCREEN_USER,String.join(",", userList));
- // 开启新的缺陷流程
- R result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK_PRIMARY_KEY, FlowUtil.getBusinessKey("hzims_oper_phenomenon","" + entity.getId()), processName, variables);
- // 流程开启失败
- if (!result.isSuccess()) {
- throw new ServiceException("缺陷流程开启失败,错误描述 : " + result.getCode());
- }
- // 关联流程唯一键
- entity.setCheckProcessInstanceId(result.getData().getProcessInstanceId());
- this.baseMapper.updateById(entity);
- }
-
-
- /**
- * 获取当前机构指定角色的用户
- * @param tenantId
- * @param deptId
- * @param alias
- * @return
- */
- public List getAliasUser(String tenantId,Long deptId,String alias){
- if(Func.isEmpty(tenantId)){
- tenantId = AuthUtil.getTenantId();
- }
- R> result = userClient.relationUserListByRoleAlias(tenantId, deptId, alias);
- if(!result.isSuccess()){
- throw new ServiceException("查询角色用户信息失败!");
- }
- return result.getData();
- }
-
- /**
- * 修改缺陷状态 -> 问题定论
- * @param handleStatus
- * @param defectCode
- */
- private void updateDefectHandleState(String handleStatus, String defectCode) {
- this.defectService.update(Wrappers.lambdaUpdate()
- .set(OperDefectEntity::getHandleStatus,handleStatus)
- .eq(OperDefectEntity::getDefectCode,defectCode)
- );
- }
-
-
- /**
- * 甄别缺陷
- * @param task
- * @return
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void screeDefect(ComleteTask task) {
- // 步骤1.现象前置判断(现象状态检查)
- OperPhenomenonEntity entity = this.preposePhenomenon(task.getProcessInstanceId());
-
- // 步骤2.更新甄别状态、数据
- this.screePhenomenonUpdate(task);
-
- // 步骤3.现象添加至缺陷库
- this.defectSave(entity);
-
- // 步骤4.流程执行至甄别处理方式
- processClient.completeTask(task);
- }
-
- /**
- * 现象前置判断
- * @param processInstanceId
- * @return
- */
- private OperPhenomenonEntity preposePhenomenon(String processInstanceId) {
- LambdaQueryWrapper wrapper = new LambdaQueryWrapper() {{
- eq(OperPhenomenonEntity::getCheckProcessInstanceId, processInstanceId);
- }};
- // 查询现象状态
- OperPhenomenonEntity entity = this.getOne(wrapper);
- if(ObjectUtil.isEmpty(entity)){
- throw new ServiceException("现象不存在");
- }
- // 现象已被自动甄别
- if(TreatMethodConstant.AUTO_SCREENED.equals(entity.getAutoDiscriminateStatus())){
- throw new ServiceException("该现象已经自动甄别");
- }
- // 现象已被手动动甄别
- if(TreatMethodConstant.SCREENED.equals(entity.getDiscriminateStatus())){
- throw new ServiceException("该现象已甄别");
- }
- return entity;
- }
-
- /**
- * 缺陷保存
- * @param phenomenon
- */
- private void defectSave(OperPhenomenonEntity phenomenon) {
- OperDefectEntity defect = new OperDefectEntity();
- defect.setHandleStatus(RepairConstant.DEFAULT_DEFECT_STATE);
- defect.setProcessInstanceId(phenomenon.getCheckProcessInstanceId());
- defect.setDefectCode(phenomenon.getDefectCode());
- defect.setCreateUser(phenomenon.getCreateUser());
- defect.setCreateDept(phenomenon.getCreateDept());
- defect.setTenantId(phenomenon.getTenantId());
- this.defectService.save(defect);
- }
-
- /**
- * 更新甄别状态、数据
- * @param task
- */
- private void screePhenomenonUpdate(ComleteTask task) {
- // 查询流程状态
- String processStatus = TreatMethodConstant.RUNNING;
- R result = processClient.queryProcessInstanceStatus(task.getProcessInstanceId());
- if(result.isSuccess() && StringUtil.isNotBlank(result.getData()) && TreatMethodConstant.PROCESS_STATE_OVER.equals(result.getData())){
- processStatus = TreatMethodConstant.PROCESS_STATE_OVER;
- }
- // 获取参数集
- Map variables = task.getVariables();
- boolean invalid = (boolean) variables.get("invalid");
- LambdaUpdateWrapper lambdaUpdate = Wrappers.lambdaUpdate();
- if(invalid){
- lambdaUpdate
- .set(OperPhenomenonEntity::getStatus,processStatus)
- .set(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT)
- .set(OperPhenomenonEntity::getAutoDiscriminateStatus, TreatMethodConstant.ORDINARY_SCREENED)
- .set(OperPhenomenonEntity::getDiscriminator, AuthUtil.getUserId())
- .set(OperPhenomenonEntity::getDiscriminateTime, new Date())
- .set(OperPhenomenonEntity::getDiscriminateStatus,variables.get("discriminateStatus").toString())
- .set(OperPhenomenonEntity::getDiscriminateDesc, Optional.ofNullable(variables.get("discriminateDesc")).map(Object::toString).orElse(null))
- .set(OperPhenomenonEntity::getSafeInfos, variables.get("safeInfos").toString())
- .set(OperPhenomenonEntity::getWorkStandards, Optional.ofNullable(variables.get("workStandards")).map(Object::toString).orElse(null))
- .set(OperPhenomenonEntity::getHandleProgramme, variables.get("handleProgramme").toString().substring(9))
- .set(OperPhenomenonEntity::getPlanHours, variables.get("planHours").toString())
- .set(OperPhenomenonEntity::getPlanStartTime, variables.get("planStartTime").toString())
- .set(OperPhenomenonEntity::getPlanEndTime, variables.get("planEndTime").toString())
- .set(OperPhenomenonEntity::getDefectLevel, variables.get("defectLevel").toString())
- .eq(OperPhenomenonEntity::getCheckProcessInstanceId,task.getProcessInstanceId());
- }else{
- lambdaUpdate
- .set(OperPhenomenonEntity::getStatus,processStatus)
- .set(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.NO_DEFECT)
- .set(OperPhenomenonEntity::getDiscriminateStatus,variables.get("discriminateStatus").toString())
- .set(OperPhenomenonEntity::getDiscriminator, AuthUtil.getUserId())
- .set(OperPhenomenonEntity::getDiscriminateTime, new Date())
- .set(OperPhenomenonEntity::getDiscriminateDesc, variables.get("discriminateDesc").toString())
- .eq(OperPhenomenonEntity::getCheckProcessInstanceId,task.getProcessInstanceId());
- }
- this.update(lambdaUpdate);
- }
-
- /**
- * 决策处理方式
- * @param task
- * @return
- */
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void treatmentMethod(ComleteTask task) {
- // 步骤1.获取参数集
- Map variables = task.getVariables();
-
- // 步骤2.根据处理方式进行处理
- String state = RepairConstant.REPAIR_DEFECT_STATE,processKey = RepairConstant.REPAIR_PROCESS_PRIMARY_KEY
- ,type = variables.get("type").toString();
- switch (type){
- // 应急抢修处理
- case TreatMethodConstant.TYPE_RUSH_TO_REPAIR:
- this.startRepair(task,variables);
- break;
- // 检修计划处理
- case TreatMethodConstant.TYPE_PLAN:
- state = RepairConstant.ACCESS_PLAN_STATE;
- this.startMaintenancePlan(task,variables);
- break;
- // 检修任务处理
- case TreatMethodConstant.TYPE_TASK:
- state = RepairConstant.ACCESS_TASK_STATE;
- this.startMaintenanceTask(task);
- break;
- default:
- throw new IllegalStateException("Unexpected type: " + type);
- }
- // 步骤3.关联处理任务
- this.relationHandlerTask(variables,type,task.getProcessInstanceId(),state);
-
- // 步骤4.缺陷库保存处理任务信息
- this.saveDefectInfo(variables,task.getProcessInstanceId(),processKey,state);
-
- // 步骤5.流程执行 -> 处理缺陷
- processClient.completeTask(task);
- }
-
- /**
- * 启动应急抢修流程
- * @param variables
- */
- private void startRepair(ComleteTask task,Map variables) {
- String json = JSON.toJSONString(variables.get("repair"));
- RepairEntity entity = JSONObject.parseObject(json, RepairEntity.class);
- R result = repairClient.startRepair(entity);
- if(!result.isSuccess()){
- throw new ServiceException("开启检修任务流程失败!");
- }
- variables.put("handlerTaskId",result.getData().getId());
- variables.put("handlerType",TreatMethodConstant.REPAIR);
- variables.put("handlerProcessInstanceId",result.getData().getProcessInstanceId());
- variables.put("handlerUserId",result.getData().getCharge());
- variables.put(TreatMethodConstant.DEFECT_HANDLER_USER,"taskUser_" + result.getData().getCharge());
- task.setVariables(variables);
- }
-
- /**
- * 开启检修计划
- * @param variables
- */
- private void startMaintenancePlan(ComleteTask task,Map variables) {
- String json = JSON.toJSONString(variables.get("accessPlan"));
- OperAccessPlanDTO accessPlan = JSONObject.parseObject(json,OperAccessPlanDTO.class);
- // 查询现象
- OperPhenomenonEntity phenomenon = this.getOne(new LambdaQueryWrapper() {{
- eq(OperPhenomenonEntity::getCheckProcessInstanceId, task.getProcessInstanceId());
- }});
-
- // 查询缺陷
- OperDefectEntity defect = this.defectService.getOne(Wrappers.lambdaUpdate().eq(OperDefectEntity::getDefectCode, phenomenon.getDefectCode()));
- accessPlan.setDefectId(defect.getId());
- accessPlan.setPhenomenonId(phenomenon.getId());
- accessPlan.setActStartTime(DateUtil.now());
- // 计划草稿
- R result = operAccessPlanService.doSave(accessPlan);
- if(!result.isSuccess()){
- throw new ServiceException("开启检修计划失败");
- }
- // 计划流程开启
- accessPlanService.handlePlan(accessPlan,null);
- variables.put("handlerTaskId",accessPlan.getId());
- variables.put("handlerProcessInstanceId",accessPlan.getProcessInstanceId());
- variables.put("handlerUserId",AuthUtil.getUserId());
- variables.put("handlerType",TreatMethodConstant.MAINTENANCE_PLAN);
- variables.put("actStartTime",accessPlan.getActStartTime());
- variables.put(TreatMethodConstant.DEFECT_HANDLER_USER,"taskUser_" + AuthUtil.getUserId());
- task.setVariables(variables);
- }
-
- /**
- * 开启检修任务
- * @param comleteTask
- */
- @Transactional(rollbackFor = Exception.class)
- public void startMaintenanceTask(ComleteTask comleteTask) {
- Assert.isTrue(CollectionUtil.isNotEmpty(comleteTask.getVariables()) && ObjectUtil.isNotEmpty(comleteTask.getVariables().get("accessTask")),()->{
- throw new ServiceException("检修任务信息不能为空!");
- });
- Map variables = comleteTask.getVariables();
- OperAccessTaskDTO accessTask = JSONObject.parseObject(JSON.toJSONString(variables.get("accessTask")),OperAccessTaskDTO.class);
- Assert.isTrue(Func.isNotEmpty(accessTask.getPhenomenonId()),()->{
- throw new ServiceException("检修任务信息必须传入现象Id");
- });
- R result = operAccessTaskService.doSave(accessTask);
- if(result.isSuccess()){
- variables.put("handler", "taskUser_"+accessTask.getHandler());
- }
- comleteTask.setVariables(this.excludeProperties(variables,"accessTask"));
- processClient.completeTask(comleteTask);
- variables.put("handlerTaskId",accessTask.getId());
- variables.put("handlerProcessInstanceId",accessTask.getProcessInstanceId());
- variables.put("handlerUserId",accessTask.getHandler());
- variables.put("handlerType",TreatMethodConstant.MAINTENANCE_TASK);
- variables.put("actStartTime",accessTask.getCreateTime());
- }
-
-
- /**
- * 保存缺陷信息
- * @param variables
- */
- private void saveDefectInfo(Map variables,String processInstanceId,String processKey,String state) {
- // 新启线程保存缺陷
- ExecutorService exe = Executors.newSingleThreadExecutor();
- exe.execute(()->{
- // 查询现象
- OperPhenomenonEntity entity = this.queryPhenomenon(processInstanceId);
-
- // 保存流程信息至缺陷表
- this.defectService.update(Wrappers.lambdaUpdate()
- .set(OperDefectEntity::getProcDefId,processKey + "->" + variables.get("handlerTaskId"))
- .set(OperDefectEntity::getActStartTime,variables.get("actStartTime"))
- .set(OperDefectEntity::getHandleStatus,state)
- .set(OperDefectEntity::getHandleType,variables.get("handlerType"))
- .eq(OperDefectEntity::getDefectCode,entity.getDefectCode())
- );
- });
- exe.shutdown();
- }
-
- /**
- * 关联处理任务
- * @param variables
- * @param type
- * @param processInstanceId
- */
- private void relationHandlerTask( Map variables,String type,String processInstanceId,String state) {
- this.update(Wrappers.lambdaUpdate()
- .set(OperPhenomenonEntity::getHandleTaskId,variables.get("handlerTaskId"))
- .set(OperPhenomenonEntity::getHandler,variables.get("handlerUserId"))
- .set(OperPhenomenonEntity::getHandleType,type)
- .set(OperPhenomenonEntity::getHandleStatus,state)
- .eq(OperPhenomenonEntity::getCheckProcessInstanceId,processInstanceId)
- );
- }
-
- /**
- * 补开工作票
- * @param task
- */
- @Override
- public void makeUpTicket(ComleteTask task) {
- // 步骤1.查询现象
- OperPhenomenonEntity entity = this.queryPhenomenon(task.getProcessInstanceId());
-
- // 步骤2.获取定论角色-用户
- List list = this.getAliasUser(entity.getTenantId(),entity.getCreateDept(),TreatMethodConstant.PHENOMENON_CONCLUSION_ALIAS);
- if(CollectionUtil.isEmpty(list)){
- throw new ServiceException("请先添加缺陷定论角色用户,再进行补工作票");
- }
- List userList = list.stream().map(o -> "taskUser_" + o.getId().toString()).collect(Collectors.toList());
-
- // 步骤3.现象状态 -> 问题定论
- this.updatePhenomenonState(entity);
-
- // 步骤4.缺陷状态 -> 问题定论
- this.updateDefectHandleState(RepairConstant.CONCLUSION_PROBLEM,entity.getDefectCode());
-
- // 步骤5.设置参数
- Map variables = task.getVariables();
- variables.put(TreatMethodConstant.PHENOMENON_CONCLUSION_ALIAS,String.join(",", userList));
- task.setVariables(variables);
-
- // 步骤6.执行流程->问题定论
- processClient.completeTask(task);
- }
-
- /**
- * 现象状态 -> 问题定论
- * @param entity
- */
- private void updatePhenomenonState(OperPhenomenonEntity entity) {
- entity.setHandleStatus(RepairConstant.CONCLUSION_PROBLEM);
- this.phenomenonMapper.updateById(entity);
- }
-
- /**
- * 查询现象
- * @param processInstanceId
- * @return
- */
- private OperPhenomenonEntity queryPhenomenon(String processInstanceId) {
- LambdaQueryWrapper wrapper = new LambdaQueryWrapper() {{
- eq(OperPhenomenonEntity::getCheckProcessInstanceId, processInstanceId);
- }};
- return this.getOne(wrapper);
- }
-
- /**
- * 定论
- * @param task
- */
- @Override
- public void conclusion(ComleteTask task) {
- // 步骤1.查询现象
- OperPhenomenonEntity entity = this.queryPhenomenon(task.getProcessInstanceId());
-
- // 步骤2.更新现象定论信息
- this.defectConclusionInfo(task,entity.getId());
-
- // 步骤3.现象加入台账
- this.saveDefect(entity);
-
- // 步骤4.故障状态更新
- this.updateFaultState(entity.getFaultCode());
-
- // 步骤5.更新缺陷状态 -> 已处理
- this.updateDefectHandleState(RepairConstant.COMPLETE_DEFECT_STATE,entity.getDefectCode());
-
- // 步骤6.缺陷流程->结束
- processClient.completeTask(task);
- }
-
- /**
- * 更新现象定论信息
- * @param task
- */
- private void defectConclusionInfo(ComleteTask task,Long phenomenonId) {
- // 获取参数集
- Map variables = task.getVariables();
-
- // 修改现象定论信息
- OperPhenomenonEntity entity = new OperPhenomenonEntity();
- entity.setStatus(Integer.valueOf(TreatMethodConstant.OVER));
- entity.setHandleStatus(RepairConstant.COMPLETE_DEFECT_STATE);
- entity.setConclusionTime(new Date());
- entity.setConclusionPeople(AuthUtil.getUserId());
- entity.setConclusionStatus(TreatMethodConstant.CONCLUSION_COMPLETED);
- entity.setConclusion((String) variables.get("conclusion"));
- entity.setCheckHours(Integer.valueOf(variables.get("checkHours").toString()));
- entity.setId(phenomenonId);
- this.phenomenonMapper.updateById(entity);
- }
-
- /**
- * 现象加入台账
- * @param entity
- */
- private void saveDefect(OperPhenomenonEntity entity) {
- entity = phenomenonMapper.selectById(entity.getId());
- // 复制现象数据
- OperDefectStatisticsEntity statistics = BeanUtil.copy(entity, OperDefectStatisticsEntity.class);
- // 查询缺陷
- OperDefectEntity defect = this.defectService.getOne(Wrappers.lambdaUpdate().eq(OperDefectEntity::getDefectCode, entity.getDefectCode()));
- if(ObjectUtil.isEmpty(statistics)){
- return;
- }
- // 实际执行时长
- statistics.setCheckHours(entity.getCheckHours());
- statistics.setConclusion(entity.getConclusion());
- statistics.setConclusionPeople(entity.getConclusionPeople());
- statistics.setConclusionTime(entity.getConclusionTime());
- statistics.setActEndTime(defect.getActEndTime());
- statistics.setActStartTime(defect.getActStartTime());
- statistics.setDisposeDesc(defect.getDisposeDesc());
- // 台账存储
- this.statisticsService.save(statistics);
- }
-
- /**
- * 故障状态更新
- * @param faultCode
- */
- private void updateFaultState(String faultCode) {
- if(StringUtil.isBlank(faultCode)){
- return;
- }
- fdpTaskClient.updateFinishStatusByDefectCode(faultCode);
- }
-
- /**
- * 排除业务中所需属性 避免传入工作流中
- * @param variable 工作流传参map
- * @param properties 不计入工作流传参的属性
- * @return
- */
- private Map excludeProperties(Map variable,String... properties) {
- Map result = new HashMap<>();
- variable.forEach((k,v)->{
- if(!Arrays.asList(properties).contains(k)) {
- result.put(k,v);
- }
- });
- return result;
- }
+ private final IOperAccessTaskService operAccessTaskService;
+
+ private final IOperAccessPlanService operAccessPlanService;
+
+ private final IOperAppearanceService operAppearanceService;
+
+ private final IOperDefectStatisticsService statisticsService;
+ private final IOperDefectService defectService;
+
+ private final IOperAccessPlanService accessPlanService;
+
+ private final OperPhenomenonMapper phenomenonMapper;
+
+ private final IFlowClient processClient;
+
+ private final IUserClient userClient;
+
+ private final ISysClient sysClient;
+
+ private final IMessageClient messageClient;
+
+ private final IFdpTaskClient fdpTaskClient;
+
+
+ private final IRepairClient repairClient;
+
+ /**
+ * 保存现象、开启缺陷处理流程
+ *
+ * @param entity
+ * @return
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public OperPhenomenonEntity startCheck(OperPhenomenonEntity entity) {
+ // 步骤1.保存现象
+ if (!this.savePhenomenon(entity)) {
+ throw new ServiceException("保存现象失败!");
+ }
+ // 步骤2.开启缺陷流程
+ this.startDefectCheckV2(entity);
+ return entity;
+ }
+
+ /**
+ * 保存现象
+ *
+ * @param entity
+ * @return
+ */
+ private boolean savePhenomenon(OperPhenomenonEntity entity) {
+ DateTimeFormatter format = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME_MINI);
+ // 缺陷编码 : 缺陷来源 + 时间格式化 + 三位长度随机值
+ if (Func.isEmpty(entity.getDefectCode())) {
+ entity.setDefectCode(entity.getSourceCode() + format.format(LocalDateTime.now()) + Func.random(3));
+ }
+ // 现象发起人 : 当前用户Id
+ if (Func.isEmpty(entity.getFinder())) {
+ entity.setFinder(AuthUtil.getUserId());
+ }
+ // 现象发起时间
+ entity.setFindTime(new Date());
+ // 现象更新时间
+ entity.setUpdateTime(new Date());
+ // 现在最后甄别时间
+// Date discriminateDeadline = DateUtil.plusHours(entity.getUpdateTime(), DefectConfiguration.discriminateDeadline);
+// entity.setDiscriminateDeadline(discriminateDeadline);
+// 最后甄别时间字段弃用
+ return this.save(entity);
+
+ }
+
+ /**
+ * 启动缺陷处理流程
+ *
+ * @param entity
+ */
+ private void startDefectCheckV2(OperPhenomenonEntity entity) {
+ // 获取机构下执行定论缺陷角色用户
+ List list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_SCREEN_ALIAS);
+ if (CollectionUtil.isEmpty(list)) {
+ throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
+ }
+ // 现象发起人名字
+ String userName = Optional.ofNullable(UserCache.getUser(entity.getFinder()).getName()).orElse("");
+ // 现象发起来源
+ String sourceName = DictCache.getValue(TreatMethodConstant.SOURCE_CODE_PREFIX, entity.getSourceCode());
+ // 流程名称
+ String processName = "[" + userName + "] 发起 " + "【" + sourceName + "】缺陷处理流程" + "——>" + entity.getDefectCode();
+ // 开启新的缺陷流程
+ String businessKey = FlowUtil.getBusinessKey("hzims_oper_phenomenon", "" + entity.getId());
+ Map variable = entityToMap(entity);
+ R result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK_PRIMARY_KEY_TY, businessKey, processName, variable);
+ // 流程开启失败
+ if (!result.isSuccess()) {
+ throw new ServiceException("缺陷流程开启失败,错误描述 : " + result.getCode());
+ }
+ // 关联流程唯一键
+ entity.setCheckProcessInstanceId(result.getData().getProcessInstanceId());
+ this.baseMapper.updateById(entity);
+ //新增缺陷流程记录
+ OperDefectStatisticsEntity operDefectStatisticsEntity = new OperDefectStatisticsEntity();
+ BeanUtil.copy(entity, operDefectStatisticsEntity);
+ statisticsService.save(operDefectStatisticsEntity);
+ //新增现象记录
+ OperAppearanceEntity operAppearanceEntity = new OperAppearanceEntity();
+ BeanUtil.copy(entity, operAppearanceEntity);
+ operAppearanceService.save(operAppearanceEntity);
+ this.save(entity);
+ }
+
+ /**
+ * 实体类转换成map
+ *
+ * @param obj
+ * @return
+ */
+ public static Map entityToMap(Object obj) {
+ Map map = new HashMap();
+ Class> clazz = obj.getClass();
+ for (Field field : clazz.getDeclaredFields()) {
+ field.setAccessible(true);
+ String fieldName = field.getName();
+ Object object = null;
+ try {
+ object = field.get(obj);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ log.info(e.getMessage());
+ }
+ map.put(fieldName, object);
+ }
+ return map;
+ }
+
+ /**
+ * Map转实体类:要转换的Map的key跟实体类属性名相同的数据会转过去,不相同的字段会为null
+ *
+ * @param clazz
+ * @param map
+ * @return
+ */
+ public static T mapToEntity(Class clazz, Map map) {
+ T obj = null;
+ try {
+ BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
+ obj = clazz.newInstance(); // 创建 JavaBean 对象
+ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+ // 给 JavaBean 对象的属性赋值
+ for (int i = 0; i < propertyDescriptors.length; i++) {
+ PropertyDescriptor descriptor = propertyDescriptors[i];
+ String propertyName = descriptor.getName();
+ if (map.containsKey(propertyName)) {
+ Object value = map.get(propertyName);
+ Object[] args = new Object[1];
+ args[0] = value;
+ try {
+ descriptor.getWriteMethod().invoke(obj, args);
+ } catch (InvocationTargetException e) {
+ log.info(e.getMessage());
+ }
+ }
+ }
+ } catch (Exception e) {
+ log.info(e.getMessage());
+ }
+ return (T) obj;
+ }
+
+
+ /**
+ * @param processWorkFlowResponse
+ *
+ */
+ @Override
+ public R listenAndUpdateDefect(ProcessWorkFlowResponse processWorkFlowResponse) {
+ String variables = processWorkFlowResponse.getVariables().toString();
+ OperPhenomenonEntity operPhenomenonEntity;
+ try {
+ //现象缺陷全表更新
+ operPhenomenonEntity = JSONObject.parseObject(variables, OperPhenomenonEntity.class);
+ } catch (Exception e) {
+ log.info("消息转换失败");
+ return R.fail("消息转换失败");
+ }
+ if (processWorkFlowResponse.getTaskId() != null || processWorkFlowResponse.getUserId() != null) {
+ operPhenomenonEntity.setCurrentOperator(processWorkFlowResponse.getNextStepOperator());
+ operPhenomenonEntity.setCurrentLinkHandler(processWorkFlowResponse.getProcessDefinitionKey());
+ }
+ //缺陷记录
+ OperDefectStatisticsEntity statisticsEntity = statisticsService.getOne(new LambdaUpdateWrapper() {{
+ eq(OperDefectStatisticsEntity::getDefectCode, operPhenomenonEntity.getDefectCode());
+ }});
+ //现象记录
+ OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(new LambdaUpdateWrapper() {{
+ eq(OperAppearanceEntity::getDefectCode, operPhenomenonEntity.getDefectCode());
+ }});
+ if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && operPhenomenonEntity.getIsWarehousing()) {
+ OperDefectEntity operDefectEntity=new OperDefectEntity();
+ BeanUtil.copy(operPhenomenonEntity,operDefectEntity);
+ operDefectEntity.setProcessInstanceId(operPhenomenonEntity.getHandleTaskId().toString());
+ defectService.save(operDefectEntity);
+ log.info("缺陷ID:"+operPhenomenonEntity.getDefectCode()+"入库成功");
+ operPhenomenonEntity.setCurrentOperator("定论");
+ operPhenomenonEntity.setCurrentLinkHandler(null);
+ }
+ //更新数据库
+ Long statisticsEntityId = statisticsEntity.getId();
+ Long appearanceEntityId = appearanceEntity.getId();
+ BeanUtil.copy(operPhenomenonEntity, statisticsEntity);
+ BeanUtil.copy(operPhenomenonEntity, appearanceEntity);
+ statisticsEntity.setId(statisticsEntityId);
+ appearanceEntity.setId(appearanceEntityId);
+ this.baseMapper.update(operPhenomenonEntity, new LambdaUpdateWrapper() {{
+ eq(OperPhenomenonEntity::getDefectCode, operPhenomenonEntity.getDefectCode());
+ }});
+ statisticsService.updateById(statisticsEntity);
+ operAppearanceService.updateById(appearanceEntity);
+ //推送消息中心相关消息
+ sendMessage(processWorkFlowResponse, operPhenomenonEntity);
+ return R.success("消息保存成功");
+ }
+
+ private void sendMessage(ProcessWorkFlowResponse processWorkFlowResponse, OperPhenomenonEntity operPhenomenonEntity) {
+ //推送消息
+ if (processWorkFlowResponse.getTaskId() != null) {
+ MessagePushRecordDto message = new MessagePushRecordDto();
+ message.setBusinessClassify("business");
+ message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONDEFECTMESSAGE.getKey());
+ message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONDEFECTMESSAGE.getDescription());
+ message.setTaskId(operPhenomenonEntity.getId());
+ message.setTenantId("200000");
+ message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
+ message.setPushType(MessageConstants.IMMEDIATELY);
+ //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ String countent =
+ "您的消缺流程待审批!现象名称:".concat(operPhenomenonEntity.getDefectName())
+ .concat(",审批环节:")
+ .concat(processWorkFlowResponse.getTaskName());
+ message.setContent(countent);
+ message.setDeptId(operPhenomenonEntity.getCreateDept());
+ R deptName = sysClient.getDeptName(operPhenomenonEntity.getCreateDept());
+ if (deptName.isSuccess()) {
+ message.setDeptName(deptName.getData());
+ }
+ String userIds = processWorkFlowResponse.getUserId();
+ if (StringUtils.isBlank(userIds)) {
+ log.error("推送的消息不能为空哦,{}", userIds);
+ return;
+ }
+ String[] split = userIds.split(",");
+ for (String userId : split) {
+ message.setPusher(userId);
+ User user = UserCache.getUser(NumberUtils.toLong(userId));
+ if (ObjectUtils.isNotEmpty(user)) {
+ message.setPusherName(user.getName());
+ }
+ message.setAccount(userId);
+
+ message.setCreateUser(NumberUtils.toLong(userId));
+ messageClient.sendMessage(message);
+ }
+ }
+ }
+
+ /**
+ * 启动缺陷处理流程
+ * 此端口弃用20230614
+ *
+ * @param entity
+ */
+ @Deprecated
+ private void startDefectCheck(OperPhenomenonEntity entity) {
+ // 获取机构下执行定论缺陷角色用户
+ List list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_SCREEN_ALIAS);
+ if (CollectionUtil.isEmpty(list)) {
+ throw new ServiceException("请先添加甄别缺陷角色用户,再发起现象!");
+ }
+ List userList = list.stream().map(o -> "taskUser_" + o.getId().toString()).collect(Collectors.toList());
+ // 现象发起人名字
+ String userName = Optional.ofNullable(UserCache.getUser(entity.getFinder()).getName()).orElse("");
+ // 现象发起来源
+ String sourceName = DictCache.getValue(TreatMethodConstant.SOURCE_CODE_PREFIX, entity.getSourceCode());
+ // 流程名称
+ String processName = "[" + userName + "] 发起 " + "【" + sourceName + "】缺陷处理流程" + "——>" + entity.getDefectCode();
+ // 设置下一步执行流程用户
+ Kv variables = Kv.create()
+ .set(TreatMethodConstant.PHENOMENON_SCREEN_USER, String.join(",", userList));
+ // 开启新的缺陷流程
+ R result = processClient.startProcessInstanceContainNameByKey(TreatMethodConstant.DEFECT_CHECK_PRIMARY_KEY, FlowUtil.getBusinessKey("hzims_oper_phenomenon", "" + entity.getId()), processName, variables);
+ // 流程开启失败
+ if (!result.isSuccess()) {
+ throw new ServiceException("缺陷流程开启失败,错误描述 : " + result.getCode());
+ }
+ // 关联流程唯一键
+ entity.setCheckProcessInstanceId(result.getData().getProcessInstanceId());
+ this.baseMapper.updateById(entity);
+ }
+
+ /**
+ * 获取当前机构指定角色的用户
+ *
+ * @param tenantId
+ * @param deptId
+ * @param alias
+ * @return
+ */
+ public List getAliasUser(String tenantId, Long deptId, String alias) {
+ if (Func.isEmpty(tenantId)) {
+ tenantId = AuthUtil.getTenantId();
+ }
+ R> result = userClient.relationUserListByRoleAlias(tenantId, deptId, alias);
+ if (!result.isSuccess()) {
+ throw new ServiceException("查询角色用户信息失败!");
+ }
+ return result.getData();
+ }
+
+ /**
+ * 修改缺陷状态 -> 问题定论
+ *
+ * @param handleStatus
+ * @param defectCode
+ */
+ private void updateDefectHandleState(String handleStatus, String defectCode) {
+ this.defectService.update(Wrappers.lambdaUpdate()
+ .set(OperDefectEntity::getHandleStatus, handleStatus)
+ .eq(OperDefectEntity::getDefectCode, defectCode)
+ );
+ }
+
+
+ /**
+ * 甄别缺陷
+ *
+ * @param task
+ * @return
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void screeDefect(ComleteTask task) {
+ // 步骤1.现象前置判断(现象状态检查)
+ OperPhenomenonEntity entity = this.preposePhenomenon(task.getProcessInstanceId());
+
+ // 步骤2.更新甄别状态、数据
+ this.screePhenomenonUpdate(task);
+
+ // 步骤3.现象添加至缺陷库
+ this.defectSave(entity);
+
+ // 步骤4.流程执行至甄别处理方式
+ processClient.completeTask(task);
+ }
+
+ /**
+ * 现象前置判断
+ *
+ * @param processInstanceId
+ * @return
+ */
+ private OperPhenomenonEntity preposePhenomenon(String processInstanceId) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper() {{
+ eq(OperPhenomenonEntity::getCheckProcessInstanceId, processInstanceId);
+ }};
+ // 查询现象状态
+ OperPhenomenonEntity entity = this.getOne(wrapper);
+ if (ObjectUtil.isEmpty(entity)) {
+ throw new ServiceException("现象不存在");
+ }
+ // 现象已被自动甄别
+ if (TreatMethodConstant.AUTO_SCREENED.equals(entity.getAutoDiscriminateStatus())) {
+ throw new ServiceException("该现象已经自动甄别");
+ }
+ // 现象已被手动动甄别
+ if (TreatMethodConstant.SCREENED.equals(entity.getDiscriminateStatus())) {
+ throw new ServiceException("该现象已甄别");
+ }
+ return entity;
+ }
+
+ /**
+ * 缺陷保存
+ *
+ * @param phenomenon
+ */
+ private void defectSave(OperPhenomenonEntity phenomenon) {
+ OperDefectEntity defect = new OperDefectEntity();
+ defect.setHandleStatus(RepairConstant.DEFAULT_DEFECT_STATE);
+ defect.setProcessInstanceId(phenomenon.getCheckProcessInstanceId());
+ defect.setDefectCode(phenomenon.getDefectCode());
+ defect.setCreateUser(phenomenon.getCreateUser());
+ defect.setCreateDept(phenomenon.getCreateDept());
+ defect.setTenantId(phenomenon.getTenantId());
+ this.defectService.save(defect);
+ }
+
+ /**
+ * 更新甄别状态、数据
+ *
+ * @param task
+ */
+ private void screePhenomenonUpdate(ComleteTask task) {
+ // 查询流程状态
+ String processStatus = TreatMethodConstant.RUNNING;
+ R result = processClient.queryProcessInstanceStatus(task.getProcessInstanceId());
+ if (result.isSuccess() && StringUtil.isNotBlank(result.getData()) && TreatMethodConstant.PROCESS_STATE_OVER.equals(result.getData())) {
+ processStatus = TreatMethodConstant.PROCESS_STATE_OVER;
+ }
+ // 获取参数集
+ Map variables = task.getVariables();
+ boolean invalid = (boolean) variables.get("invalid");
+ LambdaUpdateWrapper lambdaUpdate = Wrappers.lambdaUpdate();
+ if (invalid) {
+ lambdaUpdate
+ .set(OperPhenomenonEntity::getStatus, processStatus)
+ .set(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.IS_DEFECT)
+ .set(OperPhenomenonEntity::getAutoDiscriminateStatus, TreatMethodConstant.ORDINARY_SCREENED)
+ .set(OperPhenomenonEntity::getDiscriminator, AuthUtil.getUserId())
+ .set(OperPhenomenonEntity::getDiscriminateTime, new Date())
+ .set(OperPhenomenonEntity::getDiscriminateStatus, variables.get("discriminateStatus").toString())
+ .set(OperPhenomenonEntity::getDiscriminateDesc, Optional.ofNullable(variables.get("discriminateDesc")).map(Object::toString).orElse(null))
+ .set(OperPhenomenonEntity::getSafeInfos, variables.get("safeInfos").toString())
+ .set(OperPhenomenonEntity::getWorkStandards, Optional.ofNullable(variables.get("workStandards")).map(Object::toString).orElse(null))
+ .set(OperPhenomenonEntity::getHandleProgramme, variables.get("handleProgramme").toString().substring(9))
+ .set(OperPhenomenonEntity::getPlanHours, variables.get("planHours").toString())
+ .set(OperPhenomenonEntity::getPlanStartTime, variables.get("planStartTime").toString())
+ .set(OperPhenomenonEntity::getPlanEndTime, variables.get("planEndTime").toString())
+ .set(OperPhenomenonEntity::getDefectLevel, variables.get("defectLevel").toString())
+ .eq(OperPhenomenonEntity::getCheckProcessInstanceId, task.getProcessInstanceId());
+ } else {
+ lambdaUpdate
+ .set(OperPhenomenonEntity::getStatus, processStatus)
+ .set(OperPhenomenonEntity::getIsDefect, TreatMethodConstant.NO_DEFECT)
+ .set(OperPhenomenonEntity::getDiscriminateStatus, variables.get("discriminateStatus").toString())
+ .set(OperPhenomenonEntity::getDiscriminator, AuthUtil.getUserId())
+ .set(OperPhenomenonEntity::getDiscriminateTime, new Date())
+ .set(OperPhenomenonEntity::getDiscriminateDesc, variables.get("discriminateDesc").toString())
+ .eq(OperPhenomenonEntity::getCheckProcessInstanceId, task.getProcessInstanceId());
+ }
+ this.update(lambdaUpdate);
+ }
+
+ /**
+ * 决策处理方式
+ *
+ * @param task
+ * @return
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void treatmentMethod(ComleteTask task) {
+ // 步骤1.获取参数集
+ Map variables = task.getVariables();
+
+ // 步骤2.根据处理方式进行处理
+ String state = RepairConstant.REPAIR_DEFECT_STATE, processKey = RepairConstant.REPAIR_PROCESS_PRIMARY_KEY, type = variables.get("type").toString();
+ switch (type) {
+ // 应急抢修处理
+ case TreatMethodConstant.TYPE_RUSH_TO_REPAIR:
+ this.startRepair(task, variables);
+ break;
+ // 检修计划处理
+ case TreatMethodConstant.TYPE_PLAN:
+ state = RepairConstant.ACCESS_PLAN_STATE;
+ this.startMaintenancePlan(task, variables);
+ break;
+ // 检修任务处理
+ case TreatMethodConstant.TYPE_TASK:
+ state = RepairConstant.ACCESS_TASK_STATE;
+ this.startMaintenanceTask(task);
+ break;
+ default:
+ throw new IllegalStateException("Unexpected type: " + type);
+ }
+ // 步骤3.关联处理任务
+ this.relationHandlerTask(variables, type, task.getProcessInstanceId(), state);
+
+ // 步骤4.缺陷库保存处理任务信息
+ this.saveDefectInfo(variables, task.getProcessInstanceId(), processKey, state);
+
+ // 步骤5.流程执行 -> 处理缺陷
+ processClient.completeTask(task);
+ }
+
+ /**
+ * 启动应急抢修流程
+ *
+ * @param variables
+ */
+ private void startRepair(ComleteTask task, Map variables) {
+ String json = JSON.toJSONString(variables.get("repair"));
+ RepairEntity entity = JSONObject.parseObject(json, RepairEntity.class);
+ R result = repairClient.startRepair(entity);
+ if (!result.isSuccess()) {
+ throw new ServiceException("开启检修任务流程失败!");
+ }
+ variables.put("handlerTaskId", result.getData().getId());
+ variables.put("handlerType", TreatMethodConstant.REPAIR);
+ variables.put("handlerProcessInstanceId", result.getData().getProcessInstanceId());
+ variables.put("handlerUserId", result.getData().getCharge());
+ variables.put(TreatMethodConstant.DEFECT_HANDLER_USER, "taskUser_" + result.getData().getCharge());
+ task.setVariables(variables);
+ }
+
+ /**
+ * 开启检修计划
+ *
+ * @param variables
+ */
+ private void startMaintenancePlan(ComleteTask task, Map variables) {
+ String json = JSON.toJSONString(variables.get("accessPlan"));
+ OperAccessPlanDTO accessPlan = JSONObject.parseObject(json, OperAccessPlanDTO.class);
+ // 查询现象
+ OperPhenomenonEntity phenomenon = this.getOne(new LambdaQueryWrapper() {{
+ eq(OperPhenomenonEntity::getCheckProcessInstanceId, task.getProcessInstanceId());
+ }});
+
+ // 查询缺陷
+ OperDefectEntity defect = this.defectService.getOne(Wrappers.lambdaUpdate().eq(OperDefectEntity::getDefectCode, phenomenon.getDefectCode()));
+ accessPlan.setDefectId(defect.getId());
+ accessPlan.setPhenomenonId(phenomenon.getId());
+ accessPlan.setActStartTime(DateUtil.now());
+ // 计划草稿
+ R result = operAccessPlanService.doSave(accessPlan);
+ if (!result.isSuccess()) {
+ throw new ServiceException("开启检修计划失败");
+ }
+ // 计划流程开启
+ accessPlanService.handlePlan(accessPlan, null);
+ variables.put("handlerTaskId", accessPlan.getId());
+ variables.put("handlerProcessInstanceId", accessPlan.getProcessInstanceId());
+ variables.put("handlerUserId", AuthUtil.getUserId());
+ variables.put("handlerType", TreatMethodConstant.MAINTENANCE_PLAN);
+ variables.put("actStartTime", accessPlan.getActStartTime());
+ variables.put(TreatMethodConstant.DEFECT_HANDLER_USER, "taskUser_" + AuthUtil.getUserId());
+ task.setVariables(variables);
+ }
+
+ /**
+ * 开启检修任务
+ *
+ * @param comleteTask
+ */
+ @Transactional(rollbackFor = Exception.class)
+ public void startMaintenanceTask(ComleteTask comleteTask) {
+ Assert.isTrue(CollectionUtil.isNotEmpty(comleteTask.getVariables()) && ObjectUtil.isNotEmpty(comleteTask.getVariables().get("accessTask")), () -> {
+ throw new ServiceException("检修任务信息不能为空!");
+ });
+ Map variables = comleteTask.getVariables();
+ OperAccessTaskDTO accessTask = JSONObject.parseObject(JSON.toJSONString(variables.get("accessTask")), OperAccessTaskDTO.class);
+ Assert.isTrue(Func.isNotEmpty(accessTask.getPhenomenonId()), () -> {
+ throw new ServiceException("检修任务信息必须传入现象Id");
+ });
+ R result = operAccessTaskService.doSave(accessTask);
+ if (result.isSuccess()) {
+ variables.put("handler", "taskUser_" + accessTask.getHandler());
+ }
+ comleteTask.setVariables(this.excludeProperties(variables, "accessTask"));
+ processClient.completeTask(comleteTask);
+ variables.put("handlerTaskId", accessTask.getId());
+ variables.put("handlerProcessInstanceId", accessTask.getProcessInstanceId());
+ variables.put("handlerUserId", accessTask.getHandler());
+ variables.put("handlerType", TreatMethodConstant.MAINTENANCE_TASK);
+ variables.put("actStartTime", accessTask.getCreateTime());
+ }
+
+
+ /**
+ * 保存缺陷信息
+ *
+ * @param variables
+ */
+ private void saveDefectInfo(Map variables, String processInstanceId, String processKey, String state) {
+ // 新启线程保存缺陷
+ ExecutorService exe = Executors.newSingleThreadExecutor();
+ exe.execute(() -> {
+ // 查询现象
+ OperPhenomenonEntity entity = this.queryPhenomenon(processInstanceId);
+
+ // 保存流程信息至缺陷表
+ this.defectService.update(Wrappers.lambdaUpdate()
+ .set(OperDefectEntity::getProcDefId, processKey + "->" + variables.get("handlerTaskId"))
+ .set(OperDefectEntity::getActStartTime, variables.get("actStartTime"))
+ .set(OperDefectEntity::getHandleStatus, state)
+ .set(OperDefectEntity::getHandleType, variables.get("handlerType"))
+ .eq(OperDefectEntity::getDefectCode, entity.getDefectCode())
+ );
+ });
+ exe.shutdown();
+ }
+
+ /**
+ * 关联处理任务
+ *
+ * @param variables
+ * @param type
+ * @param processInstanceId
+ */
+ private void relationHandlerTask(Map variables, String type, String processInstanceId, String state) {
+ this.update(Wrappers.lambdaUpdate()
+ .set(OperPhenomenonEntity::getHandleTaskId, variables.get("handlerTaskId"))
+ .set(OperPhenomenonEntity::getHandler, variables.get("handlerUserId"))
+ .set(OperPhenomenonEntity::getHandleType, type)
+ .set(OperPhenomenonEntity::getHandleStatus, state)
+ .eq(OperPhenomenonEntity::getCheckProcessInstanceId, processInstanceId)
+ );
+ }
+
+ /**
+ * 补开工作票
+ *
+ * @param task
+ */
+ @Override
+ public void makeUpTicket(ComleteTask task) {
+ // 步骤1.查询现象
+ OperPhenomenonEntity entity = this.queryPhenomenon(task.getProcessInstanceId());
+
+ // 步骤2.获取定论角色-用户
+ List list = this.getAliasUser(entity.getTenantId(), entity.getCreateDept(), TreatMethodConstant.PHENOMENON_CONCLUSION_ALIAS);
+ if (CollectionUtil.isEmpty(list)) {
+ throw new ServiceException("请先添加缺陷定论角色用户,再进行补工作票");
+ }
+ List userList = list.stream().map(o -> "taskUser_" + o.getId().toString()).collect(Collectors.toList());
+
+ // 步骤3.现象状态 -> 问题定论
+ this.updatePhenomenonState(entity);
+
+ // 步骤4.缺陷状态 -> 问题定论
+ this.updateDefectHandleState(RepairConstant.CONCLUSION_PROBLEM, entity.getDefectCode());
+
+ // 步骤5.设置参数
+ Map variables = task.getVariables();
+ variables.put(TreatMethodConstant.PHENOMENON_CONCLUSION_ALIAS, String.join(",", userList));
+ task.setVariables(variables);
+
+ // 步骤6.执行流程->问题定论
+ processClient.completeTask(task);
+ }
+
+ /**
+ * 现象状态 -> 问题定论
+ *
+ * @param entity
+ */
+ private void updatePhenomenonState(OperPhenomenonEntity entity) {
+ entity.setHandleStatus(RepairConstant.CONCLUSION_PROBLEM);
+ this.phenomenonMapper.updateById(entity);
+ }
+
+ /**
+ * 查询现象
+ *
+ * @param processInstanceId
+ * @return
+ */
+ private OperPhenomenonEntity queryPhenomenon(String processInstanceId) {
+ LambdaQueryWrapper wrapper = new LambdaQueryWrapper() {{
+ eq(OperPhenomenonEntity::getCheckProcessInstanceId, processInstanceId);
+ }};
+ return this.getOne(wrapper);
+ }
+
+ /**
+ * 定论
+ *
+ * @param task
+ */
+ @Override
+ public void conclusion(ComleteTask task) {
+ // 步骤1.查询现象
+ OperPhenomenonEntity entity = this.queryPhenomenon(task.getProcessInstanceId());
+
+ // 步骤2.更新现象定论信息
+ this.defectConclusionInfo(task, entity.getId());
+
+ // 步骤3.现象加入台账
+ this.saveDefect(entity);
+
+ // 步骤4.故障状态更新
+ this.updateFaultState(entity.getFaultCode());
+
+ // 步骤5.更新缺陷状态 -> 已处理
+ this.updateDefectHandleState(RepairConstant.COMPLETE_DEFECT_STATE, entity.getDefectCode());
+
+ // 步骤6.缺陷流程->结束
+ processClient.completeTask(task);
+ }
+
+
+ /**
+ * 更新现象定论信息
+ *
+ * @param task
+ */
+ private void defectConclusionInfo(ComleteTask task, Long phenomenonId) {
+ // 获取参数集
+ Map variables = task.getVariables();
+
+ // 修改现象定论信息
+ OperPhenomenonEntity entity = new OperPhenomenonEntity();
+ entity.setStatus(Integer.valueOf(TreatMethodConstant.OVER));
+ entity.setHandleStatus(RepairConstant.COMPLETE_DEFECT_STATE);
+ entity.setConclusionTime(new Date());
+ entity.setConclusionPeople(AuthUtil.getUserId());
+ entity.setConclusionStatus(TreatMethodConstant.CONCLUSION_COMPLETED);
+ entity.setConclusion((String) variables.get("conclusion"));
+ entity.setCheckHours(Integer.valueOf(variables.get("checkHours").toString()));
+ entity.setId(phenomenonId);
+ this.phenomenonMapper.updateById(entity);
+ }
+
+ /**
+ * 现象加入台账
+ *
+ * @param entity
+ */
+ private void saveDefect(OperPhenomenonEntity entity) {
+ entity = phenomenonMapper.selectById(entity.getId());
+ // 复制现象数据
+ OperDefectStatisticsEntity statistics = BeanUtil.copy(entity, OperDefectStatisticsEntity.class);
+ // 查询缺陷
+ OperDefectEntity defect = this.defectService.getOne(Wrappers.lambdaUpdate().eq(OperDefectEntity::getDefectCode, entity.getDefectCode()));
+ if (ObjectUtil.isEmpty(statistics)) {
+ return;
+ }
+ // 实际执行时长
+ statistics.setCheckHours(entity.getCheckHours());
+ statistics.setConclusion(entity.getConclusion());
+ statistics.setConclusionPeople(entity.getConclusionPeople());
+ statistics.setConclusionTime(entity.getConclusionTime());
+ statistics.setActEndTime(defect.getActEndTime());
+ statistics.setActStartTime(defect.getActStartTime());
+ statistics.setDisposeDesc(defect.getDisposeDesc());
+ // 台账存储
+ this.statisticsService.save(statistics);
+ }
+
+ /**
+ * 故障状态更新
+ *
+ * @param faultCode
+ */
+ private void updateFaultState(String faultCode) {
+ if (StringUtil.isBlank(faultCode)) {
+ return;
+ }
+ fdpTaskClient.updateFinishStatusByDefectCode(faultCode);
+ }
+
+ /**
+ * 排除业务中所需属性 避免传入工作流中
+ *
+ * @param variable 工作流传参map
+ * @param properties 不计入工作流传参的属性
+ * @return
+ */
+ private Map excludeProperties(Map variable, String... properties) {
+ Map result = new HashMap<>();
+ variable.forEach((k, v) -> {
+ if (!Arrays.asList(properties).contains(k)) {
+ result.put(k, v);
+ }
+ });
+ return result;
+ }
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java
new file mode 100644
index 0000000..6134d4a
--- /dev/null
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java
@@ -0,0 +1,16 @@
+package com.hnac.hzims.operational.defect.service.impl;
+
+import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity;
+import com.hnac.hzims.operational.defect.mapper.OperAppearanceMapper;
+import com.hnac.hzims.operational.defect.service.IOperAppearanceService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 服务实现类
+ *
+ * @author Chill
+ */
+@Service
+public class OperAppearanceServiceImpl extends BaseServiceImpl implements IOperAppearanceService {
+}
From 64f30a971e70f6afda4d4bce9605bbf1327a850a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Mon, 19 Jun 2023 14:13:46 +0800
Subject: [PATCH 04/13] =?UTF-8?q?=E6=96=B0=E5=A2=9EDefectProcessServiceImp?=
=?UTF-8?q?l=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E7=A5=A8?=
=?UTF-8?q?=EF=BC=8C=E6=93=8D=E4=BD=9C=E7=A5=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../process/constant/TicketProcessConstant.java | 6 +
.../serviceimpl/DefectProcessServiceImpl.java | 67 +++++++
.../MachineryTicketProcessServiceImpl.java | 8 +-
.../OperationTicketProcessServiceImpl.java | 8 +-
.../service/impl/OperationTicketServiceImpl.java | 21 +--
.../controller/TicketProcessController.java | 1 +
.../service/impl/TicketProcessServiceImpl.java | 200 +++++++++------------
7 files changed, 175 insertions(+), 136 deletions(-)
create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java
diff --git a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
index 23c173e..7770383 100644
--- a/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
+++ b/hzims-service-api/middle-api/src/main/java/com/hnac/hzims/middle/process/constant/TicketProcessConstant.java
@@ -29,4 +29,10 @@ public class TicketProcessConstant {
* 日常维护
*/
public static final String MAINTENANCE_KEY = "maintenance";
+
+
+ /**
+ * 消缺流程
+ */
+ public static final String DEFECT_KEY = "defectDealty";
}
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
new file mode 100644
index 0000000..95bab8f
--- /dev/null
+++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/DefectProcessServiceImpl.java
@@ -0,0 +1,67 @@
+package com.hnac.hzims.middle.processflow.strategy.serviceimpl;
+
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import com.hnac.hzims.middle.processflow.service.ProcessDictService;
+import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
+import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
+import com.hnac.hzims.operational.defect.feign.IOperDefectClient;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.tool.api.R;
+import org.springframework.stereotype.Service;
+import static com.hnac.hzims.middle.process.constant.TicketProcessConstant.DEFECT_KEY;
+
+
+/**
+ * 消缺工作流实现类
+ *
+ * @Author dfy
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/28 8:47
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class DefectProcessServiceImpl extends ProcessAbstractService {
+
+
+ private final IOperDefectClient defectClient;
+
+
+ private final ProcessDictService processDictService;
+
+
+ /**
+ * 设置执行那种实现类
+ *
+ * @param flowQueue
+ * @return
+ */
+ @Override
+ public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
+ log.info("是否执行消缺工作流实流程环节操作~~~~,流程ticket: {}", flowQueue);
+ String dictValue = processDictService.selectDictValueByKey(DEFECT_KEY);
+ if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
+ log.info("已执行消缺工作流程环节操作~~~~");
+ return true;
+ }
+ log.error("未是否执行消缺工作流流程环节操作,请联系管理员~~~~");
+ return false;
+ }
+
+ /**
+ * 两票管理业务方法
+ *
+ * @param response
+ */
+ @Override
+ public void calculate(ProcessWorkFlowResponse response) {
+ R defect = defectClient.saveDefect(response);
+ if (!defect.isSuccess()) {
+ throw new ServiceException("消缺工作流程出现异常呢");
+
+ }
+ }
+}
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 ac68fc7..42d6ed1 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
@@ -4,7 +4,7 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
-import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
+import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
@@ -28,7 +28,7 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
- private final OperationTicketFeignClient ticketProcessService;
+ private final TicketProcessFeignClient ticketProcessService;
@@ -36,10 +36,6 @@ public class MachineryTicketProcessServiceImpl extends ProcessAbstractService {
-
-
-
-
/**
* 设置执行那种实现类
*
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 f3ab75d..1d8d70b 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
@@ -4,6 +4,7 @@ import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.middle.processflow.service.ProcessDictService;
import com.hnac.hzims.middle.processflow.strategy.abstracts.ProcessAbstractService;
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue;
+import com.hnac.hzims.ticket.ticketprocess.feign.OperationTicketFeignClient;
import com.hnac.hzims.ticket.ticketprocess.feign.TicketProcessFeignClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -28,7 +29,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
- private final TicketProcessFeignClient operationTicketService;
+ private final OperationTicketFeignClient operationTicketFeignClient;
@@ -44,7 +45,7 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
*/
@Override
public Boolean isWorkflowProcess(WorkflowQueue flowQueue) {
- log.info("是否执行开操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue);
+ log.info("是否执行操作票流程环节操作~~~~,流程flowQueue: {}", flowQueue);
String dictValue = processDictService.selectDictValueByKey(OPERATION_TICKET_KEY);
if (dictValue.equals(flowQueue.getProcessDefinitionKey())) {
log.info("已执行操作票流程环节操作~~~~");
@@ -61,10 +62,9 @@ public class OperationTicketProcessServiceImpl extends ProcessAbstractService {
*/
@Override
public void calculate(ProcessWorkFlowResponse response) {
- Boolean pending = operationTicketService.findPending(response);
+ Boolean pending = operationTicketFeignClient.findPending(response);
if (!pending) {
throw new ServiceException("操作票流程出现异常呢");
-
}
}
}
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 722c0d9..7b94004 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
@@ -77,7 +77,6 @@ public class OperationTicketServiceImpl implements OperationTicketService {
private final ProcessDictFeignService processDictFeignService;
-
private final IFlowClient flowClient;
@@ -158,7 +157,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
log.info("获取下一个审批人是: {} ", response.getNextStepOperator());
log.info("获取下一个用户Id是: {} ", response.getUserId());
log.info("获取当前任务名称是: {} ", response.getTaskName());
- log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType());
+ log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType());
//json转换表单
String formData = JSON.toJSONString(response.getVariables());
log.info("获取表单的数据:{}", formData);
@@ -168,9 +167,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class);
} catch (Exception e) {
log.error("获取表单出现异常了~~~~");
+ e.printStackTrace();
throw new IllegalArgumentException(e.getMessage());
}
-
//1.查询操作票信息
Long id = NumberUtils.toLong(response.getBusinessKey());
StandardTicketInfoEntity standardTicketInfoEntity = standardTicketInfoService.getById(id);
@@ -197,8 +196,6 @@ public class OperationTicketServiceImpl implements OperationTicketService {
}).collect(Collectors.toList());
standardTicketMeasureService.updateBatchById(standardTicketMeasureEntities);
}
-
-
//推送消息
if (response.getTaskId() != null) {
MessagePushRecordDto message = new MessagePushRecordDto();
@@ -238,6 +235,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
messageClient.sendMessage(message);
}
}
+
}
@@ -379,8 +377,6 @@ public class OperationTicketServiceImpl implements OperationTicketService {
}
-
-
/**
* 新预览
*
@@ -398,7 +394,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
StandardTicketInfoVo standardTicketInfoVo = standardTicketInfoService.selectDetailsById(ticketId);
//将查询的数据转换为map
Map workTicketInfoMap = this.convertMap(standardTicketInfoVo);
- //导入下在word
+ //导入下在word
Map resultMap = OperationWordHelper.resultMap(workTicketInfoMap);
String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status);
String os = TicketConstant.OS_NAME;
@@ -421,6 +417,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
/**
* 将查询的数据转换为map
+ *
* @param standardTicketInfoVo
* @return
*/
@@ -439,17 +436,17 @@ public class OperationTicketServiceImpl implements OperationTicketService {
map.put("index", index.get());
map.put("status", TicketConstants.MATTER_FINISH_STATUS.equals(measure.getStatus()) ? "√" : "");
map.put("operationTime", measure.getOperationTime());
- map.put("hello","");
- map.put("hello1","");
+ map.put("hello", "");
+ map.put("hello1", "");
index.getAndIncrement();
measureMapLists.add(map);
}
result.put("measureMapList", measureMapLists);
- }else {
+ } else {
result.put("measureMapList", new ArrayList<>());
}
- WordMapUtils.newMapWithList("measureMapList",result,false,17,null);
+ WordMapUtils.newMapWithList("measureMapList", result, false, 17, null);
return result;
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
index 2a18960..c0d95ca 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/controller/TicketProcessController.java
@@ -58,6 +58,7 @@ public class TicketProcessController {
ticketProcessService.findPending(response);
return true;
} catch (Exception e) {
+ e.printStackTrace();
throw new ServiceException("工作票待处理:" + e.getMessage());
}
}
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 2b71d51..eed6a7e 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
@@ -276,98 +276,78 @@ public class TicketProcessServiceImpl implements TicketProcessService {
log.error("获取工作票的数据为不存在");
return;
}
- try {
- //更新工作票
- workTicket.setId(workTicketInfo.getId());
- //保存流程描述
- workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
- workTicket.setTenantId(workTicketInfo.getTenantId());
- saveWorkTicket(workTicket, response);
- //工作流ID
- workTicket.setProcessInstanceId(response.getProcessInstanceId());
- workTicketInfoService.updateById(workTicket);
- } catch (Exception e) {
- e.printStackTrace();
- }
+ //更新工作票
+ workTicket.setId(workTicketInfo.getId());
+ //保存流程描述
+ workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
+ workTicket.setTenantId(workTicketInfo.getTenantId());
+ saveWorkTicket(workTicket, response);
+ //工作流ID
+ workTicket.setProcessInstanceId(response.getProcessInstanceId());
+ workTicketInfoService.updateById(workTicket);
//更新安全措施
- try {
- List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
- if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
- log.info("获取安全措施的数据:{}", safetyMeasuresList);
- for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) {
- if (ObjectUtils.isNotEmpty(item.getId())) {
- workTicketSafetyMeasureService.updateById(item);
- } else {
- item.setTicketId(workTicketInfo.getId());
- workTicketSafetyMeasureService.save(item);
- }
+ List safetyMeasuresList = workTicketVo.getSafetyMeasuresList();
+ if (CollectionUtils.isNotEmpty(safetyMeasuresList)) {
+ log.info("获取安全措施的数据:{}", safetyMeasuresList);
+ for (WorkTicketSafetyMeasureEntity item : safetyMeasuresList) {
+ if (ObjectUtils.isNotEmpty(item.getId())) {
+ workTicketSafetyMeasureService.updateById(item);
+ } else {
+ item.setTicketId(workTicketInfo.getId());
+ workTicketSafetyMeasureService.save(item);
}
}
- } catch (Exception e) {
- e.printStackTrace();
}
// 第二种 工作票工作任务组
List workTicketContentDtoList = workTicketVo.getWorkTicketContentDtoList();
- try {
- if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) {
- log.info("获取工作票工作任务组:{}", workTicketContentDtoList);
- workTicketContentDtoList.forEach(item -> {
- if (ObjectUtils.isEmpty(item.getId())) {
- contentService.save(item);
- } else {
- contentService.updateById(item);
- }
- });
- }
- } catch (Exception e) {
- e.printStackTrace();
+ if (CollectionUtils.isNotEmpty(workTicketContentDtoList)) {
+ log.info("获取工作票工作任务组:{}", workTicketContentDtoList);
+ workTicketContentDtoList.forEach(item -> {
+ if (ObjectUtils.isEmpty(item.getId())) {
+ contentService.save(item);
+ } else {
+ contentService.updateById(item);
+ }
+ });
}
-
// 工作票延期
WorkTicketDelayEntity workTicketDelay = workTicketVo.getWorkTicketDelay();
- try {
- if (ObjectUtils.isNotEmpty(workTicketDelay) && "延期".equals(workTicket.getInput())) {
-
- WorkTicketDelayEntity workTicketDelayEntity = workTicketDelayService.selectByTicketId(workTicketInfo.getId());
- log.info("获取工作票延期:{}", workTicketDelay);
- workTicketDelay.setCreateDept(workTicketInfo.getCreateDept());
- workTicketDelay.setTicketId(workTicketInfo.getId());
- workTicketDelay.setTenantId(workTicketInfo.getTenantId());
- if (ObjectUtils.isEmpty(workTicketDelayEntity)) {
- log.info("正在保存工作票延期");
- workTicketDelayService.save(workTicketDelay);
- } else {
- log.info("正在更新工作票延期");
- workTicketDelayService.updateByTicketId(workTicketDelay);
- }
+ if (ObjectUtils.isNotEmpty(workTicketDelay) && "延期".equals(workTicket.getInput())) {
+
+ WorkTicketDelayEntity workTicketDelayEntity = workTicketDelayService.selectByTicketId(workTicketInfo.getId());
+ log.info("获取工作票延期:{}", workTicketDelay);
+ workTicketDelay.setCreateDept(workTicketInfo.getCreateDept());
+ workTicketDelay.setTicketId(workTicketInfo.getId());
+ workTicketDelay.setTenantId(workTicketInfo.getTenantId());
+ if (ObjectUtils.isEmpty(workTicketDelayEntity)) {
+ log.info("正在保存工作票延期");
+ workTicketDelayService.save(workTicketDelay);
+ } else {
+ log.info("正在更新工作票延期");
+ workTicketDelayService.updateByTicketId(workTicketDelay);
}
- } catch (Exception e) {
- e.printStackTrace();
}
//工作结束
WorkTicketFinish workTicketFinish = workTicketVo.getWorkTicketFinish();
- try {
- log.info("工作结束==============>" + (workTicket.getFlowStatus().intValue()));
- if (ObjectUtils.isNotEmpty(workTicketFinish)) {
- WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId());
- log.info("获取工作结束:{}", workTicketFinish);
- if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) {
- log.info("获取工作结束保存成功");
- workTicketFinish.setTicketId(workTicketInfo.getId());
- workTicketFinishService.save(workTicketFinish);
- } else {
- log.info("获取工作结束更新成功");
- workTicketDelay.setInitialTime(LocalDateTime.now());
- workTicketFinishService.updateByTicketId(workTicketFinish);
- }
+ log.info("工作结束==============>" + (workTicket.getFlowStatus().intValue()));
+ if (ObjectUtils.isNotEmpty(workTicketFinish)) {
+ WorkTicketFinish ticketFinish = workTicketFinishService.selectByTicketId(workTicketInfo.getId());
+ log.info("获取工作结束:{}", workTicketFinish);
+ if (ObjectUtils.isEmpty(workTicketFinish.getId()) || ObjectUtils.isEmpty(ticketFinish)) {
+ log.info("获取工作结束保存成功");
+ workTicketFinish.setTicketId(workTicketInfo.getId());
+ workTicketFinishService.save(workTicketFinish);
+ } else {
+ log.info("获取工作结束更新成功");
+ workTicketDelay.setInitialTime(LocalDateTime.now());
+ workTicketFinishService.updateByTicketId(workTicketFinish);
}
- } catch (Exception e) {
- e.printStackTrace();
}
+
// 工作开始时间和结束时间
// List workTicketOperateTimeEntities = workTicketVo.getWorkTicketOperateTimeEntities();
// if (CollectionUtils.isNotEmpty(workTicketOperateTimeEntities)) {
@@ -376,58 +356,50 @@ public class TicketProcessServiceImpl implements TicketProcessService {
// }
//工作票负责人变更
WorkTicketPrincipalChangeEntity workTicketPrincipalChange = workTicketVo.getWorkTicketPrincipalChange();
- try {
- if (ObjectUtils.isNotEmpty(workTicketPrincipalChange) && "转移".equals(workTicket.getInput())) {
- log.info("工作票负责人变更: {}", workTicketPrincipalChange);
- //原来的负责人
- User user = UserCache.getUser(workTicketPrincipalChange.getInitialPrincipal());
- //新的负责人
- User newUser = UserCache.getUser(workTicketPrincipalChange.getChangePrincipal());
- workTicketPrincipalChange.setCreateDept(workTicketInfo.getCreateDept());
- workTicketPrincipalChange.setTicketId(workTicketInfo.getId());
- workTicketPrincipalChange.setTenantId(workTicketInfo.getTenantId());
- if (workTicketPrincipalChange.getFlowCode() == null) {
- workTicketPrincipalChange.setFlowCode(IdWorker.getIdStr());
- }
+ if (ObjectUtils.isNotEmpty(workTicketPrincipalChange) && "转移".equals(workTicket.getInput())) {
+ log.info("工作票负责人变更: {}", workTicketPrincipalChange);
+ //原来的负责人
+ User user = UserCache.getUser(workTicketPrincipalChange.getInitialPrincipal());
+ //新的负责人
+ User newUser = UserCache.getUser(workTicketPrincipalChange.getChangePrincipal());
+ workTicketPrincipalChange.setCreateDept(workTicketInfo.getCreateDept());
+ workTicketPrincipalChange.setTicketId(workTicketInfo.getId());
+ workTicketPrincipalChange.setTenantId(workTicketInfo.getTenantId());
+ if (workTicketPrincipalChange.getFlowCode() == null) {
+ workTicketPrincipalChange.setFlowCode(IdWorker.getIdStr());
+ }
- WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId());
+ WorkTicketPrincipalChangeEntity workTicketPrincipalChangeEntity = workTicketPrincipalChangeService.selectByTicketId(workTicket.getId());
- if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
- log.info("工作票负责人保存变更");
- workTicketPrincipalChangeService.save(workTicketPrincipalChange);
- } else {
- log.info("工作票负责人更新变更");
- workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange);
- }
- log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
- workTicket.setPrincipal(workTicketPrincipalChange.getChangePrincipal());
- workTicket.setPrincipalName(newUser.getName());
- //更新工作票
- workTicketInfoService.updateById(workTicket);
+ if (ObjectUtils.isEmpty(workTicketPrincipalChangeEntity)) {
+ log.info("工作票负责人保存变更");
+ workTicketPrincipalChangeService.save(workTicketPrincipalChange);
+ } else {
+ log.info("工作票负责人更新变更");
+ workTicketPrincipalChangeService.updateByTicketId(workTicketPrincipalChange);
}
- } catch (Exception e) {
- e.printStackTrace();
+ log.info("工作负责人变更 原来的负责人 {},变更为 {}", user.getName(), newUser.getName());
+ workTicket.setPrincipal(workTicketPrincipalChange.getChangePrincipal());
+ workTicket.setPrincipalName(newUser.getName());
+ //更新工作票
+ workTicketInfoService.updateById(workTicket);
}
//工作票危险点分析及控制措施票
- try {
- if (workTicket.getIsHazard()) {
- List ticketInfoDangers = workTicketVo.getTicketInfoDangers();
- if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
- List collect = ticketInfoDangers.stream().map(item -> {
- item.setTicketId(workTicketInfo.getId());
- return item;
- }).collect(Collectors.toList());
+ if (workTicket.getIsHazard()) {
+ List ticketInfoDangers = workTicketVo.getTicketInfoDangers();
+ if (CollectionUtils.isNotEmpty(ticketInfoDangers)) {
+ List collect = ticketInfoDangers.stream().map(item -> {
+ item.setTicketId(workTicketInfo.getId());
+ return item;
+ }).collect(Collectors.toList());
- System.out.println("工作票危险点分析及控制措施票 : " + collect);
+ System.out.println("工作票危险点分析及控制措施票 : " + collect);
- ticketInfoDangerService.saveBatch(collect);
- }
+ ticketInfoDangerService.saveBatch(collect);
}
- } catch (Exception e) {
- e.printStackTrace();
}
From 75f744ee1c95a6d9a5e0260c29dd6b59e3073cfc Mon Sep 17 00:00:00 2001
From: yang_shj <1069818635@QQ.com>
Date: Mon, 19 Jun 2023 15:56:09 +0800
Subject: [PATCH 05/13] =?UTF-8?q?#=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E6=8A=BD=E7=A6=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ecology/entity/EcologyFlowStationEntity.java | 2 ++
.../operational/main/vo/AppHydropowerDeviceVo.java | 4 ++++
.../operational/main/vo/HydropowerUnitRealVo.java | 3 +++
.../operation/impl/RealTargetServiceImpl.java | 2 +-
.../ecology/controller/EcologyController.java | 10 +++++-----
.../ecology/service/EcologyFlowStationService.java | 4 ++--
.../service/impl/EcologyFlowStationServiceImpl.java | 20 ++++++++++++++------
.../main/scheduled/ScheduledCreateTask.java | 7 ++-----
.../main/service/impl/HomeServiceImpl.java | 4 ++--
.../main/service/impl/HydropowerServiceImpl.java | 4 +++-
10 files changed, 38 insertions(+), 22 deletions(-)
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java
index ce4d7e8..48ee5b1 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/ecology/entity/EcologyFlowStationEntity.java
@@ -19,6 +19,8 @@ public class EcologyFlowStationEntity extends TenantEntity {
private String stationName;
+ private String city;
+
private Long isOnLine;
private Long isDemonstrate;
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java
index 604bd60..20a1cd1 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/AppHydropowerDeviceVo.java
@@ -2,6 +2,7 @@ package com.hnac.hzims.operational.main.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
import lombok.Data;
/**
@@ -28,4 +29,7 @@ public class AppHydropowerDeviceVo {
@ApiModelProperty(value = "负荷单位")
private String loadUnit;
+
+ @ApiModelProperty(value = "排序")
+ private Integer ord;
}
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitRealVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitRealVo.java
index f4cf2f8..9784d6c 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitRealVo.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/HydropowerUnitRealVo.java
@@ -61,4 +61,7 @@ public class HydropowerUnitRealVo {
@ApiModelProperty(value = "电流单位")
private String currentUnit;
+
+ @ApiModelProperty(value = "排序")
+ private Integer ord;
}
diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java
index 55fb6d7..a008be8 100644
--- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java
+++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/impl/RealTargetServiceImpl.java
@@ -1186,7 +1186,7 @@ public class RealTargetServiceImpl implements RealTargetService {
*/
private int getPhotovoltaicState(EminfoAndEmParamVo device, Map map) {
// 获取开关机监测点实时数据
- Double value = this.getSignageValue(device, map, HomePageConstant.PV_JOINT_RELAY);
+ double value = this.getSignageValue(device, map, HomePageConstant.PV_JOINT_RELAY);
// 开机状态
if (Math.abs(value) <= 0) {
return 0;
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java
index 3973568..f9f2e35 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/controller/EcologyController.java
@@ -51,11 +51,11 @@ public class EcologyController extends BladeController {
* 站点数据排行
* @return
*/
- @PostMapping("/station_top")
+ @PostMapping("/station_top")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "站点数据及达标率排行", notes = "站点数据及达标率排行")
- public R station_top() {
- return R.data(stationService.station_top());
+ public R station_top(@RequestParam String city) {
+ return R.data(stationService.station_top(city));
}
/**
@@ -65,8 +65,8 @@ public class EcologyController extends BladeController {
@PostMapping("/trend_chart")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "指标趋势图", notes = "指标趋势图")
- public R trend_chart(@RequestParam String type) {
- return R.data(stationService.trend_chart(type));
+ public R trend_chart(@RequestParam String city,@RequestParam String type) {
+ return R.data(stationService.trend_chart(city,type));
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java
index ba6ba2a..d129ab9 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/EcologyFlowStationService.java
@@ -14,12 +14,12 @@ import java.util.List;
*/
public interface EcologyFlowStationService extends BaseService {
- EcologFlowStationVo station_top();
+ EcologFlowStationVo station_top(String city);
Boolean generate(Long mon,String year);
- List trend_chart(String type);
+ List trend_chart(String city,String type);
List station();
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
index bf9dbc4..fbbcda1 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/ecology/service/impl/EcologyFlowStationServiceImpl.java
@@ -98,8 +98,9 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl stations = this.list();
+ public EcologFlowStationVo station_top(String city) {
+ List stations = this.list(Wrappers.lambdaQuery()
+ .eq(EcologyFlowStationEntity::getCity,city));
if(CollectionUtil.isEmpty(stations)){
return new EcologFlowStationVo();
}
@@ -110,8 +111,9 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl o.getIsTimely().equals(1L)).count() / (double) stations.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
station.setCount(stations.size());
- List datas = dataService.list(Wrappers.lambdaQuery().
- like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM")));
+ List datas = dataService.list(Wrappers.lambdaQuery()
+ .like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy-MM"))
+ .in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList())));
if(CollectionUtil.isEmpty(datas)){
return station;
}
@@ -132,8 +134,14 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl trend_chart(String type) {
+ public List trend_chart(String city,String type) {
+ List stations = this.list(Wrappers.lambdaQuery()
+ .eq(EcologyFlowStationEntity::getCity,city));
+ if(CollectionUtil.isEmpty(stations)){
+ return new ArrayList<>();
+ }
LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
+ wrapper.in(EcologyFlowDataEntity::getStationId,stations.stream().map(EcologyFlowStationEntity::getStationId).collect(Collectors.toList()));
if("0".equals(type)){
wrapper.like(EcologyFlowDataEntity::getMon, DateUtil.format(new Date(),"yyyy"));
}
@@ -179,7 +187,7 @@ public class EcologyFlowStationServiceImpl extends BaseServiceImpl station() {
List stations = stationService.list(Wrappers.lambdaQuery()
- .in(StationEntity::getCode,Arrays.asList("902400000054","902400052664")));
+ .in(StationEntity::getCode,Arrays.asList("902400000054","902400052664","902400056791")));
if(CollectionUtil.isEmpty(stations)){
return new ArrayList<>();
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
index f7c04b5..9da5fac 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/scheduled/ScheduledCreateTask.java
@@ -278,12 +278,9 @@ public class ScheduledCreateTask {
/**
* 水电站-机组实时加载
- * @return ReturnT
*/
- //@XxlJob(LOAD_HYDROPOWER_UNIT_REAL)
- @Scheduled(cron = "0/40 * * * * ? ")
- public ReturnT loadHydropowerUnitReal() throws Exception {
- String param = "";
+ @XxlJob(LOAD_HYDROPOWER_UNIT_REAL)
+ public ReturnT loadHydropowerReal(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
index c2a247a..8373e6d 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HomeServiceImpl.java
@@ -246,7 +246,7 @@ public class HomeServiceImpl implements HomeService {
double plan = list.stream().mapToDouble(PowerEntity::getPlannedPowerMon).sum();
double pass = list.stream().mapToDouble(power -> Double.parseDouble(power.getDoubleQualifyRate())).sum();
// 装机容量
- target.setTaget_one(list.stream().map(PowerEntity::getInstalledCapacity).collect(Collectors.toSet()).stream().mapToDouble(Double::valueOf).sum());
+ target.setTaget_one(list.get(0).getInstalledCapacity());
// 发电量
target.setTaget_two(list.stream().mapToDouble(PowerEntity::getPowerMon).sum());
if(Math.abs(plan) > 0){
@@ -254,7 +254,7 @@ public class HomeServiceImpl implements HomeService {
target.setTaget_three(BigDecimal.valueOf(target.getTaget_two() / plan * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
}
// 双票合格率
- target.setTaget_four(BigDecimal.valueOf(pass / list.size()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
+ target.setTaget_four(BigDecimal.valueOf(pass / list.size() * 100).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
return target;
}
diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
index 876c9e4..9377586 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/HydropowerServiceImpl.java
@@ -153,6 +153,7 @@ public class HydropowerServiceImpl implements HydropowerService {
HydropowerUnitRealVo real = new HydropowerUnitRealVo();
real.setDeptId(device.getCreateDept());
real.setDeviceCode(device.getEmCode());
+ real.setOrd(device.getOrd());
real.setDeptName(device.getName());
real.setDeviceName(device.getName());
// 装机容量
@@ -1548,12 +1549,13 @@ public class HydropowerServiceImpl implements HydropowerService {
AppHydropowerDeviceVo device = new AppHydropowerDeviceVo();
device.setDeviceCode(real.getDeviceCode());
device.setDeviceName(real.getDeviceName());
+ device.setOrd(real.getOrd());
device.setState(real.getState());
device.setLoadUnit(Optional.ofNullable(real.getPowerUnit()).orElse("kW"));
device.setCapacity(real.getInstalledCapacity());
device.setLoad(real.getActivePower());
return device;
- }).collect(Collectors.toList()));
+ }).sorted(Comparator.comparing(AppHydropowerDeviceVo::getOrd)).collect(Collectors.toList()));
hydropower.setLoadUnit(hydropower.getDevices().get(0).getLoadUnit());
}
return hydropower;
From 77717ce3362b4f769f6382c2d3948f828105fbaf Mon Sep 17 00:00:00 2001
From: haungxing <1203316822@qq.com>
Date: Tue, 20 Jun 2023 11:13:00 +0800
Subject: [PATCH 06/13] =?UTF-8?q?#=20=E6=B6=88=E6=81=AFAPP/WEB=E5=A4=9A?=
=?UTF-8?q?=E4=BA=BA=E5=8D=B3=E6=97=B6=E6=8E=A8=E9=80=81=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hnac/hzims/message/dto/BusinessMessageDTO.java | 66 ++++++++++++++++++++++
.../hzims/message/fegin/MessageClientFallback.java | 10 ++--
.../hnac/hzims/message/fegin/MessageClient.java | 49 +++++++++++++---
.../message/service/IMessagePushRecordService.java | 6 ++
.../service/impl/MessagePushRecordServiceImpl.java | 42 ++++++++++++--
.../service/impl/PushMessageServiceImpl.java | 40 +++++++++++++
.../message/service/impl/WebsocketServiceImpl.java | 1 +
7 files changed, 198 insertions(+), 16 deletions(-)
create mode 100644 hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java
new file mode 100644
index 0000000..b3d8d4c
--- /dev/null
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/dto/BusinessMessageDTO.java
@@ -0,0 +1,66 @@
+package com.hnac.hzims.message.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.support.QueryField;
+import org.springblade.core.mp.support.SqlCondition;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @ClassName BusinessMessageDTO
+ * @description:
+ * @author: hx
+ * @create: 2023-06-15 19:10
+ * @Version 4.0
+ **/
+@Data
+@ApiModel("事务消息")
+@EqualsAndHashCode
+public class BusinessMessageDTO implements Serializable {
+ @ApiModelProperty(value = "机构ID",required = true)
+ @NotNull(message = "机构ID不能为空")
+ private Long deptId;
+
+ @ApiModelProperty("机构名称")
+ private String deptName;
+
+ @ApiModelProperty(value = "业务关键字",required = true)
+ @NotNull(message = "业务关键字不能为空")
+ private String businessKey;
+
+ @ApiModelProperty(value = "业务分类。系统通知:system,事务消息:business,日常提醒:dailyRemind,巡检消息:inspect",required = true)
+ @NotNull(message = "业务分类不能为空")
+ private String businessClassify;
+
+ @ApiModelProperty("业务任务ID")
+ @QueryField(condition = SqlCondition.EQUAL)
+ private Long taskId;
+
+ @NotNull
+ @ApiModelProperty(value = "内容")
+ private String content;
+
+ @NotNull
+ @ApiModelProperty(value = "主题")
+ private String subject;
+
+ @NotNull
+ @ApiModelProperty(value = "推送用户")
+ private String userIds;
+
+ @ApiModelProperty(value = "创建用户")
+ private Long createUser;
+
+ @ApiModelProperty(value = "租户ID")
+ private String tenantId;
+}
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java
index e03c604..37f26e4 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/MessageClientFallback.java
@@ -1,9 +1,6 @@
package com.hnac.hzims.message.fegin;
-import com.hnac.hzims.message.dto.MessagePushRecordDto;
-import com.hnac.hzims.message.dto.PlanMsgRecordDto;
-import com.hnac.hzims.message.dto.PushDto;
-import com.hnac.hzims.message.dto.SmsPushDto;
+import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import org.springblade.core.tool.api.R;
@@ -34,4 +31,9 @@ public class MessageClientFallback implements IMessageClient {
public R planSendMessage(PlanMsgRecordDto request) {
return R.fail("调用失败!");
}
+
+ @Override
+ public R sendAppAndWsMsgByUsers(BusinessMessageDTO request) {
+ return R.fail("调用失败!");
+ }
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
index 57afdb2..83c3092 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
@@ -2,28 +2,26 @@ package com.hnac.hzims.message.fegin;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.google.common.collect.Lists;
import com.hnac.hzims.message.MessageConstants;
-import com.hnac.hzims.message.dto.MessagePushRecordDto;
-import com.hnac.hzims.message.dto.PlanMsgRecordDto;
-import com.hnac.hzims.message.dto.PushDto;
-import com.hnac.hzims.message.dto.SmsPushDto;
+import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import com.hnac.hzims.message.service.IMessagePushRecordService;
import com.hnac.hzims.message.service.IMessageService;
import com.hnac.hzims.message.service.IMessageTemplateService;
+import com.hnac.hzims.message.service.impl.PushMessageServiceImpl;
import com.hnac.hzims.message.service.impl.SmsMessageServiceImpl;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
-import org.springblade.core.tool.utils.BeanUtil;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.ObjectUtil;
-import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.core.tool.utils.*;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User;
import org.springframework.util.Assert;
@@ -33,7 +31,9 @@ import javax.validation.Valid;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Arrays;
+import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
/**
* @author hx
@@ -115,4 +115,37 @@ public class MessageClient extends BladeController implements IMessageClient{
return R.success("推送成功!");
}
+ @Override
+ @PostMapping(SEND_APP_AND_WS_MSG)
+ public R sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request) {
+ // 保存消息记录
+ List pushRecords = Func.toLongList(request.getUserIds()).stream().flatMap(userId -> {
+ long messageId = IdWorker.getId();
+ return Lists.newArrayList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH).stream().map(messageType -> {
+ MessagePushRecordEntity record = BeanUtil.copy(request, MessagePushRecordEntity.class);
+ record.setMessageId(messageId);
+ record.setPusher(userId.toString());
+ record.setPusherName(Optional.ofNullable(UserCache.getUser(userId)).map(User::getName).orElse(null));
+ record.setPushType(MessageConstants.IMMEDIATELY);
+ record.setAccount(userId.toString());
+ record.setPlanTime(LocalDateTime.now());
+ record.setType(messageType);
+ record.setCreateDept(record.getDeptId());
+ return record;
+ });
+ }).collect(Collectors.toList());
+ boolean saveResult = recordService.saveBatch(pushRecords);
+ if(saveResult) {
+ List appRecords = pushRecords.stream().filter(record -> MessageConstants.APP_PUSH.equals(record.getType())).collect(Collectors.toList());
+ // 推送消息 - app
+ recordService.sendAppMsgByUsers(request,appRecords);
+ // 推送消息 - web
+ recordService.sendWsMsgByUsers(CollectionUtils.subtract(pushRecords,appRecords).stream().collect(Collectors.toList()));
+ return R.success("推送成功");
+ }
+ else {
+ return R.fail("保存消息失败");
+ }
+ }
+
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java
index 40e5e03..b15f874 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java
@@ -1,11 +1,14 @@
package com.hnac.hzims.message.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.vo.UnreadMessageVO;
import com.hnac.hzims.message.vo.msgpushrecord.*;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@@ -84,4 +87,7 @@ public interface IMessagePushRecordService extends BaseService getPersonalAppUnreadMessage();
+ Boolean sendAppMsgByUsers(BusinessMessageDTO request,List records);
+
+ Boolean sendWsMsgByUsers(List request);
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
index 437cacc..aeffe5d 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java
@@ -14,6 +14,7 @@ import com.google.common.collect.Lists;
import com.hnac.hzims.common.utils.CacheUtil;
import com.hnac.hzims.message.MessageConstants;
import com.hnac.hzims.message.config.MessageFactory;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.enums.PushStatEnum;
import com.hnac.hzims.message.mapper.MessagePushRecordMapper;
@@ -30,6 +31,7 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -41,10 +43,7 @@ import java.time.LocalDateTime;
import java.time.Year;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.stream.Collectors;
@Service
@@ -321,6 +320,41 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl records) {
+ PushMessageServiceImpl service = SpringUtil.getBean(PushMessageServiceImpl.class);
+ try {
+ boolean sendFlag = service.sendByUsers(request.getSubject(), request.getContent(), Arrays.asList(request.getUserIds().split(",")), request.getTenantId());
+ if(sendFlag) {
+ return this.update(Wrappers.lambdaUpdate()
+ .set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
+ .set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
+ .in(MessagePushRecordEntity::getId, records.stream().map(MessagePushRecordEntity::getId).collect(Collectors.toList()))
+ );
+ }
+ return false;
+ }
+ catch(Exception e) {
+ throw new ServiceException(e.getMessage());
+ }
+ }
+
+ @Override
+ public Boolean sendWsMsgByUsers(List request) {
+ WebsocketServiceImpl service = SpringUtil.getBean(WebsocketServiceImpl.class);
+ request.forEach(record -> {
+ boolean sendFlag = service.send(record);
+ if(sendFlag) {
+ this.update(Wrappers.lambdaUpdate()
+ .set(MessagePushRecordEntity::getPushTime, LocalDateTime.now())
+ .set(MessagePushRecordEntity::getStatus, MessageConstants.PUSH_SUCCESS)
+ .in(MessagePushRecordEntity::getId, record.getId())
+ );
+ }
+ });
+ return true;
+ }
+
/**
* 状态 ===> 状态名称
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java
index b62134f..51a512a 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/PushMessageServiceImpl.java
@@ -29,6 +29,8 @@ import org.springframework.util.Assert;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicReference;
/**
@@ -117,4 +119,42 @@ public class PushMessageServiceImpl implements IMessageService {
});
return true;
}
+
+ /**
+ * 发送APP消息(多人)
+ * @param subject 消息主题
+ * @param content 消息内容
+ * @param userIds 用户ID列表
+ * @param tenantId 推送成功标识
+ * @return
+ */
+ public boolean sendByUsers(String subject, String content, List userIds,String tenantId) throws Exception {
+ // 安卓推送
+ FutureTask androidPush = new FutureTask<>(() -> {
+ PushInfoVO pushInfoVO = new PushInfoVO();
+ PushPlatform pushPlatform = PushPlatform.newBuilder().addPlatformType(PlatformType.Android).build();
+ PushAudience pushAudience = PushAudience.newBuilder().addPushAudienceType(PushAudienceType.TAG, userIds).build();
+ PushInfo pushInfo = new PushInfo("ops-push-android", subject, content,"", null, pushPlatform, pushAudience);
+ pushInfoVO.setPushInfo(pushInfo);
+ pushInfoVO.setTenantId(tenantId);
+ R pushResult = pushClient.tenantPush(pushInfoVO);
+ return pushResult.isSuccess();
+ });
+ new Thread(androidPush,"安卓推送").start();
+
+ // IOS推送
+ FutureTask iosPush = new FutureTask<>(() -> {
+ PushInfoVO pushInfoVO = new PushInfoVO();
+ PushPlatform pushPlatform = PushPlatform.newBuilder().addPlatformType(PlatformType.IOS).build();
+ PushAudience pushAudience = PushAudience.newBuilder().addPushAudienceType(PushAudienceType.TAG, userIds).build();
+ PushInfo pushInfo = new PushInfo("ops-push-ios", subject, content,"", null, pushPlatform, pushAudience);
+ pushInfoVO.setPushInfo(pushInfo);
+ pushInfoVO.setTenantId(tenantId);
+ R pushResult = pushClient.tenantPush(pushInfoVO);
+ return pushResult.isSuccess();
+ });
+ new Thread(iosPush,"ios推送").start();
+
+ return androidPush.get() && iosPush.get();
+ }
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java
index 07730aa..419da82 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/WebsocketServiceImpl.java
@@ -23,6 +23,7 @@ import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import java.io.IOException;
import java.time.LocalDateTime;
+import java.util.List;
import java.util.concurrent.TimeUnit;
/**
From face537c384af8546ecab7aec634052355180be3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Tue, 20 Jun 2023 12:27:27 +0800
Subject: [PATCH 07/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=93=8D=E4=BD=9C?=
=?UTF-8?q?=E7=A5=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/OperationTicketController.java | 1 +
.../controller/StandardTicketInfoController.java | 1 -
.../service/impl/OperationTicketServiceImpl.java | 21 +++++++++++++++------
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
index 2ef7a12..7669242 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
@@ -54,6 +54,7 @@ public class OperationTicketController {
operationTicketService.findPending(response);
return true;
} catch (Exception e) {
+ e.printStackTrace();
throw new ServiceException("操作票待处理:" + e.getMessage());
}
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
index af1d2bc..f2e930b 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardTicketInfoController.java
@@ -113,7 +113,6 @@ public class StandardTicketInfoController extends BladeController {
/**
* 根据月份,区域 获取操作详情数据
- *
* @return
*/
@GetMapping("/areaMonthlyWithOperation/{page}/{size}")
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 7b94004..ed73e0c 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
@@ -41,6 +41,7 @@ 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.beans.BeansException;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
@@ -157,7 +158,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
log.info("获取下一个审批人是: {} ", response.getNextStepOperator());
log.info("获取下一个用户Id是: {} ", response.getUserId());
log.info("获取当前任务名称是: {} ", response.getTaskName());
- log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType());
+ log.info("获取根据handleType区分是用户还是候选组角色: {}", response.getHandleType());
//json转换表单
String formData = JSON.toJSONString(response.getVariables());
log.info("获取表单的数据:{}", formData);
@@ -177,6 +178,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
log.error("获取操作票不存在");
return;
}
+
//设置id
StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity();
BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity);
@@ -186,6 +188,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
newStandardTicketInfoEntity.setProcessInstanceId(response.getProcessInstanceId());
standardTicketInfoService.updateById(newStandardTicketInfoEntity);
+
//更新安全措施
List standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos();
if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) {
@@ -196,6 +199,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
}).collect(Collectors.toList());
standardTicketMeasureService.updateBatchById(standardTicketMeasureEntities);
}
+
//推送消息
if (response.getTaskId() != null) {
MessagePushRecordDto message = new MessagePushRecordDto();
@@ -236,6 +240,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
}
}
+
}
@@ -247,19 +252,23 @@ public class OperationTicketServiceImpl implements OperationTicketService {
*/
private void saveStandardTicketInfoEntity(StandardTicketInfoEntity newStandardTicketInfoEntity, ProcessWorkFlowResponse response) {
String flowDescription = "";
- //如果response.getHandleType() 是0使用户
- newStandardTicketInfoEntity.setFlowUserId(response.getUserId());
- newStandardTicketInfoEntity.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)) {
+ log.info("StringUtils.isBlank(taskId) = " + StringUtils.isBlank(taskId));
+ if (StringUtils.isBlank(taskId)) {
newStandardTicketInfoEntity.setFlowDescription("结束");
newStandardTicketInfoEntity.setFlowTaskId(" ");
newStandardTicketInfoEntity.setFlowTaskName("结束");
newStandardTicketInfoEntity.setNextStepOperator(" ");
newStandardTicketInfoEntity.setFlowStatus(999);
} else {
+ //如果response.getHandleType() 是0使用户
+ newStandardTicketInfoEntity.setFlowUserId(response.getUserId());
+ newStandardTicketInfoEntity.setNextStepOperator(response.getNextStepOperator());
newStandardTicketInfoEntity.setFlowTaskId(taskId);
newStandardTicketInfoEntity.setFlowTaskName(response.getTaskName());
newStandardTicketInfoEntity.setFlowDescription(flowDescription);
From bc334eacb611373a688b7d2506be8a2c73c2bd6a Mon Sep 17 00:00:00 2001
From: haungxing <1203316822@qq.com>
Date: Tue, 20 Jun 2023 13:53:40 +0800
Subject: [PATCH 08/13] =?UTF-8?q?#=20=E6=B6=88=E6=81=AFAPP/WEB=E5=A4=9A?=
=?UTF-8?q?=E4=BA=BA=E5=8D=B3=E6=97=B6=E6=8E=A8=E9=80=81=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?(=E8=A1=A5)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/hnac/hzims/message/fegin/IMessageClient.java | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
index be87e27..6c298a9 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
@@ -1,10 +1,7 @@
package com.hnac.hzims.message.fegin;
import com.hnac.hzims.message.MessageConstants;
-import com.hnac.hzims.message.dto.MessagePushRecordDto;
-import com.hnac.hzims.message.dto.PlanMsgRecordDto;
-import com.hnac.hzims.message.dto.PushDto;
-import com.hnac.hzims.message.dto.SmsPushDto;
+import com.hnac.hzims.message.dto.*;
import com.hnac.hzims.message.entity.MessagePushRecordEntity;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
import org.springblade.core.tool.api.R;
@@ -29,6 +26,7 @@ public interface IMessageClient {
String SEND_MESSAGE = API_PREFIX + "/sendMessage";
String GET_TEMPLATE_BY_ID = API_PREFIX + "/getMsgTemplateById";
String PLAN_SEND_MESSAGE = API_PREFIX + "/planSendMessage";
+ String SEND_APP_AND_WS_MSG = API_PREFIX + "/sendAppAndWsMsgByUsers";
/**
* 推送消息(短信)
@@ -54,4 +52,13 @@ public interface IMessageClient {
**/
@PostMapping(PLAN_SEND_MESSAGE)
R planSendMessage(@RequestBody PlanMsgRecordDto request);
+
+ /**
+ * 发送多人APP、WEB消息
+ * @Author hx
+ * @param request
+ * @return
+ */
+ @PostMapping(SEND_APP_AND_WS_MSG)
+ R sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request);
}
From ce9330e8a8c9795c6103790d4135ef10623fc762 Mon Sep 17 00:00:00 2001
From: haungxing <1203316822@qq.com>
Date: Tue, 20 Jun 2023 16:57:41 +0800
Subject: [PATCH 09/13] =?UTF-8?q?#=20=E8=A7=A3=E5=86=B3=E6=B6=88=E6=81=AFA?=
=?UTF-8?q?PP/WEB=E5=A4=9A=E4=BA=BA=E5=8D=B3=E6=97=B6=E6=8E=A8=E9=80=81fei?=
=?UTF-8?q?gn=E6=8E=A5=E5=8F=A3=E6=8E=A5=E6=94=B6=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/com/hnac/hzims/message/fegin/MessageClient.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
index 83c3092..f8b5a26 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
@@ -138,13 +138,13 @@ public class MessageClient extends BladeController implements IMessageClient{
if(saveResult) {
List appRecords = pushRecords.stream().filter(record -> MessageConstants.APP_PUSH.equals(record.getType())).collect(Collectors.toList());
// 推送消息 - app
- recordService.sendAppMsgByUsers(request,appRecords);
+ Boolean appFlag = recordService.sendAppMsgByUsers(request, appRecords);
// 推送消息 - web
- recordService.sendWsMsgByUsers(CollectionUtils.subtract(pushRecords,appRecords).stream().collect(Collectors.toList()));
- return R.success("推送成功");
+ Boolean wsFlag = recordService.sendWsMsgByUsers(CollectionUtils.subtract(pushRecords, appRecords).stream().collect(Collectors.toList()));
+ return R.data(appFlag && wsFlag);
}
else {
- return R.fail("保存消息失败");
+ return R.data(false);
}
}
From be355ce22c575f0bcf5a1e7e89a8f0bc81ac14c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com>
Date: Tue, 20 Jun 2023 18:48:53 +0800
Subject: [PATCH 10/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A8=E9=80=81?=
=?UTF-8?q?=E6=B6=88=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/OperationTicketController.java | 48 +++++++++
.../service/impl/OperationTicketServiceImpl.java | 94 ++++++++++-------
.../service/impl/TicketProcessServiceImpl.java | 114 +++++++++++++--------
3 files changed, 179 insertions(+), 77 deletions(-)
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
index 7669242..56cc07f 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/OperationTicketController.java
@@ -1,6 +1,9 @@
package com.hnac.hzims.ticket.standardTicket.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.hnac.hzims.message.MessageConstants;
+import com.hnac.hzims.message.dto.BusinessMessageDTO;
+import com.hnac.hzims.message.fegin.IMessageClient;
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
import com.hnac.hzims.ticket.standardTicket.service.OperationTicketService;
import com.hnac.hzims.ticket.twoTicket.vo.operation.StandardTicketInfoVo;
@@ -9,6 +12,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
+import org.springblade.system.feign.ISysClient;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -30,6 +34,9 @@ public class OperationTicketController {
private final OperationTicketService operationTicketService;
+ private final IMessageClient messageClient;
+
+
/**
* 启动流程
*
@@ -76,4 +83,45 @@ public class OperationTicketController {
}
+
+
+
+ private final ISysClient sysClient;
+
+
+ @GetMapping("/test")
+ public void test(){
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ businessMessageDTO.setBusinessClassify("business");
+ businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
+ businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
+ businessMessageDTO.setTaskId(1671058860039106562L);
+ businessMessageDTO.setTenantId("200000");
+ //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ String countent =
+ "您有一张工作票待审批,工作内容:".concat("11")
+ .concat(",审批环节:")
+ .concat("监护人确认");
+ businessMessageDTO.setContent(countent);
+ businessMessageDTO.setDeptId(2000000115L);
+ R deptName = sysClient.getDeptName(2000000115L);
+ if (deptName.isSuccess()) {
+ businessMessageDTO.setDeptName(deptName.getData());
+ }
+ String userIds = "1522897714092781569";
+ businessMessageDTO.setUserIds(userIds);
+ businessMessageDTO.setCreateUser(1522897714092781569L);
+
+ System.out.println("businessMessageDTO = " + businessMessageDTO);
+
+ R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ if (!booleanR.isSuccess()) {
+ throw new ServiceException("消息推送失败");
+ }else {
+ System.out.println("推送成功");
+ }
+
+ }
+
+
}
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 ed73e0c..0a6344c 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
@@ -5,11 +5,12 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.hnac.hzims.middle.process.feign.ProcessDictFeignService;
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;
import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
@@ -41,7 +42,6 @@ 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.beans.BeansException;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
@@ -133,8 +133,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//3. 保存操作对象
this.saveStandardTicketInfo(standardTicketInfoVo);
//5. 保存安全措施
- List standardTicketInfoVos = this.saveStandardTicketMeasure(
- this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
+ List standardTicketInfoVos = this.saveStandardTicketMeasure(this.saveStandardTicketMeasureWichTicket(standardTicketInfoVo));
standardTicketInfoVo.setStandardTicketMeasureVos(standardTicketInfoVos);
//6. 查询第操作票值
String dictValue = processDictFeignService.selectDictValueByKey(OPERATION_TICKET_KEY);
@@ -183,6 +182,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
StandardTicketInfoEntity newStandardTicketInfoEntity = new StandardTicketInfoEntity();
BeanUtils.copyProperties(standardTicketInfoVo, newStandardTicketInfoEntity);
newStandardTicketInfoEntity.setId(id);
+ newStandardTicketInfoEntity.setCreateUser(standardTicketInfoEntity.getCreateUser());
//填充操作票信息
saveStandardTicketInfoEntity(newStandardTicketInfoEntity, response);
newStandardTicketInfoEntity.setProcessInstanceId(response.getProcessInstanceId());
@@ -202,45 +202,69 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//推送消息
if (response.getTaskId() != null) {
- MessagePushRecordDto message = new MessagePushRecordDto();
- message.setBusinessClassify("business");
- message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
- message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
- message.setTaskId(standardTicketInfoEntity.getId());
- message.setTenantId("200000");
- message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
- message.setPushType(MessageConstants.IMMEDIATELY);
+ // MessagePushRecordDto message = new MessagePushRecordDto();
+ // message.setBusinessClassify("business");
+ // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
+ // message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
+ // message.setTaskId(standardTicketInfoEntity.getId());
+ // message.setTenantId("200000");
+ // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
+ // message.setPushType(MessageConstants.IMMEDIATELY);
+ // //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ // String countent = "您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle()).concat(",审批环节:").concat(response.getTaskName());
+ // message.setContent(countent);
+ // message.setDeptId(standardTicketInfoEntity.getCreateDept());
+ // R deptName = sysClient.getDeptName(standardTicketInfoEntity.getCreateDept());
+ // if (deptName.isSuccess()) {
+ // message.setDeptName(deptName.getData());
+ // }
+ // String userIds = response.getUserId();
+ // if (StringUtils.isBlank(userIds)) {
+ // log.error("推送的消息不能为空哦,{}", userIds);
+ // return;
+ // }
+ // String[] split = userIds.split(",");
+ // for (String userId : split) {
+ // message.setPusher(userId);
+ // User user = UserCache.getUser(NumberUtils.toLong(userId));
+ // if (ObjectUtils.isNotEmpty(user)) {
+ // message.setPusherName(user.getName());
+ // }
+ // message.setAccount(userId);
+ //
+ // message.setCreateUser(NumberUtils.toLong(userId));
+ // messageClient.sendMessage(message);
+ // }
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ businessMessageDTO.setBusinessClassify("business");
+ businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
+ businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
+ businessMessageDTO.setTaskId(standardTicketInfoEntity.getId());
+ businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
"您有一张工作票待审批,工作内容:".concat(standardTicketInfoEntity.getTitle())
.concat(",审批环节:")
.concat(response.getTaskName());
- message.setContent(countent);
- message.setDeptId(standardTicketInfoEntity.getCreateDept());
+ businessMessageDTO.setContent(countent);
+ businessMessageDTO.setDeptId(standardTicketInfoEntity.getCreateDept());
R deptName = sysClient.getDeptName(standardTicketInfoEntity.getCreateDept());
if (deptName.isSuccess()) {
- message.setDeptName(deptName.getData());
+ businessMessageDTO.setDeptName(deptName.getData());
}
String userIds = response.getUserId();
- if (StringUtils.isBlank(userIds)) {
- log.error("推送的消息不能为空哦,{}", userIds);
- return;
- }
- String[] split = userIds.split(",");
- for (String userId : split) {
- message.setPusher(userId);
- User user = UserCache.getUser(NumberUtils.toLong(userId));
- if (ObjectUtils.isNotEmpty(user)) {
- message.setPusherName(user.getName());
- }
- message.setAccount(userId);
-
- message.setCreateUser(NumberUtils.toLong(userId));
- messageClient.sendMessage(message);
+ businessMessageDTO.setUserIds(userIds);
+ businessMessageDTO.setCreateUser(newStandardTicketInfoEntity.getCreateUser());
+
+ System.out.println("================================================");
+ System.out.println("businessMessageDTO = " + businessMessageDTO);
+ System.out.println("================================================");
+ R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ if (!booleanR.isSuccess()) {
+ throw new ServiceException("消息推送失败");
}
+ log.info("推送成功~");
}
-
-
}
@@ -288,8 +312,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
params.put("taskId", standardTicketInfoVo.getId());
params.put("guardianUserIds", "taskUser_".concat(standardTicketInfoVo.getGuardian().toString()));
//已开启流程
- R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue,
- String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
+ R processInstanceContainNameByKey = flowClient.startProcessInstanceContainNameByKey(dictValue, String.valueOf(standardTicketInfoVo.getId()), standardTicketInfoVo.getTitle(), params);
if (!processInstanceContainNameByKey.isSuccess()) {
log.error("processInstanceContainNameByKey {}", processInstanceContainNameByKey.getMsg());
throw new ServiceException("不好意思,您暂无权限...");
@@ -311,8 +334,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
private List saveStandardTicketMeasureWichTicket(StandardTicketInfoVo standardTicketInfoVo) {
List standardTicketMeasureVos = standardTicketInfoVo.getStandardTicketMeasureVos();
if (CollectionUtils.isNotEmpty(standardTicketMeasureVos)) {
- List measureEntityList = BeanUtil.copyProperties(standardTicketMeasureVos,
- StandardTicketMeasureEntity.class);
+ List measureEntityList = BeanUtil.copyProperties(standardTicketMeasureVos, StandardTicketMeasureEntity.class);
List collect = measureEntityList.stream().map(item -> {
item.setTicketId(standardTicketInfoVo.getId());
return item;
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 eed6a7e..844cc6f 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
@@ -9,6 +9,7 @@ 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;
@@ -279,7 +280,8 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//更新工作票
workTicket.setId(workTicketInfo.getId());
//保存流程描述
- workTicketInfo.setCreateDept(workTicketInfo.getCreateDept());
+ workTicket.setCreateDept(workTicketInfo.getCreateDept());
+ workTicket.setCreateUser(workTicketInfo.getCreateUser());
workTicket.setTenantId(workTicketInfo.getTenantId());
saveWorkTicket(workTicket, response);
//工作流ID
@@ -405,47 +407,77 @@ public class TicketProcessServiceImpl implements TicketProcessService {
if (response.getTaskId() != null || response.getUserId() != null) {
//推送消息
- try {
- MessagePushRecordDto message = new MessagePushRecordDto();
- message.setBusinessClassify("business");
- message.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
- message.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
- message.setTaskId(workTicketInfo.getId());
- message.setTenantId("200000");
- message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
- message.setPushType(MessageConstants.IMMEDIATELY);
- //您有一张工作票待审批,工作内容:*****,审批环节:*****;
- String countent =
- "您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent())
- .concat(",审批环节: ")
- .concat(response.getTaskName());
- message.setContent(countent);
- message.setDeptId(workTicketInfo.getCreateDept());
- message.setCreateDept(workTicketInfo.getCreateDept());
- R deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
- if (deptName.isSuccess()) {
- message.setDeptName(deptName.getData());
- }
- String userIds = response.getUserId();
- if (StringUtils.isBlank(userIds)) {
- log.error("推送的消息不能为空哦,{}", userIds);
- return;
- }
- String[] split = userIds.split(",");
- for (String userId : split) {
- message.setPusher(userId);
- User user = UserCache.getUser(NumberUtils.toLong(userId));
- if (ObjectUtils.isNotEmpty(user)) {
- message.setPusherName(user.getName());
- }
- message.setAccount(userId);
- message.setCreateUser(NumberUtils.toLong(userId));
- messageClient.sendMessage(message);
- log.info("推送消息成功,用户名称{},消息{}", user.getName(), message);
- }
- } catch (Exception e) {
- e.printStackTrace();
+ // try {
+ // MessagePushRecordDto message = new MessagePushRecordDto();
+ // message.setBusinessClassify("business");
+ // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
+ // message.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
+ // message.setTaskId(workTicketInfo.getId());
+ // message.setTenantId("200000");
+ // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
+ // message.setPushType(MessageConstants.IMMEDIATELY);
+ // //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ // String countent =
+ // "您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent())
+ // .concat(",审批环节: ")
+ // .concat(response.getTaskName());
+ // message.setContent(countent);
+ // message.setDeptId(workTicketInfo.getCreateDept());
+ // message.setCreateDept(workTicketInfo.getCreateDept());
+ // R deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
+ // if (deptName.isSuccess()) {
+ // message.setDeptName(deptName.getData());
+ // }
+ // String userIds = response.getUserId();
+ // if (StringUtils.isBlank(userIds)) {
+ // log.error("推送的消息不能为空哦,{}", userIds);
+ // return;
+ // }
+ // String[] split = userIds.split(",");
+ // for (String userId : split) {
+ // message.setPusher(userId);
+ // User user = UserCache.getUser(NumberUtils.toLong(userId));
+ // if (ObjectUtils.isNotEmpty(user)) {
+ // message.setPusherName(user.getName());
+ // }
+ // message.setAccount(userId);
+ // message.setCreateUser(NumberUtils.toLong(userId));
+ // messageClient.sendMessage(message);
+ // log.info("推送消息成功,用户名称{},消息{}", user.getName(), message);
+ // }
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // }
+
+
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ businessMessageDTO.setBusinessClassify("business");
+ businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getKey());
+ businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.TICKETMESSAGE.getDescription());
+ businessMessageDTO.setTaskId(workTicketInfo.getId());
+ businessMessageDTO.setTenantId("200000");
+ //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ String countent =
+ "您有一张工作票待审批,工作内容: ".concat(workTicketInfo.getWorkContent())
+ .concat(",审批环节: ")
+ .concat(response.getTaskName());
+ businessMessageDTO.setContent(countent);
+ businessMessageDTO.setDeptId(workTicketInfo.getCreateDept());
+ R deptName = sysClient.getDeptName(workTicketInfo.getCreateDept());
+ if (deptName.isSuccess()) {
+ businessMessageDTO.setDeptName(deptName.getData());
+ }
+ String userIds = response.getUserId();
+ businessMessageDTO.setUserIds(userIds);
+ businessMessageDTO.setCreateUser(workTicketInfo.getCreateUser());
+ System.out.println("======================================================");
+ System.out.println("businessMessageDTO = " + businessMessageDTO);
+ System.out.println("======================================================");
+ R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ if (!booleanR.isSuccess()) {
+ throw new ServiceException("消息推送失败");
}
+ log.info("推送成功~");
}
}
From 37f0a52c97ea70cfb816af02dee9b1d5111929b3 Mon Sep 17 00:00:00 2001
From: haungxing <1203316822@qq.com>
Date: Wed, 21 Jun 2023 11:51:10 +0800
Subject: [PATCH 11/13] =?UTF-8?q?#=20=E8=A7=A3=E5=86=B3=E6=B6=88=E6=81=AFA?=
=?UTF-8?q?PP/WEB=E5=A4=9A=E4=BA=BA=E5=8D=B3=E6=97=B6=E6=8E=A8=E9=80=81fei?=
=?UTF-8?q?gn=E6=8E=A5=E5=8F=A3=E6=8E=A5=E6=94=B6=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java | 2 +-
.../src/main/java/com/hnac/hzims/message/fegin/MessageClient.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
index 6c298a9..887e97c 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/fegin/IMessageClient.java
@@ -59,6 +59,6 @@ public interface IMessageClient {
* @param request
* @return
*/
- @PostMapping(SEND_APP_AND_WS_MSG)
+ @PostMapping(value = SEND_APP_AND_WS_MSG,consumes = "application/json; charset=UTF-8")
R sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request);
}
diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
index f8b5a26..0660fdd 100644
--- a/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
+++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/fegin/MessageClient.java
@@ -116,7 +116,7 @@ public class MessageClient extends BladeController implements IMessageClient{
}
@Override
- @PostMapping(SEND_APP_AND_WS_MSG)
+ @PostMapping(value = SEND_APP_AND_WS_MSG , produces="application/json; charset=UTF-8")
public R sendAppAndWsMsgByUsers(@RequestBody BusinessMessageDTO request) {
// 保存消息记录
List pushRecords = Func.toLongList(request.getUserIds()).stream().flatMap(userId -> {
From 1ba3e0fec47e8334aee6e96d5c029070beb5b1ad 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, 21 Jun 2023 14:14:35 +0800
Subject: [PATCH 12/13] =?UTF-8?q?=E8=A1=A8=E7=BB=93=E6=9E=84=E8=84=9A?=
=?UTF-8?q?=E6=9C=AC=E5=90=8C=E6=AD=A5=E8=84=9A=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hf.fo | 5 +
.../com/hnac/hzims/message/MessageConstants.java | 1 +
.../hzims-middle/src/main/resources/db/newsql.sql | 67 +++
.../controller/MaintenanceController.java | 1 +
.../service/impl/MaintenanceServiceImpl.java | 85 ++-
.../operational/src/main/resources/db/2.0.0.sql | 575 +++++++++++++++++++++
.../service/impl/OperationTicketServiceImpl.java | 2 +
.../ticket/src/main/resources/db/newsql.sql | 180 +++++++
.../template/~$第一种工作票模版.docx | Bin 0 -> 162 bytes
.../main/resources/template/电气操作票.docx | Bin 0 -> 46645 bytes
10 files changed, 889 insertions(+), 27 deletions(-)
create mode 100644 hf.fo
create mode 100644 hzims-service/hzims-middle/src/main/resources/db/newsql.sql
create mode 100644 hzims-service/operational/src/main/resources/db/2.0.0.sql
create mode 100644 hzims-service/ticket/src/main/resources/db/newsql.sql
create mode 100644 hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx
create mode 100644 hzims-service/ticket/src/main/resources/template/电气操作票.docx
diff --git a/hf.fo b/hf.fo
new file mode 100644
index 0000000..1a46bb7
--- /dev/null
+++ b/hf.fo
@@ -0,0 +1,5 @@
+BODY CONTENTBODY CONTENTBODY CONTENTBODY CONTENT
+
+
+
+
\ No newline at end of file
diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
index 4d55a16..9960a32 100644
--- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
+++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/MessageConstants.java
@@ -54,6 +54,7 @@ public class MessageConstants {
ACCESS("access","检修消息"),
TICKETMESSAGE("ticket-message","工作票消息"),
OPERATIONTICKETMESSAGE("operation-ticket-message","操作票消息"),
+ ROUTINEMAINTENANCE("operation-maintenance-message","日常维护消息"),
OPERATIONDEFECTMESSAGE("operation-defect-message","消缺消息"),
;
@Getter
diff --git a/hzims-service/hzims-middle/src/main/resources/db/newsql.sql b/hzims-service/hzims-middle/src/main/resources/db/newsql.sql
new file mode 100644
index 0000000..ac22bdf
--- /dev/null
+++ b/hzims-service/hzims-middle/src/main/resources/db/newsql.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/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
index d4868a4..de1371d 100644
--- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
+++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceController.java
@@ -58,6 +58,7 @@ public class MaintenanceController {
maintenanceService.findPending(response);
return true;
} catch (Exception e) {
+ e.printStackTrace();
throw new ServiceException("日常维护待处理:" + e.getMessage());
}
}
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 dc17a53..0578a39 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
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.common.utils.DateUtil;
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.dto.PlanMsgRecordDto;
import com.hnac.hzims.message.entity.config.MessageTemplateEntity;
@@ -113,6 +114,7 @@ public class MaintenanceServiceImpl implements MaintenanceService {
* @param response
*/
@Override
+ @Transactional(rollbackFor = RuntimeException.class)
public void findPending(ProcessWorkFlowResponse response) {
log.info("获取businessKey: {}", response.getBusinessKey());
log.info("获取taskId: {} ", response.getTaskId());
@@ -148,41 +150,70 @@ public class MaintenanceServiceImpl implements MaintenanceService {
//推送消息
if (response.getTaskId() != null) {
- MessagePushRecordDto message = new MessagePushRecordDto();
- message.setBusinessClassify("business");
- message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
- message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
- message.setTaskId(entity.getId());
- message.setTenantId("200000");
- message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
- message.setPushType(MessageConstants.IMMEDIATELY);
+ // MessagePushRecordDto message = new MessagePushRecordDto();
+ // message.setBusinessClassify("business");
+ // message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getKey());
+ // message.setSubject(MessageConstants.BusinessClassifyEnum.OPERATIONTICKETMESSAGE.getDescription());
+ // message.setTaskId(entity.getId());
+ // message.setTenantId("200000");
+ // message.setTypes(Arrays.asList(MessageConstants.APP_PUSH, MessageConstants.WS_PUSH));
+ // message.setPushType(MessageConstants.IMMEDIATELY);
+ // //您有一张工作票待审批,工作内容:*****,审批环节:*****;
+ // String countent =
+ // "您有一条日常维护任务待审批,工作内容:".concat(entity.getTitle())
+ // .concat(",审批环节:")
+ // .concat(response.getTaskName());
+ // message.setContent(countent);
+ // message.setDeptId(entity.getCreateDept());
+ // R deptName = sysClient.getDeptName(entity.getCreateDept());
+ // if (deptName.isSuccess()) {
+ // message.setDeptName(deptName.getData());
+ // }
+ // String userIds = response.getUserId();
+ // if (com.hnac.hzims.common.logs.utils.StringUtils.isBlank(userIds)) {
+ // log.error("推送的消息不能为空哦,{}", userIds);
+ // return;
+ // }
+ // String[] split = userIds.split(",");
+ // for (String userId : split) {
+ // message.setPusher(userId);
+ // User user = UserCache.getUser(NumberUtils.toLong(userId));
+ // if (ObjectUtils.isNotEmpty(user)) {
+ // message.setPusherName(user.getName());
+ // }
+ // message.setAccount(userId);
+ // message.setCreateUser(NumberUtils.toLong(userId));
+ // messageClient.sendMessage(message);
+ // }
+ BusinessMessageDTO businessMessageDTO = new BusinessMessageDTO();
+ businessMessageDTO.setBusinessClassify("business");
+ businessMessageDTO.setBusinessKey(MessageConstants.BusinessClassifyEnum.ROUTINEMAINTENANCE.getKey());
+ businessMessageDTO.setSubject(MessageConstants.BusinessClassifyEnum.ROUTINEMAINTENANCE.getDescription());
+ businessMessageDTO.setTaskId(dbOperMaintenanceTaskEntity.getId());
+ businessMessageDTO.setTenantId("200000");
//您有一张工作票待审批,工作内容:*****,审批环节:*****;
String countent =
- "您有一条日常维护任务待审批,工作内容:".concat(entity.getTitle())
+ "您有一条日常维护任务待审批,工作内容:".concat(dbOperMaintenanceTaskEntity.getTitle())
.concat(",审批环节:")
.concat(response.getTaskName());
- message.setContent(countent);
- message.setDeptId(entity.getCreateDept());
- R deptName = sysClient.getDeptName(entity.getCreateDept());
+ businessMessageDTO.setContent(countent);
+ businessMessageDTO.setDeptId(dbOperMaintenanceTaskEntity.getCreateDept());
+ R deptName = sysClient.getDeptName(dbOperMaintenanceTaskEntity.getCreateDept());
if (deptName.isSuccess()) {
- message.setDeptName(deptName.getData());
+ businessMessageDTO.setDeptName(deptName.getData());
}
String userIds = response.getUserId();
- if (com.hnac.hzims.common.logs.utils.StringUtils.isBlank(userIds)) {
- log.error("推送的消息不能为空哦,{}", userIds);
- return;
- }
- String[] split = userIds.split(",");
- for (String userId : split) {
- message.setPusher(userId);
- User user = UserCache.getUser(NumberUtils.toLong(userId));
- if (ObjectUtils.isNotEmpty(user)) {
- message.setPusherName(user.getName());
- }
- message.setAccount(userId);
- message.setCreateUser(NumberUtils.toLong(userId));
- messageClient.sendMessage(message);
+ businessMessageDTO.setUserIds(userIds);
+ businessMessageDTO.setCreateUser(dbOperMaintenanceTaskEntity.getCreateUser());
+
+ log.info("================================================");
+ log.info("businessMessageDTO = " + businessMessageDTO);
+ log.info("================================================");
+ R booleanR = messageClient.sendAppAndWsMsgByUsers(businessMessageDTO);
+ if (!booleanR.isSuccess()) {
+ throw new ServiceException("消息推送失败");
}
+ log.info("推送成功~");
}
}
diff --git a/hzims-service/operational/src/main/resources/db/2.0.0.sql b/hzims-service/operational/src/main/resources/db/2.0.0.sql
new file mode 100644
index 0000000..905c8f0
--- /dev/null
+++ b/hzims-service/operational/src/main/resources/db/2.0.0.sql
@@ -0,0 +1,575 @@
+SET FOREIGN_KEY_CHECKS=0;
+
+CREATE TABLE `hzims_operation`.`ecology_flow_data` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `STATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '站点编号',
+ `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
+ `MON` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '月份',
+ `ON_LINE` decimal(15, 2) NULL DEFAULT NULL COMMENT '在线率',
+ `DEMONSTRATE` decimal(15, 2) NULL DEFAULT NULL COMMENT '达标率',
+ `TIMELY` decimal(15, 2) NULL DEFAULT NULL COMMENT '及时率',
+ `COMPLETE` decimal(15, 2) NULL DEFAULT NULL COMMENT '完整率',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
+ `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
+ `STATUS` tinyint(4) NOT NULL COMMENT '状态',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`ecology_flow_station` (
+ `ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+ `STATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '站点编号',
+ `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
+ `IS_ON_LINE` bigint(1) NULL DEFAULT NULL COMMENT '是否在线:0-离线 1-在线',
+ `IS_DEMONSTRATE` bigint(1) NULL DEFAULT NULL COMMENT '是否达标:0-不达标 1-达标',
+ `IS_TIMELY` bigint(1) NULL DEFAULT NULL COMMENT '是否及时:0-不及时 1-及时',
+ `IS_COMPLETE` bigint(1) NULL DEFAULT NULL COMMENT '是否完整:0-不完整 1-完整',
+ `CITY` varchar(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '城市: 0-黔东南 1-广宁',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
+ `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
+ `STATUS` tinyint(4) NOT NULL COMMENT '状态',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+ALTER TABLE `hzims_operation`.`hz_ims_duty_main_template` MODIFY COLUMN `DUTY_ORDER_IDS` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组值班周期id' AFTER `TYPE`;
+
+ALTER TABLE `hzims_operation`.`hzims_fill_over` MODIFY COLUMN `ENCL_NAME` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称' AFTER `ENCL_PATH`;
+
+ALTER TABLE `hzims_operation`.`hzims_fill_over_config` MODIFY COLUMN `SORT` tinyint(4) NOT NULL COMMENT '排序' AFTER `UNIT_PRICE`;
+
+ALTER TABLE `hzims_operation`.`hzims_fill_over_config` ADD UNIQUE INDEX `OVER_NAME`(`OVER_NAME`) USING BTREE;
+
+ALTER TABLE `hzims_operation`.`hzims_fill_power` MODIFY COLUMN `POWER_MON` double(20, 2) NULL DEFAULT 0.00 COMMENT '月发电量' AFTER `PLANNED_POWER_MON`;
+
+CREATE TABLE `hzims_operation`.`hzims_fill_wind` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `STATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点编号',
+ `STATION_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点名称',
+ `FILL_DATE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '填报日期',
+ `PLAN` decimal(15, 2) NULL DEFAULT NULL COMMENT '计划发电量',
+ `POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '发电量',
+ `SPEED` decimal(15, 2) NULL DEFAULT NULL COMMENT '平均风速',
+ `SURF_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '上网电量',
+ `BELOW_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '下网电量',
+ `AVAILABLE` decimal(15, 2) NULL DEFAULT NULL COMMENT '可用时长',
+ `COMPREHENSIVE_POWER` decimal(15, 2) NULL DEFAULT NULL COMMENT '综合用电量',
+ `PEAK` decimal(15, 2) NULL DEFAULT NULL COMMENT '峰值功率',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
+ `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
+ `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位' AFTER `SOE_EXPLAIN`;
+
+ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人' AFTER `CREATE_DEPT`;
+
+ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态' AFTER `TENANT_ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间' AFTER `UPDATE_USER`;
+
+ALTER TABLE `hzims_operation`.`hzims_history_abnormal_alarm` MODIFY COLUMN `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除' AFTER `UPDATE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_main_work_bench` MODIFY COLUMN `ORD` int(11) NULL DEFAULT NULL COMMENT '排序' AFTER `ENABLE_FLAG`;
+
+ALTER TABLE `hzims_operation`.`hzims_main_work_bench` MODIFY COLUMN `REF_DEPT` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属机构' AFTER `ORD`;
+
+ALTER TABLE `hzims_operation`.`hzims_month_report` MODIFY COLUMN `OBJECT` blob NULL COMMENT '报表保存对象' AFTER `TYPE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` MODIFY COLUMN `phenomenon_id` bigint(20) NULL DEFAULT NULL COMMENT '现象ID' AFTER `DESCRIPITON`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` DROP COLUMN `TASK_NAME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_plan` DROP COLUMN `NEXT_STEP_OPERATOR`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_task` ADD COLUMN `MESSAGE_TEMPLATE_ID` bigint(20) NULL DEFAULT NULL COMMENT '模板id' AFTER `phenomenon_id`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `PROCESS_INSTANCE_ID` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '工作流实例' AFTER `EM_CODE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `ticket_id` bigint(20) NULL DEFAULT NULL AFTER `UPDATE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `delay_date` datetime(0) NULL DEFAULT NULL AFTER `ticket_id`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_access_task` MODIFY COLUMN `DELAY_STATUS` tinyint(4) NULL DEFAULT NULL AFTER `delay_date`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_fault` MODIFY COLUMN `FAULT_TYPE` tinyint(4) NULL DEFAULT NULL COMMENT '0- 标准;1 - 非标准' AFTER `FAULT_NAME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_library` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `PROC_DEF_ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_plan` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_plan` MODIFY COLUMN `TASK_TYPE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '0:系统生成任务,1:临时任务' AFTER `UPDATE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编码' AFTER `ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `TASK_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `TYPE_CODE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DISPOSER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行人(按,分隔)' AFTER `PROCESS_INSTANCE_ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DISPOSE_TIME` datetime(0) NOT NULL COMMENT '任务按周期生成计划开始时间' AFTER `DISPOSER`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `EXECUTE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '任务执行日期' AFTER `DISPOSE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `PUSH_MSG_STATUS` tinyint(4) NULL DEFAULT 0 COMMENT '消息推送状态 0=未推送 1=已推送' AFTER `DESCRIPTION`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `TASK_TYPE` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '0:系统生成任务,1:临时任务' AFTER `UPDATE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DELAY_STATUS` tinyint(4) NULL DEFAULT NULL AFTER `TASK_TYPE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `DELAY_DATE` datetime(0) NULL DEFAULT NULL AFTER `DELAY_STATUS`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `ticket_id` bigint(20) NULL DEFAULT NULL AFTER `DELAY_DATE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `PLAN_END_TIME` datetime(0) NULL DEFAULT NULL AFTER `ticket_id`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `MESSAGE_TEMPLATE_ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_description` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `next_step_operator` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_description`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_task_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名' AFTER `flow_user_id`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_maintenance_task` MODIFY COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名' AFTER `flow_task_name`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `EM_CODE` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备编号' AFTER `NAME`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `HANDLE_TASK_ID` bigint(20) NULL DEFAULT NULL COMMENT '处理任务ID' AFTER `HANDLE_TYPE`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `HANDLER` bigint(20) NULL DEFAULT NULL COMMENT '处理人,处理工作流的第一个处理人' AFTER `HANDLE_TASK_ID`;
+
+ALTER TABLE `hzims_operation`.`hzims_oper_phenomenon` MODIFY COLUMN `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人' AFTER `UPDATE_TIME`;
+
+CREATE TABLE `hzims_operation`.`hzims_oper_repair` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `EM_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '设备code',
+ `NUMBER` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号',
+ `COMPANY` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
+ `HANDLE_STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '处理状态',
+ `CHARGE` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修负责人',
+ `REPAIR_TEAM` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修班组',
+ `REPAIR_PERSONNEL` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修人员',
+ `REPAIR_TASK` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应急抢修任务描述',
+ `ORIGINATOR` bigint(20) NULL DEFAULT NULL COMMENT '应急抢修发起人',
+ `SAFETY_MEASURES` varchar(2080) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '安全措施',
+ `POINTS_ATTENTION` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '注意事项',
+ `LICENSOR` bigint(20) NULL DEFAULT NULL COMMENT '许可人',
+ `LICENSOR_TIME` datetime(0) NULL DEFAULT NULL COMMENT '许可时间',
+ `LICENSOR_MEASURES` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '许可建议安全措施',
+ `LICENSOR_MEMO` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修完成许可描述',
+ `LICENSOR_COMPLETE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修完成许可时间',
+ `IMPLEMENT_HOURS` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '抢修工时',
+ `IMPLEMENT_START_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修开始时间',
+ `IMPLEMENT_END_TIME` datetime(0) NULL DEFAULT NULL COMMENT '抢修结束时间',
+ `IMPLEMENT_DESC` varchar(500) 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',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
+ `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人',
+ `IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
+ `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态 ',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`hzims_review_standard` (
+ `id` bigint(20) NOT NULL COMMENT '主键ID',
+ `review_id` bigint(20) NOT NULL COMMENT '评审ID',
+ `standard_id` tinyint(4) NOT NULL COMMENT '标准ID',
+ `standard_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标准名称',
+ `score` tinyint(4) NULL DEFAULT NULL COMMENT '分数',
+ `status` tinyint(4) NULL DEFAULT NULL COMMENT '业务状态',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT 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,
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+ALTER TABLE `hzims_operation`.`hzims_station` DROP INDEX `hzims_station_pk`;
+
+ALTER TABLE `hzims_operation`.`hzims_station_user` MODIFY COLUMN `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人' AFTER `UPDATE_TIME`;
+
+ALTER TABLE `hzims_operation`.`hzims_station_video_type` MODIFY COLUMN `video_type` tinyint(4) NULL DEFAULT NULL COMMENT '视频类型;默认为1:清污机类型' AFTER `SORT`;
+
+ALTER TABLE `hzims_operation`.`hzims_unit_running_time` MODIFY COLUMN `DATE_TIME` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '年月' AFTER `EM_CODE`;
+
+CREATE TABLE `hzims_operation`.`temp` (
+ `db_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `tablename` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+ `LieName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`temp_dept_sync` (
+ `id` bigint(20) NOT NULL,
+ `old_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '旧机构ID',
+ `new_dept_id` bigint(20) NULL DEFAULT NULL COMMENT '新机构ID',
+ `is_sync` tinyint(255) NULL DEFAULT NULL COMMENT '是否同步',
+ `dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机构名称',
+ `execute_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '机构同步表' ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`temp_sync_info` (
+ `sync_id` bigint(20) NOT NULL COMMENT '同步ID',
+ `db_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据库',
+ `table_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '表',
+ `column_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '列',
+ `be_replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被替换值',
+ `replaced` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '替换值',
+ `replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '替换sql',
+ `create_time` datetime(0) NULL DEFAULT NULL COMMENT '执行时间',
+ `bak_replaced_sql` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '还原sql',
+ `status` tinyint(4) NULL DEFAULT NULL COMMENT '执行状态'
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_allocation` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `IN_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '入库仓库',
+ `OUT_WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库仓库',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_basic` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `MANAGEMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '分类ID',
+ `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
+ `CODE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
+ `SPECIFICATIONS` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格',
+ `BRAND` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品牌',
+ `UNIT` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
+ `WEIGHT` decimal(10, 2) NULL DEFAULT NULL COMMENT '重量',
+ `PRICE` decimal(10, 2) NULL DEFAULT NULL COMMENT '单价',
+ `UPPER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存上限',
+ `LOWER_LIMIT` int(10) NULL DEFAULT NULL COMMENT '库存下限',
+ `IS_WASTE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否回收废品',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `PARAMETER` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '主要参数',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号',
+ `WATER_PLANT_ID` bigint(16) NULL DEFAULT NULL COMMENT '水厂ID',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_management` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `tenant_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
+ `PARENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属父级',
+ `ANCESTORS` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '祖级节点',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类编码',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件:1,工具:2',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `CODE_NUMBER` bigint(20) NULL DEFAULT NULL COMMENT '序列号',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_provider` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `ORGANIZATION_ID` bigint(20) NULL DEFAULT NULL COMMENT '机构ID',
+ `ORGANIZATION_CODE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构编码',
+ `SCOPE_OF_SUPPLY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货范围',
+ `SUPPLY_CYCLE` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '供货周期',
+ `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
+ `LOGOGRAM` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称缩写',
+ `SALESMAN` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '业务联系人',
+ `LEGAL_PERSON` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '法人代表',
+ `PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '电话',
+ `MOBILE_PHONE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机',
+ `WEBSITE` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '网址',
+ `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
+ `QUALIFIED_FLAG` int(11) NULL DEFAULT 1 COMMENT '是否合格(0:否,1:是)',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
+ `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_receive` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_receives` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `TICKET_CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单ID',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `VECEIVE_ID` bigint(20) NULL DEFAULT NULL COMMENT '工具领用单ID',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_record` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `BUSINESS_ID` bigint(20) NULL DEFAULT NULL COMMENT '业务表ID',
+ `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量AMOUNT',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID',
+ `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库',
+ `TYPE` int(11) NULL DEFAULT NULL COMMENT '类型1:入库,2:出库,3:调拨,4:领用',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
+ `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_revert` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
+ `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
+ `NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_ticket_relation` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `ORDER_ID` bigint(20) NULL DEFAULT NULL COMMENT '出库单ID',
+ `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
+ `TICKET` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工单号',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备件ID',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建部门',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(2) NULL DEFAULT NULL COMMENT '业务状态',
+ `IS_DELETED` int(2) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_tool_basic` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
+ `QUALITY_GUARANTEE_PERIOD` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保质期',
+ `PRODUCTION_PERIOD` datetime(0) NULL DEFAULT NULL COMMENT '生产日期',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '领用时间',
+ `CREATE_USER` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '领用人',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `ATACHMENT_ID` bigint(20) NULL DEFAULT NULL COMMENT '类型(文件类型)',
+ `QUANTITY_RECEIVED` bigint(20) NULL DEFAULT NULL COMMENT '领用数量',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_total` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '对应备件ID',
+ `MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最低储备量',
+ `MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '最高储备量',
+ `STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存',
+ `IN_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新入库单价',
+ `OUT_PRICE` decimal(12, 2) NULL DEFAULT NULL COMMENT '最新出库单价',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `OUT_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '出库暂存',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比',
+ `WAREHOUSE_ID` bigint(20) NULL DEFAULT NULL COMMENT '所属仓库ID',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_type_dictionaries` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
+ `CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
+ `P_CODE` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上级编码',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_warehouse` (
+ `ID` bigint(20) NOT NULL COMMENT '主键ID',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `ADDRESS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '地址',
+ `CODE` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编码',
+ `NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称',
+ `MANAGER` bigint(20) NULL DEFAULT NULL COMMENT '负责人',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `STOCK` bigint(20) NULL DEFAULT NULL COMMENT '当前存量',
+ `MAX_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存上限',
+ `MIN_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '库存下限',
+ `WARNING_STOCK` bigint(20) NULL DEFAULT NULL COMMENT '警戒百分比',
+ `REMARK` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `AFFILIATED_UNIT` bigint(20) NULL DEFAULT NULL COMMENT '所属单位',
+ `AFFILIATED_NAME` varchar(255) 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 ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_warehouse_in` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `TYPE` bigint(20) NULL DEFAULT NULL COMMENT '入库类型',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
+ `CURRENT_OPERATOR` bigint(20) NULL DEFAULT NULL COMMENT '当前处理人',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `TICKET_CODE` varchar(50) 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 ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_warehouse_in_record` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '出入库编号',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '业务状态',
+ `TITLE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题',
+ `STORAGE_ROOM` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仓库库房',
+ `TYPE` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型,用枚举来判断是工具还是备品备件',
+ `OPERATION` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作:用枚举来判断是出库还是入库',
+ `AMOUNT` int(11) NULL DEFAULT NULL COMMENT '数量',
+ `SP_BASIC_ID` bigint(20) NULL DEFAULT NULL COMMENT '备品备件ID',
+ `NAME` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备品备件名称',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+CREATE TABLE `hzims_operation`.`wt_sp_warehouse_out` (
+ `ID` bigint(20) NOT NULL COMMENT '主键',
+ `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID',
+ `CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '部门ID',
+ `CODE` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单据号',
+ `CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
+ `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
+ `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
+ `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
+ `STATUS` int(11) NULL DEFAULT NULL COMMENT '流程状态',
+ `RPOC_INS_ID` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作流实例ID',
+ `STORAGE_ROOM` bigint(20) NULL DEFAULT NULL COMMENT '仓库库房',
+ `REMARKS` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '备注',
+ `IS_DELETED` int(11) NULL DEFAULT 0 COMMENT '是否已删除(0:否,1:是)',
+ `TYPE` bigint(20) NULL DEFAULT NULL COMMENT '出库类型',
+ PRIMARY KEY (`ID`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
+
+SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
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 0a6344c..0ab4599 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
@@ -43,6 +43,7 @@ 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;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@@ -151,6 +152,7 @@ public class OperationTicketServiceImpl implements OperationTicketService {
* @param response
*/
@Override
+ @Transactional(rollbackFor = RuntimeException.class)
public void findPending(ProcessWorkFlowResponse response) {
log.info("获取businessKey: {}", response.getBusinessKey());
log.info("获取taskId: {} ", response.getTaskId());
diff --git a/hzims-service/ticket/src/main/resources/db/newsql.sql b/hzims-service/ticket/src/main/resources/db/newsql.sql
new file mode 100644
index 0000000..5bb14f5
--- /dev/null
+++ b/hzims-service/ticket/src/main/resources/db/newsql.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/template/~$第一种工作票模版.docx b/hzims-service/ticket/src/main/resources/template/~$第一种工作票模版.docx
new file mode 100644
index 0000000000000000000000000000000000000000..1ffd9670ddfd17988ae912d7c4554965856720ac
GIT binary patch
literal 162
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