From 5db9ab6d4c56219f948cb2ce2fd1d5a2baf7297b 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, 24 Mar 2023 15:31:26 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=BC=80=E7=A5=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hzims/operational/feign/IAccessTaskClient.java | 2 +
hzims-service-api/inspect-api/pom.xml | 7 +
hzims-service-api/pom.xml | 6 +
.../hzimsweather/vo/RainFallCountByMonthVo.java | 1 +
.../assets/src/main/resources/application.yml | 3 +
hzims-service/ticket/pom.xml | 2 +
.../ticket/redisConsume/WorkTicketMsgConsume.java | 3 +
.../consumer/StandardWorkTicketConsumer.java | 25 +++
.../controller/StandardTicketInfoController.java | 5 -
.../controller/StandardWorkTicketController.java | 52 +++++
.../enums/StandWorkTicketConstants.java | 83 ++++++++
.../service/StandardWorkTicketService.java | 17 ++
.../impl/StandardWorkTicketServiceImpl.java | 25 +++
.../service/impl/FirstWorkTicketServiceImpl.java | 30 ++-
.../main/resources/file/新工作票.bpmn20.xml | 209 +++++++++++++++++++++
.../topvision/src/test/java/BladeDemoTest.java | 1 +
pom.xml | 2 +-
17 files changed, 459 insertions(+), 14 deletions(-)
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/consumer/StandardWorkTicketConsumer.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/enums/StandWorkTicketConstants.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/StandardWorkTicketService.java
create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardWorkTicketServiceImpl.java
create mode 100644 hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml
diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java
index 14c5045..9455567 100644
--- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java
+++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/feign/IAccessTaskClient.java
@@ -6,6 +6,7 @@ import com.hnac.hzims.operational.access.entity.OperAccessTaskEntity;
import com.hnac.hzims.feign.ITaskClient;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* @author hx
*/
+@Repository
@FeignClient(
value = OperationalConstants.APP_NAME
)
diff --git a/hzims-service-api/inspect-api/pom.xml b/hzims-service-api/inspect-api/pom.xml
index a39874a..962e7d2 100644
--- a/hzims-service-api/inspect-api/pom.xml
+++ b/hzims-service-api/inspect-api/pom.xml
@@ -23,6 +23,12 @@
org.springblade
blade-starter-mybatis
${bladex.project.version}
+
+
+ lettuce-core
+ io.lettuce
+
+
org.springblade
@@ -57,6 +63,7 @@
common-api
4.0.0-SNAPSHOT
+
diff --git a/hzims-service-api/pom.xml b/hzims-service-api/pom.xml
index 8f51cac..6d93634 100644
--- a/hzims-service-api/pom.xml
+++ b/hzims-service-api/pom.xml
@@ -32,6 +32,12 @@
org.springblade
blade-starter-mybatis
+
+
+ lettuce-core
+ io.lettuce
+
+
org.springblade
diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java
index 7dd6d50..aa4a65b 100644
--- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java
+++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/vo/RainFallCountByMonthVo.java
@@ -1,5 +1,6 @@
package com.hnac.hzims.hzimsweather.vo;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
diff --git a/hzims-service/assets/src/main/resources/application.yml b/hzims-service/assets/src/main/resources/application.yml
index bedb9c4..ae1c9a6 100644
--- a/hzims-service/assets/src/main/resources/application.yml
+++ b/hzims-service/assets/src/main/resources/application.yml
@@ -19,3 +19,6 @@ oss:
access-key: D99KGE6ZTQXSATTJWU24
secret-key: QyVqGnhIQQE734UYSUFlGOZViE6+ZlDEfUG3NjhJ
bucket-name: bladex
+
+
+
diff --git a/hzims-service/ticket/pom.xml b/hzims-service/ticket/pom.xml
index 3c2b1e1..a63fc17 100644
--- a/hzims-service/ticket/pom.xml
+++ b/hzims-service/ticket/pom.xml
@@ -217,6 +217,8 @@
com.hnac.hzims
equipment-api
+
+
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 7af631a..eba614f 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
@@ -44,4 +44,7 @@ public class WorkTicketMsgConsume {
log.info("接收工作票流程,接收消息为:{}",message);
}
+
+
+
}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/consumer/StandardWorkTicketConsumer.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/consumer/StandardWorkTicketConsumer.java
new file mode 100644
index 0000000..119a874
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/consumer/StandardWorkTicketConsumer.java
@@ -0,0 +1,25 @@
+package com.hnac.hzims.ticket.standardTicket.consumer;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.queue.annotation.RedisQueue;
+import org.springblade.queue.consume.IQueueConsume;
+import org.springframework.stereotype.Service;
+
+/**
+ * 监听数据的
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/24 9:46
+ */
+@Service
+@RedisQueue(topicName = "blade:queue:flow")
+@Slf4j
+public class StandardWorkTicketConsumer implements IQueueConsume {
+
+
+ @Override
+ public void handlerMessage(String message) {
+ log.info("监听到数据:{}", message);
+ }
+}
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 4485e45..244eafa 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
@@ -4,23 +4,18 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.ticket.standardTicket.dto.StandardTicketInfoDto;
-import com.hnac.hzims.ticket.standardTicket.entity.StandardTicketInfoEntity;
import com.hnac.hzims.ticket.standardTicket.service.IStandardTicketInfoService;
import com.hnac.hzims.ticket.standardTicket.vo.StandardTicketInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
-import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.flow.core.vo.ComleteTask;
-import org.springblade.system.feign.IDictClient;
-import org.springblade.system.feign.ISysClient;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java
new file mode 100644
index 0000000..df0db77
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java
@@ -0,0 +1,52 @@
+package com.hnac.hzims.ticket.standardTicket.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import com.hnac.hzims.ticket.response.WorkTicketMessageResponse;
+import com.hnac.hzims.ticket.standardTicket.service.StandardWorkTicketService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 工作票管理
+ *
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/23 16:07
+ */
+@Api(tags = "工作票管理")
+@Slf4j
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/standard/wordTicket")
+public class StandardWorkTicketController {
+
+ private final StandardWorkTicketService standardWorkTicketService;
+
+
+ @Autowired
+ private RedisTemplate redisTemplate;
+
+ @ApiOperation("测试开票")
+ @PostMapping("/createTicket")
+ public R createTicket() {
+ WorkTicketMessageResponse workTicketMessageResponse = new WorkTicketMessageResponse();
+ workTicketMessageResponse.setTaskId(IdWorker.get32UUID());
+ workTicketMessageResponse.setTaskName("工作流");
+ String jsonString = JSON.toJSONString(workTicketMessageResponse);
+ redisTemplate.convertAndSend("blade:queue:flow", jsonString);
+ standardWorkTicketService.createTicket();
+ return R.success("成功");
+ }
+
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/enums/StandWorkTicketConstants.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/enums/StandWorkTicketConstants.java
new file mode 100644
index 0000000..b38efab
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/enums/StandWorkTicketConstants.java
@@ -0,0 +1,83 @@
+package com.hnac.hzims.ticket.standardTicket.enums;
+
+import lombok.Getter;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/24 11:34
+ */
+public enum StandWorkTicketConstants {
+ /**
+ * 开票
+ */
+ START("1", "startEvent1", "开票"),
+ /**
+ * 签发人签发
+ */
+ SIGN("1", "sid-5E7013A9-385A-4EE4-91B6-FD5328D05E2A", "签发人签发"),
+ /**
+ * 运行人员接收
+ */
+ RECEIVE("2", "sid-355DB6EC-7D54-4537-B80F-C26CD716ADA1", "运行人员接收"),
+ /**
+ * 运行人员布置安全措施
+ */
+ FIX_UP("3", "sid-F35C4A79-53AF-40B8-AFBD-AF7283CC5708", "运行人员布置安全措施"),
+ /**
+ * 工作负责人确认安全措施
+ */
+ PRINCIPAL_CONFIRM_MEASURE("4", "sid-0CB1456A-D85C-4473-A032-FAEF62EFBF22", "工作负责人确认安全措施"),
+ /**
+ * 工作负责人确认工作内容执行
+ */
+ PRINCIPAL_CONFIRM_CONTENT("5", "sid-5476EB52-438F-4C74-94FB-88A6EA6625EA", "工作负责人确认工作内容执行"),
+ /**
+ * 许可人确认工作票结束、终结
+ */
+ LICENCE_LICENSOR("6", "sid-72E8C993-D426-476F-BF7F-F7EC3B783022", "许可人确认工作票结束、终结"),
+
+
+ /**
+ * 工作负责人确认工作票结束
+ */
+ PRINCIPAL_CONFIRM_END("7", "sid-308606FE-820A-4A23-AF2A-4B1E9BBD267C", "工作负责人确认工作票结束、终结"),
+
+ /**
+ * 工作负责人确认工作票结束
+ */
+ LICENSE_CONFIRM_END("8", "sid-72E8C993-D426-476F-BF7F-F7EC3B783022", "许可人确认工作票结束、终结"),
+
+ /**
+ * 签发人审核
+ */
+ SIGN_CONFIRM_DELAY("9", "sid-DABC1AF3-EB78-4913-8BFE-EA44C887B418", "签发人审核"),
+ /**
+ * 许可人许可
+ */
+ LICENCE("10", "sid-48995D69-1E09-4ED2-8C81-5D1A6D015FA5", "许可人许可"),
+ /**
+ * 工作票转移
+ */
+ PROCESS_COURSE("11", "sid-FB7BF0B3-5189-437F-B29D-B87E22A81460", "工作票转移"),
+ /**
+ * 工作票转移
+ */
+ PROCESS_POSTPONE("12", "sid-6358A80D-F592-4875-B281-A5B14A0EA39E", "工作票延期");
+
+
+ private String status;
+ @Getter
+ private String flowId;
+ @Getter
+ private String segment;
+
+ StandWorkTicketConstants(String status, String flowId, String segment) {
+ this.status = status;
+ this.flowId = flowId;
+ this.segment = segment;
+ }
+
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/StandardWorkTicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/StandardWorkTicketService.java
new file mode 100644
index 0000000..3ed9de9
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/StandardWorkTicketService.java
@@ -0,0 +1,17 @@
+package com.hnac.hzims.ticket.standardTicket.service;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/23 16:21
+ */
+public interface StandardWorkTicketService {
+
+ /**
+ * 开票
+ */
+ void createTicket();
+
+
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardWorkTicketServiceImpl.java
new file mode 100644
index 0000000..394fc5d
--- /dev/null
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardWorkTicketServiceImpl.java
@@ -0,0 +1,25 @@
+package com.hnac.hzims.ticket.standardTicket.service.impl;
+
+import com.hnac.hzims.ticket.standardTicket.service.StandardWorkTicketService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Author WL
+ * @Version v1.0
+ * @Serial 1.0
+ * @Date 2023/3/23 16:21
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class StandardWorkTicketServiceImpl implements StandardWorkTicketService {
+ /**
+ * 开票
+ */
+ @Override
+ public void createTicket() {
+
+ }
+}
diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
index 38a1334..59e0853 100644
--- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
+++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
@@ -119,7 +119,10 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl variables = new HashMap<>(3);
@@ -170,7 +174,9 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl> listR = userClient.relationUserListByRoleAlias(AuthUtil.getTenantId(),Long.parseLong(AuthUtil.getUser().getDeptId()),TicketConstants.SIGNER_ROLE);
+ R> listR = userClient.relationUserListByRoleAlias(
+ AuthUtil.getTenantId(),Long.parseLong(AuthUtil.getUser().getDeptId()),
+ TicketConstants.SIGNER_ROLE);
if(!listR.isSuccess() || CollectionUtil.isEmpty(listR.getData())){
throw new ServiceException("工作票签发人角色下未查询到相关人员");
}
@@ -178,7 +184,10 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl result = flowClient.startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey,"workTicket:task:" + dto.getId(),dto.getWorkContent(), params);
+ R result = flowClient
+ .startProcessInstanceContainNameByKey(newFirstWorkTicketFlowKey,"workTicket:task:" + dto.getId(),
+ dto.getWorkContent(),
+ params);
Assert.isTrue(result.isSuccess(),()-> {
throw new ServiceException("开启工作票工作流失败!");
});
@@ -197,8 +206,10 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl measureEntityList = dto.getWorkTicketSafetyMeasureDtoList().stream().map(measure -> {
- WorkTicketSafetyMeasureEntity measureEntity = BeanUtil.copy(measure, WorkTicketSafetyMeasureEntity.class);
+ List measureEntityList =
+ dto.getWorkTicketSafetyMeasureDtoList().stream().map(measure -> {
+ WorkTicketSafetyMeasureEntity measureEntity =
+ BeanUtil.copy(measure, WorkTicketSafetyMeasureEntity.class);
measureEntity.setTicketId(dto.getId());
return measureEntity;
}).collect(Collectors.toList());
@@ -206,8 +217,11 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl contentEntities = dto.getWorkTicketContentDtoList().stream().map(contentDto -> {
- WorkTicketContentEntity contentEntity = BeanUtil.copy(contentDto, WorkTicketContentEntity.class);
+ List contentEntities = dto.getWorkTicketContentDtoList()
+ .stream()
+ .map(contentDto -> {
+ WorkTicketContentEntity contentEntity =
+ BeanUtil.copy(contentDto, WorkTicketContentEntity.class);
contentEntity.setTicketId(dto.getId());
return contentEntity;
}).collect(Collectors.toList());
diff --git a/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml b/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml
new file mode 100644
index 0000000..bbc2874
--- /dev/null
+++ b/hzims-service/ticket/src/main/resources/file/新工作票.bpmn20.xml
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hzims-service/topvision/src/test/java/BladeDemoTest.java b/hzims-service/topvision/src/test/java/BladeDemoTest.java
index 8c75934..8b75fd6 100644
--- a/hzims-service/topvision/src/test/java/BladeDemoTest.java
+++ b/hzims-service/topvision/src/test/java/BladeDemoTest.java
@@ -26,4 +26,5 @@ public class BladeDemoTest {
System.out.println("notice数量:[] 个");
}
+
}
diff --git a/pom.xml b/pom.xml
index eafbbae..bffec03 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,7 +13,7 @@
4.5.8-SNAPSHOT
4.0.0-SNAPSHOT
- 4.5.6.RELEASE
+ 4.5.8-SNAPSHOT
UTF-81.8
3.8.1
UTF-8